So, this issue has been resolved!
The problem is that newer dev boards use a newer monitor with a new protocol. I did ask if I was allowed to publish the flash images (old and new) but did not get a response.
The uploader is MIT licenced though, so I am attaching it here. USE IT AT YOUR OWN RISK of course. For me it worked flawlessly on Linux using Python3.
The image it expects is the output file from the WDC assemblers. My current "myled.s" starts at
Code:
.org $1000
and the make script is:
Code:
#!/bin/sh
wine WDC02AS -g -l -DUSING_02 myled.s || exit
wine WDCLN -g -sz -t -HZ myled || exit
wine WDCSYM -A -L myled.sym>myled_sym.txt || exit
wine WDCOBJ myled>myled_obj.txt || exit
python3 wdc_uploader_term.py -d /dev/ttyUSB0 -a 001000 -x -m write -v myled.bin
EDIT: A warning: The monitor leaves the CPU running in native mode (non-emulated, so not the same state as on boot). This caused me a lot of head scratching. Symptoms are for instance:
Code:
ldx #0
requires a trailing nop (to account for the missing byte of the second half of 16 bit value). Sequences like:
Code:
ldx #0
nop ; Required because ldx is expecting more data to the instruction
delay:
dex
bne delay
takes much longer time than expected since X is 16 bits instead of 8.
For newcomers using the WDC assembler, this is the first few lines I use to set up the org and switch back to 6502:
Code:
.org $1000
CHIP 65816 ; start in native mode
SEC ; set carry for emulation mode
XCE ; go into emulation mode
CHIP 65C02 ; don't want to use any 65816 codes
EDIT: "WDC assembler" instead of "WDC compiler"