jsnyder / stm32loader

Python script to load firmware using STM32 bootloader
324 stars 238 forks source link

unable to load firmware to stm32f103C #8

Open shirish47 opened 6 years ago

shirish47 commented 6 years ago

I have setup stm32 board properly with boot0 set to 1 and boot1 set to 0 and connecting RX and TX to arduino uno board removing mcu from it. I get this error ..

 python ./stm32loader.py -p /dev/cu.usbmodem1421 -w ~/Downloads/generic_boot20_pc13.bin
Can't init. Ensure that BOOT0 is enabled and reset device
Traceback (most recent call last):
  File "./stm32loader.py", line 436, in <module>
    bootversion = cmd.cmdGet()
  File "./stm32loader.py", line 118, in cmdGet
    if self.cmdGeneric(0x00):
  File "./stm32loader.py", line 115, in cmdGeneric
    return self._wait_for_ask(hex(cmd))
  File "./stm32loader.py", line 91, in _wait_for_ask
    raise CmdException("Unknown response. "+info+": "+hex(ask))
__main__.CmdException: Unknown response. 0x0: 0xf8

whats the problem I can't upload the firmware. :(

shirish47 commented 6 years ago

on multiple trials I was able to do it .. but then I saw it was not showing in USB. So I added verify flag in command I got

Verification FAILED
21140 vs 21140
0x1: 0x50 vs 0x4
0x4: 0xf1 vs 0x45
0x5: 0x0 vs 0x1
0x8: 0x31 vs 0xe7
0x9: 0x1 vs 0x2
0xc: 0x31 vs 0xdf
0xd: 0x1 vs 0x2
shirish47 commented 6 years ago

Ok so I ran that command with erase flag and it worked I suppose there was some other code on it.