Hi,
I’m creating a firmware for the Cortex-M4 and for every GPIO I need to use, it takes some steps:
-
Follow the pin in the connector to the SODIMM using the schematic.
-
Find in the Toradex Tool the name of the PAD associated to that module pin
-
Find in the Reference Manual which is the name of the registers and which gpio and pin it is associated.
After that I can define, using the same struct defined in the examples this:
// SODIMM BALL NAME GPIO ALT
// 79 ECSPI1_MISO GPIO04_18 5
gpio_config_t gpioX20_37 = {
“SODIMM 79”, // name (X20.37 on Aster)
&IOMUXC_SW_MUX_CTL_PAD_ECSPI1_MISO, // muxReg
5, // muxConfig
&IOMUXC_SW_PAD_CTL_PAD_ECSPI1_MISO, // padReg
IOMUXC_SW_PAD_CTL_PAD_ECSPI1_MISO_PS(2) | // padConfig
IOMUXC_SW_PAD_CTL_PAD_ECSPI1_MISO_PE_MASK |
IOMUXC_SW_PAD_CTL_PAD_ECSPI1_MISO_HYS_MASK,
GPIO4, // base
18 // pin
};
It takes a while for every pin.
So, I was wondering if Toradex already have this or something similar defined somewhere.
Maybe an include for each module.
Thanks, Mauricio Scaff
Hi @mscaff!
I think you could refer to the pinfunc include. For the iMX7, you would find it inside the Linux kernel sources at arch/arm/boot/dts/imx7d-pinfunc.h
.
This is a list of all SoC pads with their possible functions.
Hi, Gustavo.
It helps but not much.
From that file I can only guess what are the real register names (defined in MCIMX7D_M4.h) and more important I still do not have a link between the PAD name and the Module pin.
I still have to use the toradex app just to check which pin form the module goes to which pin from the SOC.
Best regards, Mauricio
hi @mscaff
This is true. For the PAD name of the corresponding Module Pin, you can look in the datasheet or as you are already doing use the gpio_tool.
For your gpio definitions, AFAIK there is no other simple way to do this. In Linux, there is this C Library called libsoc, which can be used to interface with common peripheral of SOC. Something similar does not exist for Cortex-M4.
Best regards,
Jaski
That is unfortunate.
Something that Toradex, could easy provide using a few hours of a trainee, since it is the only one having access to the module schematics,
Thanks, Mauricio
You don’t need to have module schematic for this task. All information about relations between X1 pins and iMX7 Ball names provided at Table 4.4.1 (page 20) of Colibti iMX7 datasheet - https://docs.toradex.com/103125-colibri-arm-som-imx7-datasheet.pdf