This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to start cpu in ARMv7 baremetal environment?

I am using an Allwinner H3 SoC (on a zeropi board) and I want to start up a secondary core without using an OS.
I am trying to use the SMC call CPU_ON, using the following code:


smc_call(0x84000003, 0x02, (void*)blink, 0);


Where I use the assembler routine smc_call:

globl smc_call
.arch_extension sec
smc_call:
SMC #0
bx lr


According to the Documentation, the following parameters should be (and to the best of my knowledge, are) passed:

1. uint32 Function ID (0x84000003)
2. uint32 target CPU (0x02)
3. uint32 entry_point_address (in my case, a function called 'blink')
4. uint32 context_d (0, but this is only a guess from what I've seen in the Linux kernel)

The outcome is very interesting: Core0 starts executing 'blink', instead of returning and leaving Core3 to execute it.

What am I overlooking?

(Edit: fixed contradicting cpu numbering)

Parents Reply Children
  • No, I start this program straight from uboot. 

    I watch the serial output, which, when the program terminates, should acknowledge it. The 'blink' function is an infinite loop, and therefore it does not return. The main 'thread' only has one job: spin up another core that will execute'blink', and terminate. It, however, does not terminate, and the LED is physically blinking, therefore _something_ must be executing it. I experimented with using the LED to encode the cpuID, and it also shows its running on core0 - however I'm not entirely sure if that's a good indicator (I took the code to determine the cpuID from the DS-5 examples)