printf messages on UART console in mpc5777m

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

printf messages on UART console in mpc5777m

2,049 次查看
yalamandadosaky
Contributor V

Hi , I want to use printf function in my code , so I thought we can use uart for printing printf messages. So Any one can help how to do this ?Martin Kovar

标签 (1)
8 回复数

1,099 次查看
martin_kovar
NXP Employee
NXP Employee

Hi.

please check example PinToggleStationery for MPC5777M.

Example MPC5777M PinToggleStationery S32DS 

I wrote a document which describes, how to use printf function in S32 Design Studio. It could be useful for you.

https://community.nxp.com/docs/DOC-332018 

Regards,

Martin

1,099 次查看
nxppower912935
Contributor IV

Hi Martin,

could you extend How to use printf function in S32DS for Power Architecture using EWL library for MPC5643L or other architectures or explain how to please?

Kind regards,

Ludwig

0 项奖励

1,099 次查看
martin_kovar
NXP Employee
NXP Employee

Hello Ludwig,

did you try to use the procedure I had described for MPC57xx also with MPC5643L? I am not 100% sure, but I think it could work. It will be necessary to edit GPIO settings in uart.c file and check, which source clock is used for linflex (UART) and eventually edit timing settings in uart.c.

Regards,

Martin

1,099 次查看
nxppower912935
Contributor IV

Hi Martin,

I looked into this a bit, but please explain me how I can use the HW init of MPC57xx series for MPC56xx series? I noticed several MPC5643L projects talking #uart, including a MPC5643L_HWInit.c/.h with the needed setup stages, however that doesn't compile in S32. (Reply to similar issue here error: expected '(' before 'void' __asm void Cpu_SetBASEPRI(uint32_t Level) {  )

I think the nice thing about getting the MPC5643L_HWInit.c working would be to use further CCW projects and have them running from S32. Literally every sample project includes it.

Does the MPC5744P_Printf_Function-S32DS.c maybe apply for MPC56xx as well? It's not that large, I haven't checked all module etc. if they are similar to both devices - and doubt it.

I have a feeling you can help me here, can you?

Best,
Ludwig

Update: For now I removed MPC5643L_HWInit.c/.h and all was compiling.

The main is from MPC5643L-LINFlex-UART-echo-RXTX_DMA-CW210 (zip)

0 项奖励

1,099 次查看
martin_kovar
NXP Employee
NXP Employee

Hello Ludwig,

I did not mean you use whole MPC57xx project for MPC5643L microcontroller. But you can take your project for MPC5643L and add uart.c, uart.h and  uart_console_io.c files to your project. Then you edit uart.c file (GPIO settings and maybe bit timing) and it should work correct.

Regards,

Martin

1,099 次查看
nxppower912935
Contributor IV

Hi Martin,

I would do that, but I try to use S32DS for MPC5643L and don't have any existing samples/portations or are there any you know of? That would be great. When trying to take CCW code into S32DS, I ran several compiling issues error: expected '(' before 'void' __asm void Cpu_SetBASEPRI(uint32_t Level) { .

One general question. I have a MPC5748G and MPC5643L board and understand that coding them is different. For 5748G there are many S32DS examples, however there seems to be another problem with downloading. I actually think I should go with the 5748G, right? And one more question if you could help me: If I would have a Multilink, would there be a speedup when downloading? Downloading to the 5748G takes minutes, surely something wrong there?!

Thanks and good weekend,

Ludwig

0 项奖励

1,099 次查看
martin_kovar
NXP Employee
NXP Employee

Hello Ludwig,

I ported MPC5643L PinToggleStationery example for S32 Design Studio, please see attachment in this post. It is not "absolutely amazing", but it works correct ;-).

About your compiling issues, you cannot use startup from CodeWarrior, because it uses different compiler. S32DS uses GCC compiler and for example, there are no pragmas and also as I know there is key word attribute instead of declspec. But these are not only changes.

So please check the example and let me know, if it works on your side.

About MPC5748G I did not test code flashing via USB (there could be some problem with Open SDA firmware, but I guess only), but if you use Multilink it takes about 30 seconds (there is big flash memory). 

If you have any other question, please feel free to write me back.

Regards,

Martin

1,099 次查看
nxppower912935
Contributor IV

Hi Martin,

Kudos!!! It's working. I understand with the compiler specific parts CCW vs. GCC. Actually, I noticed compilation works if you just remove MPC5643L_HWInit.c/.h, but despite the successful download and running elf, I need to verify again what this was.

Thanks again and have a great weekend,

Ludwig

pastedImage_1.jpg