I'm having some problems flashing an STM32F4 Discovery board on linux.
I can read and write fine with the IAR systems demo, or the ST-Link utility on windows.
On linux, I'm using (the latest, although I've tried a few builds)
https://github.com/texane/stlink , which can read data out from the chip fine. The file that's read out passes a verify agains the chip.
Output from a read operation is:
st-flash read demo1.bin 0x80000000
2013-04-15T17:02:19 INFO src/stlink-common.c: Loading device parameters....
2013-04-15T17:02:19 INFO src/stlink-common.c: Device connected is: F4 device, id 0x10016413
2013-04-15T17:02:19 INFO src/stlink-common.c: SRAM size: 0x30000 bytes (192 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 16384 bytes
However, trying to write to the chip produces this:
st-flash write demo.bin 0x80000000
2013-04-15T16:49:11 INFO src/stlink-common.c: Loading device parameters....
2013-04-15T16:49:11 INFO src/stlink-common.c: Device connected is: F4 device, id 0x10016413
2013-04-15T16:49:11 INFO src/stlink-common.c: SRAM size: 0x30000 bytes (192 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 16384 bytes
stlink_sram_flash() == -1
I can (usually, although it will sometimes throw up a libusb error) debug the chip, and load a .elf file using arm-none-eabi-gdb
Does anyone have any suggestions? (I can probably work around the problem using the windows software in a virtual machine, but it's not really ideal!)