Printf not printing float in START project for E70.

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

With the linker "Use size optimized library" option, the following program only printed the text, no number.

 

Unchecking the "Use size optimized library" option,  the program didn't print anything, but still printed the Hello Atme text.

 

Unchecking changed the Program memory usage from 8K to 28K.

 

#include <atmel_start.h>
#include "stdio_start.h"
struct io_descriptor *io;
volatile float fa,fb,fc;
void TARGET_IO_ex(void)
{
	usart_sync_get_io_descriptor(&TARGET_IO, &io);
	usart_sync_enable(&TARGET_IO);
}

int main(void)

{

	/* Initializes MCU, drivers and middleware */

	atmel_start_init();
	TARGET_IO_ex();
	io_write(io, (uint8_t *)"Hello World!", 12);
	printf("\r\nHello ATMEL World!\r\n");
	fa =3.333;
	fb = 10.78393;
	fc = fa * fb;
	printf("the sum %f\r\n",fc);
	/* Replace with your application code */

	while (1) {

	}

}

 

Last Edited: Mon. Feb 5, 2018 - 10:58 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In properties, toolchain linker, deselect "use size optimized libraries"

jeff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I mentioned in the original post that I had unchecked (deselected) size optimized libraries.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sorry, you'd think a week into travel the jetlag would be less :)

On the SAMD51 the library check box worked. 

jeff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I has worked for me in the past on project built from ASF 3.36  examples.