boards/nxp/frdm_imx91/doc/index.rst
.. zephyr:board:: frdm_imx91
Overview
The FRDM-IMX91 board is a low-cost and compact platform designed to show the most commonly used features of the i.MX 91 Applications Processor in a small and low cost package. The FRDM-IMX91 board is an entry-level development board, which helps developers to get familiar with the processor before investing a large amount of resources in more specific designs.
Hardware
i.MX 91 applications processor
RAM: 2GB LPDDR4
Storage:
Wireless:
USB:
Ethernet:
PCIe:
Connectors:
LEDs:
Debug:
.. zephyr:board-supported-hw::
This board configuration uses a system clock frequency of 24 MHz. Cortex-A55 Core runs up to 1.4 GHz.
This board configuration uses a single serial communication channel with the CPU's UART1 for A55 core.
i.MX 91 processor has three ultra secured digital host controller (uSDHC) modules for SD/eMMC interface support. On the FRDM-IMX91 board, the uSDHC2 interface of the processor connects to the MicroSD card slot (P13), and uSDHC1 interface connects to the eMMC memory (located at the SOM board). DTS overlay file "usdhc1.overlay" and "usdhc2.overlay" are provided to enable specified the uSDHC controller.
Currently it rely on U-boot or Linux to boot Zephyr, so Zephyr need to use different uSDHC controller from U-boot or Linux to avoid resource conflict. For example, if FRDM-IMX91 board boots from SD Card which uses uSDHC2, Zephyr can use MMC which uses uSDHC1 for testing:
.. zephyr-app-commands:: :zephyr-app: tests/subsys/sd/mmc :host-os: unix :board: frdm_imx91/mimx9131 :goals: build :gen-args: -DEXTRA_DTC_OVERLAY_FILE=usdhc1.overlay
And if FRDM-IMX91 board boots from MMC which uses uSDHC1, Zephyr can use SD Card which uses uSDHC2 for testing:
.. zephyr-app-commands:: :zephyr-app: tests/subsys/sd/sdmmc :host-os: unix :board: frdm_imx91/mimx9131 :goals: build :gen-args: -DEXTRA_DTC_OVERLAY_FILE=usdhc2.overlay
The user buttons K2 is connected to onboard GPIO expander PCAL6524, use the following command to test user buttons:
.. zephyr-app-commands:: :zephyr-app: samples/basic/button :host-os: unix :board: frdm_imx91/mimx9131 :goals: build
Run the app, press and release K2 button, then the following log could be found on Zephyr console: .. code-block:: console
*** Booting Zephyr OS build v4.3.0-6943-gc384779e39ac ***
Press the button
Button 11 pressed at 3058829772
Button 11 released at 3064215344
Programming and Debugging
.. zephyr:board-supported-runners::
There are multiple methods to program and debug Zephyr
U-Boot "go" command is used to load and kick Zephyr to Cortex-A55 Core.
Stop the board at U-Boot command line, then need to download Zephyr binary image into DDR memory, it can use tftp:
.. code-block:: console
tftp 0x80000000 zephyr.bin
Or copy the Zephyr image zephyr.bin to SD card and plug the card into the board, for example
if copy the image to the FAT partition of the SD card, use the following U-Boot command to load
the image into DDR memory (assuming the SD card is dev 1, fat partition ID is 1, they could be
changed based on actual partitions):
.. code-block:: console
fatload mmc 1:1 0x80000000 zephyr.bin;
Then use U-Boot to load and kick zephyr.bin to Cortex-A55 Core:
.. code-block:: console
dcache off; icache flush; go 0x80000000
Use this configuration to run basic Zephyr applications and kernel tests,
for example, with the :zephyr:code-sample:synchronization sample:
.. zephyr-app-commands:: :zephyr-app: samples/synchronization :host-os: unix :board: frdm_imx91/mimx9131 :goals: build
This will build an image with the synchronization sample app, boot it and display the following console output:
.. code-block:: console
*** Booting Zephyr OS build v4.2.0-4272-g1cbd317fd85e ***
thread_a: Hello World from cpu 0 on frdm_imx91!
thread_b: Hello World from cpu 0 on frdm_imx91!
thread_a: Hello World from cpu 0 on frdm_imx91!
thread_b: Hello World from cpu 0 on frdm_imx91!
The default runner for the board is JLink runner, there is one SWD connector P14 on the FRDM-IMX91 board, connect P14 to J-Link debugger with Pin1 of P14 connect to SWDCLK, Pin2 of P14 connect to SWDIO, and Pin3 of P14 connect to GND, the VCC of J-Link debugger could connect to P1 of P12 connector.
Power up the board and stop the board at U-Boot command line.
Then use "west flash" command to load the zephyr.bin image from the host computer and start the Zephyr application on A55 core.
Here is an example for the :zephyr:code-sample:hello_world application.
.. zephyr-app-commands:: :zephyr-app: samples/hello_world :host-os: unix :board: frdm_imx91/mimx9131 :goals: flash
Then the following log could be found on UART1 console:
.. code-block:: console
*** Booting Zephyr OS build v4.3.0-1976-g8f0df404c2ee ***
Hello World! frdm_imx91/mimx9131
Power up the board and stop the board at U-Boot command line.
Then use "west debug" command to load the zephyr.bin image from the host computer and debug the Zephyr application on A55 core.
Here is an example for the :zephyr:code-sample:hello_world application.
.. zephyr-app-commands:: :zephyr-app: samples/hello_world :host-os: unix :board: frdm_imx91/mimx9131 :goals: debug
SPSDK runner leverages SPSDK tools (https://spsdk.readthedocs.io), it builds an
bootable flash image flash.bin which includes all necessary firmware components.
Using west flash command will download the boot image flash.bin to DDR memory, SD card
or eMMC flash. By using flash.bin, as no U-Boot image is available, so TF-A will boot
up Zephyr on the Cortex-A55 Core directly.
In order to use SPSDK runner, it requires fetching binary blobs, which can be achieved by running the following command:
.. code-block:: console
west blobs fetch hal_nxp
.. note::
It is recommended running the command above after :file:west update.
SPSDK runner is enabled by configure item :kconfig:option:CONFIG_BOARD_NXP_SPSDK_IMAGE, currently
it is not enabled by default for FRDM-IMX91 board, so use this configuration to enable
it, for example, with the :zephyr:code-sample:synchronization sample:
.. zephyr-app-commands:: :zephyr-app: samples/synchronization :host-os: unix :board: frdm_imx91/mimx9131 :goals: build :gen-args: -DCONFIG_BOARD_NXP_SPSDK_IMAGE=y
If :kconfig:option:CONFIG_BOARD_NXP_SPSDK_IMAGE is available and enabled for the board variant,
flash.bin will be built automatically. The programming could be through below commands.
Before that, onboard switch SW1[3:0] should be configured to 0b0001 for USB download mode
to boot, and USB1 and DBG ports should be connected to Linux host PC. There are 2 serial ports
enumerated (115200 8n1), the first port will be used for Cortex-A55 Zephyr's Console.
(The flasher is spsdk which already installed via scripts/requirements.txt.
On Linux host, USB device permission should be configured per Installation Guide
of https://spsdk.readthedocs.io)
.. code-block:: none
$ west flash -r spsdk
$ west flash -r spsdk --bootdevice sd
$ west flash -r spsdk --bootdevice=emmc
Then the Zephyr log will be displayed in the first serial port's console.
.. include:: ../../common/board-footer.rst.inc