printf() is Broke in KSDK 1.3

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

printf() is Broke in KSDK 1.3

跳至解决方案
2,572 次查看
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

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
2,200 次查看
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

在原帖中查看解决方案

4 回复数
2,201 次查看
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

2,200 次查看
audi_mcavoy
Contributor IV

Thanks David, that worked for me too.

- Audi

0 项奖励
回复
2,200 次查看
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 项奖励
回复
2,200 次查看
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 项奖励
回复