Hi
I tested the i2c_led example from SYSBIOSSDK-IND-AM335X v01.00.00.04 on the ICE AM3359 and I realized that the RGB-LED D4 only light in red and green color, not in blue. So I looked in the Source-Code and noticed following lines:
set_generic_gpio_led(0,12 ,0);
...
set_generic_gpio_led(0,12 ,1);
But in the shematic the Blue LED in D4 is connected with GPIO_29. I would propose to check if the Board is an IDK or an ICE to determinate which Pin should be used. I did this tiny change and attached the main.c. I have to admit that I'm not 100% sure that on the IDK the pin 12 is the right one...
Changes:
/*
* ======== taskFxn ========
*/
Void taskFxn(UArg a0, UArg a1)
{
unsigned int RunLed = 0;
unsigned char led_val = 0xff;
unsigned char changing_pin = 0;
System_printf("enter taskFxn()\n");
UARTPutString(uartInstance,"\nTI Industrial SDK Version - ");
UARTPutString(uartInstance,IND_SDK_VERSION);
UARTPutString(uartInstance,"\n\rSYS/BIOS LED Sample application running on ");
if(AM335X_BOARD_TYPE_ICE == boardType)
{
UARTPutString(uartInstance,"ICE \n\r");
changing_pin = 29;
}else if(AM335X_BOARD_TYPE_IDK == boardType)
{
UARTPutString(uartInstance,"IDK \n\r");
changing_pin = 12;
}
set_led(led_val);
Task_sleep(2000);
led_val = 0;
set_led(led_val);
Task_sleep(1000);
set_generic_gpio_led(0,0 ,0);
set_generic_gpio_led(0,1 ,0);
set_generic_gpio_led(0,changing_pin ,0);
set_generic_gpio_led(0,13 ,0);
set_generic_gpio_led(0,16 ,0);
set_generic_gpio_led(0,17 ,0);
set_generic_gpio_led(0, 0,1);
set_generic_gpio_led(0, 1,1);
set_generic_gpio_led(0, changing_pin,1);
set_generic_gpio_led(0, 13,1);
set_generic_gpio_led(0, 16,1);
set_generic_gpio_led(0, 17,1);
while(1)
{
set_led_off(led_val);
led_val = (led_val+1)%9;
set_led_on(led_val);
Task_sleep(300);
if (RunLed > 0)
{
set_run_led();
set_act0_led();
reset_error_led();
reset_act1_led();
}
else
{
set_error_led();
set_act1_led();
reset_run_led();
reset_act0_led();
}
RunLed ^= 1;
}
}:
Kind regards, Cyril