I wonder if anyone had tried this? I changed the linker script flash.ld to
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 61K
rom (rx) : ORIGIN = 0x08000000, LENGTH = 492K
(I copy these setting from bootloader). I uploaded the "Blink" binary complied by Maple-IDE using ST-LINK V2 Jtag and... it wouldn't run!
I look into the init() function from boards.cpp (which contains a lot of initialize function) and compare it with the bootloader main(), which contains 4 setup functions
systemReset(); <--- missing?
setupCLK(); <--- setupClocks() perhaps?
setupLED(); <--- gpio_init_all() take cares all
setupUSB(); <--- setupUSB almost the same as bootloader
Q1: Has anyone try modifying board.cpp init() so that the IDE-generated binary can run without bootloader? Is setupClocks() and systemReset() the issue why the binary can't run independently?
Q2: I can understand the user code starts at 0x8005000, with bootloader at 0x8000000. Why does user RAM starts at 0x20000C00? Between 0 to 0xC00 are used by bootloader only?Is the user code using the same stack as the bootloader?
many thanks!