.. include:: ../../substitutions.rst .. _MCUPlusRun-64: 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 :code:`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 :code:`SRC_URI`. You will also need to include the proper license file, and update the :code:`SRCREV` variable to the proper commit from your repo. * Now you can update the :code:`install -m` command for the am64xx 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 :code:`am64-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 :code:`/sys/class/remoteproc*`, we can find the names of the cores. For example: .. code-block:: console :substitutions: |target-prompt| cat /sys/class/remoteproc/remoteproc0/name This should output :code:`5000000.m4fss`, which tells us that remoteproc0 targets the M4 core. * Stop the core: .. code-block:: console :substitutions: |target-prompt| 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. .. code-block:: console :substitutions: |target-prompt| ln -sf /gpio_led_blink_phyboard-electra-am64xx_m4fss0-0_nortos_ti-arm-clang.out /lib/firmware/am64-mcu-m4f0_0-fw * Now we can start the core: **Target (Linux)** .. code-block:: console :substitutions: |target-prompt| echo start > /sys/class/remoteproc/remoteproc0/state Now your MCU Program should be running. For technical support, please visit `PHYTEC's Support Portal `_!