FloatToStr issue for Mikroe-M4 (STM32F415)

General discussion on mikroPascal PRO for ARM.
Post Reply
Author
Message
Marniftarr
Posts: 3
Joined: 12 May 2021 10:41

FloatToStr issue for Mikroe-M4 (STM32F415)

#1 Post by Marniftarr » 12 May 2021 11:12

Hi community !!!
I have strange issue for my STM32F415.

The functions FloatToStr returns vrong value if the divisor value between 0.5 and 1
For example -

var
A_str:String[30];
B:single;
begin
B:=0.65;
FloatToStr(B,A_str);
UART1_write_text(A_str);
end;

My uart decoder in oscilloscope , UART sniffer in another PC , NEXTION display , all those devices show "1.35000" instead "0.65".

Built in debugger show A_string correctly "0.65";

This is table of returns value of FloatTostr function.

Input float: returned value:
0.1..0.5 working normally.

0.51 "1.49000"
0.65 "1.35000"
0.80 "1.20000"
0.99 "1.01000"
1 "0.00000"
1.1 "1.1"
1.2 "1.2"
...
1.5 "2.5'
1.6 "2.4"
and etc..

I checked this bug twice. Unternal debugger show correctly convertations but the compiled code during working in the STM32 showing incorrectly conversion resultat.
Please tell me any solutions because i not sure that my custom Floattostr function will worling correctly in my all onther projects in future.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: FloatToStr issue for Mikroe-M4 (STM32F415)

#2 Post by filip » 13 May 2021 13:04

Hi,

The solution given here - viewtopic.php?f=189&t=76647 - does not solve your problem ?

Regards,
Filip.

Marniftarr
Posts: 3
Joined: 12 May 2021 10:41

Re: FloatToStr issue for Mikroe-M4 (STM32F415)

#3 Post by Marniftarr » 13 May 2021 23:15

No , does not working for me ! Problem still exists.

I read this thread. The "michaF" member promised that he will testing new conversation lib but disappeared from forum.. Yesterday I replaced my old __Lib_Conversions.emcl with new in M4 folder. No positive results.
I have latest Mikropascal version (6.2.0) .
I tried variables in the functions (local) and global - problem still exists.
Also i tried convert all combinations - real , double,extended with FloatToStr. Problem still exists.
My MINI-M4 module was purchased in 2020 year. I have 4 modules from different shops. This problem same for all M4 modules. Also i tried Mikropascal 6.2.0 as demo in another PC. Problem still exists.
Any solution ?

Post Reply

Return to “mikroPascal PRO for ARM General”