cancel
Showing results for 
Search instead for 
Did you mean: 

I have a strange phenomenon in stm32f103

Jlim.1
Associate II

Hello

I have a hw configuration that uses mpu6050, lora chip, gps, and bluetooth using stm32f103 mcu. I use lithium polymer 3.7v 1300mah for power to board.

It doesn't make sense to me, but it's like this.

After downloading the firmware via stlink, mpu6050, lora, gps, and blueetooth work well. In this state, the mpu6050 and GPS will not work if the board is powered on for several hours after turning off power to the board.

1.GPS turns on the power in the form of a module and gets GPS data by itself after about a minute, but when the phenomenon occurs, you can't get gps data even if i turn it on for 10 minutes.

2. MPU6050 needs to get acceleration values using i2c, but if i read the values, they all read zero.

3.Other chips are operating normally.

4. When GPS and MPU6050 don't work, downloading the same firmware via st link can work well again, and sometimes it needs to be downloaded a few more times.

What I thought was that I was using the internal clock of the stm32 and the sw is still on/off, but when I first downloaded it, it worked well, then turned off, and then it didn't work, and I thought it was because the clock shook or didn't work well, but when GPS and MPU started not working, I turned it off. I don't know what to do with debugging.

Have you ever experienced this before?

Or is there a good way to debug to find the cause?

Please give me your opinion.ᅲᅲ

13 REPLIES 13
Jlim.1
Associate II

@TDK​ 

Why do you think there is a problem with the code?

Probably because the chips are not filled with glaring holes in their functionality. So issues will primarily be in the code, or in the board design/wiring.

At the end of the day you and your colleagues are going to have to debug the HW/SW you've built, the resources available here are pretty finite.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

clive1 answered this exactly how I would have.

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

> Why is the SCL sending it off at a different frequency

Broken code and I2C clock stretching is kicking in. Most likely something related to bad ISR implementation for I2C and/or other peripherals. Typically either something takes too long time to execute or the code is not interrupt/thread safe and can mess up completely.