Hi All :
I’m trying to use the non-Secure SysTick Timer in Non-Secure project of trustzone example “Hello World” from SDK_2.9.0_LPCXpresso55s69 (MCUXpresso IDE project) with my LPCXpresso55s69 board.
The System Tick Configuration (non-secure) “TZ_SysTick_Config_NS” runs successfully in non-secure world. (hello_world_ns.c )
After trustzone example “Hello World” runs completely, nothing happened to the Handler function “SysTick_Handler” which added in non-sercure world. (hello_world_ns.c )
The same result presented if I try to copy and add another vector table initialization e.g., “g_pfnVectors_ns” in starup code for secure & non-secure project (~\lpcxpresso55s69_hello_world_s\startup\startup_lpc55s69_cm33_core0.c & ~\lpcxpresso55s69_hello_world_ns\startup\startup_lpc55s69_cm33_core0.c )
The Non-secure vector base address specify to start address of non-secure world in secure project. ( hello_world_s.c )
/* Set non-secure vector table */ SCB_NS->VTOR = NON_SECURE_START; |
As we know, there are three system tick timers (SysTick timer) are present in the LPC55S69. Two inside the CPU0 (Secured and Non-Secured), and one inside the CPU1 (Non-Secured).
How can I use non-Secure SysTick Timer for my non-Secure application in non-Secure world?
Ref :
- “The vector base address is banked between Secure and Non-secure state. VTOR_S contains the Secure vector base address, and VTOR_NS contains the Non-secure vector base address. These registers can be programmed by software, and also initialized at reset by the system” ( https://developer.arm.com/documentation/100230/0002/functional-description/programmers-model/excepti... )
- “two system tick timers in CPU0 in lpc55s69” https://community.nxp.com/t5/LPC-Microcontrollers/two-system-tick-timers-in-CPU0-in-lpc55s69/m-p/100...
- “The system supports two separate interrupt vector tables for secure and non-secure code execution. This interrupt assignment is controlled during Secure state code execution via the NVIC (nested vector interrupt controller).” ( https://www.keil.com/pack/doc/CMSIS/Core/html/using_TrustZone_pg.html )