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
Solved! Go to Solution.
Hi Audi,
Found fix but need to try to understand why.
Please set heap to 0x400.
Generate Code.
Do a project clean and rebuild.
Regards,
David
Hi Audi,
Found fix but need to try to understand why.
Please set heap to 0x400.
Generate Code.
Do a project clean and rebuild.
Regards,
David
Thanks David, that worked for me too.
- Audi
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
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.