UC GEE
UC GEE
DIIDevHeads IoT Integration Server
Created by Sterling on 7/9/2024 in #middleware-and-os
Using an STM32F767ZI microcontroller with FreeRTOS
Well, I believe you can start by modifying the system reset procedure in task-2 to ensure a safe and reliable reset. Before calling NVIC_SystemReset, disable all interrupts to prevent any pending ISR from causing the system to hang.
// Task 2: Handles user requests and may request a system reset
void Task2(void *pvParameters) {
for (;;) {
// Handle user requests
if (userRequestsReset) {
// Disable interrupts to ensure no ISRs are pending
taskENTER_CRITICAL();
// Attempt system reset
NVIC_SystemReset();
// Enable interrupts again (though this will not be reached if the system resets)
taskEXIT_CRITICAL();
}
}
}
// Task 2: Handles user requests and may request a system reset
void Task2(void *pvParameters) {
for (;;) {
// Handle user requests
if (userRequestsReset) {
// Disable interrupts to ensure no ISRs are pending
taskENTER_CRITICAL();
// Attempt system reset
NVIC_SystemReset();
// Enable interrupts again (though this will not be reached if the system resets)
taskEXIT_CRITICAL();
}
}
}
Check out this @Sterling it will help you to achieve a reliable software reset.
7 replies