Skip to main content
YGail.2
Associate III
February 24, 2023
Question

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

  • February 24, 2023
  • 4 replies
  • 2075 views

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?

This topic has been closed for replies.

4 replies

Tesla DeLorean
Guru
February 24, 2023

>>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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
YGail.2
YGail.2Author
Associate III
February 24, 2023

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
YGail.2Author
Associate III
February 25, 2023

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
YGail.2Author
Associate III
February 25, 2023

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