florisla / stm32loader

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

Add support for chip_id "0x444": "STM32F03xx4/6" #17

Closed omerk closed 5 years ago

omerk commented 5 years ago

As titled, a simple change to support chip id 0x444.

Curiously, these parts do not seem to have unique id support (no mention in the datasheet or the reference manual) so added a bit of logic to handle that.

Tested changes on a STM32F030F4P6 board (the common SSOP20 breakout board available ubiquitously, it seems), can confirm it working.

omerk commented 5 years ago

For reference, here's quite a detailed list of these common 32F030F4P6 boards: https://github.com/stm32duino/Arduino_Core_STM32/issues/165

florisla commented 5 years ago

Thanks!

If you agree with my comments above, can you change and test it?

omerk commented 5 years ago

Tidied up get_uid() and format_uid() as discussed, with tweaks to the constant names.

Testing this on two boards I have here:

STM32F030F4P6:

python -m stm32loader -p COM6 -f F0 -e -w -v stm32loader\blink.bin Bootloader version 31 Chip id: 0x444 (STM32F03xx4/6) Device UID: UID not supported in this part Flash size: 16 KiB Extended erase (0x44), this can take ten seconds or more Write 40 chunks at address 0x8000000... ?[KWriting ████████████████████████████████ 40/40 ?[?25hRead 40 chunks at address 0x8000000... ?[KReading ████████████████████████████████ 40/40 Verification OK ?[?25h

STM32F103C8T6:

python -m stm32loader -p COM6 -f F1 -e -w -v stm32loader\blink.bin Bootloader version 22 Chip id: 0x410 (STM32F10x Medium-density) Device UID: FF52-0673-56558049-87132650 Flash size: 128 KiB Write 40 chunks at address 0x8000000... ?[KWriting ████████████████████████████████ 40/40 ?[?25hRead 40 chunks at address 0x8000000... ?[KReading ████████████████████████████████ 40/40 Verification OK ?[?25h

STM32F103C8T6 (Key 'F1' commented out in UID_ADDRESS):

python -m stm32loader -p COM6 -f F1 -e -w -v stm32loader\blink.bin Bootloader version 22 Chip id: 0x410 (STM32F10x Medium-density) Device UID: UID address unknown Flash size: 128 KiB Write 40 chunks at address 0x8000000... ?[KWriting ████████████████████████████████ 40/40 ?[?25hRead 40 chunks at address 0x8000000... ?[KReading ████████████████████████████████ 40/40 Verification OK ?[?25h `

florisla commented 5 years ago

This is now part of the 0.5.0 release.