Is there anyone with experience with the ARTX166 RTOS and the Infineon XE167. I have problems to get the RTOS working which is caused by the interrupts of the used timers. The interrupt never com and all RTOS functions with a delay hangs. Although the webpage of Keil tells the RTOS is compatible , the RTOS is not for the XE167. I had made a report of this bug to Keil but they never answer me when a update of the RTOS comes. They have commit that there is problem with the XE167 and the use of ARTX166 but still there is no solution. Maybe there is ARTX user who have a work around for this and can give me some information how to get the RTOS running.
Problem found interruptvector in AR166_CONFIG.C was not o.k. for the Infineon XE167. Infineon XE167 has also less Timers.
Modification of AR166_CONFIG.C for XE167
#if (OS_TIMER == 2)/* Timer2 */
#define OS_TREG T2
#define OS_TOVF T2IR
#define OS_INTNR 0x20 // <== was 0x22
#define OS_TIE T2IE
#define OS_TRUN() T2CON = 0x0040
#define OS_TIEN() T2IC = aINT_ENABLE
#define OS_TSET() T2 = OS_TRV
#define OS_TREL() T2 += OS_TRV
#elif (OS_TIMER == 3)/* Timer */
#define OS_TREG T3
#define OS_TOVF T3IR
#define OS_INTNR 0x21 // <== was 0x23
#define OS_TIE T3IE
#define OS_TRUN() T3CON = 0x0040
#define OS_TIEN() T3IC = aINT_ENABLE
#define OS_TSET() T3 = OS_TRV
#define OS_TREL() T3 += OS_TRV
#elif (OS_TIMER == )/*Timer4*/
#define OS_TREG T4
#define OS_TOVF T4IR
#define OS_INTNR 0x22 // <== was 0x24
#define OS_TIE T4IE
#define OS_TRUN() T4CON = 0x0040
#define OS_TIEN() T4IC = aINT_ENABLE
#define OS_TSET() T4 = OS_TRV
#define OS_TREL() T4 += OS_TRV
#elif (OS_TIMER == )/*Timer5 */
#define OS_TREG T5
#define OS_TOVF T5IR
#define OS_INTNR 0x23 // <== was 0x25
#define OS_TIE T5IE
#define OS_TRUN() T5CON = 0x0041
#define OS_TIEN() T5IC = aINT_ENABLE
#define OS_TSET() T5 = OS_TRV
#define OS_TREL() T5 += OS_TRV
#elif (OS_TIMER == 6)/* Timer 6 */
#define OS_TREG T6
#define OS_TOVF T6IR
#define OS_INTNR 0x24 // <== was 0x26
#define OS_TIE T6IE
#define OS_TRUN() T6CON = 0x8041
#define OS_TIEN() T6IC = aINT_ENABLE
#define OS_TSET() T6 = CAPREL = OS_TRV
#define OS_TREL()
#else
#error OS_TIMER invalid
#endif
Did you remember to tag your code as code?
I'am sorry first time i post a message here But i learn fast. Next piece of code must also be added to get the RTOS working..........
// add define's to AR166_CONFIG.C //
#ifndef GPT12E_KSCCFG #define GPT12E_KSCCFG (*((unsigned int volatile *) 0xFE1C)) #endif #ifndef SCU_SLC #define SCU_SLC (*((unsigned int volatile *) 0xF0C0)) #endif #ifndef SCU_SLS #define SCU_SLS (*((unsigned int volatile *) 0xF0C2)) #endif
// add lock and unlock functions to AR166_CONFIG.C //
void AR166_vUnlockProtecReg(void) { unsigned int uwPASSWORD; SCU_SLC = 0xAAAA; // command 0 SCU_SLC = 0x5554; // command 1 uwPASSWORD = SCU_SLS & 0x00FF; uwPASSWORD = (~uwPASSWORD) & 0x00FF; SCU_SLC = 0x9600 | uwPASSWORD; // command 2 SCU_SLC = 0x0000; // command 3 } // End of function MAIN_vUnlockProtecReg void AR166_vLockProtecReg(void) { unsigned int uwPASSWORD; SCU_SLC = 0xAAAA; // command 0 SCU_SLC = 0x5554; // command 1 uwPASSWORD = SCU_SLS & 0x00FF; uwPASSWORD = (~uwPASSWORD) & 0x00FF; SCU_SLC = 0x9600 | uwPASSWORD; // command 2 SCU_SLC = 0x1800; // command 3; new PASSWOR is 0x00 uwPASSWORD = SCU_SLS & 0x00FF; uwPASSWORD = (~uwPASSWORD) & 0x00FF; SCU_SLC = 0x8E00 | uwPASSWORD; // command 4 } // End of function MAIN_vLockProtecReg
// Modification of os_tmr_init in file // // AR166_CONFIG.C //
/*--------- os_tmr_init -------*/ void os_tmr_init (void) { AR166_vUnlockProtecReg(); GPT12E_KSCCFG = 0x0003; // enable module _nop_(); _nop_(); AR166_vLockProtecReg(); OS_TSET(); OS_TIEN(); OS_TRUN(); #if (OS_ROBIN == 1) os_robin_time = OS_ROBINTOUT; #endif } /* end of os_tmr_init */