Closed Viguro79 closed 1 year ago
The data_empty.ihx file is correct. This error message could be a stm8flash bug or the SWIM connection is not working. I can't verify it because I don't know and don't use MacOS, let's wait for someone more experienced.
This looks like a mistake in the script? I think you need to pass -s eeprom
to stm8flash
to write to the EEPROM, which the Makefile suggests is what should be happening.
-s eeprom (https://github.com/vdudouyt/stm8flash/blob/7885455458d6b1d351eb039ab88250ce590ab59b/main.c#L361) technically shouldn't matter because data_empty.ihx specifies memory addresses explicitly.
But maybe it would solve OP's issue.
Address 0x4000 is indeed eeprom as specified in the data_empty.ihx. So perhaps stm8flash is thinking it is programming different cpu?
How about trying with quotation marks? https://github.com/emmebrusa/TSDZ2-Smart-EBike-1/issues/30
None of these combinations work :
stm8flash -c stlinkv2 -p stm8s105?6 -w data_empty.ihx (original form)
stm8flash -c stlinkv2 -p "stm8s105?6" -w data_empty.ihx
stm8flash -c stlinkv2 -p stm8s105?6 -s -w data_empty.ihx
stm8flash -c stlinkv2 -p "stm8s105?6" -s -w data_empty.ihx
Maybe an issue with MacOS
Try this:
stm8flash -c stlinkv2 -p stm8s105?6 -s eeprom -w data_empty.ihx
In short, I get :
stm8flash -c stlinkv2 -p stm8s105?6 -w data_empty.ihx
returns Address 4000 is out of range at line 1
.
stm8flash -c stlinkv2 -p stm8s105?6 -s eeprom -w data_empty.ihx
returns OK
.
stm8flash -c stlinkv2 -p stm8s105?6 -s eeprom -v data_empty.ihx
returns FAIL
.
I had #37, so I tried to verify the EEPROM was really cleared, and form what I understand, It's not.
For the context, I'm using a STLink-V2 clone in 3.3V after hitting SWIM error 0x04
.
Still not working on macos :
stm8flash -c stlinkv2 -p stm8s105?6 -s eeprom -w data_empty.ihx
Determine EEPROM area
STLink: v2, JTAG: v29, SWIM: v7, VID: 8304, PID: 4837
Due to its file extension (or lack thereof), "data_empty.ihx" is considered as INTEL HEX format!
STLink-V2 clone in 5V or 3.3V, neither works
If it's of any use, I was having the same issue on macOS and ubuntu, I applied the fix from this PR - didn't work, same error. It only started working when I also connected the RST cable - it wasn't super clear for me as this documentation page suggests it can be done with just GND, SWIM and 5V. Worked on Ubuntu, didn't get round to retrying on macOS
Thanks, I agree. Always connect 4 wires, even RST.
Yes ! I missed this important point : connecting the RST wire did the trick! Thanks everyone
Using mac os ventura on macbook pro M1, I'm able to connect the key to the bike. When lauching ./compile_and_flash_20.sh, it is able to compile ; then ask to backup or not ; then to compile.
What is this issue about ? The TSDZ2-20.1C.2-2-.hex is well generated in the releases folder.
Any idea about this?