Possible bug in pin configuration tool?

cancel
Showing results for 
Search instead for 
Did you mean: 

Possible bug in pin configuration tool?

279 Views
Contributor II

Hello all,

I've noticed what may be a bug in the pin configuration tool in mcuxpresso.

I've been using it with a '824. After selecting a pin to configure the lower panel generates default options for the pin. It looks to me that if some of the default values are not confirmed/ changed the correct code is not generated.

This may help others..

Labels (1)
5 Replies

152 Views
NXP Employee
NXP Employee

Hi Leo,

In case you are referring to the values that are shown with italic text after a pin/signal is added in Routed Pins tab, it indicates that the value is not configured and it shows the after-reset value and no code is generated, so the configuration relies on the after reset value or the values configured from the different functions.

In case you are observing different problem, can you please provide a bit more details so that we may try to reproduce it?

Thank you,

Lukas

152 Views
Contributor II

Thanks for the replies. It's fairly much as Lukas states but I'll try to explain a bit more in detail to confirm for others.

After selecting a new pin as Lukas states default values populate the lower panel. At this stage if the code is updated the code such as below is generated in the file pin_mux.c:

gpio_pin_config_t misc_config = {
        .pinDirection = kGPIO_DigitalOutput,
        .outputLogic = 0U,
    };
    /* Initialize GPIO functionality on pin PIO0_0 (pin 19)  */
    GPIO_PinInit(BOARD_INITPINS_misc_GPIO, BOARD_INITPINS_misc_PORT, BOARD_INITPINS_misc_PIN, &misc_config);

But it's only after after all default values in the lower panel are changed/ confirmed that the code below is generated:

const uint32_t misc = (/* Selects pull-up function */
                           IOCON_PIO_MODE_PULLUP |
                           /* Disable hysteresis */
                           IOCON_PIO_HYS_DI |
                           /* Input not invert */
                           IOCON_PIO_INV_DI |
                           /* Disables Open-drain function */
                           IOCON_PIO_OD_DI |
                           /* Bypass input filter */
                           IOCON_PIO_SMODE_BYPASS |
                           /* IOCONCLKDIV0 */
                           IOCON_PIO_CLKDIV0);
    /* PIO0 PIN0 (coords: 19) is configured as GPIO, PIO0, 0. */
    IOCON_PinMuxSet(IOCON, IOCON_INDEX_PIO0_0, misc);

It might not be clear to others but it seems to me that the code is only fully generated when all the default values are changed/ confirmed, so although a GPIO might be set as an output it won't be programmed as one until all the rest of the values (even though they may be acceptable) are changed/ confirmed.

Hope this helps,

Leo

0 Kudos

152 Views
NXP Employee
NXP Employee

Hi, 

I agree that it may be confusing that the code is different. It's determined by the limitations of the SDK library that does not provide all possible options of initialization. If it's possible, the Pins tool generated call to the GPIO_PinInit or other SDK functions. If there is selected some option which is not covered by this function, the tool generates direct writes to the registers.

However, at the end of this function, the result should be the same and the pin initialized according to the settings.

best regards

Petr Hradsky  

0 Kudos

152 Views
NXP Employee
NXP Employee

Hi Leo,

I tried to change pull resistor on the same pin:

* by default, reset value (PullUp) is selected and no code is generated

* if I select "PullDown", the code is generated

* if I select "PullUp", the code is generated

* if I select "Reset (PullUp)", no code is generated again

I believe this works well: by default no extra code is generated and you can see after reset valued (in GUI are displayed using italic font). After you select any value, the code starts to be generated. 

Note: generated code can be easily reviewed in Code Preview window. The code on the disk is updated after you press "Update Code" button.

Regards,

Marek

Regards,
Marek
0 Kudos

152 Views
NXP Employee
NXP Employee

Hi leo838,

can you provide more details? What pins and what values are not correct?

Regards

Marek

Regards,
Marek
0 Kudos