This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM6412: SysConfig (1.8.1+1900) - LED Driver Code generation issue

Part Number: AM6412
Other Parts Discussed in Thread: SYSCONFIG

Not sure if anyone use LED driver functions generated from SysConfig tool. If you have multiple LEDs defined, beware of the configuration issue as described below in ti_board_open_close.c:

/*
 * LED
 */
/* LED specific includes */
#include <board/led/led_gpio.h>
#include <board/led/led_gpio.h>

/* LED Object - initalized during LED_open() */
LED_Object gLedObject_GPIO;
/* LED Object - initalized during LED_open() */
LED_Object gLedObject_GPIO;

/* LED Driver handles - opened during Board_ledOpen() */
LED_Handle gLedHandle[CONFIG_LED_NUM_INSTANCES];

/* LED Config */
LED_Config gLedConfig[CONFIG_LED_NUM_INSTANCES] =
{
    {
        .attrs = &gLedAttrs_GPIO,
        .fxns = &gLedFxns_GPIO,
        .object = (void *)&gLedObject_GPIO,
    },
    {
        .attrs = &gLedAttrs_GPIO,
        .fxns = &gLedFxns_GPIO,
        .object = (void *)&gLedObject_GPIO,
    },
};

In the code snip above, two LED objects defined (line 9 and line 11 with same name) and attached to the gLedConfig[], lines 22 and 27.

These should have been different LED_Objects (or an array of) Now, the last LED configuration (gpio base, gpio pin ...) in the array list overwrites all other LED configuration (uses same object).

All reference to any LEDs defined will all comes down to the same gpio pin!