cancel
Showing results for 
Search instead for 
Did you mean: 

Why does changing the floating-point ABI from hard to soft, stop HAL_Delay returning?

DM.7
Associate III

Basic project with the defaults from the config wizard for STM32L4S7

Add into the main while loop:

declared_volatile_variable += 1;

HAL_Delay(1000);

Set a break point on the addition and debug. Every second, the breakpoint triggers, then continue - all is well.

Change the Floating-point ABI in the project properties, C/C++ Build -> Settings -> Tool Settings -> MCU Settings, from "Hardware implementation" to "Software Implementation".

Rebuild, start debugging. The breakpoint triggers on the first addition, continue, then it gets stuck in HAL_Delay and never returns.

Can anyone explain why this would happen?

2 REPLIES 2
TDK
Guru

HAL_Delay doesn't use floating point instructions. Something else is the culprit. Look at the source code and verify yourself. If code is "stuck", hit pause, see where exactly the CPU is at. Possible it's in hard fault, or stuck inside another IRQ endlessly.

If you are only evaluating this in a debug context, be aware instructions may be optimized out and if your main loop only includes two instructions which have no consequence, not really a good test.

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

Reasons to go to bed: problems like this disappear. It was reliably doing this late last night, after a reboot this is no longer a problem. Something got into a strange state