Avoid resetting the target when loading an elf #32
-
I am not sure where asking this, but I am putting it here with the hope of getting some sort of guidance. I am using the Microsemi polarfire soc, to be more accurate, I am using the Microchip Polarfire ICICLE Kit and the version of openocd which comes with the latest version of Softconsole. Versions Problem In the normal use case scenario what I do is this:
In the other debug use case scenario what I would like to do is this:
Sadly however, when openocd connects it resets the soc, so I lost the initialization done by the bootloader, and when the app start executing I end up trapped in here By default the microsemi-riscv.cfg file is doing
what I have tried so far is to modify this file and instead of the aforementioned line I putted:
but neither this worked. The command I am using with gdb to load the elf are:
What I further tried is to modify my board/microsemi-riscv.cfg adding the following commands:
My application does not start, but now it does not trap anymore, but it is just stucked somewhere in the code. I can say that because if I start again openocd and connect trough GDB I can see were it is stucked:
Is there any way to achieve my goal? I tried to dig trough openOCD code but I didnt found anything. Furthermore I wasnt able to figure out where the sources of the openOCD version which is shipped with SoftConsole are stored. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @fcuzzocrea yes this should be possible, I'm not sure exactly what to do (wanted to get you a response at least!) - my reasoning is our provided debug configurations in softconsole, if you have a look below in the "all-harts debug" configuration "Initial reset" is selected along with "Load executable" to reset the target and download the application: Whereas in the "all-harts attach" the target is not reset and the application is not downloaded: I'll see if I can find out what deselecting these options translates into but if you can figure it out in the mean time go for it 😄 |
Beta Was this translation helpful? Give feedback.
-
Just a brief update to let you know that I was able to achieve my goal using ebreak. Basically I have created a wait_for_debugger() function:
Of course I know the value of When my bootloader is started from a debugging environment (Trace32 or OpenOCD+GDB), it executes the function and then hits the ebreak, so wait for the application to be loaded in the LIM. With GDB I do:
And my application loads correctly. As I said, this probably it is just an hack, and can hardly be integrated into an IDE to allow interactive debugging (because when the start is exectued the IDE GDB frontend crash), but at least it is working and I can use GDB from the CLI. FWIW I also tried replacing the |
Beta Was this translation helpful? Give feedback.
-
Hey, closing this issue as there has been no activity in several months. If this issue persists or you require more information please add a comment and we can re-open it 🙂 |
Beta Was this translation helpful? Give feedback.
Just a brief update to let you know that I was able to achieve my goal using ebreak.
Probably it is just an hack, but maybe could be useful for someone else in future.
Basically I have created a wait_for_debugger() function: