Skip to main content
jim_jones188
Associate II
July 14, 2018
Question

Stuck in a loop in startup_stmf051x8.s file

  • July 14, 2018
  • 3 replies
  • 918 views
Posted on July 15, 2018 at 00:55

I can only run a few dozen lines of code until I get stuck in a loop. When trying to debug it appears I am stuck in the startup_stmf051x8.s file on these lines:

0x0800016E E7FE      B        PendSV_Handler (0x0800016E)

   164:                 B       .

0x08000170 E7FE      B        SysTick_Handler (0x08000170)

   230:                 B       .

   231:  

   232:                 ENDP

If I try to step through it in the disassembly window it just jumps between line 164 and 232. I can't figure out what is going on.

#loop-startup-file #startup-file #loop
    This topic has been closed for replies.

    3 replies

    Tesla DeLorean
    Guru
    July 14, 2018
    Posted on July 15, 2018 at 01:10

    Suggests you're enabling an interrupt you don't have a real handler for. Perhaps something like the SysTick_Handler in stm32f0xx_it.c

    Missing file? Using C++ or .cpp?

    You're going to have to provide more context here.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    jim_jones188
    Associate II
    July 14, 2018
    Posted on July 15, 2018 at 01:38

    I am not familiar with stm32f0xx_it.c.

    I am programming an STM32f051k8 through the onboard STlink on a STM32f072Discovery board using Keil UV5 using no C++, only C.

    I do not have a SysTick_Handler, but adding one doesn't seem to solve the problem. I am not sure how SysTick gets enabled, it seems to be enabled by default.

    I am enabling 4 interrupts, TIM1, TIM2, TIM3, and ADC1_COMP. Looks like my ADC1_COMP handler is missing. I added an empty handler, since that peripheral doesn't seem to have any interrupt flags, that also didn't solve the issue.

    henry.dick
    Associate II
    July 14, 2018
    Posted on July 15, 2018 at 01:58

    '

    I can't figure out what is going on.'

    it is not with those handlers but somewhere else. Unfortunately you haven't provide any info on that.