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


thread.js (Rowley ARM7 demo)

Posted by *anonymous on January 9, 2009

As far as I can tell, thread.js has never worked properly. I once posted a correction to the algorithm for traversing the data structures, but even that was not right. But a more serious problem was a crash of CrossStudion when switching to the Idle thread context.

I have finally determined the problem and will explain here. I will also send a corrected threads.js to Richard Barry.

This problem is a strange one. In threads.js a function Debug.Evaluate() is used to poke into the object code being debugged. All variables accessed should be known in the current debug context. Oddly (and apparently unknown to Rowley), if they are not known because they are static in some other context then the value returned is the address of the variable rather than the value of the variable. The original FreeRTOS threads.js exploits this idiosyncracy and just dereferences values that are static in tasks.c. Unfortunately if you switch to the context of the Idle task (which has visibility into tasks.c) then addresses are not returned but the proper values are. This crashes threads.js and consequently CrossStudio.

Recent FreeRTOS versions of tasks.c make use of aportREMOVE_STATIC_QUALIFIER, a preprocessor macro. With portREMOVE_STATIC_QUALIFIER defined, statics in tasks.c become extern instead. This gives them global visibility. With '#define portREMOVE_STATIC_QUALIFIER' in portmacro.h, and modifying threads.js to lose the extra dereferencing of Debug.Evaluate() accessed data, we get a working system.

The threads.js I am sending to Richard also fixes the traversing of the TCB lists. I can send it to users if they email me at...   glen at EmbeddedClarity dot com.


thread.js (Rowley ARM7 demo)

Posted by richardbarry on January 9, 2009

Excellent work Glen - I have the file you sent.  Thanks!


[ 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