FreeRTOS V8.0.0 Final Release available as Processor Expert Component

The final FreeRTOS V8.0.0 has been released last week: time to update the Processor Expert component for it, and this time it is really a major release 🙂 : from V7.5.0 to V8.0.0:

FreeRTOS V8.0.0 Processor Expert Component

FreeRTOS V8.0.0 Processor Expert Component

FreeRTOS V8.0.0 comes with many small changes, especially it now includes many of the extra casts I have contributed to avoid compiler warnings. And additionally it has a brand new feature: Event Groups.

Event Groups

The new Event Groups are optional, and allows to set one or more bits and to use them as a group. See http://www.freertos.org/FreeRTOS-Event-Groups.html. Such event bits are sometimes named ‘flags’ too. Unlike normal flags, this implementation with FreeRTOS allows to synchronize the tasks on such events.

FreeRTOS V8.0.0 Component

FreeRTOS V8.0.0 Component with Event Group Methods

Upgrading

Upgrading from the earlier FreeRTOS component and RTOS sources is straight forward: load the new FreeRTOS (and Percepio Trace, if used) components, restart Eclipse and things should be ready to go. http://www.freertos.org/upgrading-to-FreeRTOS-V8.html details any other porting issues. FreeRTOS has a compatibility mode, but I recommend to update the application. Here are a few things I had to change:

FRTOS1_vApplicationStackOverflowHook()

The old declaration of FRTOS1_vApplicationStackOverflowHook() in Events.h generated by Processor Expert is using signed PortCHAR:

void FRTOS1_vApplicationStackOverflowHook(xTaskHandle pxTask, signed portCHAR *pcTaskName);

while the new one is simply using ‘char’:

void FRTOS1_vApplicationStackOverflowHook(xTaskHandle pxTask, char *pcTaskName);

So the version in Events.h needs to changed to ‘char’ too.

xTaskCreate() and Character Pointers

V8.0.0 has fixed and aligned usage of ‘char’ pointers. In may code I have properly casted things like this:

if (FRTOS1_xTaskCreate(DriveTask, (signed portCHAR *)"Drive", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY+3, NULL) != pdPASS) {
  for(;;){} /* error */
}

Now I can remove (signed portCHAR*) cast:

if (FRTOS1_xTaskCreate(DriveTask, "Drive", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY+3, NULL) != pdPASS) {
  for(;;){} /* error */
}

Summary

The new V8.0.0 RTOS adds the ‘long time missed’ event flags and groups. Upgrading was easy for me, so I hope it will be for you too :-). The new sources and port files are available on GitHub, and I’m in the process of uploading the new components and updated demo files.

Happy FreeRTOSing 🙂

Advertisements

23 thoughts on “FreeRTOS V8.0.0 Final Release available as Processor Expert Component

    • Thanks :-). QueueSet and GroupEvent are somewhat similiar, but different in the implementation. QueueSet have queues behind it, while GroupEvent is really about bits. You could mimic GroupEvent bits with a set of binary QueueSet, but in my view that would be too heavy. In my view QueueSets have been added to the RTOS in the past for problems which are solved with GroupEvent bits more elegantly. So far I have not used QueueSet in my application: I have used my own implementation of event bits (see my SimpleEvent Processor Expert component). But that SimpleEvent component is really just an array of bits with atomic bit operations. Event Bits in FreeRTOS add blocking and RTOS synchronization to it which makes it a really nice way to implement task rendevous and checking bits within the RTOS API.

      Like

  1. Pingback: First Steps with the Freescale TWR-K64F120M | MCU on Eclipse

  2. I’m making use of the xEventGroupSetBitsFromISR() function in your FreeRTOS 8.0.1 component and came across the following build error:

    undefined reference to `xTimerPendFunctionCallFromISR’

    The fix (taken from the API documentation) is simply to add the following lines to the FreeRTOSConfig.h file:

    #define INCLUDE_xEventGroupSetBitFromISR 1
    #define INCLUDE_xTimerPendFunctionCall 1

    Perhaps these could be added to the PE Driver with a %if statement?

    Like

  3. Hi Erich
    Have the FreeRTOS timers been implemented and tested? I have been using them but I have had intermittent errors and unexpected results. These are probably my fault and not the port, but I would be interested to know if you are sure they are robust.

    I have emailed Richard Barry at FreeRTOS with some questions – I could copy you, or post here, though it is quite long…

    Regards – Charles

    Like

    • Hi Charles,
      I have used FreeRTOS timers in some of my projects, and have not had any issues. But I used it for rather slow timers (like 10 ms or 50 ms).
      Maybe you face a stack overflow/space problem?
      Posting your observations to the FreeRTOS email list is probably the best way: Richard Barry is very active on that list.

      Erich

      Like

  4. Hi Erich,

    There is one thing, I dont understand: in setting the cpu, build options -> generate linker files. Why heap size is defined with length 0x0000 by default? The heap should not be greater than zero, for many reasons, for example to freertos heap fit in memory?

    Thanks,

    Matheus

    Like

  5. Pingback: Tutorial: Playing MP3 Files with VS1053B and FRDM Board | MCU on Eclipse

  6. Hi Erich,
    using freeRTOS I saw that the RTOS heap is initialized like a normal variable with 0xA5 in the data flash segment; in my opinion it is a waste since the heap could be initialized later directly in the _vTaskStartScheduler function freeing the flash for more code. Am I wrong and is this possible to do?
    Thanks, Michael

    Like

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.