Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Using freing code samples in port demo

Posted by Yuri Wolchkov on November 20, 2009
Good day.

I have ported the FreeRTOS for the MSP430F5438 mcu and toolchain Code Composer Essentials. Now I’m working on demo application for my port. There is several tasks already working on my development board (MSP-EXP430F5438). It is FlashTasks, IntegerMathTasks, PolledQueueTasks and the task, that checks that all the other tasks are still operating as expected, and that no errors have been detected.

There is only 2 leds on my devboard, but it have an I2C LCD. So, I thought that I should use it in demos to my port. Writing my own drivers to this LCD will take too much time end efforts, so I decided to use the TI’s demo files, that contains this driver already. But this code isn’t effective, in particular for using in RTOS, because it contains constructs such:

for(int i=0; i {
while (isI2Cbusy);

Therefore I have a dilemma. At the beginning of my work on port I intended to use TI’s files as is, but now I forced to edit them. And what about programming notation used in the FreeRTOS? Should I rewrite all this sample code from TI with this notation? (there is a lot of code should to be rewritten, and it will take a lot of my time)

Another approach is in creating some process, that will call original functions from TI’s samples. But it seems to me isn’t very good, because this functions throw out a lot of mcu’s cycles.

So what should I do to create an adequate port for my mcu, toolchain, end devboard in current situation?

RE: Using freing code samples in port demo

Posted by Dave on November 20, 2009
You could change the busy wait loop to instead block on a binary semaphore and have the I2C generate an interrupt when it has finished its transfer. That way you will not waste CPU cycles polling the I2C.

Alternatively, and very simply, if your design allows it you could just run the task that uses the I2C at the idle priority so more important tasks will always pre-empt it. That will allow you to use the code without modification.

RE: Using freing code samples in port demo

Posted by Yuri Wolchkov on November 20, 2009
Thank you for the reply, davedoors. But the main question isn’t how to avoid I2C polling, but what should I do with coding notation (for example naming conventions), and should I to rewrite this TI’s files whith it notation, if I want to publish my port.

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers





STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner