Could setVal be corrupted in some unexpected way? a stack overflow or an overflow in some adjacent variable.
Giovanni
float acting like double
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: float acting like double
I don't think that a stack overflow is occurring, but I'm not sure that I know exactly what I should be looking for. Please give me some hints. I don't know what to look for regarding an overflow in adjacent variables.
The working area I started with for thread1 was 1024. I've gone as high as 10000 without any change in behavior.
Also another interesting fact is that when it is giving the double like values, it interspaces them with 0's like this:
Float into vSV: 406F4000
Float into vSV: 0
Float into vSV: 406F4000
Float into vSV: 0
Float into vSV: 406F4000
Float into vSV: 0
Thanks,
John
The working area I started with for thread1 was 1024. I've gone as high as 10000 without any change in behavior.
Also another interesting fact is that when it is giving the double like values, it interspaces them with 0's like this:
Float into vSV: 406F4000
Float into vSV: 0
Float into vSV: 406F4000
Float into vSV: 0
Float into vSV: 406F4000
Float into vSV: 0
Thanks,
John
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: float acting like double
Try to package a very minimal project showing the problem, I am out of ideas.
Giovanni
Giovanni
Re: float acting like double
-what fpu option do you use ? (USE_FPU_OPT in Makefile) ?
° for stm32h7, if using FPU, should be -mfpu=fpv5-d16
° If you have several units compiled separately, you must keep -mfloat-abi value consistent in all the project
since it tell the compiler how are passed the float parameters, in fpu registers or cpu registers.
-what compiler ?
After assuring that you have consistent USE_FPU_OPT in all your project, you can try the three possible value : 'no', 'soft', 'hard' to check if you keep the same strange behavior.
To go further, follow Giovanni advice, try a simple example in a single main.c and post it here.
A.
° for stm32h7, if using FPU, should be -mfpu=fpv5-d16
° If you have several units compiled separately, you must keep -mfloat-abi value consistent in all the project
since it tell the compiler how are passed the float parameters, in fpu registers or cpu registers.
-what compiler ?
After assuring that you have consistent USE_FPU_OPT in all your project, you can try the three possible value : 'no', 'soft', 'hard' to check if you keep the same strange behavior.
To go further, follow Giovanni advice, try a simple example in a single main.c and post it here.
A.