Application based on FreeRTOS S32DS example performs prinf/scanf functionality
in FreeRTOS. Application runs in two modes - standard run-time mode with two tasks
maintained by scheduler and command mode implementing basic memory monitor.
Application was tested with putty terminal (http://www.putty.org/).
Putty serial terminal settings: 115200 8N1, no HW control.
USAGE:
In run-time mode is green LED blinking and on terminal are shown task
counter values.
To enter into COMMAND MODE - press button (next to LED diode). LED light
switches to red and you can enter commands.
Available commands:
===================
F show free heap memory
A set memory address
V print value on address
M set address to main()
P previous mem page
N next mem page
? help
X Exit from command mode
Putty configuration:
Terminal output:
Hi Jiri Kral
Thanks.
But if I try to use printf/scanf exclusive of freeRTOS.
Is there any other way can reach this feature?
Hi,
sure - you can use and modify in your project console.c and console.h files. That's where printf/scanf callbacks are implemented.
Jiri
Hi Jiri,
Can you tell me how to config the project that I can use printf to print serial port.
I download your attached project and copy the console.c & console.h, also initialize the LPUART1 and then use printf function in my code, but cannot see serial port print log.
But use the download project you provided it works.
Please advice, thanks.
Hi,
well, it's hard to say what may be wrong. You can copy/paste the LPUART init from rtos.c . Also don't forget set PTC6 as input and PTC7 output and check uart speed.
Hope it helps.
Jiri
Hi Jiri,
Thanks for relly, I cannot upload attachment file in this thread, can you help on below issue:
Hi,
for some reason your link is not accessible for me. Did you create your thread in https://community.nxp.com/community/s32/s32ds community space?
Jiri
Yes, under S32K, my topic named:
Hi Jiri,
Try your project, printf function is ok, but cannot type in command in command mode?
I don't konow why, I am using the S32K144 EVB and use usb to serial port cable.
Hi,
what terminal you are using? In RealTerm - RealTerm: Serial/TCP Terminal - Browse /Realterm/2.0.0.70 at SourceForge.net
is input working okay.
Jiri
I use putty:
If I remember it correctly - in putty you need to setup the end character. So - you can give a chance to RealTerm - this one works out of box.
Jiri
Hi,
I tried fresh Putty install, and for me it also works out of the box:
Here is my putty settings:
Jiri
Thanks Jiri,
Maybe there are some hardware or connection issue in my side, I will show your the capture of my board and serial line connection.
Hi,
I can also compile using your project and pringf output is ok.I copied your console.c and.h files into my project. After adding the reference path, you can compile.But printf can't output, the code card dies here.
Hi,
I can also compile using your project and pringf output is ok.I copied your console.c and.h files into my project. After adding the reference path, you can compile.But printf can't output, the code card dies here.
Hi,
I can also compile using your project and pringf output is ok.I copied your console.c and.h files into my project. After adding the reference path, you can compile.But printf can't output, the code card dies here.
Hi Jiri,
Thanks for providing this sample code. With some modification, now I can use printf on S32K118.
I put scanf() in a task, and I found the task have high percentage of run time loading. That's because the __read_console traps in the LPUART_DRV_GetReceiveStatus if there is no input data.
Thus, I add some delay in the while loop or use LPUART_DRV_ReceiveDataBlocking with portMax_DELAY, then the run time loading becomes normal. I was wondering if this a correct method. If so, I think this could be a reference for others.
Regards,
Jimmy
Hi, I use your console.h and console.c file in my project, but get that problem, How can i do this? thank you very much.
if I use another config, still have error,I don't know how to slove this erroe, Thank you!
i creat three task in this demo, but it doesn't work, seems all hold on, can you check it ?
i resolved it, thanks
Hi! I am learning and using NXP S32k148 board from scratch. I have to connect ESP32 Wi-Fi module to NXP board and simply trans receive "HELLO" message using UART. How to do that? Please help me out. I cannot see any recourse about this so need your help.