Driver Porting Layer (DPL) demo
Introduction
This example shows a simple application, which setups the CPU and the underlying RTOS or no-RTOS environment on the supported SOC.
The example does the below
Setup a timer with system tick of 1ms, setup MPU and cache (if available)
Create a RTOS task (in RTOS example)
Trigger a ISR and signal a semaphore from ISR to main task
Show usage of clock delay
Show usage of cache APIs
Show usage of heap APIs
Supported Combinations
Parameter |
Value |
|---|---|
CPU + OS |
a53ss0-0 nortos |
CPU + OS |
a53ss0-0 freertos |
CPU + OS |
a53ss0-1 freertos |
CPU + OS |
a53ss1-0 freertos |
CPU + OS |
a53ss1-1 freertos |
CPU + OS |
a53ss0-0 freertos-smp |
CPU + OS |
c75ss0-0 freertos |
CPU + OS |
mcu-r5fss0-0 nortos |
CPU + OS |
mcu-r5fss0-0 freertos |
CPU + OS |
r5fss0-0 freertos |
Toolchain |
ti-arm-clang |
Toolchain |
arm.gnu.aarch64-none |
Board |
am62dx-evm |
Example folder |
examples/kernel/dpl/dpl_demo/ |
Steps to Run the Example
When using CCS projects to build, import the CCS project for the required combination and build it using the CCS project menu (see Using SDK with CCS Projects).
When using makefiles to build, note the required combination and build using make command (see Using SDK with Makefiles)
Launch a CCS debug session and run the executable, see CCS Launch, Load and Run
See Also
Sample Output
Shown below is a sample output when the application is run,
[DPL] Hwi post ...
[DPL] Hwi post ... DONE !!!
[DPL] Sleep for 100 msecs ...
[DPL] Sleep ... DONE (Measured time = 100000 usecs, CPU cycles = 80000055 ) !!!
[DPL] Running cache operations ...
[DPL] Running cache operations ... DONE !!!
[DPL] Heap free size = 1984 bytes
[DPL] Allocated 1023 bytes @ 0x80010440, heap free size = 896 bytes
[DPL] Free'ed 1023 bytes @ 0x80010440, heap free size = 1984 bytes
All tests have passed!
FreeRTOS-AMP Sample Output
Attention
Output from a53ss0-1, a53ss1-0 and a53ss1-1 cores are log to the Shared memory, can be viewed via a53ss0-0 on which log reader is enabled
Shown below is a sample output on UART0 console when the application is run,
DPL Demo Example started on a53_core0
[DPL] Hwi post ...
[DPL] Hwi post ... DONE !!!
[DPL] Hwi(sgi) post ...
[DPL] Hwi(sgi) post ... DONE !!!
[DPL] Sleep for 100 msecs ...
[a530-1] 0.001324s : DPL Demo Example started on a53_core1
[DPL] Hwi post ...335s :
[a530-1] 0.001344s : [DPL] Hwi post ... DONE !!!
[a530-1] 0.001350s : [DPL] Hwi(sgi) post ...
[a530-1] 0.001354s : [DPL] Hwi(sgi) post ... DONE !!!
[a530-1] 0.001357s : [DPL] Sleep for 100 msecs ...
[a531-0] 0.003061s : DPL Demo Example started on a53_core2
[DPL] Hwi post ...071s :
[a531-0] 0.003081s : [DPL] Hwi post ... DONE !!!
[a531-0] 0.003086s : [DPL] Hwi(sgi) post ...
[a531-0] 0.003090s : [DPL] Hwi(sgi) post ... DONE !!!
[a531-0] 0.003093s : [DPL] Sleep for 100 msecs ...
[a531-1] 0.003068s : DPL Demo Example started on a53_core3
[DPL] Hwi post ...078s :
[a531-1] 0.003088s : [DPL] Hwi post ... DONE !!!
[a531-1] 0.003093s : [DPL] Hwi(sgi) post ...
[a531-1] 0.003098s : [DPL] Hwi(sgi) post ... DONE !!!
[a531-1] 0.003101s : [DPL] Sleep for 100 msecs ...
[a530-1] 0.101003s : [DPL] Sleep ... DONE (Measured time = 99642 usecs, CPU cycles = 180095 ) !!!
[DPL] Sleep ... DONE (Measured time = 99473 usecs, CPU cycles = 11895359 ) !!!
Note: In case of FREERTOS CPU Cycles will not match with the measured time
As the "WFI" instruction is called from idle task, which suspends the PMU counter used to mea.
[DPL] Running cache operations ...
[DPL] Running cache operations ... DONE !!!
[DPL] Heap free size = 1984 bytes
[DPL] Allocated 1023 bytes @ 0x80020440, heap free size = 896 bytes
[DPL] Free'ed 1023 bytes @ 0x80020440, heap free size = 1984 bytes
All tests have passed on a53_core0 !!
[a530-1] 0.101008s : Note: In case of FREERTOS CPU Cycles will not match with the measured time
[a530-1] 0.101012s : As the "WFI" instruction is called from idle task, which suspends thes
[a530-1] 0.101016s : ure CPU cycles.
[a530-1] 0.101019s : [DPL] Running cache operations ...
[a530-1] 0.101023s : [DPL] Running cache operations ... DONE !!!
[a530-1] 0.101027s : [DPL] Heap free size = 1984 bytes
[a530-1] 0.101032s : [DPL] Allocated 1023 bytes @ 0x86010440, heap free size = 896 bytes
[a530-1] 0.101037s : [DPL] Free'ed 1023 bytes @ 0x86010440, heap free size = 1984 bytes
[a530-1] 0.101042s : All tests have passed on a53_core1 !!
[a531-0] 0.103003s : [DPL] Sleep ... DONE (Measured time = 99906 usecs, CPU cycles = 179601 ) !!!
[a531-0] 0.103008s : Note: In case of FREERTOS CPU Cycles will not match with the measured time
[a531-0] 0.103012s : As the "WFI" instruction is called from idle task, which suspends thes
[a531-0] 0.103016s : ure CPU cycles.
[a531-0] 0.103019s : [DPL] Running cache operations ...
[a531-0] 0.103023s : [DPL] Running cache operations ... DONE !!!
[a531-0] 0.103027s : [DPL] Heap free size = 1984 bytes
[a531-0] 0.103032s : [DPL] Allocated 1023 bytes @ 0x88010440, heap free size = 896 bytes
[a531-0] 0.103038s : [DPL] Free'ed 1023 bytes @ 0x88010440, heap free size = 1984 bytes
[a531-0] 0.103042s : All tests have passed on a53_core2 !!
[a531-1] 0.103003s : [DPL] Sleep ... DONE (Measured time = 99898 usecs, CPU cycles = 180235 ) !!!
[a531-1] 0.103008s : Note: In case of FREERTOS CPU Cycles will not match with the measured time
[a531-1] 0.103012s : As the "WFI" instruction is called from idle task, which suspends thes
[a531-1] 0.103016s : ure CPU cycles.
[a531-1] 0.103019s : [DPL] Running cache operations ...
[a531-1] 0.103023s : [DPL] Running cache operations ... DONE !!!
[a531-1] 0.103027s : [DPL] Heap free size = 1984 bytes
[a531-1] 0.103032s : [DPL] Allocated 1023 bytes @ 0x8a010440, heap free size = 896 bytes
[a531-1] 0.103038s : [DPL] Free'ed 1023 bytes @ 0x8a010440, heap free size = 1984 bytes
[a531-1] 0.103043s : All tests have passed on a53_core3 !!