Commit Graph

87 Commits

Author SHA1 Message Date
Paul Molloy 476c28cb24 slight tweak to buffer.c for firmware, want buffer status to be last thing
set as other things may trigger off of this.

Also forgot firmware size report:

AVR KAZZO:
avr-size build_avr/avr_kazzo.elf
   text    data     bss     dec     hex filename
   6952       6     674    7632    1dd0 build_avr/avr_kazzo.elf

INL6:
arm-none-eabi-size -t build_stm/inlretro_stm.elf
   text    data     bss     dec     hex filename
   8408       0     684    9092    2384 build_stm/inlretro_stm.elf

STM adapter:
arm-none-eabi-size -t build_stm/inlretro_stm.elf
   text    data     bss     dec     hex filename
   9212       0     684    9896    26a8 build_stm/inlretro_stm.elf

Also the more I get into these flashing routines, maybe the original kazzo
wasn't so bad..  It just takes awhile to flash these chips...  I'm not
sure it makes much sense to offer/support stm32 adapter.  While it is less
work to cut it out, it's brought out bugs in my code just due to having
different platforms with their quirks manifest bugs.
2017-08-24 13:56:09 -05:00
Paul Molloy 5ceb148c85 Have SNES flashing and dumping working for all 3 kazzos on SNES v3.0p
prototype which has STM8 CIC driving flash /OE with inversion of SYS /RST.
STM8 CIC is running at 16Mhz, and doesn't actually function as CIC.  Still
need to come up with special way to signal to CIC that it's plugged into a
programmer and not a console.

Things aren't as fast as they could be, but they're good for now and
proved working on all kazzo versions.  Expecting decent speedup could be
aquired by optimizing the flash routine, not changing address unless
needed, or only changing low byte of address, etc.  Could also let the
host put the flash chip in unlock bypass mode and keep it there until done
with flashing.

Current speeds:
INL6: 42.2 KBps flashing, 92KBps dumping
stm adapter: 25.3 KBps flashing, 96KBps dumping
AVR kazzo: 18.0KBps flashing, 14.3KBps dumping

Was able to get the inl6 up to 59KBps flashing.  Which was 35sec total
flash time for 16mbit chip which has typical flash time of 22s plus
overhead.  This got slowed down when supporting stm adapter as checks for
buffer status were required from what I recall.  Also fixing flash polling
routine AVR found slowed things down.

Was able to get 140KBps dump time on inl6 with 16mbit SNES flash.  This
was slowed when supporting stm adapter which brought out issue with stm32
usb driver.  Locks up the device if the buffer isn't fully dumped prior to
calling.  Need to get driver to support sending NAKs until data is dumped.
Current fix for checking buffer status slows things down for all devices.

AVR brought out issue with SNES v3 design where we can't rely on flash
poll data to toggle between reads as /OE and /CE are stuck low.  Have to
toggle /RESET slowly to toggle /OE and ensure we don't move on to next
byte until previous is fully flashed.

STM32 found initial issue where /WR should be set low first to set
direction of data level shifter, then set /ROMSEL low to enable level
shifter output.  Not doing this caused bus conflicts between the two
causing flakey writes where not all bits were getting cleared.

lua scripts currently force SNES, need to add smart check that identifies
SNES flash board if vector data is 0xFFFF.  Also funky order where it
always erases after flashing as this was more convient for testing.

While this commit is far from ideal, it's stable and I've done my best to
not commit junk that will cause problems later.  Just make sure to always
verify dumping algo before assuming something is wrong with writes!
2017-08-24 13:41:08 -05:00
Paul Molloy 4b3c822a24 Have basic SNES cart detection and dumping working. Dumping mario paint
works on both inl6 and original kazzo just fine.  Dumping v3 prototype has
a few byte corruptions on inl6, but is fine on original kazzo.  The same
bytes often fail, but not consistently.  Tinkered with adding delay, but
that didn't help.  Also have issue with adapter not dumping properly.
Prob bug with HIGH ADDR on that board need to sort out still.  Going to
focus on erasing and dumping next then come back to some of these issues.
2017-08-21 12:30:39 -05:00
Paul Molloy dfeaf960ef commiting files as they were left a couple weeks ago..
Not 100% sure what all happened with this update.. :/

