Please enable JavaScript to view this site.

winIDEA Help

Version: 9.21.243

Navigation: Operating Systems > AUTOSAR > How-to guides

Scroll Prev Top Next More

Find memory location for RUNNINGTASK

In this topic:

Requirements

Configuration steps

 

 

Introduction

Symbols specified as RUNNINGTASK, RUNNINGISR2 are used to show the OS state during debug when the CPU is stopped. OS Profiling, however, can be implemented in two different ways. Either through:

data trace (if supported by the MCU) or

instrumentation trace (OTM, ITM, SofTrace, User Trace Port...)

 

By default data trace is used for OS Profiling, the only prerequisite is to have RUNNINGTASK, RUNNINGISR2, specified as simple variables (not pointers to these variables). If your ORTI file uses vs_SIGNAL specifications, these specify the instrumentation trace method that will be used for trace (instead of data trace). In such cases you need to make sure that the application is correctly instrumented.

 

All OSEK implementations include structures that describe the current state of the OS (current task, current ISR...). This structure is placed in a fixed memory location and it's address needs to be known in advance in order to trace it.

ORTI generators often specify a pointer to this structure, which can easily be followed by OS awareness plugins, but unfortunately can not be directly traced.

 

An example of such ORTI configuration would be:

RUNNINGTASK[1] = "OS_kernel_ptr[1]->taskCurrent";
RUNNINGTASK[2] = "OS_kernel_ptr[2]->taskCurrent";
RUNNINGISR2[1] = "OS_kernel_ptr[1]->isrCurrent";
RUNNINGISR2[2] = "OS_kernel_ptr[2]->isrCurrent";

 

In this case the RUNNINGTASK / RUNNINGISR are given as pointers, which can not be resolved by the trace engine and therefore can not be used for OS signaling.

To circumvent this limitation, you need to find the symbol (or memory location) that this pointer points to.

 

 

Requirements

Established debug connection

ORTI description file

 

 

 

Configuration steps

number1

Start the application.

 

number2

Run until the point where the OS is initialized.

Pay attention to the address the RUNNINGTASK / RUNNINGISR pointer points to by inspecting the correlating variable in the watch window (e.g. OS_kernel_ptr[1]->taskCurrent). In our case this was 0x51800840.

 

 

number3

Open the View / Debug / Symbols view / Variables and sort the variables by address.

 

Number4

Search for the symbol (structure) that is the closest match to the address you found.

rtos-Autosar-KernelDataStruct

 

 

Number4

Expand the structure with a double-click and look for the element with the address you found earlier.

RTOS-Autosar-KernelDataStructMember

 

Number5

Use this variable to replace the pointer which was initially specified as RUNNINGTASK / RUNNINGISR.

 

number6

the changes to the ORTI file.

 

Copyright © 2024 TASKING Germany GmbH