2017-04-07 06:08 AM
I am trying to program and debug from SRAM but it seems that I'm not doing something right.
This is what I do to start debugging:
it does not work.
When I try to do the samething in TrueStudio debugger, I see that it is looking for some creppy address which I don't know where they are supposed to be. something like 0x78a212b .
What steps have I forgotten to do? Reference manual has mentioned that
When the device boots from SRAM, in the application initialization code, you have to
relocate the vector table in SRAM using the NVIC exception table and the offset register.but I don't know what I am supposed to add inside the code.
#gcc #debug #stmf4 #gdb #linker #sram2017-04-07 06:46 AM
In Keil I'd use a debugger script to download the code, and make sure the IROM/IRAM pointed to different areas of SRAM.
I haven't used SRAM like this in a while, but the F1 parts had some undocumented behaviour with respect to the Vector Table, and Reset Handler. ie It jumped to a specific address, not the Initial PC vector.
I would suggest you make a small FLASH based loader/monitor which can provide some interactive control (options, download .HEX to RAM, etc) and transfer control to the RAM based code using that. In things like Keil that would definitely let you 'run to main()' on the RAM based code, and step through the code, if that level of understanding was required.