Tested and have all 3 recent kazzos flashing and dumping PRG-ROM and
CHR-ROM on NROM NES board.  Pretty sure I tested purple and green kazzos
too as I had left those on in pinport and seem to recall having them all
working when I tweeted 2 weeks ago..

Created new status_wait for buffers so can wait for them to finish
dumping/flashing before starting/ending operations.  That cleaned up
dump/flash code a fair amount.

On first tests today I had issues where setting flash operation would hang
and fail with both stm kazzos.  As I started to debug the issue it
disappeared, so IDK what that was all about..  I think there might be an
issue with my stm32 usb drivers..  Those were updated in this commit to
properly allow write "OUT" packets to be supported.

Planning to start tinkering with SNES in prep for the no save boards
arriving tomorrow!
2017-08-20 16:38:12 -05:00
Paul Molloy 82a6b606dd Have PRG-ROM flashing working for NROM on AVR KAZZO
Need to get stm32 up and working, currently the usbFunctionWrite causes
device descriptor request to fail on stm32 devices.  So need to do some
debugging there which I was expecting..
2017-08-08 15:08:39 -05:00
Paul Molloy f4aa907e69 Have CHR-ROM dumping working for NROM cart.
Learned lesson yet again to stop putting logic inside ADDR/DATA port
macros.  The expansion of putting logic inside those is hard to predict,
it ends up varing based on mcu hardware..  Just don't do it!!
Have some cleaning up on buffer.c that's needed.  Currently have to give
the device some time to dump buffer prior to calling payload.  The buffer
manager should be able to handle this itself!  Also don't think I should
have to reset raw buffers and reallocate from scratch between PRG/CHR
dumping!  But that's currently the case.  It works for now on AVR kazzo
and STM adapter & inlretro6.
2017-08-07 23:10:33 -05:00
Paul Molloy 7e8ad86d3a Big update, have PRG-ROM dumping on NROM working for all devices!
tested and verified on purple, green, and yellow/orange avr kazzos and
stm32 inlretro6 proto, and stm32 adapter with yellow kazzo board

AVR takes ~17.5sec to dump 256KB -> 1:10 for 1MByte = 14.6KBps
STM takes  ~8.5sec to dump 1MByte = 120KBps
STM32 usb driver is far from optimal as it's setup to be minimal with only
8byte endpoint0 to make an effort to align avr and stm.  Larger endpoints
and bulk transfers should greatly speed up stm usb transfers

refactored firmware buffer.c and implemented most of the required opcodes
added check that should cover if device isn't ready for a IN/OUT
transfer.  Does this by usbFunctionSetup returning zero which causes the
device to ignore the host.  Don't think I've got the stm32 usb driver
setup properly to handle this not sure I fully understand Vusb driver
either.  Anyway, hopefully it works well enough for now and keep this in
mind if issues crop up in future.

Still haven't implemented usbFunctionWrite, not sure stm usb driver is
setup properly yet either..

build sizes:
avr yellow/orange: avr-size build_avr/avr_kazzo.elf
   text    data     bss     dec     hex filename
   5602       6     674    6282    188a build_avr/avr_kazzo.elf

previous builds of avr code size was ~6.4KB when flashing and dumping was working.
AVR bootloader is 1.7KB taking up majority of 2KB boot sector.
So AVR has 16KB - 2KB boot = 14KB available, using ~44% of non-boot sector
available flash Have 4 buffers defined, and 512B of raw buffer defined so using
~65% SRAM Making pretty good use of the chip just for basic framework.
Not a ton of room for board/mapper specific routines, so will have to keep this
in mind.  Creating more generic routines to save flash will come with a speed
hit, but perhaps we shouldn't worry too much about that as devices below
really boost speed without even trying.  There is some sizable amount of
SRAM available could perhaps load temporary routines into SRAM and execute
Also have ability to decrease buffer sizes/allocation.  Perhaps routines
could actually be store *IN* the raw buffers.. ;)

stm adapter: arm-none-eabi-size -t build_stm/inlretro_stm.elf
   text    data     bss     dec     hex filename
   7324       0     680    8004    1f44 build_stm/inlretro_stm.elf
