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

Hello, I'm a beginner, I try to retrieve values from a sensor by i2c, but I can't, I'm brought back to this code that I don't understand since I've never done assembler: ldr sp,=_stack /* Set stack pointer */

  • March 13, 2022
  • 3 replies
  • 1391 views

..

This topic has been closed for replies.
Best answer by TDK

That is the start of the reset handler. Read RCC->CSR bits to determine why the chip reset. Possibly a watchdog issue. The watchdog does not stop in debug mode by default.

3 replies

TDK
TDKBest answer
March 13, 2022

That is the start of the reset handler. Read RCC->CSR bits to determine why the chip reset. Possibly a watchdog issue. The watchdog does not stop in debug mode by default.

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

Thank you for your answer, can you tell me how to fix the problem because I am coding in c and my code is supposed to read data from a sensor at an i2c address

TDK
March 13, 2022

I have some suggestions in my previous post.

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

how to read this bit  RCC->CSR bits

TDK
March 13, 2022

If you are using STM32CubeIDE, when you're in debug mode, open the SFRs tab and scroll to the RCC peripheral and read the values in the CSR register. Compare those against what is shown in the reference manual to determine the source of the reset.

In the "SFRs" view. (Window -> Show View -> SFRs).

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

Here is what I find in the rcc:

Peripheral: RCC

Base address: 0x40021000

there is no value