File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -267,3 +267,33 @@ If you are measuring size using the right method and your program is still too
267
267
big then check out our section on optimizations.
268
268
269
269
> ** TODO** (resources team) add link to the optimizations section
270
+
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.
You can’t perform that action at this time.
0 commit comments