Currently targetting STM32F070C6 which has 32KB flash, 6KB SRAM
Could upgrade to STM32F070CB in same LQFP-48 package w/ 128KB/16KB
Don't think that'll be of much value though especially with limitation
on connectors for adapter.
So currently don't have user bootloader, only built in ones.
8KB of 32KB avaiable flash = 25% utilization
680B of 6KB available sram = 11% utilization
32KB device doubles amount of available flash compared to AVR, although
stm32 code isn't quite a condensed compared to AVR.

stm inlretro6: arm-none-eabi-size -t build_stm/inlretro_stm.elf
   text    data     bss     dec     hex filename
   6932       0     680    7612    1dbc build_stm/inlretro_stm.elf
Mostly limited to STM32F070RB as choosing device requiring XTAL, and
desire large number of i/o.  This device provides 128KB flash, 16KB SRAM
Currently using 7.6KB/128KB flash = 6% utilization
Currently using 680B/16KB SRAM = 4.1% utilization
LOTS of room for growth in this device!!  Part of why I choose it over
crystalless 072 version, as it came with more flash for less cost.

Also hardly making use of 1KB of USB dedicated SRAM:
32B buffer table entries
16B endpoint0 IN/OUT
48B of 1024B available = 4.6% utilization
2017-08-07 16:06:23 -05:00
Paul Molloy cb2d2e693a committing fix to PURPLE_KAZZO as noted last commit 2017-08-05 16:15:00 -05:00
Paul Molloy 8b5650b75f Well over due commit with lots of updates..
Have separate lua modules now in scripts/app folder
Dictionary calls are now their own lua module
firmware now capable of calling multiple different dictionaries
have firmware & lua io and nes dictionaries, able to detect
NES and famicom carts.  Created expansion port abstraction so most kazzo
versions behave identically.
Created separate make file for stm adapter and inl6
added PURPLE_KAZZO and GREEN_KAZZO defines back in.  They work well enough
for sensing NES vs famicom carts so far.  GREEN_KAZZO requires
PURPLE_KAZZO to also be defined.  GREEN_KAZZO is also only compatible with
AVR_CORE due to software_AHL/AXL functions specifically written for AVR.
I think things will work if a STM_ADAPTER is placed on a PURPLE_KAZZO and
both those defines are made as only real difference is software tying of
AXL and X_OE.  But haven't tested this aside from ensuring it compiles.
Have correction to pinport_al.h that will commit immediately after this.
2017-08-05 16:04:59 -05:00
Paul Molloy ec725f7e33 Getting closer to how I'd like to handle dictionary calls with lua.
Effectively deleted old dictionary call function/files.
Created lua_usb_vend_xfr function so lua can directly send and receive
vendor setup transfers.

Dictionary calls are more like function calls now, and all args aren't
required so the LED can be turned on for example in lua like so:
dict_pinport("LED_ON")
general format is:
dict_name( opcode, operand, misc, datastring )
Also added ability to store opcode's return length in shared dict library
files with RL=number in the comments following the opcode.
Negative numbers designate OUT transfers, positive for IN.
Default value can be determined by each dictionary's calling function.
Decided pinport is 1 for SUCCESS/ERROR CODE.
Also have default return data means with second byte giving length of
return data in bytes that follows.
dictionary call function reports any errors reported by the device and
returns any return data from the device excluding error code / data len

Now time to start implementing some of these dictionaries on the device.
2017-08-01 17:17:13 -05:00
Paul Molloy 1e5ea8cc7e Have USB drivers successfully calling usbFunctionSetup when vendor setup
packet arrives.  Had issue with return data on STM32 not being properly
aligned when the rv array was only 8bit.  So defining it as a 16bit array
and then pointing a 8bit pointer to it seems to be an easy fix for now.

Ready to start working on pinport dictionary.  Need to get lua code
working on a lower level handling the dictionary calls.  Need it do do
things like fill out the wLength and everything for me so one doesn't have
to remember every detail about an opcode/dictionary before calling it.
Realizing code was heavily segmented based on how big/many operands there
were and how big the return data was.  This is hard to maintain, need lua
to resolve this issue, and make everything easier to script.  Thinking
opcode/dictionary calls need to be more like a function call.  Passing in
necessary args only, and returning data instead of succeed/fail.
2017-07-24 21:56:34 -05:00
Paul Molloy ea5f1d9842 Creation of pinport abstraction layer to make firmware more generic to the
underlying hardware/mcu.  Created avr_gpio.h to define AVR pin registers
in a struct fashion similar to what's common with ARM code.  Doing that
makes things much easier to abstract in pin macro 'functions'.

Added define to Makefiles that flags pinport_al.h which board is targetted
for build.

Tested and able to turn on/off and pull-up LED on all 3 builds.
2017-07-22 23:58:16 -05:00
Paul Molloy 750ab2f082 Creating one Makefile that calls the other makefiles as shortcut 2017-07-22 17:26:44 -05:00
Paul Molloy 3779afe88d Successfully building avr & stm core with one set of files.
Two different Makefiles, specify which with -f file flag:
make -f Make_avr clean program
make -f Make_stm clean program

made release dir to put released .hex firmware files
Need to make separate avr build folder
Need to make one master Makefile that calls one of the other makefiles as
instructed.

Currently device is recognized by PC but does nothing else other than
being recognized by app during connection process:

arm-none-eabi-size -t build_stm/inlretro_stm.elf
text    data     bss     dec     hex filename
1332       0      20    1352     548 build_stm/inlretro_stm.elf
1332       0      20    1352     548 (TOTALS)

avr-size avr_kazzo.elf
text    data     bss     dec     hex filename
1496       2      43    1541     605 avr_kazzo.elf
2017-07-22 17:03:23 -05:00
Paul Molloy 895bd6a737 Completely trimmed avr build down to bare bones, only completing
enumeration with host, no vendor/class requests handled.
move avr builds into avr_release dir
move original source files into source/old for future reference.

avr-size avr_kazzo.elf
text    data     bss     dec     hex filename
1496       2      43    1541     605 avr_kazzo.elf
2017-07-22 14:30:03 -05:00
Paul Molloy 1ec74eaf68 Starting to separate AVR build so STM can be build alongside in same dir
Modified Makefile to include project name, moved usbdrv to usbdrv_Vusb
renamed project avr_kazzo instead of main
added .swp files to gitignore
2017-07-22 14:01:07 -05:00
Paul Molloy 464598be21 setting device current to threshold without requesting more 200/2= 100mA. 2017-07-22 13:30:41 -05:00
Paul Molloy a8124e8983 Resolved issue where final buffer wasn't getting fully flashed.
Added check to ensure buff1 is done before quitting and resetting buffers.
Currently have a hacked load_oper_info_elements_chr function to test
CHR-ROM flashing.
NROM PRG & CHR flashing and dumping tested and working on black ASUS
win10 machine.
Firmware still doesn't implement previously added feature for oper_info
rd/wr_func pointer.  flash/dump.c simply overrides by providing the
function pointer based on memory type.

A bit frustrated with how complicated everything is currently...
Feel like there's a lack of standard for function definition and calls.
Would like majority of host program flow to be determined solely by
script calls.  Firmware is getting more generic and versatile at the cost
of being SLOW!!!  Perhaps that's okay though as it's not terribly slow in
comparision to comparable AVR kazzo firmware builds.  And with current
target to migrate to STM32 device this generic setup is much cleaner and
easier to work with.  However complexity was added to the firmware code in
order to help make it faster.  Not sure the goal of faster should take
priority over speed.  Obsessing over speed will cause issues with race
conditions, and complicate code to the point where I won't reach my goal.

With the long break since I've been working on this project it's making me
more willing to scrap some previous work for a cleaner solution more
aligned with my end goal.  I had to write some of this code to get a
better idea of my what my end goal will look like anyway.  Going to make a
couple builds for UIROM, and action53 as they're urgently needed.  But
beyond that I need to start working on script features, and STM32 support!
2017-06-04 20:13:58 -05:00
Paul Molloy 748c474ddb Flashing operations working, cleaning up a few items.
usb_Func_write updates buffer status if bytes remaining is zero.
Not the best solution as a buffer could be over/under run, define
MAKECHECKS to have buffer mark itself if full.
This method is faster and we always have transfer sizes match buffer sizes
anyway.
2017-02-20 01:45:22 -06:00
Paul Molloy pinkASUS 52a1b306c9 Flash NROM PRG-ROM operations are pretty well up to snuff now.
Had to add check to get cur_buff status and wait to send payload until
it's empty.  Still need to add timeout check as it'll spin forever if
there is a problem and it's never empty...

device should be able to handle buffer sizes smaller than usb transfer
but this probably isn't true if the first two bytes are stuffed into setup
packet.  Currently relies on end of (upto) 8 byte transfer to fill buffer.
MAKECHECKS would verify we don't overflow buffer..  Still kind of a half
thought out idea unfortunately.
2017-02-13 23:51:51 -06:00
Paul Molloy pinkASUS fe04496cfb Flashing NROM PRG-ROM working but unstable.
Not sure how I thought flash operations were previously working as there
were many bugs I had to correct to support flash operations properly.
Operations module appears to be working so far, still need to pass
functions to operation module.
Flash operations verify PRG-ROM 32KB writes working with file comparison.
Currently dependent on extra buffer status reads to delay next buffer.
I think the write operation is taking longer than the usb load operation.
Potentially due to slow code of operation module, but also possible I
had only been testing with slow eeepc linux machine previously.  Perhaps
combination of both.

Still need to correct issue so added buff status delays aren't needed.
buffer manager should be able to key off of status==USB_FULL but that
doesn't seem to work.  When trying I don't always get the same number of
buffers to get flashed so appear to have a race condition or something
not properly intialized..?

Need sort out sending of USB STALL if buffer isn't ready to be loaded yet.

This commit is mainly for documentation/reference purposes as things are
kind of working, but buggy/unstable.

AVR Memory Usage
----------------
Device: atmega164a

Program:    6486 bytes (39.6% Full)
(.text + .data + .bootloader)

Data:        679 bytes (66.3% Full)
(.data + .bss + .noinit)
2017-02-13 11:49:57 -06:00
Paul Molloy 56ea22f750 fixing some typo bugs to permit compiling. Updating test.c to perform
some dual port board tests.
2017-02-10 08:51:12 -06:00
paul eeepc d1aacecd6c Committing some edits made awhile ago that look legit.
Need to get things rolling again with this project!!!
2017-01-29 17:47:29 -06:00
paul eeepc 4b0c340eb1 Creations of operation module and dictionary.
Things appear to be working with some early testing.  Assumption that oper_info elements
are aligned in SRAM linearly appears to hold true.  Researching this I found it probably
was true, but can't be certain esp if gets changed in the future to not be purely 8byte
sized elements.
Still need to provide means to decode function numbers info function pointers.
2016-12-25 13:48:30 -06:00
paul eeepc de9b5d67a4 Basic flashing operatoins working. Still need to do some tests and erasing before flashing.
Need to verify page programmed successfully as it currently just continues even if unable to
flash proper data.  Need to make write page utilize variables for bank address based on mapper
and/or memory as currently doesn't flash CHR-ROM due to $5555 $2AAA being above address space
of CHR-ROM
2016-12-18 01:26:51 -06:00
Paul Molloy 876b526e8c Some timing tests on windows machine. Double buffering was pretty
successful only 1KBps speed drop when actually dumping real cart data.
2016-12-12 22:31:46 -06:00
paul eeepc a7eaf970b2 CHR-ROM dumping working for NROM checksum appears to be off need to compare files. 2016-12-12 10:56:53 -06:00
paul eeepc e483406c01 firmware main.hex commit from last time along with versions of other kazzos
AVR Memory Usage
----------------
Device: atmega164a

Program:    5486 bytes (33.5% Full)  ***final design last commit***
(.text + .data + .bootloader)

Data:        653 bytes (63.8% Full)
(.data + .bss + .noinit)

AVR Memory Usage
----------------
Device: atmega164a

Program:    5498 bytes (33.6% Full)  ***early purple design***
(.text + .data + .bootloader)

Data:        653 bytes (63.8% Full)
(.data + .bss + .noinit)

AVR Memory Usage
----------------
Device: atmega164a

Program:    5764 bytes (35.2% Full)  ***prototype green design***
(.text + .data + .bootloader)

Data:        655 bytes (64.0% Full)
(.data + .bss + .noinit)
2016-12-12 00:54:07 -06:00
paul eeepc c2359e67a5 Dumps offically working for PRG-ROM on NROM!!!
Found bug with setting map_n_part due to >/< instead of >=/<= for setting called_buff...
Was also setting mem_type and part backwards in dump.c
The had issues with usb timing out for more than 1 buffer read back
Problem was due to lack of usbPoll while dumping during double buffering
Adding usbPoll to page read to correct issue

Appears to be issue with dumping first byte of this choplifter cart I'm testing with.
Not so certain it's my bug though..  No matter what I do the first byte reads
back 0x78 and copy I downloaded has 0x00.  Setting my first byte to 0x00 also
creates proper CRC32 according to bootgod's database.  So need to look into this more
to figure out what's going on.
2016-12-12 00:38:01 -06:00
paul eeepc 49ec51e767 Much of dumping code for PRG-ROM completed but have some bugs with setting buff elements working on debugging... 2016-12-11 20:34:43 -06:00
paul eeepc 4db2929c3b Big overdue commit of past few days effort..
Detecting mirroring code working and tested
Started working on buffer operations from host
Current code compiles but not yet at point where can start testing
Adding cpu page read to nes.c to have faster dumping operations.
moving enums to shared as gets used quite a bit communicating between device and host.
2016-12-11 01:06:41 -06:00
paul eeepc dff396a1c2 Successful detection of UNROM512 mapper30 PRG-ROM flash
Processing input args to create rom file when dumping
Adding create_rom function in file.c working but need to add check if file already exists
Listing out number of mappers which planning to support
2016-12-09 01:58:34 -06:00
paul eeepc a89caf2454 Detecting some flash carts including NROM and UNROM.
Using CHR-RAM sensing, and flash manf/prod ID based on PRG-ROM banking

fixing bug in firmware for ppu writes was ANDing in /A13 instead of ORing..

adding datasheets to hardware folder for 5v PLCC and 3v TSOP flash used on all flash boards
2016-12-08 21:52:47 -06:00
paul eeepc 66635b15e7 Making progress on main program flow with detection in preparation for dumping/writing operations.
Prepended DICT_ to dictionary names to prevent using those defines for something else accidentally
"NES/SNES" etc could be used in a lot of places, don't want to use wrong enum/define in wrong place.

created enums.h to list out all enums/defines for cartridge and memory elements in one location.

separate file.c/h file for getting data in/out of a files, and opening/closing them.

adding test roms to roms folder so they can be used for various testing.
2016-12-07 18:08:31 -06:00
paul eeepc 497e53378b Basic cartridge detection working. NES detected with CIRAM /CE and PPU /A13N jumper. Famicom detected with audio in/out connection. SNES detected by enabling control signals and reading reset vector looking for non 0xff data. Still need to add check that would pass with blank flash cart though reading flash ID's perhaps.
Removing bad logic where TRUE == 0x00 as that's 'false' in C so that was causing more confusions than solutions.
2016-12-04 03:16:40 -06:00
Paul Molloy 2f8823053e making some changes to dictionary call for print options. 2016-12-01 23:15:58 -06:00
paul eeepc a24d728cea flashing page working, verified by reading back again.
currently instruct buffer to dump/flash by setting its function accordingly
2016-12-01 00:45:10 -06:00
Paul Molloy 937435220a Some early dumping functionality working.
buffer opcode updates to transfer payloads
including stuffing two bytes of write transfers in setup packet.
Calling specific buffers with miscdata or opcode.

new dump and flash modules for firmware.

new buffer function update_buffers called during main to monitor and
manage buffer objects when not being loaded/unloaded from USB.
2016-11-30 22:52:43 -06:00
paul eeepc 8cdeecdd77 adding some error checks to usbFunctionWrite.
Trying to prevent transfer from exceeding buffer size.
Also verifying buffer's status is properly set to enforce upholding of the status.
Giving usbFunctionWrite a means to communicate it's error/success back to host with USB 'dictionary'.
2016-11-30 12:53:06 -06:00
paul eeepc b6164aa3a6 adding buffer element getter and setters to dict and firmware.
Need to add to host support and test operation.
2016-11-30 02:04:07 -06:00
Paul Molloy 3326c2fb34 payload buffers working with some early testing.
Had a good lesson on what static means... :/
everything working now as previously designed
speed testing on windows10 PC yeilded ~21KBps when transferring 128-512KB
payloads and 128Byte transfer size.  Going to bump to 256 and see how that
does after 128KB speed tests on linux machine.

created host test.c/.h file for general testing of new features.
that way I can start working on erase/write.h files and just use test.c as
scratch code space for tinkering and still call with -t flag on command
line.

