This is the documentation for the latest (main) development branch of HPM SDK. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

15.5. Hello demo

15.5.1. Overview

Multi-core example project runs the “hello world” example on core0 and runs the “rgb_led” example on core1.

In this project:

  • The serial port outputs “hello world”; Manually input the stirng information through the keyboard and print it through the serial port

  • The RGB leds are switching among RED, GREEN, BLUE respectively.

15.5.2. Board Setting

BOOT_PIN should be configured to 0-OFF, 1-OFF

15.5.3. Generate core1 project

CMAKE_BUILD_TYPE must be “sec_core_img”

15.5.4. Generate core0 project

CMAKE_BUILD_TYPE user can specify “debug” or “flash_xip”, etc.

15.5.5. Build project

Core1 project must be generated and built first Core0 project must be generated after the core1 project has been built successfully.

15.5.6. Debugging the example

  • Download the core0 example to the target and run core0 example first

  • Download the core1 example to the target and run the core1 example

NOTE

  • If users expects to debug the core0 and core1 example step by step, users must ensure the board_init() function is executed before debugging the core1 example as some hardware resoruces needs to be initialized by board_init() in core0 example.

  • When debug core0 and the project runs successfully, The serial port terminal will output the following information:

        hello world from primary core
    
  • When debug core1 and the project runs successfully, The RGB leds are switching among RED, GREEN, BLUE respectively.

15.5.7. Running the example

  • When CMAKE_BUILD_TYPE is “flash_xip” , download the core0 example to the target, stop debugging and reset the board. When the project runs successfully, the serial port terminal will output the following information:

        Copying secondary core image to destination memory...
        Starting secondary core...
        Secondary core started, RGB leds are blinking...
    
        hello world from primary core
    
  • The RGB leds are switching among RED, GREEN, BLUE respectively.