Cortex R5F Peripheral Base Address

I’m investigating using traceanalyzer with the Cortex R5F processors on the TI Jacinto platform. Does anyone know where to find the Peripheral base address required to configure the hardware port to enable the analyser to access the counter registers?

Currently I’m finding the comment in trcHardwarePort.h ‘but should work with all Cortex-A and R processors assuming that TRC_CA9_MPCORE_PERIPHERAL_BASE_ADDRESS is set accordingly.’ to be somewhat misleading.
As far as I can private timer of the A9 referred to by the registers does not exist in the Cortex-R processors.

You might be correct about the comment that might be a little bit misleading. I am not familiar with this TI platform so I can’t provide details to implement the HW port for it. But in general, there are two things that must be done.
First, you need a time source, normally a hardware timer. The below defines should be configured:
#define TRC_HWTC_TYPE
#define TRC_HWTC_COUNT
#define TRC_HWTC_PERIOD
#define TRC_HWTC_DIVISOR
#define TRC_HWTC_FREQ_HZ
Second is the critical sections. There are a few HW ports for Cortex-A9 and Cortex-R5 that use the same implementation of the critical section. So maybe it can be reused.

There is a blog post with some more details here:

2 Likes

Thanks Kristoffer. That clarifies the situation. I think the TI PDK and documentation provide all the required information, with the possible exception of the divisor/prescaler.

Hello @SteveB,

I’m basically recreating the same setup as you except its for the TI AM64x platform, also based on a Cortex-R5F. Did you finally achieved something working ?

I have a hard time figuring out where is the processor header file in TI’s case (is it necessary when not using a Cortex-M ?) But more importantly I absolutely can’t find any info about the peripheral base address. Could you show me where you find it in the TI Jacinto PDK?

Many thanks.

Hi @Fnx_QT,

Sorry, I didn’t end up taking this any further.

The approach I would take is to ignore the comments in trcHardwarePort.h with reference to Peripheral_base_address and focus on the example linked by kristoffer_percepio.

For the listed #define on the Jacinto/J721e I’d be looking at

#define TRC_HWTC_TYPE TRC_OS_TIMER_INCR
#define TRC_HWTC_COUNT ‘function from the processor port’, e.g. uxPortGetTimeInUsec()
#define TRC_HWTC_PERIOD 2^32 - Counter is an unsigned 32bit variable
#define TRC_HWTC_DIVISOR Don’t know
#define TRC_HWTC_FREQ_HZ 1000000 - based on a 1us timer

The critical section functions you should fine in the port (portmacro.h), e.g.
TRACE_ALLOC_CRITICAL_SECTION() Not sure - A local variable declaration for storing the interrupt status.
TRACE_ENTER_CRITICAL_SECTION() vPortEnterCritical()
TRACE_EXIT_CRITICAL_SECTION() vPortExitCritical()

All a bit hypothetical I’m afraid. Would be interested to know how you get on.

Cheers
Steve

1 Like

Thanks for your response @SteveB.