Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make flash error #27

Open
rico666 opened this issue Mar 22, 2021 · 0 comments
Open

make flash error #27

rico666 opened this issue Mar 22, 2021 · 0 comments

Comments

@rico666
Copy link

rico666 commented Mar 22, 2021

make flash exhibits less than optimal behavior

$ make flash
arm-none-eabi-objcopy -Obinary main.elf main.bin
/usr/bin/st-flash  write main.bin 0x8000000
st-flash 1.6.1
2021-03-22T17:40:27 INFO common.c: F1xx Medium-density: 20 KiB SRAM, 128 KiB flash in at least 1 KiB pages.
file main.bin md5 checksum: 6dbdf99e962bdc0f293082734b88, stlink checksum: 0x00056291
2021-03-22T17:40:27 INFO common.c: Attempting to write 3816 (0xee8) bytes to stm32 address: 134217728 (0x8000000)
2021-03-22T17:40:27 INFO common.c: Flash page at addr: 0x08000000 erased
2021-03-22T17:40:27 INFO common.c: Flash page at addr: 0x08000400 erased
2021-03-22T17:40:27 INFO common.c: Flash page at addr: 0x08000800 erased
2021-03-22T17:40:27 INFO common.c: Flash page at addr: 0x08000c00 erased
2021-03-22T17:40:27 INFO common.c: Finished erasing 4 pages of 1024 (0x400) bytes
2021-03-22T17:40:27 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL core id
2021-03-22T17:40:27 INFO flash_loader.c: Successfully loaded flash loader in sram
2021-03-22T17:40:27 ERROR flash_loader.c: flash loader run error
2021-03-22T17:40:27 ERROR common.c: stlink_flash_loader_run(0x8000000) failed! == -1
stlink_fwrite_flash() == -1
make: *** [../../Makefile.incl:134: flash] Error 255

And it has been a neverending story for quite some time: see stlink-org/stlink#607 and
stlink-org/stlink#356

One solution is to constantly plug and unplug STlink, which is not sustainable. Another solution is to modify Makefile.incl and insert the --reset option:

# Flash 64k Device
flash:	$(BINARY).bin
	$(STFLASH) --reset $(FLASHSIZE) write $(BINARY).bin 0x8000000

# Flash 128k Device
bigflash: $(BINARY).bin
	$(STFLASH) --reset --flash=128k write $(BINARY).bin 0x8000000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant