Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The following is a guide for running a FreeRTOS demo on the Cortex-M4. The demo showcases RPMsg communication between the Cortex-A7 (running Linux) and the Cortex-M4. In the demo, the Cortex-M4 receives and prints a message from Cortex-A7. It will toggle an LED if a certain message is received.

 

Targeted HardwarephyCORE-i.MX7, phyBOARD-Zeta i.MX7
Targeted Software
i.MX7

Cortex-M4: BSP FreeRTOS FSL iMX7 ALPHA1

Cortex-A7: BSP Yocto FSL iMX7 ALPHA2

Date
 

NXP FreeRTOS info

Demo: Send Command from Cortex-A7 (Linux) to Cortex-M4(FreeRTOS) to toggle GPIO

  

Running the Demo

Requirements

  • SD card formatted formated with sdcard image from ALPHA2 release. Instructions for formatting here.
  • Hardware set up as described in Getting Started section of Quickstart.
  • PEB-EVAL-02 module required. Demo uses LED1 and debug UART2 for the Cortex-M4

Step-by-step guide

  1. Download demo image from Artifactory Here and add to Boot partition of SD card.
  2. A different DTS file is required that configures memory allocation, enables rpmsg bus, and disables UART2 in Linux. Download the dtb and copy it to the boot partition as well.
  3. Connect a serial cable from UART2 RS232 DB-9 connector on the evaluation board to your host PC.
  4. In your preferred terminal software (such as Minicom or TeraTerm) on your host PC, configure an additional terminal for UART2 with 115200 baud, 8 data bits, no parity, and 1 stop bit (8n1) ,no handshake. Note that UART5 should be connected as well and is the debug UART for Cortex-A7) 
  5. Set the boot switch located on the underside of the board to boot from SD (See quickstart for more info).
  6. Power on the board. Press the power button if board doesn't automatically boot.
  7. Press any key to stop autoboot and enter U-Boot.
  8. In U-boot, edit the environment to boot imx7d-phyboard-zeta-m4.dtb. This DTS file configures memory allocation, enables rpmsg bus, and disables UART2 in Linux.

    Code Block
    => editenv fdt_file
    edit: imx7d-phyboard-zeta-m4.dtb
     
    => saveenv
    => reset
  9. In U-Boot, type the following to load the application image from the SD card to TCM, flush cached content, and start the M4 demo.

    Code Block
    => fatload mmc 0:1 0x7F8000 <demo name>
    rpmsg_gpio_toggle_freertos_example.bin
    => dcache flush
    => bootaux 0x7F8000
  10. You should see the following appear in the serial terminal connected to UART2:<picture>

    Code Block
    RPMSG GPIO Toggle FreeRTOS RTOS API Demo...
    Load module imx_rpmsg_tty in Linux to continue
    
    
    
  11. Now boot Linux on the Cortex-A7.

    Code Block
    => boot
  12. Type root to log in, and then load the kernel module imx_rpmsg_tty which will configure RPMSG on the A7.

    Code Block
     modprobe imx_rpmsg_tty
  13. You can now echo content to /dev/ttyRPMSG and it will be received by the M4 and printed on the FreeRTOS serial console.
  14. In order to toggle LED1 on the evaluation board, echo "led1" to /dev/ttyRPMSG:

    Code Block
    echo "led1" > /dev/ttyRPMSG

Demo Source Code

Download The FreeRTOS i.MX7 release from NXP.

Apply patch from Artifactory

release is based on NXP's FreeRTOS_BSP_1.0.1_iMX7D. PHYTEC's source can be found on stash.phytec.com. The demo is located at: examples/imx7d_phyboard_zeta/demo_apps/rpmsg/gpio_toggle_freertos/.

See NXP's Getting Started Guide located at doc/Getting_Started_with_FreeRTOS_BSP_for_i.MX_7Dual.pdf for instructions on building the demo with ARM GCC or DS-5.Note: Supports GCC cmake

Additional Info

NXP Documentation is located in the doc/ subdirectory of the source code. They provide extensive documentation on building and running demos, a reference manual, and information on NXP's implementation of RPMsg.