KSDK 2.0 for FRDM-K66F

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

KSDK 2.0 for FRDM-K66F

828 Views
a8Chcx
Contributor V

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

Labels (1)
0 Kudos
5 Replies

498 Views
Carlos_Mendoza
NXP Employee
NXP Employee


Hi Christie,

It seem like you forgot to attach the document with the error.

Thanks in advance!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos

498 Views
a8Chcx
Contributor V

Hi Carlos,

Sorry. Here it is...

0 Kudos

498 Views
Carlos_Mendoza
NXP Employee
NXP Employee

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:

pastedImage_1.png

You could use the hello_world demo as base for your application.


Hope it helps!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos

498 Views
a8Chcx
Contributor V

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

0 Kudos

498 Views
Carlos_Mendoza
NXP Employee
NXP Employee


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);
    }
}

pastedImage_1.png

 

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

0 Kudos