cancel
Showing results for 
Search instead for 
Did you mean: 

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 */

Essayator
Associate III
 
1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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".

View solution in original post

6 REPLIES 6
TDK
Guru

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
Associate III

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

I have some suggestions in my previous post.

If you feel a post has answered your question, please click "Accept as Solution".

how to read this bit  RCC->CSR bits

TDK
Guru

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".

Here is what I find in the rcc:

Peripheral: RCC

Base address: 0x40021000

there is no value