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




Loading

TMS570 port patch for non preemtive scheduler

Posted by Emanuel Bringas on May 9, 2013
Hi, I want to use FreeRTOS in a Hercules TMS570 with CCSv5, and I used this port -> http://www.freertos.org/Free_RTOS_for_TI_RM48_and_TMS570.html

When I configured the FreeRTOS scheduler as non-preemptive I got compilation and semantic errors. My fix of these errors is attached.

Please, let me know if my changes are correct.

Thanks in advance!


diff -Naur CORTEX_R4_RM48_TMS570_CCS5-original/FreeRTOS/portable/CCS/ARM_Cortex-R4/port.c CORTEX_R4_RM48_TMS570_CCS5/FreeRTOS/portable/CCS/ARM_Cortex-R4/port.c
--- CORTEX_R4_RM48_TMS570_CCS5-original/FreeRTOS/portable/CCS/ARM_Cortex-R4/port.c2013-04-30 22:04:48.000000000 -0300are
+++ CORTEX_R4_RM48_TMS570_CCS5/FreeRTOS/portable/CCS/ARM_Cortex-R4/port.c2013-05-09 16:23:15.285074598 -0300
@@ -279,7 +279,8 @@
__interrupt void vPortNonPreemptiveTick( void )
{
/* clear clock interrupt flag */
-RTI->INTFLAG = 0x00000001;
+
+portRTI_INTFLAG_REG = 0x00000001;

/* Increment the tick count - this may make a delaying task ready
to run - but a context switch is not performed. */
diff -Naur CORTEX_R4_RM48_TMS570_CCS5-original/FreeRTOSConfig.h CORTEX_R4_RM48_TMS570_CCS5/FreeRTOSConfig.h
--- CORTEX_R4_RM48_TMS570_CCS5-original/FreeRTOSConfig.h2013-05-07 11:11:00.000000000 -0300
+++ CORTEX_R4_RM48_TMS570_CCS5/FreeRTOSConfig.h2013-05-09 16:22:54.238407769 -0300
@@ -95,7 +95,7 @@
* See http://www.freertos.org/a00110.html.
*----------------------------------------------------------*/

-#define configUSE_PREEMPTION1
+#define configUSE_PREEMPTION0
#define configUSE_PORT_OPTIMISED_TASK_SELECTION1
#define configUSE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 1
diff -Naur CORTEX_R4_RM48_TMS570_CCS5-original/startup/sys_startup.c CORTEX_R4_RM48_TMS570_CCS5/startup/sys_startup.c
--- CORTEX_R4_RM48_TMS570_CCS5-original/startup/sys_startup.c2012-10-18 15:37:00.000000000 -0300
+++ CORTEX_R4_RM48_TMS570_CCS5/startup/sys_startup.c2013-05-09 16:23:01.068407822 -0300
@@ -43,7 +43,11 @@
phantomInterrupt,
esmHighLevelInterrupt,
phantomInterrupt,
+#if configUSE_PREEMPTION == 1
vPortPreemptiveTick,/* RTI */
+#else
+ vPortNonPreemptiveTick,
+#endif
phantomInterrupt,
phantomInterrupt,
phantomInterrupt,


RE: TMS570 port patch for non preemtive scheduler

Posted by Richard on May 10, 2013
Thanks for taking the time to point this out, I can confirm your finding and have added it to the known issues list. I have tested this compiles but not that it runs so please let me know if more than just this one line change is required.

Regards.


RE: TMS570 port patch for non preemtive scheduler

Posted by Emanuel Bringas on May 10, 2013
Thanks Richard,

please note that the fix includes also a change in the interrupts vector (it seems you forgot to mention it in the known issues list), which is the last in the patch.
FWIW, it runs for me.

BTW, do you know who did this port, so I can check with him/her about this fix? The author is not named in the files.

Thanks!
Ema.

RE: TMS570 port patch for non preemtive scheduler

Posted by Richard on May 10, 2013
I updated the known issue to include a note about replacing the installed vector too.

“do you know who did this port”


Me!

Regards.


[ 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