Problem with printf() usage in can_pal example for a S32k144

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

Problem with printf() usage in can_pal example for a S32k144

跳至解决方案
1,187 次查看
pierpaolo_dini
Contributor III

Hi, everybody,
I am using the S32k144 board to read simulated CAN traffic via an Arduino + MCP2515 module.
I was able to get NXP to read any ID sent by Arduino. Just for testing, I used the example can_pal and I verified that with any pair of IDs I send from Arduino, on NXP the red and yellow LEDs alternate (or green, I don't understand it too well...).
So I would say that on the reading part of the CAN I more or less understood it.
For safety, I also use a Peak device that monitors the bus so I'm sure that Arduino sends the messages (as a second control compared to the LEDs turning on...).
The problem is that I would like to print on the screen the "id" and "cs" field (which should be the Timestamp!) but I can't see them on the console even when I press run during debugging.
I've also tried to make different settings of the libraries from "Project Settings"-->C/C+++ Buildings-->Target Processor-->Libraries Support (honestly I've tried all of them besides "ewl c Debugger" which is the recommended one...).
I also noticed I can run in debag only if I use "flash_pemicro" and it doesn't work if I use "ram_pemicro".

Can someone give me a solution?

Thank you to anyone who can find the time to answer.

Greetings, everyone.

PS: Below I reported the part where I made some changes compared to the example (basically I just inserted the two functions before the while(1) and modified the id because they are the ones I send).

pastedImage_1.png

标签 (3)
标记 (5)
1 解答
1,045 次查看
kaden
NXP Employee
NXP Employee

Hi,

did you enable semihosting in your debug configuration for the PE micro?

Just go to your debug configurations and in the "Startup" tab there is a checkbox which says "Enable Semihosting".

Also, make sure to use ewl_C debugger console in "Properties -> C/C++ Build -> Settings -> Target Processor -> Libraries support".

Regards

在原帖中查看解决方案

2 回复数
1,046 次查看
kaden
NXP Employee
NXP Employee

Hi,

did you enable semihosting in your debug configuration for the PE micro?

Just go to your debug configurations and in the "Startup" tab there is a checkbox which says "Enable Semihosting".

Also, make sure to use ewl_C debugger console in "Properties -> C/C++ Build -> Settings -> Target Processor -> Libraries support".

Regards

1,045 次查看
pierpaolo_dini
Contributor III

Hi,

thanks for your help. I can print now.
Sorry if it was trivial, but I wouldn't have thought of changing the debugging settings myself.

Best Regards.