cancel
Showing results for 
Search instead for 
Did you mean: 

Debug randomly causes "Signal Thread #1 (Suspended : Signal : SIGTRAP:Trace/breakpoint trap)"

SLe B.1
Associate II

I'm trying to write a piece of code using STM32 Cube IDE but when trying to debug i get the following error and i really cant get rid of it.

Thread #1 (Suspended : Signal : SIGTRAP:Trace/breakpoint trap)   

   0x1fffecec   

   <signal handler called>() at 0xfffffff1   

   0x42332600   

   <signal handler called>() at 0xfffffff9   

   HAL_GPIO_WritePin() at stm32f0xx_hal_gpio.c:416 0x8000dc6   

   main() at main.c:178 0x8000442   

Tried on two different computers, trimmed the code to a few GPIO writes, disabled most pins/peripherals, changed Flash Wait States, nothing solves the issue yet.

I'm using a STM32F051K6T7 on custom board with a STLINK V2

0693W00000FCNU3QAP.png

6 REPLIES 6
TDK
Guru

Hard to know exactly. It could be that your vector table is corrupt/invalid and it's trying to jump to an invalid address (0x42332600). You can look at the VECTACTIVE bits to see what interrupt the chip is in and go from there.

If you feel a post has answered your question, please click "Accept as Solution".
SLe B.1
Associate II

Thanks,

VectActive = 3

I'm Checking Meaning in RM0693W00000FCOCeQAP.png

TDK
Guru

Subtract 16 and look up in IRQn_Type. That one is HardFault_IRQn, probably because 0x42332600 is an invalid address. You need to figure out why it wants to jump there.

If you feel a post has answered your question, please click "Accept as Solution".
SLe B.1
Associate II

Substract 16 in PC ? ICSR Addres ?

The 0x1fffecec is here

0693W00000FCOikQAH.png 

I can't find IRQn_Type within the regular SFR how can i do ?

TDK
Guru

Per your screenshot, VECTACTIVE = 3.

Subtract 16 and you get -13.

Look up IRQn_Type in the software and you'll see values like this (different on the F0, but similar):

/**
 * @brief STM32H7XX Interrupt Number Definition, according to the selected device
 *        in @ref Library_configuration_section
 */
typedef enum
{
/******  Cortex-M Processor Exceptions Numbers *****************************************************************/
  NonMaskableInt_IRQn         = -14,    /*!< 2 Non Maskable Interrupt                                          */
  HardFault_IRQn              = -13,    /*!< 4 Cortex-M Memory Management Interrupt                            */
  MemoryManagement_IRQn       = -12,    /*!< 4 Cortex-M Memory Management Interrupt                            */
  BusFault_IRQn               = -11,    /*!< 5 Cortex-M Bus Fault Interrupt                                    */
  UsageFault_IRQn             = -10,    /*!< 6 Cortex-M Usage Fault Interrupt                                  */
  SVCall_IRQn                 = -5,     /*!< 11 Cortex-M SV Call Interrupt                                     */
  DebugMonitor_IRQn           = -4,     /*!< 12 Cortex-M Debug Monitor Interrupt                               */
  PendSV_IRQn                 = -2,     /*!< 14 Cortex-M Pend SV Interrupt                                     */
  SysTick_IRQn                = -1,     /*!< 15 Cortex-M System Tick Interrupt                                 */
/******  STM32 specific Interrupt Numbers **********************************************************************/
  WWDG_IRQn                   = 0,      /*!< Window WatchDog Interrupt ( wwdg1_it, wwdg2_it)                   */
  PVD_AVD_IRQn                = 1,      /*!< PVD/AVD through EXTI Line detection Interrupt                     */
  TAMP_STAMP_IRQn             = 2,      /*!< Tamper and TimeStamp interrupts through the EXTI line             */
  RTC_WKUP_IRQn               = 3,      /*!< RTC Wakeup interrupt through the EXTI line                        */

-13 corresponds to HardFault_IRQn, so the processor is in the hard fault interrupt.

Because the processor is going to 0x1fffecec for this interrupt and not to somewhere in your program, it suggests your vector table is missing or corrupted or something else.

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

In Bluepill board the boot selector jumper connected wrongly .please correct it