How does FSBL load the FreeRTOS on the small core and execute it?

Hi all,
I’m excited to see that the small core now can run FreeRTOS.

As mentioned in Duo firmware v1.0.5, it says:

  • FSBL itself already supports dual-core startup, and you can use kernel remoteproc to start the small core’s ELF.
  • BL2 will first load the FreeRTOS binary from the flash into memory and start the small core. After that, BL2 loads OpenSBI/U-Boot/Kernel to run on the big core.

I followed this post Milk-v Duo Compilation Process Part II- Compiling Small Core FreeRTOS, which explains quite detailed info how FreeRTOS is built, to trace the symbols defined for FreeRTOS, such as BLCP_2ND_RUNADDR is the address to run on the small core.

However, I get stuck at FSBL stage because I could not find any source code that let FSBL load FreeRTOS image cvirtos.bin to BLCP_2ND_RUNADDR and wake up the small core.

In Duo Buildroot SDK, FSBL is almost pre-built, when I refer to duo-buildroot-sdk/fsbl/plat/cv180x/bl2/bl2_main.c at develop · milkv-duo/duo-buildroot-sdk · GitHub, only init_comm_info() function is related to FreeRTOS.

So, I have few questions, please kindly guide me on them:

  • Where can I get the full source to to understand how BL2 load the FreeRTOS and wake up the small core?
  • Is there any document should I look at for better understaning the boot up of dual-core system?
4 Likes

i’d like to know the answers too!

2 Likes

Please refer to [v2,2/2] package/milkv-duo: add packages for milkv-duo - Patchwork (ozlabs.org), where the series of patches submitted to buildroot indicate how the freertos is built.

And FYI [v2,1/2] configs/milkv_duo: new defconfig - Patchwork (ozlabs.org), the post-image.sh clearly tells how fip.bin integrates the freertos’s binary file.

I hope the sdcard image building process of the buildroot is more clear than the official sdk.