printf() is Broke in KSDK 1.3

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

printf() is Broke in KSDK 1.3

Jump to solution
1,240 Views
audi_mcavoy
Contributor IV

printf() is broke in KSDK 1.3 (at least with the  fsl_debug_console using PEx).

 

Steps to reproduce.

 

select File menu | New | Kinetis Project

enter a project name (e.g. printf_test) (next)

select Boards | Kinetis | FRDM-K64F (next)

select KSDK_1.3.0, check Processor Expert (next)

select GNU C Compiler (finish)

 

select Processor Expert menu | Show Views

select Components Library tab

navigate to KSDK 1.3.0 | Peripheral Drivers/HAL | Utilities

right-click fsl_debug_console and select Add to project

select Component Inspector tab

leave baud rate at 115200, set RxD to DBG_CONSOLE_RX, set TxD to DBG_CONSOLE_TX

Generate Processor Expert code

 

edit Sources | main.c

add #include <stdio.h> on line 41

starting on line 54, add the following three lines...

  PRINTF("KSDK 1.3 PRINTF\r\n");

  printf("printf\r\n");

  puts("puts");

Build project

 

attach FRDM-K64F board via OpenSDA USB port

connect your favorite terminal program to the mbed Serial Port (115200, 8N1)

debug using GDB OpenOCD Debugging

observe that only the first PRINTF statement is displayed

 

Repeat all of these steps using KSDK 1.2.0 and you will see all three lines displayed.

 

- Audi

Labels (1)
Tags (2)
0 Kudos
1 Solution
868 Views
DavidS
NXP Employee
NXP Employee

Hi Audi,

Found fix but need to try to understand why.

Please set heap to 0x400.

ScreenHunter_185 Oct. 20 17.47.gif

Generate Code.

Do a project clean and rebuild.

Regards,

David

View solution in original post

4 Replies
869 Views
DavidS
NXP Employee
NXP Employee

Hi Audi,

Found fix but need to try to understand why.

Please set heap to 0x400.

ScreenHunter_185 Oct. 20 17.47.gif

Generate Code.

Do a project clean and rebuild.

Regards,

David

868 Views
audi_mcavoy
Contributor IV

Thanks David, that worked for me too.

- Audi

0 Kudos
868 Views
audi_mcavoy
Contributor IV

David,

I want to add that this fix was also necessary to get the HID mouse demo to work.

Would I be correct in assuming that this fix is necessary for every PEx project under KSDK 1.3.0?

- Audi

0 Kudos
868 Views
DavidS
NXP Employee
NXP Employee

Hi Audi,

Honestly I don't know.

I will report it to our KSDK experts to allow them to dig into and reference this post so they can comment on it.

Regards,

David

Reference:

Issue KPSDK-7360 - KSDK_1.3 PE examples need 0x400 heap added to allow printf has been successfully created.

0 Kudos