Running the Firmware
This section provides instructions for running your MCU firmware alongside Linux, either by integrating it with Yocto or manually running it on the target system.
Note
This section requires the firmware to be compiled using the Release target. To do this, click the arrow next to the hammer icon in the toolbar and select Release. Then, click the hammer icon again to rebuild the firmware with the correct target.
Yocto Integration
You can integrate your MCU domain program into the Yocto build system to run automatically alongside Linux at startup. Follow the steps below to add your own firmware to the image.
The recipe to include the MCU program is located at:
meta-ampliphy/recipes-examples/phytec-mcu-plus-sdk-firmware_git/mcu-plus-sdk-firmware_git.bb
To use your own firmware repository, modify the following:
Update the SRC_URI variable to point to your repository.
Include the appropriate license file.
Update the SRCREV variable to the correct commit hash from your repository.
Modify the install -m command for the AM62x to ensure the source path matches the location of your binary in the firmware repository.
Note
The install destination must remain unchanged. The remoteproc driver looks for the file am62-mcu-m4f0_0-fw as the program to run on the MCU domain.
Once these steps are completed, you can build the image. Your MCU domain program will run alongside Linux at startup.
Running Firmware Without Yocto
If you prefer to test your firmware without rebuilding the entire image, you can manually run it by copying the binary to the target system and starting it through the remoteproc interface.
Step 1: Verify the Target Core
Before running the firmware, confirm that the correct core is targeted. You can check the core name by running:
phyboard-lyra-am62xx-3:~# cat /sys/class/remoteproc/remoteproc0/name
This should output something like 5000000.m4fss, indicating that remoteproc0 targets the M4F core.
Note
The remoteproc interfaces are enumerated based on the order in which they are probed. As a result, the M4F core might be listed under a different number, such as remoteproc1.
Step 2: Stop the Core
To stop the M4F core, run the following command:
phyboard-lyra-am62xx-3:~# echo stop > /sys/class/remoteproc/remoteproc0/state
Step 3: Copy the Binary to the Target
Use scp (or any other file transfer method) to copy your binary to the target system.
Step 4: Link the Binary
Once the binary is on the target system, link it to the existing firmware file:
phyboard-lyra-am62xx-3:~# ln -sf /path/to/your/binary /lib/firmware/am62-mcu-m4f0_0-fw
Step 5: Start the Core
After linking the binary, start the core by running:
phyboard-lyra-am62xx-3:~# echo start > /sys/class/remoteproc/remoteproc0/state
Your MCU program should now be running on the target system.
Note
For any technical questions, feel free to reach out to PHYTEC’s Support Portal!