@@ -268,6 +268,36 @@ big then check out our section on optimizations.
268268
269269> ** TODO** (resources team) add link to the optimizations section
270270
271+ # I'm trying to follow the book but my program won't flash
272+
273+ It is quite common that by oversight the linker configuration is not suitable
274+ for the target device. Indications for such a problem are loading errors in ` gdb ` :
275+
276+ ```
277+ (gdb) load
278+ Loading section .vector_table, size 0x400 lma 0x0
279+ Loading section .text, size 0x2064 lma 0x400
280+ Load failed
281+ ```
282+
283+ Please note the ` lma ` which is the loading address and needs to match up with the
284+ start address of the flash.
285+
286+ Similarly ` openocd ` will indicate such a problem:
287+
288+ ```
289+ ...
290+ auto erase enabled
291+ Info : device id = 0x10036422
292+ Info : flash size = 256kbytes
293+ Warn : no flash bank found for address 0
294+ wrote 0 bytes from file target/thumbv7em-none-eabihf/debug/examples/hello in 0.001434s (0.000 KiB/s)
295+ ```
296+
297+ If you see such a message you will need to check your linker configuration, usually in
298+ ` memory.x ` for the correct addresses (and ideally also sizes). Please also note that
299+ after a change you will need to ` cargo clean ` and rebuild to use the changed addresses.
300+
271301# My program just halts without connected debugger. What am I doing wrong?
272302
273303## Short answer
@@ -296,4 +326,4 @@ Please note that examples may make use of the `semihosting` concept but this
296326should not be used in production setups due to the lack of connected debugger and
297327a host running appropriate debugging software. The use of a serial interface is
298328often a better choice. However if you just would like to see your example running
299- please make sure your setup is ready to deal with the ` semihosting ` requirements.
329+ please make sure your setup is ready to deal with the ` semihosting ` requirements.
0 commit comments