Hi,
I have been trying to just set/reset a gpio on a verdin development board with imx8mplus on it. I have the linux disabled and i can see the command prompt with uboot on it through putty.
Just to give you a background:
I want to run a simple baremetal code on cortex-M7 on the verdin development board with imx8mplus som.
-
I downloaded the SDK from NXP namely SDK_2.x_MIMX8ML8xxxKZ since that is the only one i found for imx8mplus on nxp website.
-
I am running this on visual studio with xpresso extension on it.
-
I created an example project from NXP (evkmimx8mp_igpio_led_output_cm7).
-
I modified the pin_mux.c to set the appropriate pinmux and pinconfig.
- I have tried couple of gpios like sodimm141,206 etc but none of them worked.
- Taking sodimm141 as example, i modified the pin_mux.c as this
- IOMUXC_SetPinMux(IOMUXC_SD1_DATA5_GPIO2_IO07, 0U);
- IOMUXC_SetPinConfig(IOMUXC_SD1_DATA5_GPIO2_IO07, 0x0170);
- I also modified the app.h for the respective GPIO
- #define EXAMPLE_LED_GPIO GPIO2
- #define EXAMPLE_LED_GPIO_PIN 7U
- changed the gpio_led_output.c to make a constant write of 0 or 1 but i couldnt see it changing.
-
int main(void)
{
/* Define the init structure for the output LED pin*/
gpio_pin_config_t led_config = {kGPIO_DigitalOutput, 0, kGPIO_NoIntmode};
/* Board pin, clock, debug console init */
BOARD_InitHardware();
/* Init output LED GPIO. */
GPIO_PinInit(EXAMPLE_LED_GPIO, EXAMPLE_LED_GPIO_PIN, &led_config);
while(true)
{
GPIO_PinWrite(EXAMPLE_LED_GPIO, EXAMPLE_LED_GPIO_PIN, 1U);
}
}
-
I checked that the clocks are enabled (GPIO_Clocks are called by gate enable which i think enables clocks for all the gpios)
- (void)CLOCK_EnableClock(s_gpioClock[instance]); in fsl_gpio.c
-
Then i build the project under vscode with xpresso extension.
-
-
For loading the igpio_led_output.bin i am using tftpd64 program that i installed and did the following to run the code.- assigned a static ip address 192.168.1.10
- opened tftpd64 and opened 192.168.1.10 in the server interfaces and pointed the directory to the place where i have igpio_led_output.bin
- In the putty terminal i did the following :
- setenv ipaddr 192.168.1.20
- setenv serverip 192.168.1.10
- tftp 0x91000000 igpio_led_output.bin
- go 0x91000000
- reboot happens but i cant see the gpio being set. ( i measuring the pin sodimm141 from multimeter.)
- Like i mentioned i tried on various gpios but no success.
- I would really appreciate if you could help me here.
- Thanks.
