Skip to main content
ferro
Lead
October 16, 2024
Solved

Reset Configuration "set $pc=xxxxxxx", possible to use function name instead of its address ?

  • October 16, 2024
  • 1 reply
  • 2075 views

Hi,

I created this Reset config

ferro_0-1729099154820.png

The address of Reset_Hnadler () is from a .map file.

ferro_0-1729099354664.png

As the adress changes with builds, would be great to use function name.

'set $pc=Reset_Handler'

Is that possible ? What language is that 'set $pc ...'

 

See chapter '3.1.5.6.2 Restart configurations' in 'UM2609 STM32CubeIDE user guide'

ferro_0-1729102881170.png

 

(Eventually I'll port the handler from .s to .cpp and place it at a fixed address so that the address never change)

Thanks

Best answer by ferro

Yes, it is possible and the code in question works as it is.

ferro_0-1729102421389.png

Still, I wonder what laguage it is, is it possible to execute some other code/commands/call a script there ?

1 reply

ferro
ferroAuthorBest answer
Lead
October 16, 2024

Yes, it is possible and the code in question works as it is.

ferro_0-1729102421389.png

Still, I wonder what laguage it is, is it possible to execute some other code/commands/call a script there ?

Lead II
November 7, 2024

@ferro wrote:

Still, I wonder what laguage it is, is it possible to execute some other code/commands/call a script there ?


Language is GDB commands. I assume pc is the program counter register, so the dumb IDE thinks you are in the reset handler, while in fact you are nowhere since the MCU isn't running your program yet.
I'm not familiar with GDB commands. I tried the print command and nothing happened, nothing showed in the debugger console. It's all so poorly documented. Hard to find examples.

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."