cancel
Showing results for 
Search instead for 
Did you mean: 

Chip stops working and does not return to work even with the use of NRST reset.

wMeir.1
Associate II

I have a curious problem on a board that uses STM32F103c8t6 and and it's stopping working after using it for a few days. This problem happens in 20% of my boards.

The voltage on the VDD is 3.3V. NRST reset does not work. After disconnecting the power and reconnecting, the chip can recover and function again.

I am trying to reproduce the problem in the lab but I am not having success.

The normal operation of the board is to remain in stop mode, wake up from an interruption pin to perform the task and return to stop mode again.

#reset-stm32

6 REPLIES 6
turboscrew
Senior III

Have you checked that the wake-up flags are reset when the system enters low power mode? I recall that the wakeup happens at the "rising edge", and if the flag was already set, the wake-up doesn't take place at all.

Uwe Bonnes
Principal II

Did you do some debugging, flagging the core to halt on reset and you did not remove these settings when disconnecting?

wMeir.1
Associate II

The code used to enter the stop mode is as follows:

void NODE_PWR_Stop(uint32_t time){
 
	if(time == 0)
            return;
 
	__NODE_LOG_Debug("goto stop mode. Wakeup Time: %d s\n\r", time);
 
    int32_t timeNow = NODE_RTC_ReadTimeCounter();
    int32_t alarmTime = timeNow + time;
 
	if (NODE_RTC_SetAlarm_IT(alarmTime)!= HAL_OK){
		__NODE_LOG_Error("set alarm error\n\r");
		HAL_Delay(1000);
		return;
	}
 
 
	HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET);
 
    HAL_SuspendTick();
    __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
	HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
    //////////////////////
    // STOP
    //////////////////////
    HAL_ResumeTick();
    NODE_SystemClock_Config();
   __NODE_LOG_Debug("wake up stop mode\n\r");
   HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET);
 
}

However, I'm not sure if the problem occurs while in stop mode:

My biggest doubt is to know in which situation the processor remains in a state that cannot be restarted even by a hard reset.

TDK
Guru

“Stops working�? is hard to debug. The chip is certainly doing something in a loop

somewhere, or asleep, or something. Attach to the process when it’s hung and figure out where it is. Instrument the sleep/wake code to help figure it out. Recheck your assumptions. Going to be hard to debug if you can’t reproduce it, but you can instrument the code better to be more helpful when it happens again.

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

But do you believe that there is any state that the chip is in a loop and in this case neither the reset pin takes it out of this loop? This is my question. Because if I know what makes the chip lose the ability to be reset via the reset pin, it will be easier to find the problem.

Pulling nRST low always resets the chip.
If you feel a post has answered your question, please click "Accept as Solution".