Implemented flash writing.
[fw/stlink] / README
1 HOWTO
2 =====
3
4 To run the gdb server, do (you do not need sudo if you have
5 set up permissions correctly):
6 $ make -C build && sudo ./build/st-util 1234 /dev/sg1
7
8 Then, in gdb:
9 (gdb) target remote :1234
10
11 Have fun!
12
13 Running programs from SRAM
14 ==========================
15
16 You can run your firmware directly from SRAM if you want to.
17 Just link it at 0x20000000 and do
18 (gdb) load firmware.elf
19
20 It will be loaded, and pc will be adjusted to point to start of the
21 code, if it is linked correctly (i.e. ELF has correct entry point).
22
23 Writing to flash
24 ================
25
26 The GDB stub ships with a correct memory map, including the flash area.
27 If you would link your executable to 0x08000000 and then do
28 (gdb) load firmware.elf
29 then it would be written to the memory.
30
31 Caveats
32 =======
33
34 `continue' GDB command does not work: target does not step at
35 all or steps with a turtle speed. Looks like there's something
36 wrong with SCSI requests.
37
38 GDB sends requests for a multi-sectioned ELF files (most ones;
39 having both .text and .rodata is enough) in a quite strange way which
40 absolutely does not conform to flash page boundaries. Which is even more
41 weird when you think about FlashErase requests which it sends correctly.
42 And I couldn't think of a way which will resolve this correctly now.
43
44 Hardware breakpoints are not supported yet. You can still run your code from
45 RAM, and then GDB will insert bkpt opcodes automagically.