cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB, when atof() or strtod() BLE advertisement stops

YGail.2
Associate III

I currently need a simple string to double/float function. For this I use atof() or strtod(). However whenever I call these functions the BLE advertisement stops and I cannot further connect to the WB.

Does someone have the same problem?

4 REPLIES 4

>>Does someone have the same problem?

Diagnose the problem you have.

Stop in the debugger, see were the MCU is stuck

Instrument the Hard Fault Handler so it doesn't fall in there and silently die...

If this is a STM32WB with an M4, make sure the FPU is enabled if you're using it, or the libraries use or expect it.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I did stop the debugger multiple times, but no error handler was triggered, and the code seems to run nominally.

I​ also have similar this kind of issue when enabling the flag to print float in string using sprintf.

I​ use a wb15cc I think it has a m4 for the BLE part. I will have a look to the FPU. I didn't know it needs to be enabled

YGail.2
Associate III

I checked the FPU the hardware one is enabled by default. I tried the software one but doesn't work either. It seems that there is a mismatch between the RF Core and the Application Core. Is the Stack binary compiled with floating point flag? Actually my app is running by it doesn't tell the wireless stack to start advertising.

0693W00000aHeZsQAK.png

YGail.2
Associate III

After sime further try and error I could run the advertising and the FPU by setting the runtime library to standard C. The question now why is this so?

0693W00000aHea7QAC.png