cancel
Showing results for 
Search instead for 
Did you mean: 

float argument inside function stopping the infinite loop. screen sorts and file are given below. Edit: mcu I'm using is stm32f411re .

GMond.1
Associate

0693W00000JMx5tQAD.pngif I give argument like above picture infinity loop stops working

0693W00000JMx6wQAD.pngbut if I give the number num inside function the instead of giving argument then its working fine.

If I give int instead of double as the datatype of argument then also it's working.

Please help

5 REPLIES 5
Nikita91
Lead II

What MCU ?

Does it provide float or double ?

How do you configure the compiler: software or hardware float libraries?

Use the debugger to see where the code hangs

Please format your code correctly, it is hard to read...

Oh, sorry, stm32f411re is the microcontroller. I don't know how to configure compiler. It has the default setting. Double is working if i give the value inside the function. When I'm debugging and running the code the code runs successfully but infinity loop stops.

So where exactly does it end up if the loop stops? If you halt in the debugger where is it?

In the Hard Fault routine? Does that output any useful data so you could determine if it got there?

Is the FPU enabled?

Have you reviewed the code generated by the compiler?

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

Try to increase the stack size

Right click on the project name / Properties / C/C++ Build / Settings

Tool Settings tab, MCU settings line0693W00000JMze7QAD.png