Skip to main content
GMond.1
Associate
January 22, 2022
Question

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

  • January 22, 2022
  • 2 replies
  • 2809 views

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

This topic has been closed for replies.

2 replies

Nikita91
Lead II
January 22, 2022

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...

GMond.1
GMond.1Author
Associate
January 23, 2022

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.

Tesla DeLorean
Guru
January 23, 2022

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 VenmoUp vote any posts that you find helpful, it shows what's working..
S.Ma
Principal
January 23, 2022

Try to increase the stack size