florisla / stm32loader

Flash firmware to STM32 microcontrollers using Python.
GNU General Public License v3.0
109 stars 53 forks source link

Missing key in self.configuration, class Stm32Loader, main.py #38

Closed steverlc closed 4 years ago

steverlc commented 4 years ago

When calling python main.py -r -p /dev/ttyAMA0 0x02 0x40022080 fl.hex I encountered

File "main.py", line 347, in main loader.perform_commands() File "main.py", line 198, in perform_commands self.configuration["address"], self.configuration["length"] KeyError: 'length'

It seems that 'length' is not defined in the dictionary self.configuration[?

florisla commented 4 years ago

You have to supply the -l argument; there is no 'default' length.

See the example:

stm32loader -r -p /dev/cu.usbserial-A5XK3RJT -f F1 -l 0x10000 -a 0x08000000 dump.bin 

I'll make sure to produce a nicer error message for missing. Length.

steverlc commented 4 years ago

Ah! I see now I didn't supply the -l argument, Sorry