two system tick timers in CPU0 in lpc55s69

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

two system tick timers in CPU0 in lpc55s69

1,003 Views
binjun-charles_
Contributor II

Hello All

As we know, there are 2 system tick timers in CPU0. I am trying to initialize secure one in secure world and non-secure one in trustzone example project(hello-world and My IDE is IAR 8.40). 

1. The secure one is working if i call SysTick_Config in secure world.

2. The non-secure world enters hard fault if i call SysTick_Config in non-secure world. I debug the non-secure world code and it shows that SysTick_Config use secure address to configure the system tick timer. (why does it not use Systick_NS address? )

Anyone could help me to initialize 2 system tick timers separately in different worlds?  

Labels (1)
Tags (2)
3 Replies

903 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, BinJun,

Can you post your code so that we can have a review?

BR

XiangJun Rong

0 Kudos

903 Views
binjun-charles_
Contributor II

i used a example code in SDK_2.7 -- \boards\lpcxpresso55s69\trustzone_examples\secure_gpio. 

In the non-secure world project, i call SysTick_Config(USEC_TO_COUNT(5000U, DEMO_SYSTICK_CLK_FREQ)) in main() entry. Then program enters hard fault. 

0 Kudos

903 Views
binjun-charles_
Contributor II

Also i have tried the code below in secure project

//configure secure systick

SysTick_Config(MSEC_TO_COUNT(1000U, DEMO_SYSTICK_CLK_FREQ));

//configure non-secure systick

SysTick_NS->LOAD = (uint32_t)(MSEC_TO_COUNT(2000U, DEMO_SYSTICK_CLK_FREQ) - 1UL); 
SysTick_NS->VAL = 0UL; 
SysTick_NS->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_TICKINT_Msk |SysTick_CTRL_ENABLE_Msk;

The code seems working(non-secure systick working, but frequency is not same as value i set). 

However secure systick is working after configuring non-secure one.  How can i configure these 2 system tick timers separately to make them working in different worlds.