M4 Control Tool for i.MX platforms
This application is an example of controlling M4 core from A core: stop, start, deploy a new firmware for M4 into TCM. Depending on the used platform, the application can be only user space or to have a light component in kernel space and one in user space.
Supported platforms: i.mx8qm and i.mx8qxp
2. Build Instructions
For i.mx8, it is needed to build the kernel module and user space application.
2.1 Setup the environment:
# Path to kernel building directory. It recommended to point directly to the built kernel from Yocto.
# Path to the used cross-compiler
# Build the application and kernel module
For i.mx6 and i.mx7, it is needed to build only the user space application.
2.1 Setup environment:
# Initialize the environment by sourcing an environment setup script from yocto toolchain generated for desired platform
# Export SOC variable for the desired platform
# Build the application
3. Run instructions
# Instructions for i.mx8 platform
Note: 1. This application assumes that the M4 apps are compiled for TCM in order to be in sync with MCU SDK release (SDK_2.2_VAL-MIMX8QM_M4). If other memories are needed for M4 app, please update these macros from include/m4ctrl.h. Please note that some memories will likely need to be reserved from Linux dtb in order to be excluded from the memory used by linux. 2. hello_world app for M4 was used for testing.
3.1 Insert the kernel module
3.2 Run the app:
Examples - i.mx8QM
root@imx8qmlpddr4arm2:~# ./m4ctrl --deploy=./m4_image_c0.bin --core=0
root@imx8qmlpddr4arm2:~# ./m4ctrl --stop --core=0
root@imx8qmlpddr4arm2:~# ./m4ctrl --start --core=0
root@imx8qmlpddr4arm2:~# ./m4ctrl --deploy=./m4_image_c1.bin --core=1
root@imx8qmlpddr4arm2:~# ./m4ctrl --stop --core=1
root@imx8qmlpddr4arm2:~# ./m4ctrl --start --core=1
# Instructions for i.mx6 and i.mx7 platforms
Note: 1. This application assumes that the M4 apps are compiled for TCM and the cortex M4 is started from uboot. 2. hello_world app for M4 was used for testing.
3.1 Run the app:
Examples: - i.mx6sx
=> run m4boot
root@imx6sxsabresd:~# ./m4ctrl --deploy=hello_world.bin
4. Known limitations:
- Cortex M4 should be started from u-boot on imx6 and imx7 platforms.
- Due to known hardware TLB issue, sometimes the application will block on IMX8QM.