Lpc1769 software floating point unit (FPU) - ( for printf family)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Lpc1769 software floating point unit (FPU) - ( for printf family)

949 Views
ramazan_kurban3
Contributor III

I use gnu arm on eclipse ( lpc1769 m3 cortex ). I want to convert float value to string with sprintf but it doesnt work.

I add -u_printf_float to linker option but it is didnt work because m3 cortex has not hard FPU.  Therefore i add -mfloat-abi=soft to linker option for use software FPU but it doesnt work. How can i solve this problem.

int main(void) {

    InitBoard();         float flt = 1.1;        char msg[256];        sprintf(msg , "number is %.3f ", flt);        while (1){             KC_UART_sendstring(LPC_UART0, msg);             delay_ms(500);        }}
0 Kudos
Reply
1 Reply

830 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Ramazan Kurban,

Could you please show what's the data inside msg[] when it doesn't work。

I test on MCUXpresso IDE (it based on Eclipse), it seems can work well:

pastedImage_1.png

BR

Alice

0 Kudos
Reply