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.

AM5728: DSP LED blink example

Part Number: AM5728
Other Parts Discussed in Thread: SYSBIOS

Hi,

I am trying to run Led blink example on AM5728 DSP C66x . The application is loaded with the help of debugger. Since, I want to use the application as bare metal without any OS , I did not define the USE_BIOS macro. The GPIO_PinConfig for AM5728  is defined as

#define GPIO_USER0_LED_PORT_NUM                (0x07)

#define GPIO_USER0_LED_PIN_NUM                    (0x08)

#define GPIO_USER1_LED_PORT_NUM                (0x07)

#define GPIO_USER1_LED_PIN_NUM                    (0x09)

GPIO_PinConfig gpioPinConfigs[] = {

GPIO_DEVICE_CONFIG(GPIO_USER0_LED_PORT_NUM, GPIO_USER0_LED_PIN_NUM) |  GPIO_CFG_IN_INT_RISING |  GPIO_CFG_INPUT,

GPIO_DEVICE_CONFIG(GPIO_USER0_LED_PORT_NUM, GPIO_USER0_LED_PIN_NUM)  |  GPIO_CFG_OUTPUT

};

The same pin is configured as input and output. In application the interrupt is triggered at GPIO port 7 , pin number 8.  So I modified the pin at index 1 to 

GPIO_DEVICE_CONFIG(GPIO_USER1_LED_PORT_NUM, GPIO_USER1_LED_PIN_NUM) |  GPIO_CFG_OUTPUT,

The project gets build and loaded to DSP with the help of debugger. But the registered ISR with the Pin at index 0 is never called. 

GPIO_setCallback(USER_LED0, AppGpioCallbackFxn); 

Can you please tell  me why the interrupt routine is never called. 

  • Hi,

    We have GPIO LED blinking example in Processor SDK RTOS already. See the user guide: software-dl.ti.com/.../index_device_drv.html

    The code supports A15, DSP and M4. The test application is a SYSBIOS project, but you can also build it in bare-metal. The source code is under pdk_am57xx_1_0_xx\packages\ti\drv\gpio\test\led_blink\src\main_led_blink.c. There is "BARE_METAL" you can define and build.

    See user guide: software-dl.ti.com/.../index_faq.html
    "Some of the driver examples contain a flag for BARE METAL usage of the driver. Example: GPIO/SPI already have these flags implemented."

    To do this, you have to comment out the gpio_test task creation code in the .cfg file as well:
    var task0Params = new Task.Params();
    task0Params.instance.name = "echo";
    task0Params.stackSize = 0x1000;
    Program.global.echo = Task.create("&gpio_test", task0Params);

    You can check this example how the two GPIO pins are used and how the interrupt is registersed.

    Regards, Eric