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.

SK-AM62A-LP: Running GPIO issue with Microsar Stack

Part Number: SK-AM62A-LP

Tool/software:

Hello,

I am working on the microsar autosar stack from vector and created an initial project to run the gpios. I have used one of the led blink examples as reference for the gpio initialiazation. The code snippet looks as follows -

Initially called the System_init() from the ti_drivers_config.c

void System_init(void)
{
/* DPL init sets up address transalation unit, on some CPUs this is needed
* to access SCICLIENT services, hence this needs to happen first
*/
Dpl_init();
/* We should do sciclient init before we enable power and clock to the peripherals */
/* SCICLIENT init */
{
int32_t retVal = SystemP_SUCCESS;

retVal = Sciclient_init(CSL_CORE_ID_MCU_R5FSS0_0);
DebugP_assertNoLog(SystemP_SUCCESS == retVal);

}
PowerClock_init();
/* Now we can do pinmux */
Pinmux_init();
/* finally we initialize all peripheral drivers */
Drivers_uartInit();

GPIO_init();

}

void GPIO_init()
{
uint32_t baseAddr;

/* Instance 0 */
/* Get address after translation translate */
baseAddr = (uint32_t) AddrTranslateP_getLocalAddr(GPIO_LED_BASE_ADDR);
GPIO_pinWriteLow(baseAddr, GPIO_LED_PIN);

GPIO_setDirMode(baseAddr, GPIO_LED_PIN, GPIO_LED_DIR);
}

after this, for turning the LED on i do the following -

gpioBaseAddr = (uint32) AddrTranslateP_getLocalAddr(GPIO_LED_BASE_ADDR);

pinNum = GPIO_LED_PIN;

GPIO_setDirMode(gpioBaseAddr, pinNum, 0);
GPIO_pinWriteHigh(gpioBaseAddr, pinNum);

This does not work all the time but surprisingly works sometimes, could it be a compiler/optimization/linker issue or am i missing certain compiler flags/project settings ? 

On debugging i see the gpio.h file and variable windows as follows, that "the variable is not available" which cannot be seen in the case of the led example. Also single stepping works but breakpoints do not work - 

    

Is this because of missing compiler/linker settings ? or any other settings in general, as certain modules such as the gpio module are located in the mcu+sdk 

Thanks and best regards,

Nikhil