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.

CCS/TMDSICE3359: RTOS driver configuration issue

Part Number: TMDSICE3359
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

Hi,

I am new with code composer, sitara and TI-RTOS. In order to learn how to configure the so and sitara peripherials I want to create a basic program to write a message throw my ICE v2 AM335x UART.

I took the SYS/BIOS minimal example as starting piont of my project. Project configuration in ccs6:

From the very begining I had loads of problems to add peripherial drivers to the project. Eventhough I included the header files mentioned in the RTOS guide I was unable to compile due to 'undefined reference to Board_init' error.

Since there is no so many information about TI-RTOS and sitara configuration it took me some time to figure out I had to add references to the drivers in the .cfg file. Not only to the ones mentioned in the guide (board and UART), but also to OSAL and CSL packages. I found this by reading post!! No workshop or guide mention this!!

After loading those packages I still having problems to compile because of some I2C and UART 'undefined references', at some point they got solved. To be honest I am not sure how... Could be the order I add the packages to the .cfg file??

Afer reading this post I added suport to MMU and cache memory.

So now mi .cfg file looks like this:

/*
 *  ======== app.cfg ========
 */
var Defaults = xdc.useModule('xdc.runtime.Defaults');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Error = xdc.useModule('xdc.runtime.Error');
var Log = xdc.useModule('xdc.runtime.Log');
var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
var Main = xdc.useModule('xdc.runtime.Main');
var SysMin = xdc.useModule('xdc.runtime.SysMin');
var System = xdc.useModule('xdc.runtime.System');
var Text = xdc.useModule('xdc.runtime.Text');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Idle = xdc.useModule('ti.sysbios.knl.Idle');
/*
 * Uncomment this line to globally disable Asserts.
 * All modules inherit the default from the 'Defaults' module.  You
 * can override these defaults on a per-module basis using Module.common$.
 * Disabling Asserts will save code space and improve runtime performance.
Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
 */
/*
 * Uncomment this line to keep module names from being loaded on the target.
 * The module name strings are placed in the .const section. Setting this
 * parameter to false will save space in the .const section.  Error and
 * Assert messages will contain an "unknown module" prefix instead
 * of the actual module name.
 */
Defaults.common$.namedModule = false;
/*
 * Minimize exit handler array in System.  The System module includes
 * an array of functions that are registered with System_atexit() to be
 * called by System_exit().
 */
System.maxAtexitHandlers = 4;
/*
 * Uncomment this line to disable the Error print function.
 * We lose error information when this is disabled since the errors are
 * not printed.  Disabling the raiseHook will save some code space if
 * your app is not using System_printf() since the Error_print() function
 * calls System_printf().
Error.raiseHook = null;
 */
/*
 * Uncomment this line to keep Error, Assert, and Log strings from being
 * loaded on the target.  These strings are placed in the .const section.
 * Setting this parameter to false will save space in the .const section.
 * Error, Assert and Log message will print raw ids and args instead of
 * a formatted message.
 */
Text.isLoaded = false;
/*
 * Uncomment this line to disable the output of characters by SysMin
 * when the program exits.  SysMin writes characters to a circular buffer.
 * This buffer can be viewed using the SysMin Output view in ROV.
 */
SysMin.flushAtExit = false;
/*
 * The BIOS module will create the default heap for the system.
 * Specify the size of this default heap.
 */
BIOS.heapSize = 0x0;
/* System stack size (used by ISRs and Swis) */
Program.stack = 0x400;
/* Circular buffer size for System_printf() */
SysMin.bufSize = 128;
/*
 * Create and install logger for the whole system
 */
