[SOLVED] TLE9879 and KEIL RTOS2

Announcements

Webinar: Integrated solutions for smaller, simpler low-voltage motor control design.
Join the webinar to experience!

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User14639
Level 1
Level 1
5 replies posted Welcome! First question asked
Hello,
has someone experience in use KEIL RTOS on TLE9879.
Especially handling of the WDT1.

At the moment my evalboard Resets every second although I put in every task a wdt1_Service() ...
I tested also without wdt1_Service() and different other ways also a separate watchdog task.

Could it be that is not possible to use RTOS on the TLE9879? I think I can't see the forest for the trees...
A downloadable Example would help.

regards
0 Likes
9 Replies
User14639
Level 1
Level 1
5 replies posted Welcome! First question asked
Ok it was my fault.
My code was on some parts longer than the WDT so the MCU will be reset.
Maybe that's the difference between GUI SW and embedded one 😉

regards
0 Likes
Not applicable
Hello MRE,
I'm trying to use KEIL RTOS on TLE9879.
The already existing project on which I'm trying to implement the RTOS is not using the SDK of infineon instead we use our own configuration (which ist working correctly).
Building the source files of RTOS within my project leads to an error that states "Unknown Arm Architecture!" (along with some other errors).
How did you get KEIL RTOS started in your project?
Do you have an example code that could help me to figure out what I'm doing wrong?

regards

TE
0 Likes
User14639
Level 1
Level 1
5 replies posted Welcome! First question asked
Hello,
I'm using the SDK from Infineon and also the ifxconfigwizard.
I think you use another MCU than TLE987x?
Did you include the correct MCU?

In my case I've
#include CMSIS_device_header
#include

and in the RTE_Components.h
#define CMSIS_device_header "tle987x.h"

and also in the options you have to choice the correct MCU.

regards
0 Likes
Not applicable
Thank you for your quick response.

Where did you include CMSIS_device_header and ?

In my case CMSIS_device_header ist included in os_systick.c and rtx_core_c.h. These are both read-only files.
In RTE_Components.h we define:
#define CMSIS_device_header "TLE987x.h"
In TLE987x.h:
#include

So both files you mentioned should be included. We are certain that our MCU is correct.
What options do you mean?

regards
0 Likes
User14639
Level 1
Level 1
5 replies posted Welcome! First question asked
Hello,
I think you need it in main.c because I run TLE_Init() there.
I'm also init threads and start the kernel in main.c.

I mean "options for target" there you have to choose a target MCU under "Device".

regards
0 Likes
Not applicable
Hello,
we chosed the correct device in the options and also inlcude the fails in main, so that can't be the problem.
We added the source code of the RTOS to the project by selecting Keil RTX5 in Manage Run-Time Environment -> CMSIS -> RTOS2 (API) -> KEIL RTX5. At the moment we're trying to build the source code but we also tried to build the library (both didn't work).
How have you added RTOS to your project. Did you choose the source code or the library?

Our main problem occures in the following lines in rtx_core_c.h:

#if ((!defined(__ARM_ARCH_6M__)) && \
(!defined(__ARM_ARCH_7A__)) && \
(!defined(__ARM_ARCH_7M__)) && \
(!defined(__ARM_ARCH_7EM__)) && \
(!defined(__ARM_ARCH_8M_BASE__)) && \
(!defined(__ARM_ARCH_8M_MAIN__)))
#error "Unknown Arm Architecture!"
#endif

The error states: C:\Keil_v5\ARM\PACK\ARM\CMSIS\5.3.0\CMSIS\RTOS2\RTX\Source\rtx_core_c.h(39): error: #35: #error directive: "Unknown Arm Architecture!".

I'm wondering if my setting in options for target -> target are correct. Could you please tell me what your settings are?

Tank you for your help.

3116.attach
0 Likes
User14639
Level 1
Level 1
5 replies posted Welcome! First question asked
Hello,
it seems looking good...

Maybe... take a look on the Manage Run-Time Environment and activate also under RTOS(API)->Keil RTX5 in addition to RTOS2(API)->Keil RTX5
I'm not sure but I thinked I've read this on a Keil help site, somewhere here: https://www.keil.com/pack/doc/CMSIS/RTOS2/html/index.html

I'm using RTOS1 because I didn't see the threads with RTOS2 in debugging mode...

So I'm now in weekend.

regards
0 Likes
User19538
Level 1
Level 1
Hello MRE,

Do you have any sample code for tle9879 with free RTOS. Will you please share it.

Thank you in advance.
0 Likes
User14639
Level 1
Level 1
5 replies posted Welcome! First question asked
Hello sagar,
it is a long time ago, so I'm not sure if this code works? Also I could only insert the Code here and no ZIP...

We didn't use RTOS cause with our application we have not enough resources to use RTOS.

/*----------------------------------------------------------------------------
* CMSIS-RTOS 'main' function template
*---------------------------------------------------------------------------*/

#include "RTE_Components.h"
#include CMSIS_device_header
#include "cmsis_os.h"
#include "tle_device.h"
#include "stdio.h"

#ifdef RTE_Compiler_EventRecorder
#include "EventRecorder.h"
#endif

extern void taskW (void const *argument);
extern void task1 (void const *argument);
extern void task2 (void const *argument);

osThreadId w1;
osThreadId ta1;
osThreadId ta2;

osThreadDef(taskW, osPriorityNormal, 1, 0);
osThreadDef(task1, osPriorityNormal, 1, 0);
osThreadDef(task2, osPriorityNormal, 1, 0);

uint16 i;
uint16 j;

void taskW (void const *argument)//war als WDT Task gedacht, braucht es aber ja nicht
{
while(1)
{
//WDT1_Service();
}
}

void task1 (void const *argument)
{
while(1)
{
WDT1_SOW_Service(1); //Zeitschleife mit Variabler i

for(i=1000; i==0; i--)
{
osDelay(1); //so noch unschön mit Timer wäre es besser
}

PORT_ChangePin(0x04, PORT_ACTION_TOGGLE);
fputs("Task1 ",stdout);
}
}

void task2 (void const *argument)
{
while(1)
{
WDT1_SOW_Service(1);

for(j=1000; j==0; j--) //Zeitschleife mit Variabler j
{
osDelay(1); //so noch unschön mit Timer wäre es besser
}

PORT_ChangePin(0x14, PORT_ACTION_TOGGLE);
fputs("Task2 ",stdout);
}
}


int main (void) {


TLE_Init(); //alle Inits des TLE aufrufen

// System Initialization
SystemCoreClockUpdate();

#ifdef RTE_Compiler_EventRecorder
// Initialize and start Event Recorder
EventRecorderInitialize(EventRecordError, 1U);
#endif
// ...

osKernelInitialize(); // Initialize CMSIS-RTOS

w1 = osThreadCreate(osThread(taskW), NULL); // Tasks generieren
ta1 = osThreadCreate(osThread(task1), NULL);
ta2 = osThreadCreate(osThread(task2), NULL);

osKernelStart(); // Start thread execution

fputs("\n\n************** Neustart ***************\n\n",stdout);

while(1) {
WDT1_Service(); //WDT1 regelmäßig auslösen/prüfen
}
}
0 Likes