Quality RTOS & Embedded Software

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


thread.js (Rowley ARM7 demo)

Posted by Glen B. 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.


RE: thread.js (Rowley ARM7 demo)

Posted by Richard on January 9, 2009
Excellent work Glen - I have the file you sent. Thanks!


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

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

Latest News

Meet us at Embedded World. Hall 3A-525.

Hear from Richard Barry at Embedded World. Feb 28, 16:00, Hall 4-428.

Video: Watch James Gosling & Richard Barry at re:Invent, Las Vegas 2017.

FreeRTOS kernel V10.0.1 is available for immediate download. Now MIT licensed.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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