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); }}
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:
BR
Alice