Hi,
I generated KSDK 2.0 for FRDM-K66F today
Then I generate my application by using wizard 2.x in KDS 3.2. it works fine to generate *.elf. But when I add printf, I found the printf() function to cause linker problem. So, it can't generate *.elf file. See attached doc.
When I use KSDK 2.0 that is generated 2 months ago, printf() worked fine...
Does anyone know how to fix it?
Thanks,
Christie
Hi Christie,
It seem like you forgot to attach the document with the error.
Thanks in advance!
Best Regards,
Carlos Mendoza
Technical Support Engineer
Hi Christie,
Thanks for attaching the file.
I would recommend you to use the SDK Debug console implementation to print information instead of the printf function from the stdio library, here is an example:
You could use the hello_world demo as base for your application.
Hope it helps!
Best Regards,
Carlos Mendoza
Technical Support Engineer
Hi Carlos,
Yes. I can use PRINTF, but it can't output the formatted data, like "%#02X", and etc...
I can't make my USB project to work as demo project. But it works fine with KSDK that I built two months ago..
Regards,
Christie
Hi Christie,
I would recommend you to compare the project properties of your new project with the properties of the hello_world demo, I have done some test and I'm able to use both PRINTF and printf functions.
Regarding the formatting you mention, in order to print hexadecimal numbers using the PRINTF function you need to use the following syntax:
PRINTF("0x%02X\r\n",255);
Here is an example based on the hello_world demo:
int main(void)
{
char ch;
/* Init board hardware. */
BOARD_InitPins();
BOARD_BootClockRUN();
BOARD_InitDebugConsole();
PRINTF("hello world.\r\n");
printf("hello world.\r\n");
printf("%#02X\r\n",255);
PRINTF("0x%02X\r\n",255);
while (1)
{
ch = GETCHAR();
PUTCHAR(ch);
}
}
You can check the chapter "12.1.2 Advanced Feature" in the Kinetis SDK v.2.0 API Reference Manual for more information on how to scan and print formatted data.
Hope it helps!
Best Regards,
Carlos Mendoza
Technical Support Engineer