Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


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 ]    [ Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists