The i.MX7 processor comes equipped with 2x Arm Cortex-A7 cores as well as a Arm Cortex-M4 core. In this guide, we will modify the device tree to run in parallel with the FreeRTOS running on the M4 core. We will then demonstrate the A7 core's ability to communicate to the M4 core and cause it to effect a change on a GPIO signal. In order to follow this guide you will first need to download the demo tarball from Artifactory and extract the file rpmsg_gpio_toggle_freertos_example.bin.
- Create an additional terminal for UART2 on your host machine.
- Ensure this second Terminal is configured for 115200 baud, 8 bit data, no parity bit, 1 stop bit and no handshake. Note that UART1 should be connected as well and is the debug UART for Cortex-A7)
Using your host machine, navigate to the location of your rpmsg_gpio_toggle_freertos_example.bin file and copy it to the Boot partition of your SD card.
- Boot your i.MX7 from SD card and stop in U-boot. This is done by pressing any key within the first 3 seconds of the bootloader.
We will first reset U-Boot to the default environment:
Edit the environment to use the dtb designed to run in parallel with FreeRTOS on the M4:
- Once prompted, change "edit: oftree" to "edit: imx7d-phyboard-zeta-004-m4.dtb"
Save the environment and reset U-Boot:
Stop in U-boot again by pressing any key within the first 3 seconds of the bootloader.
If you miss the 3 second window let U-Boot finish loading the kernel, login as root, and enter the following to reboot:
Make sure you stop in U-Boot this time.
In U-Boot, type the following to load the application image from the SD card to TCM, flush any cached content, and start the M4 demo:
Now Boot into linux:
Once logged into Linux as root, load the kernel module to configure RPMSG on the Cortex-A7:
If you see the following output after loading the module, all is OK!
You can now echo content to /dev/ttyRPMSG0 and it will be received by the M4 and printed on the FreeRTOS serial console. To do this, enter the following:
You will notice that there is a typo in the demo output to the M4 console specifying /dev/ttyRPMSG as the correct device for communicating with the RTOS. This is because there was a change in driver initialization for the imx_rpmsg_tty kernel module for PD19.1.0. This is a known issue and is planned to be resolved in a new demo binary in the future.
Verify that the LED D1 on the PEB-D-RPI Expansion Board toggled and the following message was outputted to the FreeRTOS console: