Commit Graph

12 Commits

Author SHA1 Message Date
beyondcoast 4fec4855b6 Update .gitignore to ignore VSCode metadata 2018-12-20 07:27:46 -06:00
Paul XPS e4debe5a13 Big update for firmware version v2.3.1
this is the verion getting flashed on all v2.0N NESmaker kits
v2.3.0 worked for basic functions, but was never shipped

Majority of effort revolved around testing mapper30 boards with the
smaller v2.0N INLretro with the NES connector alone for NESmaker kits.

added linear feedback shift register for test stream data generated
locally on the device.  I'm not 100% sure if this is any faster than
pushing the actual data via USB though.. :/  It's plenty fast on the
stm32 nearly instantaneous for 32KByte.  But the AVR takes a couple
sec..

Created "stuff" dictionary for things like that were I just want to add
small things and don't want to bother with a whole new dictionary.

Added file verification to the host with files.lua

Have some nes flash algos return post-written data so calling function
can decide if want to retry, fail, etc.

Changed host dictionary calls to assert instead of error because it
really shouldn't continue.  I didn't see an error when sending opcode to
wrong dict and caused head banging..

fwupdate permits bytes to be skipped, or force the update.  Found that
the fwupdater got assigned different addresses of ram depending on what
all other ram gets allocated to the main application

Some clean up of inlretro.lua

TODO:
host learn and keep track of the connected device.
Needed for ciccom right now, or knowing whether ciccom connection
is even present..
In the end maybe ciccom is better placed in firmware, but for small
transfers of only a few bytes it kinda makes sense to keep on the host.
Pinport gets quite messy with these made up pin names when really all I
want to do is toggle a specific pin on the NES connector.  So maybe some
double mappings would actually be okay, need to rethink that..

create different flash modes that either keep going, retry, or error
depending on the goal of the flash operation.  Fanout the return value
from flash algos to all of them.

have fwupdate assigned a specific area of ram so the ram pointer doesn't
change between builds.  Okay to ignore for now.

Realized can have STM32F070C6 devices execute bootloader by erasing all
the flash or perhaps even just the first word of flash according at
AN2606.  This wouldn't work for RB devices though.  This could be done
through the bootloader dict
2018-12-06 01:07:13 -06:00
Paul Molloy ec596dd963 Merge branch 'master' into 'unrom-find-banktable'
# Conflicts:
#   .gitignore
2018-12-01 17:33:39 +00:00
beyondcoast 5691721cd6 Don't track unix binary in source control 2018-12-01 00:23:28 -06:00
beyondcoast d55cf71ac5 Add liblua.a to .gitignore 2018-12-01 00:04:32 -06:00
Sylvain Gadrat 75aaba1ad8 Add inlretro built binary to gitignore 2018-11-30 13:42:51 +01:00
beyondcoast 0213df5580 Rearchitect Makefile to support dependency tracking / fast incremental builds. Lua now built and linked as static library via its own Makefile. .gitignore modified to ignore *.d Makefile fragments with dependency info. 2018-11-29 20:36:06 -06:00
beyondcoast fbcd5de5ff Reference shared/*.h using compiler flag, remove need to copy files to build host application. Remove related content in .git_ignore. 2018-11-25 13:02:53 -06:00
Paul blue asus b7364b964c little bit of clean up commit. Updating readme for little more
direction for stm32 ARM cortex-M0 building.  Also adding more explicit
error message if VID/PID of device found, but unable to open due to
drivers not being installed.

Got quite a bit done since last commit, and never committed all the
changes.  Most should be fine but need to review a little more before
I'm ready to commit those.  Mostly was in a rush to get SF2 working and
then took a break before cleaning up and committing progress.

Once old SF2/SNES STM8 updates committed, need to move on to supporting
NES mappers.  Also in a bit of a rush to verify new STM8S001 can be
programmed via CIC CLK on inl6 devices.  Also need to get JTAG up and
running to make progress on SNES v2 board design.

Figured out problem with STM32F070 bootloader, basically broken for
16Mhz crystals because ST doesn't do adequate testing on their
bootloader code to verify datasheet and AN specs of allows xtal
frequencies.  4, 8, 12, & 24Mhz tested and working, also STM32F072
works.  Have dumped bootloader and started analysis.  STmicro isn't
offering any help to fix issue, bunch of jackasses!  Oh well, plan is to
establish my own bootloader means which has benefit of allowing me to
define however I'd like.  Planning on LED pin held high triggering
bootloader which would require smallest erase/write protected sector to
be devoted to my bootloader similar to how things were done for AVR.
After detecting bootloader, initialize HSE and jump to ST's bootloader
code so don't have to write my own USB drivers for the bootloader alone.
2017-12-19 02:39:47 -06: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 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 aabf49d1ee creating gitignore file 2017-07-22 13:42:05 -05:00