This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM48L952: No system tick counter

Part Number: RM48L952
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);
}

  • Hi William,

    I don't have any experience of using Keil uVision5 RTX-RTOS. Is os_dly_wait() located in a memory region which can not be accessed in user mode?
  • Hello QJ,

    os_dly_wait() can be accessed in user mode. I is used pause the calling task.

    I've done some more debugging and it appears that the RM48 is not supplying the system tick timer. As such, RTX-RTOS will never come out of the idle state because it is not getting the system tick. Can you point me to information on how to properly set up the RM48 system tick timer?

    William

  • Hello William,

    RM48 has a RTI (real time interrupt) module which can be used for tick timer.

    Please refer to the freeRTOS example generated through TI HALCoGen tool for RM48 device.
  • QJ,

    Thanks for the link. I already had the RTI setup as per the example. However, I was able to find a working project and import the *.dil file. This got the system tick to work. I have not figured out the difference in between the two HALCoGen configurations, but at least I have a working board.

    Thanks for you assistance,

    William