GPIO init issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GPIO init issue

1,403 Views
farid_mabrouk
Contributor II

I found out that adding the line if code below to this function BOARD_InitPins(), makes my program fail. And while I try to debug I get this error message: please see attached.


      IOMUXC_SetPinMux(
           IOMUXC_GPIO_EMC_39_GPIO8_IO25,        /* GPIO_EMC_39 is configured as GPIO3_IO25 */
          0U);

Any clue why this is happening?

Labels (1)
0 Kudos
8 Replies

1,215 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Andre,

 

Looks like you are using the incorrect macro. Please use IOMUXC_GPIO_EMC_39_GPIO3_IO25 instead of IOMUXC_GPIO_EMC_39_GPIO8_IO25.

 

Best regards,

Felipe

0 Kudos

1,215 Views
farid_mabrouk
Contributor II

Thank you for your reply.

I tried adding the line of my code below again to my project and still makes me get the same error as I did before:

IOMUXC_SetPinMux(
           IOMUXC_GPIO_EMC_39_GPIO3_IO25,        /* GPIO_EMC_39 is configured as GPIO3_IO25 */
          0U);

 I tried adding this line of code also to all the sample projects that comes with the MCUXpresso, and they still fail giving me the same error. The only thing I am doing different here is that I am booting from the SDRAM and that pin is not used in my SDRAM interface.

Can anyone try to run any example code, and add the above line of code to the  BOARD_InitPins() function, and also try booting from SDRAM and see if you get same error as mine.

Thank you!

0 Kudos

1,215 Views
mitterha
Senior Contributor I

Hello Andre,

are you using the SDRAM configuration?

If I run the hello world project from internal RAM (in EWARM it's the debug configuration) everything works fine. If I switch to the sdram_debug configuration first I get the error message

An MPU or Execute Never (XN) default memory map access violation has occurred on an instruction fetch (CFSR.IACCVIOL, MMFAR).

I don't know which project and board you are using I just tried the hello world project for RT1050. I imported the evkbimxrt1050_sdram_ini_dcd.c file to MCUXpresso Config tools. If you take a look at the Device Configuration Data the GPIO_EMC_39 gets initialized

pastedImage_3.png

so maybe the SEMC controller needs the EMC_39 (in MCUXpresso Config Pins Tool the label is SEMC_DQS). Maybe that is your problem?

Kind regards,

Stefan

0 Kudos

1,215 Views
farid_mabrouk
Contributor II

I am using iMX RT1060. I just don't see that pin connected anywhere in my schematics to SDRAM. It configured to be an output GPIO. Anyone tech support comments?

0 Kudos

1,215 Views
FelipeGarcia
NXP Employee
NXP Employee

Did you initialize GPIO using GPIO_PinInit?

 

Regards,

Felipe

0 Kudos

1,215 Views
farid_mabrouk
Contributor II

Can anybody comment? Thank you!

0 Kudos

1,216 Views
mjbcswitzerland
Specialist V

Hi

Have you enabled clocks to GPIO3 (in CCM_CCGR2)?

Regards

Mark

[uTasker project developer for Kinetis and i.MX RT]

0 Kudos

1,216 Views
farid_mabrouk
Contributor II

Yes the GPIO3 Clock is enabled. I have other GPIOs on port3 that are toggling fine.

0 Kudos