I have my program something like this below.
My question is under which condition (block 1) codes executed and (block 2) codes executed.
1. At board power up, (block 2) executed. (for sure).
2. If I erase the CPU, reprogram the CPU with the power still on, then which block will be executed, 1 or 2?
3. If I do hard reset on the CPU, which block will be executed?
//Init clock ...
if (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST) != RESET)
//block 1 codes executed.
//block 2 codes executed