Config Tools -> Routed Pins

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

Config Tools -> Routed Pins

2,145 Views
naga
Contributor III

MCUXpresso IDE v11.1. 0 (2019-12-12)

Hi,

In the MCUXpresso IDE -> Config Tool-> Routed Pins -> GPIO interrupt, there are the following variants:
- Disabled
- Low Level
- High Level
- Rising Edge
- Falling Edge
- Falling or Rising Edge
- Reset (Disabled)
- No init

By setting one of the variants, for example "Rising Edge", the interrupt is implicitly enabled.

The way in which an interrupt is activated and the activation / deactivation of an interrupt are two distinct things and thus they must be treated separately in this configuration interface.

At program initialization, immediately after reset, the pins are fully configured but it is very possible to enable the interrupt to be made later in the program.

Thus the "GPIO interrupt" option needs to be replaced with two other options:
- "Interrupt Config": Low / Hi Level / Rising / Falling Edge.....
- "Interrupt Mask": Enable / Disable

This will give you natural flexibility in this case.

Neculai Agavriloaie

ACK Fluid srl

naga@ack.ro

Labels (1)
0 Kudos
Reply
4 Replies

1,987 Views
naga
Contributor III

MCUXpresso IDE v11.1. 0 (2019-12-12)

Hi,

Another shortcoming is configuring FreeRTOS drivers using Config Tools.

For example, Config Tools highly resolves the configuration of an I2C interface by generating the following source code:

void LPI2C1_init(void) {
  LPI2C_MasterInit(LPI2C1_PERIPHERAL, &LPI2C1_masterConfig, LPI2C1_CLOCK_FREQ);
  LPI2C_MasterTransferCreateHandle(LPI2C1_PERIPHERAL, &LPI2C1_masterHandle, NULL, NULL);
}

If you want to use the I2C driver in FreeRTOS, Config Tools must generate the following source code along with all those necessary for the proper functioning of the interrupts:

void LPI2C1_init(void) {
LPI2C_RTOS_Init(&lpi2c_rtos_handle, LPI2C1_PERIPHERAL, &LPI2C1_masterConfig, LPI2C1_CLOCK_FREQ);‍‍‍
}

To put it simply, Config Tools does not have the ability to generate source code for drivers (I2C, SPI, UART ...) that work in FreeRTOS (although in the initial configuration of a project FreeRTOS drivers can be included !).

Please keep in mind that in a future version you should include this option which is indispensable in creating a professional source code.

Regards,

Neculai naga@ack.ro

0 Kudos
Reply

1,987 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Neculai,

Hope you are doing well. Could you please share the screenshot of the option you are referring to in the Configtools. I have attempted to follow as per your instructions but I do not get a drop down menu for the GPIO interrupt. Also could you please confirm the microcontroller you are using and if you are initializing with an example.

Best Regards,

Sabina

0 Kudos
Reply

1,987 Views
naga
Contributor III

Hi,

The microcontroller used is the iMX RT1064 using the MIMXRT1064-EVK board.

As you can see in the screenshot the pin named NXPNCI_IRQ has the property GPIO interrupt = "Rising Edge".

MCUX.png

The code generated in this case as can be seen in the image is as follows:

/* GPIO configuration of NXPNCI_IRQ on GPIO_AD_B0_03 (pin G11) */
gpio_pin_config_t NXPNCI_IRQ_config = {
.direction = kGPIO_DigitalInput,
.outputLogic = 0U,
.interruptMode = kGPIO_IntRisingEdge
};
/* Initialize GPIO functionality on GPIO_AD_B0_03 (pin G11) */
GPIO_PinInit(GPIO1, 3U, &NXPNCI_IRQ_config);
/* Enable GPIO pin interrupt on GPIO_AD_B0_03 (pin G11) */
GPIO_PortEnableInterrupts(GPIO1, 1U << 3U);

A separate treatment of the two distinct properties is required, namely:
1. The way in which an interruption occurs refers to the registers; ICR1, ICR2 and EDGE_SEL
2. The masking of an interruption refers to the IMR register.

These two properties of a pin need to be set independently and this should be reflected in the generated code.

Thus the "GPIO interrupt" option needs to be replaced with two other options:

1. "Interrupt Config": Low / Hi Level / Rising / Falling Edge.....

generated code: GPIO_PinInit(GPIO1, 3U, &NXPNCI_IRQ_config);


2. "Interrupt Mask": Enable / Disable

generated code: GPIO_PortEnableInterrupts(GPIO1, 1U << 3U);  // for "Enable"

                                                                                                         // Clear mask bit for "Disable" 

Best regards,

Neculai

0 Kudos
Reply

1,987 Views
Lukas_Heczko
NXP Employee
NXP Employee

Hi Neculai,

thank you for your feedback. The pin interrupt control interface in Pins tool for i.MX RT processor is actually reused from previous platforms (Kinetis, LPC) where the GPIO interrupt could be only either configured or disabled (i.e. there is only single bitfield / SDK function to set it up). However, you are right that this approach does not fully cover possibilities of GPIO on i.MX RT processors.

We will look on how to split the functionality for the i.MX RT GPIO interrupt settings in next version of MCUXpresso Config Tools.

Regards,

Lukas