Electrical – With harmony how to implement printf to uart

microchipmplabmplab-harmonypic

I setup a project using harmony v2 for a pic32mx470f512l. In drivers -> USART i configured the UART (strange its called USART in harmony in datasheet says its a UART):

enter image description here

Now i want to use the function printf, like we can easily use in MCC.
How can it be implement in harmony?

I seem to have made it work after

but i get wrong chars on termite:
enter image description here
enter image description here

The configs i made in device configuration:
enter image description here

Best Answer

I was facing a similar issue with a PIC32MX and my solution was to use the configuration as in the image below for the USART driver.

USART settings on Harmony

Then, I've enabled the 'Use Console System Service?', under 'Harmony Framework Configuration > System Services > Console', using the configurations listed in the image below.

Console settings

Hopefully, these configurations may be applicable to your situation. Don't forget to configure the desired pins as U2TX and U2RX.

Related Topic