Other Parts Discussed in Thread: HALCOGEN
Hello,
I have an RM48 HDK, Iam programming in Keil uVision5 RTX-RTOS, and I am using a Seeger JLink programmer. I have written the simple example program below. After calls to os_dly_wait() in both tasks , the console reports "* JLink Info: Memory access: CPU temp. halted: https://wiki.segger.com/Memory_accesses#Stop_mode," and the program stops.
#include <RTL.h> /* RTX kernel functions & defines */ #include "rti.h" #include <stdint.h> volatile U32 g_os_err_code; /* id1, id2 will contain task identifications at run-time */ OS_TID id1, id2; int counter1; int counter2; /* Forward reference */ __task void task1(void); __task void task2(void); /* Used for debugging */ uint32_t sys_time; __task void task1(void) { /* Obtain own system task identification number */ id1 = os_tsk_self (); /* Assign system identification number of task 1 to id1 */ id2 = os_tsk_create(task2, 1); while(1) { sys_time = os_time_get(); counter1++; /* Indicate to task2 completion of do-this */ os_evt_set (0x0004, id2); /* Wait for completion of do-that (0xffff means no time-out)*/ os_evt_wait_or (0x0004, 0xffff); /* Wait now for 50 ms */ os_dly_wait((uint16_t)5); sys_time = os_time_get(); } } __task void task2(void) { while(1) { sys_time = os_time_get(); counter2++; /* Wait for completion of do-this (0xffff means no time-out) */ os_evt_wait_or (0x0004, 0xffff); /* do-that */ /* Pause for 20 ms until signaling event to task1 */ os_dly_wait((uint16_t)2); /* Indicate to task1 completion of do-that */ os_evt_set (0x0004, id1); } } int main(void) { // Enable interrrupts. __enable_fiq(); __enable_irq(); os_sys_init(task1); }