hallo!
I am using MPC5748G devkit board, and would like be able to use the printf() function to be able to see some output. I found this howto: How to use printf function in S32DS for Power Architecture using EWL library but can't get it working with the board. I don't get any warnings so it is difficult to debug. I am kind of lost...
Basically what i did was:
1. I added the uart.c and uart.h to the project /src and /include folders, to the Z2_2 core folders to be specific (I downloaded the files from the link above).
2. I changed the header file in uart.c to #include "MPC5748G.h".
3. I copied the uart_console_io.c file (from the /S32DS_Power_v2.1\S32DS\build_tools\e200_ewl2 folder) to the /src folder of the project
4. I added few lines to the main.c of the Z2_2 core,. It looks now like this.
#include "derivative.h" /* include peripheral declarations */
#include <stdio.h>
extern void xcptn_xmpl(void);
int main(void)
{
volatile int counter = 0;
xcptn_xmpl (); /* Configure and Enable Interrupts */
HW_Init();
LINFlexD_0_Init();
printf("Hallo world. this is a printf example.\n")
/* Loop forever */
for(;;) {
counter++;
}
}
5. I set up a Putty to operate on serial terminal with this settings: Baudrate 19200; Data bits 8; Stop bit 1; no parity, no flow control.
6. I built the project (see below) and run it in the debugger.
The project would not build with the HW_Init() function call. So i deleted it, although I don't know what it does... After that the project runs (I am using the S32DS debugger to run all the cores in RAM mode), but I can't see any output on the terminal (I checked also some other app for serial port monitoring).
My questions are:
1. The board has three cores. The code similar to the one in the example is only in main.c on the Z2_2 core. Does it mean that all code from all cores will run if I simply debug the code? Or do i have to call some functions on the boot core to make other cores run their programs?
2. If I wanted to run this program with one of the other core, how could I do that? The main.c from the other cores looks different (it is empty), and pasting the code over there results in many errors (even after adjusting all the references to header files).
3. In the windows tool manager the COM4 port is set up to 9600, although in the example I am using a higher baud rate. Could this be a problem? How to change the baud rate in the given program?
4. Why doesn't the program work?
Thanks in advance for any suggestions!