UDP Logging

Hi,
While looking for logging functionality over the UDP connection, I came across this link. However, this link only specifies the associated macros but not the source code for UDP logging itself. Can anyone tell me where can I download the UDP logging code associated with this?

Thanks,
Ravi

This file contains UDP logging code for WinSim - FreeRTOS/FreeRTOS-Plus/Demo/Common/Logging/windows/Logging_WinSim.c at main · FreeRTOS/FreeRTOS · GitHub.

1 Like

Hi @rdarbha
You can go through these links for reference :-

  1. Link
  2. Link
1 Like

UDP logging is very convenient: it is non-blocking and it is sent to a particular port number on a broadcast address, like e.g. 192.168.1.255.

You can run an UDP client on e.g. 192.168.1.33 and see all logging.

Another good thing of UDP logging is that it gives a “real-time” impression of the events. It will add time-stamps so you can see exactly when things have happened.

The function lUDPLoggingPrintf() will store text in a RAM buffer and add a time-stamp. The actual sending is postponed until a low-priority task will send all messages.

Gaurav showed an URL to the UDP logging for the WinSim project. That version is quite different from the generic version that is used in non-WinSim projects.

You can find one version of UDPLoggingPrintf.c here.

1 Like

@htibosch Do you know if there anything for microcontroller environment instead of winsim?

@htibosch Nevermind. Looks like the link you shared is already for the microcontroller environment.

the link you shared is already for the microcontroller environment.

That’s right, I also added the generic version.

The usage is pretty simple:

  • Make sure that vUDPLoggingTaskCreate() is called, preferably once the interface is up and running.
  • Look in UDPLoggingPrintf.c what macro’s are expected, and their default values.

If it doesn’t work, please put a break on FreeRTOS_sendto() and check if the target address is correct.

Cheers