Pin Assigment Tool Bugged For GPIOs

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

Pin Assigment Tool Bugged For GPIOs

872 Views
cnebe-autopac
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

850 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @cnebe-autopac 

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
%3CLINGO-SUB%20id%3D%22lingo-sub-2351026%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EPin%20Assigment%20Tool%20Bugged%20For%20GPIOs%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2351026%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EWhen%20I%20use%20the%20pin%20tool%20and%20assign%20GPIO%20pins%20the%20generated%20code%20incorrectly%20assigns%20the%20PORT%20macro%20to%20the%20initialization%20code%20instead%20of%20the%20GPIO%20macro%3A%3C%2FP%3E%3CDIV%3E%3CPRE%3Eexpected%20'GPIO_Type%20*'%20but%20argument%20is%20of%20type%20'PORT_Type%20*'%3CBR%20%2F%3Ehal_gpio_pin_config_t%20createAdapterGpioPinConfig(GPIO_Type%20*port%2C%20uint8_t%20pin%2C%20hal_gpio_direction_t%20direction%2C%20uint8_t%20level)%3C%2FPRE%3E%3CP%3Ee.g%20in%20my%20pin_mux.h%3A%3C%2FP%3E%3CDIV%3E%3CPRE%3E%3CFONT%20size%3D%222%22%3E%2F*%20Symbols%20to%20be%20used%20with%20GPIO%20driver%20*%2F%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%3E%23define%20BOARD_INITPINS_LCD_BL_GPIO%20GPIOA%20%2F*!%26lt%3B%40brief%20GPIO%20peripheral%20base%20pointer%20*%2F%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%3E%23define%20BOARD_INITPINS_LCD_BL_INIT_GPIO_VALUE%201U%20%2F*!%26lt%3B%40brief%20GPIO%20output%20initial%20state%20*%2F%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%3E%23define%20BOARD_INITPINS_LCD_BL_GPIO_PIN_MASK%20(1U%20%26lt%3B%26lt%3B%2017U)%20%2F*!%26lt%3B%40brief%20GPIO%20pin%20mask%20*%2F%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%3E%3CBR%20%2F%3E%2F*%20Symbols%20to%20be%20used%20with%20PORT%20driver%20*%2F%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%3E%23define%20BOARD_INITPINS_LCD_BL_PORT%20PORTA%20%2F*!%26lt%3B%40brief%20PORT%20peripheral%20base%20pointer%20*%2F%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%3E%23define%20BOARD_INITPINS_LCD_BL_PIN%2017U%20%2F*!%26lt%3B%40brief%20PORT%20pin%20number%20*%2F%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%3E%23define%20BOARD_INITPINS_LCD_BL_PIN_MASK%20(1U%20%26lt%3B%26lt%3B%2017U)%20%2F*!%26lt%3B%40brief%20PORT%20pin%20mask%20*%2F%3C%2FFONT%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3EThen%20in%20peripherals.c%3C%2FP%3E%3CDIV%3E%3CPRE%3EgpioPinConfig%20%3D%20createAdapterGpioPinConfig(%3CSTRONG%3EBOARD_INITPINS_LCD_BL_PORT%3C%2FSTRONG%3E%2C%20BOARD_INITPINS_LCD_BL_PIN%2C%20BOARD_INITPINS_LCD_BL_PIN_DIRECTION%2C%20BOARD_INITPINS_LCD_BL_PIN_LEVEL)%3B%3C%2FPRE%3E%3CP%3EI%20need%20to%20change%20to%3A%3C%2FP%3E%3CPRE%3EgpioPinConfig%20%3D%20createAdapterGpioPinConfig(%3CSTRONG%3EBOARD_INITPINS_LCD_BL_GPIO%3C%2FSTRONG%3E%2C%20BOARD_INITPINS_LCD_BL_PIN%2C%20BOARD_INITPINS_LCD_BL_PIN_DIRECTION%2C%20BOARD_INITPINS_LCD_BL_PIN_LEVEL)%3B%3C%2FPRE%3E%3C%2FDIV%3E%3CP%3E%3CBR%20%2F%3EThis%20requires%20a%20manual%20edit%20of%20the%20peripherals.c%20code%20every%20time%20I%20make%20a%20change%20to%20the%20configuration.%20Is%20there%20any%20way%20to%20fix%20this%20permanently%3F%3CBR%20%2F%3E%3CBR%20%2F%3ETarget%20Processor%3A%20MCXW71%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2351026%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EPackage%20and%20IO%7CGPIO%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2351108%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Pin%20Assigment%20Tool%20Bugged%20For%20GPIOs%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2351108%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F257898%22%20target%3D%22_blank%22%3E%40cnebe-autopac%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20tested%20it%20on%20my%20end.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Snipaste_2026-04-15_12-25-10.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Snipaste_2026-04-15_12-25-10.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F382384i66CB387E559549DF%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Snipaste_2026-04-15_12-25-10.png%22%20alt%3D%22Snipaste_2026-04-15_12-25-10.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%2F*%20Get%20GPIO%20pin%20configuration%20*%2F%0Ahal_gpio_pin_config_t%20createAdapterGpioPinConfig(GPIO_Type%20*port%2C%20uint8_t%20pin%2C%20hal_gpio_direction_t%20direction%2C%20uint8_t%20level)%7B%0A%20%20hal_gpio_pin_config_t%20temp%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EThe%20generated%20code%20is%20correct.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Snipaste_2026-04-15_12-25-10.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Snipaste_2026-04-15_12-25-10.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F382385i1F09589ED3EFE9A4%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Snipaste_2026-04-15_12-25-10.png%22%20alt%3D%22Snipaste_2026-04-15_12-25-10.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EHow%20can%20i%20reproduce%20this%20issue%3F%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EHarry%3C%2FP%3E%3C%2FLINGO-BODY%3E