cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G0B1RET6 - Signal Trap error while debugging

HPATH.1
Associate II

I am getting this following error while trying to debug the Custom Board.

please help me find out what is the meaning of this error.

Thread #1 [main] 1 [core: 0] (Suspended : Signal : SIGTRAP:Trace/breakpoint trap)

0x1fff5a30

<signal handler called>() at 0xfffffff9

frame_dummy() at 0x80000e0

__libc_init_array() at 0x8017084

Reset_Handler() at startup_stm32g0b0retx.s:98 0x8010bb2

2 REPLIES 2
Amel NASRI
ST Employee

Hi @HPATH.1​ ,

Could you please provide some more details about the issue you are facing: which IDE? for which example is problem faced?

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

I am using STM32CubeIDE Version 1.8.0

Project configured for STM32GOB0RET6

But prototype is fitted with ​STM32GOB1RET6.

It is custom board with Custom Application. new prototype board being testing.

I tested Timer, UART, PWM working fine. Finally I started testing ADC eight channel used.

that time, sometimes it is not executing application and stuck.

I used debug LED to switch on after reset. it is not getting on.

then I tried to debug using IDE. I got this error.

one mistake I did was using uint8_t variable adcTick as 16bit variable as adcTick in TIM6 interrupt. it was incrementing to 400

I am using same timer as interval timer and also Starting ADC conversion,

below is the code. after correcting it also it did not solve the problem.

void Timer6Tick()
{
    if (HAL_ADC_Start(&hadc1) != HAL_OK)
    {
      Error_Handler();
    }
 
// 40000 ticks per second devided by 400 to get 100 ticks per second
	adcTick++;
	if(adcTick == 400)
	{
		adcTick = 0;
	}
	else
		return;
 
// 100 ticks per second here. 
 
	tick++;
	if(tick < 10)
		return;
 
// 10 ticks per second here. 
 tick = 0;
}
 
// Timer6 INIT
// 40000 ticks per second
 
HAL_StatusTypeDef MX_TIM6_Init(void)
{
  RCC_ClkInitTypeDef    clkconfig;
  uint32_t              uwTimclock = 0;
  uint32_t              uwPrescalerValue = 0;
  uint32_t              pFLatency;
 
  /*Configure the TIM6 IRQ priority */
  HAL_NVIC_SetPriority(TIM6_IRQn, 2 ,0);
 
  /* Enable the TIM6 global Interrupt */
  HAL_NVIC_EnableIRQ(TIM6_IRQn);
  /* Enable TIM6 clock */
  __HAL_RCC_TIM6_CLK_ENABLE();
 
//  TIM_MasterConfigTypeDef sMasterConfig = {0};
 
  /* Get clock configuration */
  HAL_RCC_GetClockConfig(&clkconfig, &pFLatency);
 
  /* Compute TIM6 clock */
  uwTimclock = HAL_RCC_GetPCLK1Freq();
 
  /* Compute the prescaler value to have TIM6 counter clock equal to 1MHz */
  uwPrescalerValue = (uint32_t) ((uwTimclock / 1000000) - 1);
 
  /* Initialize TIM6 */
  htim6.Instance = TIM6;
 
  /* Initialize TIMx peripheral as follow:
  + Period = [(TIM6CLK/100) - 1]. to have a (1/100) s time base.
  + Prescaler = (uwTimclock/1000000 - 1) to have a 1MHz counter clock.
  + ClockDivision = 0
  + Counter direction = Up
  */
  htim6.Init.Period = (1000000 / 40000) - 1;
  htim6.Init.Prescaler = uwPrescalerValue;
  htim6.Init.ClockDivision = 0;
  htim6.Init.CounterMode = TIM_COUNTERMODE_UP;
  if(HAL_TIM_Base_Init(&htim6) == HAL_OK)
  {
    /* Start the TIM time Base generation in interrupt mode */
    return HAL_TIM_Base_Start_IT(&htim6);
  }
 
  /* Return function status */
  return HAL_ERROR;
 
}

.