Commit Graph

14 Commits

Author SHA1 Message Date
Paul Desktop ASUS-C7H cc4aa6c67c -------------------------------------------
Firmware application version #3 release
-------------------------------------------

N64 updates:
Some extra timing delays were necessary for consistent dumping.
Includes fixes for N64 dumping that proved working for me on 10+ carts I
dumped successfully.  There is now a .csv in docs folder with cart size
in bytes, divide that number by 131,072 to get size in mbits for -z
flag.  Includes CRC32 checksum that can be verified using HxD hex
editor.  N64 file output is big-endian so it reads as it should in hex
editor which is .z64 file format.  lua script updated to print out the
game name from the in rom header.

NES updates:
flashing support for quite a few different mappers including GTROM,
MMC2, MMC4, action53, easyNSF, and other tweaks to rd/wr timings.

FIRMWARE UPDATES:
inlretro2.lua script now tries to poll the firmware "application
version" and suggest updating your firmware if you're not running the
version in this release.  You can always update your firmware using the
bootloader method in the readme.  But there is an easier method if you
have an stm32 based device (translated: you purchased your device in
2018 or later). AND you're already running firmware version v2.3.x

simply run the new scripts which were added in this commit:

	PCB version 2.0 or 2.1 (large square PCB with option for 6 connectors)
	>inlretro.exe -s scripts\inlretro_inl6fwupdate.lua

	PCB version 2.0N (smaller PCB with NES connector only:
	>inlretro.exe -s scripts\inlretro_inlNESfwupdate.lua

Now that it's easier for the host software to detect the firmware
application version can work towards having the scripts automatically
update the device firmware for you..  But still need to implement this..
2019-08-16 10:27:19 -05:00
Paul Win10 shuttle PC 0884d6608d Support for GTROM mapper 111. Both INLretro6 firmware and AVR firmware
included.  Not making an offical firmware release, will have to upload to
INLretro6 with fwupdate call.

The colordream firmware updates are also included.  But not the host
scripts, need to clean them up a bit.
2019-02-16 10:04:11 -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 XPS 54e3e6bf3c Big release commit for firmware v2.3.0
Put bunch of notes in Readme.txt on how to update device firmware to
v2.3 using dfusedemo.  Anyone with a device currently in their hands
will want to update to this latest version using the dfusedemo
instructions there.  Or the AVR instructions if you have an old kazzo.

For devices shipping after Dec 1st 2018 I will be flashing this latest
v2.3 firmware which has it's own firmware updater so the INLretro host
software can easily and seamlessly update the firmware for you without
any external software, switch or jumper operation on the PCB.

This update also includes some power functions in the bootloader
dictionary.  Can now make direct read/write access to the entire ARM
memory space.  Maybe I'll add this to the AVR someday..?
Having this previously would have actually allowed me to bootstrap
a switchless bootloader without dfuse..  ahh well...

Also turned the watchdog timer on for the STM32 build finally.
Requires refreshing every ~1sec, currently only done in the main.

Added application versioning to address 0x08000800 in the binary.
Couldn't get the linker script to do this for me for some reason.
So for now I just manually put it in the binary file.

The fwupdate.lua script has a lot more checks now.  Uses the new
bootloader dict functions to dump device firmware and make sure
all looks good before it starts erasing firmware.

Haven't done much testing with the current AVR build.  Got a report
there was a problem with UNROM flashing, will have to check that out.

Done with the firmware for awhile now hopefully.  Need to clean up some
things with the main program & inlretro.lua script.  Start making better
use of some recent contributions by several gracious people.

Maybe I'll get going on gameboy, GBA, & sega soon..  Got a ton of
NESmaker devices to push out the door now with this latest build.  So
might be slow for a bit..
2018-12-01 02:18:01 -06:00
Paul XPS 86e8d3d215 Big old first major commit since publicly releasing..
I made a commit earlier this week but messed things up by not pulling
from the master and things weren't updated...  Here's the notes from
that commit:

 Author: Paul XPS <paul@infiniteneslives.com>
 Date:   Tue Nov 6 22:45:52 2018 -0600

 Large commit biggest feature add is NES MMC3 support including Save RAM
 (aka WRAM/PRGRAM) support including dumping and writing save files.

 The MMC3 script & method of dumping/flashing is the most forward
 thinking script/firmware so far.  Finally starting to form a clear
 vision of how I want to handle flashing/dumping variations with mappers.
 Biggest thing is having the host handle the mapper init & banking
 control.  In the view of the firmware, it's only responsible for knowing
 how to flash a bank.  And dumping is even more generic with the host
 just telling what address range to read.  Things will get more complex
 with support of mappers with bus conflicts.  But ready to start
 converting these old hacked methods to be more like the MMC3 means.

 Have some early support for dumping gameboy using the snes script as the
 pinouts are nearly identical.  Along with testing of toggling between 3v
 GBA and 5v DMG.

 Have some early support for INLretro NES only version which uses a
 smaller mcu because it doesn't need to support large 16bit carts.  Still
 have to get this completed.

 Added support for CNROM, but I'm not sure if it's actually working.  Going
 to restart with NROM and start updating the currently supported
 mappers to be more like MMC3.

But this also includes some new updates from the second half of the week:

Started updating existing NES scripts to use new MMC3 methodology.  Got
NROM, CNROM, BNROM, & Color Dreams working.  On the host side only
needed to add nes.c functions for specific flash algos.  Able to delete
significant amounts of mapper specific code from flash.c

Got some basic SNES script support with new methodology for Catskull
elect 5v PLCC SNES LoROM board.  And INL SNES HI/LO-ROM 3v board as
well.  These don't yet use buffer writes, just single byte writes.

Also having issues with Mirroring test/sensing again.  Driving me crazy,
but don't really care about it at the moment and not sure what's wrong..
So just committing that broken for now.  Looking to remove this
functionality from the firmware side as the host should be controlling
most of this.

Looking to add SNES RAM & buffered writes.  Also need to test some of
the HIROM code as I just added it in there while I did the LOROM stuff..
2018-11-09 21:52:33 -06:00
Paul Win10 shuttle PC 25c159c27f Final commit for firmware version 2.01 first public release
Host does not require v2.01 over v2.00
2018-09-07 09:13:39 -05:00
Paul Win10 shuttle PC 88a2d30858 Massive commit with bunch of random junk..
Added windows driver package, just have to run InstallDriver.exe to
get drivers installed on windows 10 (and others I believe)

Created dictionaries for all remaining cart connectors.
Nothing useful there yet, just wanted to get the files created
and dictionaries working.

Added bunch of notes to shared_dictionaries to explain how to go
about creating new dictionaries and some opcode details.

Have STM8 cic communications working "CICCOM" to change between H/V
mirroring on new discrete boards.  Currently these operations are handled
entirely from the host scripts and opcode/operands are mostly hard coded.
Need to move these to more generic functions in the ciccom dictionary
which will also speed things up moving to the firmware which will speed
things up.

Some changes to mapper 30 script to eat the ines header, and test CHR-RAM
banking.

Some updates to snes flashing operations, still a work in progress to
fully support prior SNES board designs.
2018-09-06 23:01:59 -05:00
Paul Black ASUS win7 9c57f1bdb3 Massively overdue commit of several months worth of random work.
Mostly adding support for mappers as I needed it for my own hardware
builds:
-MMC1
-mapper 30
-easy NSF (still need to update for mapper verilog fix)
-action53 (still need to update for mapper verilog fix)
-dual port board flashing
-colordreams, not sure if I actually got this working
-color ninja, just a special CPLD version of colordreams for ninja boards

Just started working on SNES code.  slowly getting things up and working
outside of main inlretro.lua script similar to how NES has been handling
everything with it's own script.  Able to flash v3 boards fine.  v1 boards
flash without errors, but still having some mapping problems where it
verifies but won't boot.  v2 prototype flashes most bytes but not all,
seems v2 boards are much slower to output valid data..  But that may just
be the manufacturer ID codes..?

TODO next:
-bootloader dictionary that jumps to bootloader so don't have to manually
close jumper on the board.
-turn on the watchdog timer for stm32
-create some sort of host timeout so reset button on programmer isn't as
useful
-allow firmware programing algos to be uploaded and executed from SRAM for
faster code that also doesn't require specific firmware builds to support
new mapers.
-Finish JTAG to simplify programing NES & SNES CPLDs
-Sort out swim issue with stm8s001 CICs
-add SWIM support for avr
2018-07-08 20:23:44 -05:00
Paul blue asus fafe706481 Another late commit from bunch of updates I made over a month ago..
Most progress was on jtag lua statemachine code.  From what I recall I
tested and verified most state change possibilities with logic analyzer.
So they should be fairly good.  Possible I didn't test all later ones,
or things are partly unfinished, but my best guess is they're good.
Appears was able to erase MachXO CPLD.  Added time delay for run test.
Did some basic testing for gameboy power switching circuit.

Also just got STM8S001 CIC programming working for discrete boards via
A0.  Pretty sure I broke EXP0 in the process for SNES boards..  So need
to go back and fix that I think due to new means of changing swim pin.
2018-02-13 14:36:43 -06:00
Paul blue asus 535b45be27 Committing working build that was used for flashing STM8 SNES v3.1
boards for SF2 builds.  Not necessarily the most clean, but it was
stable and worked well.

Need to get swim comms working on other board designs.
Need to come up with better swim activation with more exact timing.
Still need to implement swim comms on avr, hopefully that doesn't prove
to be too much of a PITA...  Not looking forward to that.  Can probably
only handle low speed, and faking pullup may not work as well without
time on it's side @ 16Mhz...
2017-12-20 09:28:01 -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 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 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