Hi nxp community,
I want to use the printf funcrtion in S32S.3.5 but i con't see results "hello world" at the console or terminal. so far i can not see results whenever i run the code. is there a special configuration required to use this function ? i am using the GBD SEGGER J-Link Debugging line and SWD.
#S32DS #printf @jiri_kral
解決済! 解決策の投稿を見る。
Hi,
easiest way is enable semihosting console. Anyway, what's your target device and debugger?
@jiri_kral sorry for so many questions, I'm really new to the S32D IDE.
I want to try using the UART port instead since for the printf, because I want to send messages over UART for my project. I have a USB serial on my board, I want to try the [S32K1 AUTOSAR 4.4 RTD 1.0.1 D2202 Example Projects] example name is [Uart_Example_S32K144]. But so far I have some issues with the Port_ci_Port_lp_Cfg files. I can't change the PIN based on my board. I want to use Pin PTC6 as RX and Pin PTC7 as Tx. But I'm having problems as shown below..How can I change the pins? or what am I missing?
Which of the following headers can I use to configure the Pins
"''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''
Hi,
you need to implement the _write function which is called by printf at the end for example like this:
int _write(int file, char *ptr, int len)
{
int i;
file = file;
for (i = 0; i < len; i++)
{
UART_PutByte(*ptr++);
}
return len;
}
Instead UART_PutByte you can use something like UART_Send(buffer,len), but the implementation is up to you. You can re-use uart send code from an existing RTD example.
Anyway, the STD C printf is pretty complex and even for "hello word" message it uses a lot of instructions. In my opinion - If you like to send some simple status/log messages it is better implement your own print which directly sends buffer into uart.
Hi,
easiest way is enable semihosting console. Anyway, what's your target device and debugger?
My target device is S32K144 and I am using a GBD SEGGER J-Link Debugging line to SWD.
I have enable semihosting as you suggested but no print showing .
here
after build and flash no results .
Did you switched to semihosting console? On your screenshot is shown debugger console:
I have switch to the console but no results yet. just to let you know I'm using a JTAG 20pin connection.