stm8 code for flashing tsdz2 firmware

mossboss

10 mW
Joined
Nov 5, 2018
Messages
21
eco-ebike.com now offers some customized firmware for the TSDZ2 that I'd like to try:
https://www.eco-ebike.com/blogs/eco-cycles-instructionals/tsdz2programmingfromscratch

They offer instructions on how to flash with the st-link software, but I don't have a windows machine. My plan was to try flashing with stm8flash, modifying the flashing script in the open source project: https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/Flash-the-firmware-on-TSDZ2

One question I had was that eco-ebike provides a program memory and data memory .hex, in contrast to the open source project which is a single file. Should I write both the program and data memory files to the motor, and does order matter?

Would, eg:
Code:
stm8flash -c stlinkv2 -p stm8s105?6 -w datamemory.hex
stm8flash -c stlinkv2 -p stm8s105?6 -w programmemory.hex
...work?
 
looks nice but what advantage would it have over the available open source solution?
 
Tried the following:
Code:
echo "00 00 ff 20 df 00 ff 00 ff 00 ff 00 ff 00 ff" | xxd -r -p > option_bytes_pwm_n_channels_enabled.bin
stm8flash -c stlinkv2 -p stm8s105?6 -s opt -w option_bytes_pwm_n_channels_enabled.bin
stm8flash -c stlinkv2 -p stm8s105?6 -w 48vprogrammemory.hex
stm8flash -c stlinkv2 -p stm8s105?6 -w 48vdatamemory.hex

... program memory is written just fine, but flashing the data memory throws an error:
"Address 4000 is out of range at line 1"

Thankfully I backed everything up, because the above script definitely disables the motor!
 
Back
Top