modified dictionary calls to include pointers to data and lengths.
2016-11-29 18:27:54 -06:00
paul eeepc cb0941e86c usbFunctionWrite support loading incoming write/OUT data to buffer objects.
Still untested, need to write some host code to test things out.
2016-11-29 15:27:31 -06:00
Paul Molloy fe1b0e0ba5 AVR Memory Usage
----------------
Device: atmega164a

Program:    4092 bytes (25.0% Full)
(.text + .data + .bootloader)

Data:        445 bytes (43.5% Full)
(.data + .bss + .noinit)

upgraded windows machine to avr-gcc (GCC) 6.1.1 20160627
dropped .hex down to within 2 bytes of linux machine running 4.8.2

changed main to remove avr-gcc 6.1.1 warnings
2016-11-28 22:53:12 -06:00
Paul Molloy 80943f7f62 firmware buffer.c reorganization and some intitial testing complete.
moved all buffer operations out of usb.c with new bridge function between
the two files.  Lots of pointing going on and lessons learned..
Thankfully everything seems to be working if you actually call the
functions as I designed them..  Gotta love trouble shooting bugs that
don't exist..  Helped updating allocate output to get returned as error
back to the host.

Moved typedef structs to firmware type.h file as seemed to cause
compilation issues being contained in the files .h file when other .c
files needed those types.

Fixed casting warnings with usbMsgPtr ended up looking at usbdrv.c figured
out how close I got, just shouldn't have been putting the * in there..
2016-11-28 22:16:35 -06:00
Paul Molloy 52ef11c7e3 AVR Memory Usage
----------------
Device: atmega164a

Program:    4186 bytes (25.5% Full)
(.text + .data + .bootloader)

Data:        445 bytes (43.5% Full)
(.data + .bss + .noinit)

buffer allocation basic operations tested and working great.
Still need to update windows machine avr-gcc..
implemented with 8 buffers and 256 raw buffer
2016-11-28 20:45:46 -06:00
Paul Molloy c36313135e Initial firmware implementation of buffer objects and raw sram allocation
complete.  should be able to allocate buffers from host, but haven't got
to testing it yet.  Compiling on firmware though..
Currently have 256 bytes of raw_buffer, and 8 buffer objects/structs
each with ~16 bytes per object.  So could trim things down, but still have
decent amount of SRAM left.  Could have another 256 byte buffer at this
rate..  but might not leave enough SRAM for temporary routines.

Possible that raw buffer space could be dynamically allocated
as either buffer space or temporary routine space...

AVR Memory Usage
----------------
Device: atmega164a

Program:    4094 bytes (25.0% Full)
(.text + .data + .bootloader)

Data:        573 bytes (56.0% Full)
(.data + .bss + .noinit)
2016-11-28 02:01:14 -06:00
paul eeepc 931222cf17 new buffer.h/.c firmware files. Mostly just comments and struct defn for now 2016-11-27 21:18:54 -06:00
Paul Molloy c6a68c679f Adding EXP0_PULLUP_TEST should probably verify pullup on EXP0 provides
logic 1 if relying on it.  Seems to work fine on NES discrete and
INLXO-ROM boards where planning to utilize it.  SNES can't pull up due to
pulldown and original famicom cart can't either perhaps because of
EXP6 EXP FF output being too much of a load..?
2016-11-27 17:47:40 -06:00
paul eeepc cd6378b8c5 SNES dictionary creation, addition of NES cpu/ppu read/writes
cleaned up firmware pinport.h used PURPLE/GREEN KAZZO for all #ifdef's

AVR Memory Usage
----------------
Device: atmega164a

Program:    3404 bytes (20.8% Full)
(.text + .data + .bootloader)

Data:         53 bytes (5.2% Full)
(.data + .bss + .noinit)

final kazzo design hex commited as comparable build to the past two commits of green/purple.
So this .hex commit is apples to apples with recently commited purple/green .hex commits.
2016-11-27 15:32:36 -06:00
paul eeepc 3aca4c863e AVR Memory Usage
----------------
Device: atmega164a

Program:    3416 bytes (20.8% Full)
(.text + .data + .bootloader)

Data:         53 bytes (5.2% Full)
(.data + .bss + .noinit)

First commit of purple kazzo specific firmware.
Currently just 12bytes larger than final design v1.2b-v1.4
This will probably expand as more updates twiddle with EXP FF
2016-11-27 15:10:16 -06:00