Skip to main content
Essayator
Associate II
March 15, 2022
Solved

Hello, I'm new to the forum, and it's also the first time I've used this microontroller. A few years after my first I started having a blockage in my code, when I run my code I am always stuck in assembly code while I am coding in c: ldr sp,=_stack

  • March 15, 2022
  • 6 replies
  • 1576 views

ldr sp,=_stack /* Set stack pointer */

It is this code that I am always brought back, it is in the file: startup_stm2l476rgtx.s

This topic has been closed for replies.
Best answer by Tesla DeLorean

What IF you Run (Play, Go ?) from that point onward?

Strikes me that it's just breakpointed at the CPU entry point, and you just need to start execution.

After it initializes the statics, and constructors, etc it should then get to your main() function.

6 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
March 15, 2022

What IF you Run (Play, Go ?) from that point onward?

Strikes me that it's just breakpointed at the CPU entry point, and you just need to start execution.

After it initializes the statics, and constructors, etc it should then get to your main() function.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Tesla DeLorean
Guru
March 15, 2022
Essayator
EssayatorAuthor
Associate II
March 15, 2022

I understand but how to avoid stops at this point?

TDK
March 15, 2022

Hard to decipher what the actual question is here.

The startup_stm2l476rgtx.s file will always be opened when starting a debug session. There is no way around that.

You are not currently debugging anything in the screenshot you provided. You just have the startup file open with the cursor on a line.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Essayator
EssayatorAuthor
Associate II
March 15, 2022

Yes you are right, my question is not very well explained... but when I got my answer, In my first program the file did not open when I ran the code it was because I did not understand.

I understand ar I have code to make del blink that works

Essayator
EssayatorAuthor
Associate II
March 15, 2022

This is my code to read in i2c the data on a sensor that does not work, maybe the address I have is wrong