Pin Assigment Tool Bugged For GPIOs

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

Pin Assigment Tool Bugged For GPIOs

1,234 Views
c_nebe
Contributor II

When I use the pin tool and assign GPIO pins the generated code incorrectly assigns the PORT macro to the initialization code instead of the GPIO macro:

expected 'GPIO_Type *' but argument is of type 'PORT_Type *'
hal_gpio_pin_config_t createAdapterGpioPinConfig(GPIO_Type *port, uint8_t pin, hal_gpio_direction_t direction, uint8_t level)

e.g in my pin_mux.h:

/* Symbols to be used with GPIO driver */
#define BOARD_INITPINS_LCD_BL_GPIO GPIOA /*!<@brief GPIO peripheral base pointer */
#define BOARD_INITPINS_LCD_BL_INIT_GPIO_VALUE 1U /*!<@brief GPIO output initial state */
#define BOARD_INITPINS_LCD_BL_GPIO_PIN_MASK (1U << 17U) /*!<@brief GPIO pin mask */

/* Symbols to be used with PORT driver */

#define BOARD_INITPINS_LCD_BL_PORT PORTA /*!<@brief PORT peripheral base pointer */
#define BOARD_INITPINS_LCD_BL_PIN 17U /*!<@brief PORT pin number */
#define BOARD_INITPINS_LCD_BL_PIN_MASK (1U << 17U) /*!<@brief PORT pin mask */



Then in peripherals.c

gpioPinConfig = createAdapterGpioPinConfig(BOARD_INITPINS_LCD_BL_PORT, BOARD_INITPINS_LCD_BL_PIN, BOARD_INITPINS_LCD_BL_PIN_DIRECTION, BOARD_INITPINS_LCD_BL_PIN_LEVEL);

I need to change to:

gpioPinConfig = createAdapterGpioPinConfig(BOARD_INITPINS_LCD_BL_GPIO, BOARD_INITPINS_LCD_BL_PIN, BOARD_INITPINS_LCD_BL_PIN_DIRECTION, BOARD_INITPINS_LCD_BL_PIN_LEVEL);


This requires a manual edit of the peripherals.c code every time I make a change to the configuration. Is there any way to fix this permanently?

Target Processor: MCXW71

Labels (1)
Tags (1)
0 Kudos
Reply
1 Reply

1,212 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @c_nebe 

I tested it on my end.

Snipaste_2026-04-15_12-25-10.png

/* Get GPIO pin configuration */
hal_gpio_pin_config_t createAdapterGpioPinConfig(GPIO_Type *port, uint8_t pin, hal_gpio_direction_t direction, uint8_t level){
  hal_gpio_pin_config_t temp;

The generated code is correct.

 

Snipaste_2026-04-15_12-25-10.png

 

How can i reproduce this issue?

BR

Harry

0 Kudos
Reply