var loggerBufParams = new LoggerBuf.Params();
loggerBufParams.numEntries = 4;
var logger0 = LoggerBuf.create(loggerBufParams);
Defaults.common$.logger = logger0;
Main.common$.diags_INFO = Diags.ALWAYS_ON;
System.SupportProxy = SysMin;
/*
 * Build a custom BIOS library.  The custom library will be smaller than the
 * pre-built "instrumented" (default) and "non-instrumented" libraries.
 *
 * The BIOS.logsEnabled parameter specifies whether the Logging is enabled
 * within BIOS for this custom build.  These logs are used by the RTA and
 * UIA analysis tools.
 *
 * The BIOS.assertsEnabled parameter specifies whether BIOS code will
 * include Assert() checks.  Setting this parameter to 'false' will generate
 * smaller and faster code, but having asserts enabled is recommended for
 * early development as the Assert() checks will catch lots of programming
 * errors (invalid parameters, etc.)
 */
BIOS.libType = BIOS.LibType_Custom;
BIOS.logsEnabled = false;
BIOS.assertsEnabled = true;
/* ================ Driver configuration ================ */
/* Load the OSAL package */
var osType = "tirtos"
var Osal = xdc.useModule('ti.osal.Settings');
Osal.osType = osType;
/*use CSL package*/
var socType           = "am335x";
var Csl = xdc.loadPackage('ti.csl');
Csl.Settings.deviceType = socType;
/* Load the uart package */
var Uart              = xdc.loadPackage('ti.drv.uart');
Uart.Settings.socType = socType;
/* Load the spi package */
var I2C             = xdc.loadPackage('ti.drv.i2c');
I2C.Settings.socType = socType;
/* Load the gpio package */
var GpioPackage = xdc.loadPackage('ti.drv.gpio');
GpioPackage.Settings.enableProfiling = true;
/* Load the board package */
var Board = xdc.loadPackage('ti.board');
Board.Settings.boardName = "icev2AM335x";
Idle.idleFxns[0] = "&UartWriteSomething";

/* ================ Cache and MMU configuration ================ */

var Cache = xdc.useModule('ti.sysbios.family.arm.a8.Cache');
Cache.enableCache = true;

var Mmu = xdc.useModule('ti.sysbios.family.arm.a8.Mmu');
Mmu.enableMMU = true;

/* Force peripheral section to be NON cacheable strongly-ordered memory */
var peripheralAttrs = {
type : Mmu.FirstLevelDesc_SECTION, // SECTION descriptor
tex: 0,
bufferable : false, // bufferable
cacheable : false, // cacheable
shareable : false, // shareable
noexecute : true, // not executable
};

/* Define the base address of the 1 Meg page the peripheral resides in. */
var peripheralBaseAddr = 0x44e00400;

/* Configure the corresponding MMU page descriptor accordingly */
Mmu.setFirstLevelDescMeta(peripheralBaseAddr,
peripheralBaseAddr,
peripheralAttrs);


/* Define the base address of the 1 Meg page the peripheral resides in. */
var peripheralBaseAddr = 0x481a6000;

/* Configure the corresponding MMU page descriptor accordingly */
Mmu.setFirstLevelDescMeta(peripheralBaseAddr,
peripheralBaseAddr,
peripheralAttrs);

Now it compiles but it still not working. I have tried to debug the problem but when the main function calls Board_init it gives me an error and jumt to syscalls.c file. I have tried to debug inside the Board_init function but I cannot set any brakepoint there, also when I want to go to definition it takes me to the header file and not to the icev2AM335x.c file where it is defined.
I guess It has something to do with my project configuration so I post here the build output, mi main.c file and the error it gives me. Please help me finding what I am doing wrong.
This is the build output I get when it successfully compiles:

**** Build of configuration Debug for project PDK_Drivers_Test_ICEv2AM3359 ****

