Hi, i am very new to nrf family. when i use sprintf function with %d specifier, it works fine. but if i set it to %2.1f or anything with "f" included doesnt work and program crushes. How can i fix this in keil uvision ?
Hi, i am very new to nrf family. when i use sprintf function with %d specifier, it works fine. but if i set it to %2.1f or anything with "f" included doesnt work and program crushes. How can i fix this in keil uvision ?
Hello,
It looks like Keil uVision should include floating point support by default. I tried sprintf with the \nRF5_SDK_17.0.2_d674dde\examples\peripheral\uart example and I did not have to add any linker flags, etc to make it work. Could you try the same? Attached is my slighly modified project.
It turns out like you said. I am using 52810 but the example i modified was for 52832. Since 52832 has hardware fpu, flashing the software to 52810 crushed the code. I changed targed device and set iram1 and iram2. Problem solved. I can now use float variables. Thanks for your help. I realized my mistake when i go into build settings of your example. Thanks again.
It turns out like you said. I am using 52810 but the example i modified was for 52832. Since 52832 has hardware fpu, flashing the software to 52810 crushed the code. I changed targed device and set iram1 and iram2. Problem solved. I can now use float variables. Thanks for your help. I realized my mistake when i go into build settings of your example. Thanks again.
Thanks for confirming what the issue was. It's best to start with a 'PCA10040e' configuration when developing for the 52810. We have this user guide which I guess you may have seen already: Developing for nRF52810