Free GPIOS with NXP i.MX 8M Plus on PICO Core

  • Hi, we will use the Pico Core with the

    • NXP i.MX 8M Plus.


    • I am not sure, how many general GPIO's are available for my on this Modul. The Controller is new for me and my understanding up to know is, that the NXP offers 32 GPIOS. But I am not sure the Modul offers all these and no of them is internal used on the Modul. Does someone can give me a answer.

  • Apart from differential signals like USB, MIPI or LVDS, almost all signals of the CPU are multiplexed. So they can serve different purposes. And one of these purposes is GPIO. Other functions depend on the pin. In most cases we use a dedicated function as default. But if you do not need this function, you can use these pins as GPIOs. So for example if you do not need the third or fourth UART port, then you can use these pins as GPIOs instead. Or if you do not need SPI or I2C, then these pins can suit as GPIOs. So the number of GPIOs depends on what other functions you actually need.


    Some pins are already defined as GPIOs by us. For example we always provide one or two additional signals in addition to the basic I2C or SPI signals to serve as reset or interrupt. These pins can of course be used as GPIOs, too. Pins 44, 46, 52, 54 are examples for such pins. They are probably the best candidates for your own GPIOs to start with.


    Configuration is basically done in the Device Tree. The device tree tells Linux, what devices there are and which pins to use for them. Our default device tree defines all the interfaces that you can see in the hardware documentation. If you do not need some interface or device, then the basic idea is to simply remove those entries from the device tree and configure those pins for GPIOs. For most devices we have already prepared a CONFIG macro that does exactly this. All these macros are defined at the beginning of the device tree. If you don't need a device, simply add two slashes in front of the #define to comment it out. This will disable the device and in most cases, the pins will then automatically fall back to the GPIO setting, which is the default at reset time of the CPU.


    Let's do a specific example.


    I2C_C provides two signals on pins 40 and 42 of the PicoCore-Connector. You do not need I2C_C and want to use these pins as GPIOs instead. So you edit the device tree file, which is


    arch/arm64/boot/dts/F+S/picocoremx8mp.dts


    You'll find the following macros near the beginning of the file

    Code
    1. /* I2C */
    2. /* default CAN_B */
    3. #define CONFIG_PICOCOREMX8MP_I2C_A
    4. #define CONFIG_PICOCOREMX8MP_I2C_B
    5. #define CONFIG_PICOCOREMX8MP_I2C_C
    6. #define CONFIG_PICOCOREMX8MP_I2C_D
    7. #define CONFIG_PICOCOREMX8MP_I2C_E
    8. //#define CONFIG_PICOCOREMX8MP_I2C_D_A71CH

    Change the line for I2C_C to:

    Code
    1. //#define CONFIG_PICOCOREMX8MP_I2C_C

    Then save the file, rebuild the device tree and store the new device tree on the board. How this is done is shown in the document "Linux on F&S Boards". Now you can use these two pins as GPIOs. The GPIO Reference Card shows, that they are GPIOs number 136 and 137.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Thank you very much for your comments.


    Now I want to put my board into operation, but I cannot find the readme.txt or the first steps document.

    I also cannot see which module is installed on the starter kit. (Code 00055116FF30) (starterkit:FFFFFF177A0B)


    Can you give me a link to it?

  • Documentation is available on our Website. Go to "Products" -> "PicoCore" and select the PIcoCoreMX8MP. Then click on the tab "Documents". You can use the serial number to unlock the software section for this board. This will be in "Support" -> "My F&S" then.


    For the type of module, I expected that you have a PicoCoreMX8MP if you are posting in this subsection. The type of board will also be output on the serial debug port if you start U-Boot.


    If you are completely new to this type of environment with Linux on an embedded board, then you might consider booking our Linux Workshop. There you will be shown everything to get started with your system.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.