"C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
'Building file: ../app.cfg'
'Invoking: XDCtools'
"C:/ti/xdctools_3_32_01_22_core/xs" --xdcpath="C:/ti/bios_6_46_04_53/packages;C:/ti/pdk_am335x_1_0_6/packages;C:/ti/uia_2_20_00_02/packages;C:/ti/ccsv6/ccs_base;" xdc.tools.configuro -o configPkg -t gnu.targets.arm.A8F -p ti.platforms.evmAM3359 -r release -c "C:/ti/gcc-arm-none-eabi-4_9-2015q3" "../app.cfg"
making package.mak (because of package.bld) ...
generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
configuring app.xa8fg from package/cfg/app_pa8fg.cfg ...
generating custom ti.sysbios library makefile ...
Linking with library ti.board:./lib/icev2AM335x/a8/release/ti.board.aa8fg
Linking with library ti.drv.gpio:./lib/a8/release/ti.drv.gpio.profiling.aa8fg
Linking with library ti.drv.i2c:./lib/am335x/a8/release/ti.drv.i2c.aa8fg
Linking with library ti.drv.uart:./lib/am335x/a8/release/ti.drv.uart.aa8fg
Linking with library ti.csl:./lib/am335x/a8/release/ti.csl.aa8fg
Linking with library ti.osal:./lib/tirtos/a8/release/ti.osal.aa8fg
Starting build of library sources ...
making C:/ti/blink_ICE_test/PDK_Drivers_Test_ICEv2AM3359/src/sysbios/sysbios.aa8fg ...
gmake[1]: Entering directory `C:/ti/blink_ICE_test/PDK_Drivers_Test_ICEv2AM3359/src/sysbios'
asma8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/IntrinsicsSupport_asm_gnu.asm ...
asma8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/TaskSupport_asm_gnu.asm ...
asma8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/a8/Cache_asm_gnu.sv7A ...
asma8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/a8/Mmu_asm_gnu.sv7A ...
asma8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/a8/TimestampProvider_asm_gnu.sv7A ...
asma8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/timers/dmtimer/Timer_asm_gnu.sv7A ...
asma8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/a8/intcps/Hwi_asm_gnu.sv7A ...
asma8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/exc/Exception_asm_gnu.asm ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/BIOS.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/IntrinsicsSupport.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/TaskSupport.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/knl/Clock.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/knl/Idle.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/knl/Intrinsics.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/knl/Queue.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/knl/Semaphore.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/knl/Swi.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/knl/Swi_andn.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/knl/Task.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/a8/Cache.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/a8/Mmu.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/a8/TimestampProvider.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/hal/Cache.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/hal/Core.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/hal/CoreNull.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/hal/Hwi.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/hal/Hwi_stack.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/hal/Hwi_startup.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/timers/dmtimer/Timer.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/a8/ti81xx/TimerSupport.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/gates/GateHwi.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/gates/GateMutex.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/a8/intcps/Hwi.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/exc/Exception.c ...
ara8fg arm_IntrinsicsSupport_asm_gnu.o arm_TaskSupport_asm_gnu.o a8_Cache_asm_gnu.o a8_Mmu_asm_gnu.o a8_TimestampProvider_asm_gnu.o dmtimer_Timer_asm_gnu.o intcps_Hwi_asm_gnu.o exc_Exception_asm_gnu.o _BIOS.o arm_IntrinsicsSupport.o arm_TaskSupport.o knl_Clock.o knl_Idle.o knl_Intrinsics.o knl_Queue.o knl_Semaphore.o knl_Swi.o knl_Swi_andn.o knl_Task.o a8_Cache.o a8_Mmu.o a8_TimestampProvider.o hal_Cache.o hal_Core.o hal_CoreNull.o hal_Hwi.o hal_Hwi_stack.o hal_Hwi_startup.o dmtimer_Timer.o ti81xx_TimerSupport.o gates_GateHwi.o gates_GateMutex.o intcps_Hwi.o exc_Exception.o ...
gmake[1]: Leaving directory `C:/ti/blink_ICE_test/PDK_Drivers_Test_ICEv2AM3359/src/sysbios'
Build of libraries done.
cla8fg package/cfg/app_pa8fg.c ...
'Finished building: ../app.cfg'
' '
1 archivo(s) copiado(s).
making ../src/sysbios/sysbios.aa8fg ...
gmake[1]: Entering directory 'C:/ti/blink_ICE_test/PDK_Drivers_Test_ICEv2AM3359/src/sysbios'
gmake[1]: Nothing to be done for 'all'.
gmake[1]: Leaving directory 'C:/ti/blink_ICE_test/PDK_Drivers_Test_ICEv2AM3359/src/sysbios'
'Building file: ../main.c'
'Invoking: GNU Compiler'
"C:/ti/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -marm -mfloat-abi=hard -mfpu=neon -Dam3359 -Dicev2AM335x -DSOC_AM335x -DBUILDCFG_MOD_UART -I"C:/ti/gcc-arm-none-eabi-4_9-2015q3/arm-none-eabi/include" -I"C:/ti/pdk_am335x_1_0_6/packages" -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF"main.d" -MT"main.o" -o"main.o" @"configPkg/compiler.opt" "../main.c"
'Finished building: ../main.c'
' '
'Building target: PDK_Drivers_Test_ICEv2AM3359.out'
'Invoking: GNU Linker'
"C:/ti/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc.exe" -mcpu=cortex-a8 -march=armv7-a -marm -mfloat-abi=hard -mfpu=neon -Dam3359 -Dicev2AM335x -DSOC_AM335x -DBUILDCFG_MOD_UART -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,"PDK_Drivers_Test_ICEv2AM3359.map" -nostartfiles -static -Wl,--gc-sections -L"C:/ti/bios_6_46_04_53/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/fpu" -Wl,--defsym,STACKSIZE=0x1C000 -Wl,--defsym,HEAPSIZE=0x400 -o"PDK_Drivers_Test_ICEv2AM3359.out" "./main.o" -Wl,-T"configPkg/linker.cmd" -Wl,--start-group -lgcc -lm -lnosys -lc -Wl,--end-group
'Finished building target: PDK_Drivers_Test_ICEv2AM3359.out'
' '

