2026-03-02 1:16 AM - last edited on 2026-03-02 1:22 AM by Andrew Neil
求助篇!
使用主控芯片STM32F405RGT6 在操作flash后 复位指令不起作用 这是什么问题呢?
////////////////////以下是代码段////////////////////////////
/*注释以下语句就可以自动复位成功*/
Translation:
I'm using STM32F405RGT6 microcontroller, the reset command doesn't work after flash operation. What could be the problem?
HAL_FLASH_Unlock();
if (HAL_FLASH_Program(TYPEPROGRAM_WORD, FWR_ADDR, 0) != HAL_OK)
{
printf("Clear OTA flag error\n");
} else {
HAL_Delay(10);
uint32_t flag_sttus = HAL_FLASH_GetError;
if(flag_sttus & HAL_FLASH_ERROR_PGA)
{
printf("flash_err!\r\n");
}
printf("Clear OTA flag\n");
}
HAL_FLASH_Lock();
请各位大佬看看是什么情况 感谢!!!!
Translation:
Could someone please take a look and tell me what's going on? Thanks
2026-03-02 1:22 AM
Hello @Wu_wu and welcome to the St community,
1- In next time please use English in this community. This is not a Chinese Forum.
2- To share a code please use </> button.
Please see How to write your question to maximize your chances to find a solution
PS: I've edited your post to complies with this community rules.
2026-03-02 4:14 AM
There's no reset command in the posted code.
Does HAL_FLASH_Program work? Does it return an error code?
Insufficient information is presented.
2026-03-02 11:29 AM
HAL_FLASH_GetError(); // note the ()Look for the compiler warnings.