I ported FreeRTOS on EFM32 based kit by EnergyMicro. After porting I want to develop a simple application that will display Hello World on the LCD.

When we talk about windows OS, we have a function printf() that interacts with OS to stream out the Hello World on the LCD. What do I use in case of FreeRTOS to put Characters on the LCD?

The closest match that I have found is FreeRTOS_write().


size_t FreeRTOS_write( Peripheral_Descriptor_t const pxPeripheral, 
                       const void *pvBuffer, 
                       const size_t xBytes );

Writes one or more bytes to an open peripheral.

The board support package defines the peripherals that are available to be opened. FreeRTOS_ioctl() is used to select between interrupt driven and polled write modes.

pxPeripheral    The descriptor associated with the peripheral to which bytes are being written. The descriptor will have been returned from the FreeRTOS_open() call used to open the peripheral.
pvBuffer    A pointer to the first byte of data to write.
xBytes      The total number of bytes to write.

When an interrupt driven transfer mode is being used, the actual number of bytes written to a peripheral may be less than the requested number if not all the bytes could be written before the peripheral's write timeout expired. FreeRTOS_ioctl() is used to set the write timeout value. 

Can somebody explain me how to use this function for display?
I am not even sure whether this will help me or not. Please enlighten me if this is not the correct approach.

  • \$\begingroup\$ pxPeripheral is the key -- this needs to be set up to point and write to your LCD screen \$\endgroup\$
    – HL-SDK
    Commented Nov 6, 2013 at 14:50

1 Answer 1


You need the board support package for the EFM32. It should have the drivers for the peripherals on the board, hopefully including the LCD. If it allows you to write plain text to the LCD, then

Call FreeRTOS_open() with the name of the LCD peripheral; it returns a Peripheral_Descriptor_t object (probably just a pointer incognito), or NULL in the case of fail. This object is the first argument to FreeRTOS_write(). The second argument is a pointer to a char array containing your "Hello World" string, the last argument is the number of characters in the string.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.