Running the Firmware

Yocto Integration

You can have an MCU domain program built into your image to run alongside Linux at startup. The steps below will show you how to add your own program.

  • The recipe used to include the MCU program is located in meta-ampliphy/recipes-examples/phytec-mcu-plus-sdk-firmware_git/mcu-plus-sdk-firmware_git.bb

  • You can replace PHYTEC’s mcu-plus-sdk-firmware repository with your own by updating SRC_URI. You will also need to include the proper license file, and update the SRCREV variable to the proper commit from your repo.

  • Now you can update the install -m command for the am62xx so that the source path matches the path to your binary in your firmware repository.

Note

You must leave the install destination as it is. The remoteproc driver will look for am62-mcu-m4f0_0-fw as the MCU program to run.

You should now be able to build and see your MCU domain program run.

Running Firmware Without Yocto

If you wish to test your firmware without rebuilding your whole image, you can simply copy your binary onto the target system and run it manually.

  • First we should check to make sure that we are targetting the correct core. If we look in /sys/class/remoteproc*, we can find the names of the cores. For example:

    phyboard-lyra-am62xx-3:~# cat /sys/class/remoteproc/remoteproc0/name
    

    This should output 5000000.m4fss, which tells us that remoteproc0 targets the M4 core.

  • Stop the core:

    phyboard-lyra-am62xx-3:~# echo stop > /sys/class/remoteproc/remoteproc0/state
    
  • Now you can copy your binary over to the target (we recommend using scp), then link it to the existing firmware file.

    phyboard-lyra-am62xx-3:~# ln -sf /am62-mcu-m4f0_0-fw /lib/firmware/am62-mcu-m4f0_0-fw
    
  • Now we can start the core:

    phyboard-lyra-am62xx-3:~# echo start > /sys/class/remoteproc/remoteproc0/state
    

Now your MCU Program should be running.

For technical support, please visit PHYTEC’s Support Portal!