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

Accessing scheduler list

Posted by dioghenes-0 on May 14, 2017

Hi all, I need to write an application that is able to make FreeRTOS to fail under fixed conditions. To do so I need to access the scheduler List_t structure 'pxReadyTasksLists', in order to get data about TCBs and stacks of the started tasks, but looking at the code, the list I'm interested into is defined in tasks.c and so not visible to the programmer. Is there a good and elegant way to access to those data? Thank you in advance.


Accessing scheduler list

Posted by heinbali01 on May 14, 2017

A quick answer: there are more than 25 trace macros's that you can fill in, for example:

~~~ traceTASKINCREMENTTICK( xTickCount ); traceTASKSWITCHEDOUT(); traceTASKSWITCHEDIN(); ~~~

You can define them in your FreeRTOSConfig.h.

Another trick you could do is include your own code into task.c, e.g. after the last declaration and macro definition:

~~~ #include "mytestingmodule.c" ~~~

When you mess up the code, no warranty is given, of course. Good luck


Accessing scheduler list

Posted by dioghenes-0 on May 14, 2017

Uhm...there is no way, for example, to modify some field of some elements of pxReadyTasksLists without modifying the code of FreeRTOS? I ask because trace macros allow me only to 'react' to events while I need to access data in writing mode. I have tried with a 'dirty' trick: I have removed the PRIVILEGED_DATA ahead that list, so that it is accessible from anywhere...could it be a good way to proceed? Thank you a lot.


Accessing scheduler list

Posted by heinbali01 on May 14, 2017

It is dirty and risky to write e.g. in pxReadyTasksLists. There are many limitations on what you can do safely. One thing is for sure: things that might go wrong, certainly will go wrong.

The structure and objects have been kept local and static to avoid users from getting access to them.


Accessing scheduler list

Posted by dioghenes-0 on May 14, 2017

Ok I will try to reduce as much as I can the modification to the code.


Accessing scheduler list

Posted by rtel on May 14, 2017

A header file is included at the bottom of tasks.c that allow additional code to be added into the file specifically so static variables can be accessed during module testing.


Accessing scheduler list

Posted by dioghenes-0 on May 14, 2017

Really nice, just seen! Thank you all!


Accessing scheduler list

Posted by burry94 on May 24, 2017

Sorry can I ask how did you resolved the problem? How did you modify akernel variable?


Accessing scheduler list

Posted by burry94 on May 24, 2017

Sorry can I ask how did you resolved the problem? How did you modify akernel variable?


[ 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