**** Build Finished ****

This is my main.c file:
/*
 *  ======== main.c ========
 */
// ----- Default includes
#include <xdc/std.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include "stdio.h"
#include "stdint.h"
#include "stdlib.h"
#include "string.h"
// ----- My includes
// Board driver
#include <ti/board/board.h>
// UART drivers
#include <ti/drv/uart/UART.h>
#include <ti/drv/uart/UART_stdio.h>
void UartWriteSomething (void){
UART_printf("I AM ALIVE");
}
/*
 *  ======== main ========
 */
Int main()
    /*
     * use ROV->SysMin to view the characters in the circular buffer
     */
    System_printf("enter main()\n");
    /* Setting up for pinmux and uart */
    Board_initCfg boardCfg;
    boardCfg = BOARD_INIT_MODULE_CLOCK | BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_UART_STDIO;
    Board_init(boardCfg);
    UART_printf("I AM ALIVE");
    BIOS_start();    /* does not return */
    return(0);
}

This is the ROV report when I run the program in my board:

,emaphoreP_tirtos.c", line 131: error {id:0x10000, args:[0x800157a4, 0x800157a4]}

 xdc.runtime.Error.raise: terminating execution

Any idea of what is happening??? 

  • The RTOS team have been notified. They will respond here.
  • user4805179,

    Apologies for the problems you are having. To help move you along, I just wanted to point out that there is a ICEv2 UART RTOS project located at C:\ti\pdk_am335x_1_0_7\packages\MyExampleProjects\UART_BasicExample_evmAM335x_armExampleProject in the PDK. This project does not show up by default in the PDK and would have to be built. Instructions are provided here processors.wiki.ti.com/.../Rebuilding_The_PDK

    Thought that point out this example would help resolve issues you are having with your build, or to use that example as a starting point.

    For training, not sure if you have already seen this video training.ti.com/application-development-using-processor-sdk-rtos it provides a guide on application development with Processor SDK RTOS.

    Please also peruse the rest of the PRSDK training material at training.ti.com/processor-sdk-training-series

    Hope this helps.

    Lali
  • Thanks for your quick response.

    I have already seen those trainings and examples you mention... They are much complex than what I am triying to achieve so I am not able to decide which modules are necessary for my application (just to write a line trought the UART).

    Anyways my program crashes at Board_init  call, which is the first thing it does, so I cannot reach the UART specific functions... it calls _exit(int code) function in syscalls.c and abort execution

    Could you please post a .cfg file with the minimal modules necessary to make Board_init  function work???

    Do I have to modify any of my board specific files?

    Something special I should take into account??

    Any register to monitorize that could give me a hint of whats happening??

    Is it necessary to define Cache and MMU configuration in order to use the board or UART functions??

    I am sure I am making a stupid mistake somewhere but I am completely lost...

  • user4805179.

    I have attached the PDK example project that gets created at C:\ti\pdk_am335x_1_0_7\packages\MyExampleProjects\UART_BasicExample_icev2AM335x_armTestProject you should be able to import this into the CCS workspace. Keep in mind that the project assumes you have the pdk_am335x_1_0_7 installed at C:ti\

    Also attached is the .cfg file used in that project.

    I would encourage you to try and create the example projects in the PDK at MyExampleProjects. These examples would be a good starting point to understand how the examples are constructed.

    Hope this helps.

    Lali

    /cfs-file/__key/communityserver-discussions-components-files/791/UART_5F00_BasicExample_5F00_icev2AM335x_5F00_armTestProject.zip

    /cfs-file/__key/communityserver-discussions-components-files/791/3441.am335x_5F00_app_5F00_icev2am335x.cfg

  • Thanks for the answer!  

    Based on this example, I added a few includes that were missing and finally it works!

    Now I want to use the uart as terminal to control Ethernet leds on the board (D1 and D2).

    For that, I have created the example projects you mentioned and followed the "GPIO_LedBlink_icev2AM335x_armTestProject" project.

    That example sets LEDs cofinguration in "GPIO_evmAM572x_board.c" file as follow:

    #define GPIO_USER0_LED_PIN_NUM    (0x10)
    #define GPIO_USER0_LED_PORT_NUM   (0x00)
    #define GPIO_USER1_LED_PIN_NUM    (0x11)
    #define GPIO_USER1_LED_PORT_NUM   (0x00)
    /* GPIO Driver board specific pin configuration structure */
    GPIO_PinConfig gpioPinConfigs[] = {
        /* Input pin with interrupt enabled : AM57X_IDK_GRN_LED */
        GPIO_DEVICE_CONFIG((GPIO_USER0_LED_PORT_NUM + 1), GPIO_USER0_LED_PIN_NUM) |
        GPIO_CFG_IN_INT_RISING | GPIO_CFG_INPUT,
        /* Output pin : AM57X_IDK_YEL_LED */
        GPIO_DEVICE_CONFIG((GPIO_USER0_LED_PORT_NUM + 1), GPIO_USER0_LED_PIN_NUM) |
        GPIO_CFG_OUTPUT
    };
    and refer to them using ids definded like this:
    /* ON Board LED pins which are connected to GPIO pins. */
    typedef enum GPIO_LED {
        USER_LED0 = 0,
        USER_LED1
    }GPIO_LED;
    I have some questions:

    1. I assume that if I use GPIO_DEVICE_CONFIG(GPIO_USER0_LED_PORT_NUM , GPIO_USER0_LED_PIN_NUM) I am defining GPIO0_2. Is that correct?
    2. Why does it adds "+1" to GPIO_USER0_LED_PORT_NUM in gpioPinConfigs?
    3. Why does it define USER_LED0 and USER_LED1 using same port and pin numbers in gpioPinConfigs? 
    4. If USER_LED0  and USER_LED1 sepresent the same GPIO. What is the point on configuring it as input and output statically? Is that the way to use it as input/output during execution?

    5. Where can I find the PIN and PORT numbers coresponding to the other leds in the board? I have checked schematics and pinmux but none of them assign those leds to GPIO1_2 (what I guess it is defining in the code). 

    Thanks again.

    Regards.

  • Please, any feedback?
  • user4805179,
    I'm looking into your questions.

    Lali
  • Hi,

    Sorry for the late reply, was doing some research on the questions before responding.

    The code isn't very clear, so I will try and clarify. The +1 is due to the driver APIs being one-based. You can see that at C:\ti\pdk_am335x_1_0_7\packages\ti\drv\gpio\src\v1\GPIO_v1.c where there is a -1U in hwAttrs. This is an artifact of code brought in from other platforms such as AM57x. I have filed a ticket to get any references to AM57x in the AM335x source code cleaned-up as this is confusing.

    You will notice that 1 pin is configured as input and the other as output. No, its not required that you configure the same pin as input and output. The reason for configuring 1 of the pins as input is for the interrupt mechanism in the GPIO blink. This isn't required in your application; the example uses this method to illustrate the GPIO blink with interrupts. The way the example is written is confusing on configuring the same pin as both input and output, I have filed another ticket to fix this.

    Here is a snippet of code that would help you out and provide a clear mapping of the LEDs on the AM335x ICEv2. See the comments next to each mapping to understand which LED is being touch for each setting.

    GPIO_icev2AM335x_board.c

    #define GPIO_USER0_LED_PIN_NUM    (0x10)  //LED D1 Grn LED_2 -> GPIO0_16
    #define GPIO_USER0_LED_PORT_NUM   (0x00)  //LED D1 Grn LED_2 -> GPIO0_16
    
    #define GPIO_USER1_LED_PIN_NUM    (0x11)  //LED D1 Red LED_1 -> GPIO0_17
    #define GPIO_USER1_LED_PORT_NUM   (0x00)  //LED D1 Red LED_1 -> GPIO0_17
    
    #define GPIO_USER2_LED_PIN_NUM    (0x9)   //LED D1 Blue LED_3 -> GPIO3_9
    #define GPIO_USER2_LED_PORT_NUM   (0x3)   //LED D1 blue LED_3 -> GPIO3_9
    
    #define GPIO_USER3_LED_PIN_NUM    (0x1E)  //LED D2 Red LED_4 -> GPIO1_30
    #define GPIO_USER3_LED_PORT_NUM   (0x1)   //LED D2 Red LED_4 -> GPIO1_30
    
    #define GPIO_USER4_LED_PIN_NUM    (0x13)  //LED D2 Blue LED_4 -> GPIO0_19
    #define GPIO_USER4_LED_PORT_NUM   (0x00)  //LED D2 blue LED_4 -> GPIO0_19
    
    #define GPIO_USER5_LED_PIN_NUM    (0x14)  //LED D2 Grn LED_4 -> GPIO0_20
    #define GPIO_USER5_LED_PORT_NUM   (0x00)  //LED D2 Grn LED_4 -> GPIO0_20
    
    
    /* GPIO Driver board specific pin configuration structure */
    GPIO_PinConfig gpioPinConfigs[] = {
        /* Input pin with interrupt enabled  */
        GPIO_DEVICE_CONFIG((GPIO_USER0_LED_PORT_NUM + 1), GPIO_USER0_LED_PIN_NUM) |
        GPIO_CFG_IN_INT_RISING | GPIO_CFG_INPUT,
    
        /* Output pin   */
        GPIO_DEVICE_CONFIG((GPIO_USER4_LED_PORT_NUM + 1), GPIO_USER4_LED_PIN_NUM) |
        GPIO_CFG_OUTPUT
    };
    

    D1 & D2 are the tri-color LEDs on the ICEv2 EVM. So, as seen on the comments in the code snippet, its using the varying LED and PORT NUMS to map different LED for the example.

    Below are the screenshots of the ICEv2 schematic and hope thie LEDs are pinned out. Hope this addresses Q #5. I don't know where you are getting GPIO1_2 from. But LED_4 is mapped to GPIO1_30 which is the Red LED on D2.

    Lali