Skip to main content
rwmao
Senior
December 11, 2015
Question

STM32 chip keeps rebooting

  • December 11, 2015
  • 14 replies
  • 3929 views
Posted on December 11, 2015 at 02:00

Hi all,

it is really very weird.

I am using stm32f411rct6,which has 256k program space and 128k ram.

Very often the program is weird, keeps rebooting or dead at all.

For example in a subroutine, when I delete 2 or 3 lines of code, it is working well. If I keep them, the chip keeps rebooting. I swear the lines I deleted have no any problem in logic.

Adding code somewhere else may also have the similar problem.

Sometime after I add the code, the chip is totally dead. No any response.

Please give me some clue to debug:

1. limit of ram, overflow?

Program Size: Code=28884 RO-data=456 RW-data=748 ZI-data=29364 

I don't really use too much space.

2. when chip keeps rebooting, I measured the voltage. It is fluctuating. But I swear the code I added, which causes the problem, have nothing to do with the power.

Please help.

    This topic has been closed for replies.

    14 replies

    rwmao
    rwmaoAuthor
    Senior
    December 12, 2015
    Posted on December 12, 2015 at 03:14

    By the way Clivel, when I try to use STLINK to debug, before stepping into somewhere, it just says internal command error or unable to connect to the target, or the debug session was shutdown. The line causing the error is also random. 

    It is very hard to debug. 

    Now after I fixed the power supply problem, I can run the debug without issues.

    It also tells me that the microcontroller may consume a power of much higher than 25mA.

    Thanks

    Tesla DeLorean
    Guru
    December 12, 2015
    Posted on December 12, 2015 at 05:00

    I was just pushing on the reset stuff to try an confirm it was more of a HW side issue, not sure I can really explain the SW side of it. I can't give you a hard number for current, most of it tends to get pulled by what it's driving externally.

    Any way, glad you could get it figured out. You could try an external bench supply and get a feel for the current, and running at different frequencies.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    rwmao
    rwmaoAuthor
    Senior
    December 12, 2015
    Posted on December 12, 2015 at 06:13

    sure. thanks

    rwmao
    rwmaoAuthor
    Senior
    December 12, 2015
    Posted on December 12, 2015 at 08:01

    Clivel, may I ask you one more question?

    When we use STM32 chip, is there a limit for the size of array and subroutine?

    For example, if the chip has 128k ram, can I allocat 100k to an array(or buffer)?

    Certainly the algorithm of program may take space such as 20k.

    how about subroutine?

    May I define a very long subroutine? For example main() or others.

    What is the limit?

    I just need a basic guideline.

    Thanks