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/EVMK2G: Add GPIO functionality to included SPI arm test project

Part Number: EVMK2G

Tool/software: Code Composer Studio

Hello,

I’m having trouble adding/using additional GPIO LLD functionality to a bundled SPI test project.

 

I’m working on the EVMK2G and am trying to attach to it to an ADC that requires a conversion control signal to trigger a reading. I chose to start with the included project ”SPI_BasicExample_evmK2G_arm_TestProject”. I modified the project to use SPI0 on the serial expansion header (J12) and verified that I have clock and data coming out (from the EVM to the peripheral) as expected. I intend to use GPIO1_47 (SOC_ECAP1_IN_PWN1_OUT / serial expansion header pin 42) to trigger the conversion on the ADC.

 

I keep running into issues where structs and function calls are flagged by the linker for being an undefined reference despite having the file(s) containing the struct/function implementation included in the project

 

  1. I added the same #include files that are in main_led_blink.c from the project “GPIO_LedBlink_evmK2G_armTestProject”. Since the project is in a different relative location, I also tried #3 and #4 as absolute paths.
    1. #include <ti/drv/gpio/GPIO.h>
    2. #include <ti/drv/gpio/soc/GPIO_soc.h>
    3. #include "ti/drv/gpio/test/led_blink/src/GPIO_log.h"
    4. #include "ti/drv/gpio/test/led_blink/src/GPIO_board.h"
    5. I added the project “GPIO_LedBlink_evmK2G_armTestProject” as a dependency to my SPI project. Right-click project -> build -> dependencies -> add… -> GPIO_LedBlink_evmK2G_armTestProject
    6. I added .h and .c files to the project Right_click project name -> Add Files . . . -> Link to files, create link relative to PDK_INSTALL_PATH (just like the other files in the project).
    7. I noticed some differences in the .cfg files (gpio_arm.cfg and spi_arm.cfg) so I tried to incorporate those into spi_arm.cfg:

/* Load the spi package */

var Spi = xdc.loadPackage('ti.drv.spi');

Spi.Settings.enableProfiling = true;    

Spi.Settings.socType = devType;

var Gpio = xdc.loadPackage('ti.drv.gpio');//added

Gpio.Settings.enableProfiling = true;  

Gpio.Settings.socType = devType;

var peripheralBaseAddrs = [

{ base: 0x4ae00000, size: 0x00100000 }, // PRM

{ base: 0x02530C00, size: 0x00000400 }, // UART 0 regs

{ base: 0x02531000, size: 0x00000400 }, // UART 1 regs

{ base: 0x21805400, size: 0x00000800 }   // SPI 0/1/2/3 regs

{ base: 0x02603000, size: 0x00000100 }, // GPIO 0 regs

{ base: 0x0260a000, size: 0x00000100 }   // GPIO 1 regs

];

 

I think that what’s happening here is that I somehow haven’t initialized the GPIO_Config struct meaning there would be no EVMK2G specific drivers for any of the GPIO functions i.e. GPIO_read(), GPIO_write(), GPIO_setCallback() etc.

 

How do I know exactly what needs to be included in the project to add this functionality?

 

 

Linker output from failed build:
Building target: "SPI_BasicExample_evmK2G_armTestProject.out"

Invoking: GNU Linker

"C:/ti/ccs910/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/arm-none-eabi-gcc.exe" -mtune=cortex-a15 -marm -Dk2g02 -Darm0 -DUSE_BIOS -DSOC_K2G -DevmK2G -Og -g -gdwarf-3 -gstrict-dwarf -Wall -finstrument-functions -MMD -MP -mfloat-abi=hard -Wl,-Map,"SPI_BasicExample_evmK2G_armTestProject.map" -nostartfiles -static -Wl,--gc-sections -L"C:/ti/bios_6_75_02_00/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/hard" -Wl,--defsym,ARM_CORE=1 -Wl,--defsym,STACKSIZE=0x10000 -Wl,--defsym,HEAPSIZE=0x400 --specs=nano.specs -o"SPI_BasicExample_evmK2G_armTestProject.out" "./GPIO_drv.o" "./GPIO_v0.o" "./main_spi_flash_read_write_test.o" -Wl,-T"configPkg/linker.cmd" -Wl,--start-group -lrdimon -lgcc -lm -lnosys -lc -Wl,--end-group

makefile:148: recipe for target 'SPI_BasicExample_evmK2G_armTestProject.out' failed

./GPIO_drv.o: In function `GPIO_clearInt':

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/GPIO_drv.c:56: undefined reference to `GPIO_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/GPIO_drv.c:56: undefined reference to `GPIO_config'

./GPIO_drv.o: In function `GPIO_disableInt':

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/GPIO_drv.c:67: undefined reference to `GPIO_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/GPIO_drv.c:67: undefined reference to `GPIO_config'

./GPIO_drv.o: In function `GPIO_enableInt':

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/GPIO_drv.c:78: undefined reference to `GPIO_config'

./GPIO_drv.o:C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/GPIO_drv.c:78: more undefined references to `GPIO_config' follow

./GPIO_v0.o: In function `GPIO_toggle_v0':

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:580: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:580: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:583: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:583: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:592: undefined reference to `GPIO_v0_hwAttrs'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:592: undefined reference to `GPIO_v0_hwAttrs'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:594: undefined reference to `GPIO_v0_hwAttrs'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:594: undefined reference to `GPIO_v0_hwAttrs'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:597: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:597: undefined reference to `GPIO_v0_config'

./GPIO_v0.o: In function `GPIO_setCallback_v0':

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:380: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:380: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:399: undefined reference to `GPIO_v0_config'

./GPIO_v0.o:C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:399: more undefined references to `GPIO_v0_config' follow

./GPIO_v0.o: In function `GPIO_write_v0':

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:634: undefined reference to `GPIO_v0_hwAttrs'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:634: undefined reference to `GPIO_v0_hwAttrs'

./GPIO_v0.o: In function `GPIO_setConfig_v0':

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:431: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:431: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:438: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:438: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:439: undefined reference to `GPIO_v0_hwAttrs'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:439: undefined reference to `GPIO_v0_hwAttrs'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:467: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:467: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:516: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:516: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:527: undefined reference to `GPIO_v0_hwAttrs'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:527: undefined reference to `GPIO_v0_hwAttrs'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:551: undefined reference to `GPIO_v0_hwAttrs'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:551: undefined reference to `GPIO_v0_hwAttrs'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:555: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:555: undefined reference to `GPIO_v0_config'

./GPIO_v0.o: In function `GPIO_clearInt_v0':

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:138: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:138: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:141: undefined reference to `GPIO_v0_config'

./GPIO_v0.o:C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:141: more undefined references to `GPIO_v0_config' follow

./GPIO_v0.o: In function `GPIO_clearInt_v0':

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:147: undefined reference to `GPIO_v0_hwAttrs'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:147: undefined reference to `GPIO_v0_hwAttrs'

./GPIO_v0.o: In function `GPIO_enableInt_v0':

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:222: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:222: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:225: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:225: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:235: undefined reference to `GPIO_v0_hwAttrs'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:235: undefined reference to `GPIO_v0_hwAttrs'

./GPIO_v0.o: In function `GPIO_disableInt_v0':

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:163: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:163: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:166: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:166: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:175: undefined reference to `GPIO_v0_hwAttrs'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:175: undefined reference to `GPIO_v0_hwAttrs'

./GPIO_v0.o: In function `GPIO_read_v0':

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:354: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:354: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:357: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:357: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:363: undefined reference to `GPIO_v0_hwAttrs'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:363: undefined reference to `GPIO_v0_hwAttrs'

./GPIO_v0.o: In function `GPIO_init_v0':

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:308: undefined reference to `GPIO_socGetNumPinsPorts'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:323: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:323: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:325: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:325: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:330: undefined reference to `GPIO_v0_config'

./GPIO_v0.o:C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:330: more undefined references to `GPIO_v0_config' follow

./GPIO_v0.o: In function `GPIO_v0_hwiFxn':

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:259: undefined reference to `GPIO_v0_hwAttrs'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:259: undefined reference to `GPIO_v0_hwAttrs'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:261: undefined reference to `GPIO_socGetNumPinsPorts'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:284: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:284: undefined reference to `GPIO_v0_config'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:288: undefined reference to `GPIO_v0_hwAttrs'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.c:288: undefined reference to `GPIO_v0_hwAttrs'

./main_spi_flash_read_write_test.o: In function `Board_initGPIO':

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/spi/test/spi_flash/src/main_spi_flash_read_write_test.c:59: undefined reference to `GPIO_socGetInitCfg'

C:/ti/pdk_k2g_1_0_14/packages/ti/drv/spi/test/spi_flash/src/main_spi_flash_read_write_test.c:62: undefined reference to `GPIO_socSetIntMux'

collect2.exe: error: ld returned 1 exit status

gmake[1]: *** [SPI_BasicExample_evmK2G_armTestProject.out] Error 1

gmake: *** [all] Error 2

makefile:144: recipe for target 'all' failed

 

**** Build Finished ****

 

 

  • Jorg,

    Can you please copy your entire build log in a text file and share here. It may also be useful to see the full .cfg file that you have. 

    First thing to try is to see if you can add the file GPIO_soc.c from pdk_k2g_1_0_14\packages\ti\drv\gpio\soc\k2g to the project as all the missing symbols are from that library.  

    GCC linker can also sometime play tricks during compilation since it doesn`t do a circular search of symbols in the libraries as we have indicated here:

    https://e2e.ti.com/support/processors/f/791/t/669273?RTOS-AM5728-Linking-problem-with-ti-osal-package

    Regards,

    Rahul

  • Thank you for your response Rahul,

    I tried each of the three workarounds included in the link that you included. They did not solve the issue, however, I would like to share what did in case anybody else finds this page helpful.

    Like I said in the post:
    > I think that what’s happening here is that I somehow haven’t initialized the GPIO_Config struct meaning there would be no EVMK2G specific drivers for any of the GPIO functions i.e. GPIO_read(), GPIO_write(), GPIO_setCallback() etc.

    This assumption was correct.

     

    I did some research in the Processor SDK RTOS (http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/index_board.html#lld-dependencies) and found the note regarding <drv>_soc.c, here: GPIO_soc.c. It was already added to the project so that wasn’t the issue.

    To fix the issue, I had to add GPIO_board.c to the project (PDK_INSTALL_PATH/packages/ti/drv/gpio/test/led_blink/k2g/GPIO_board.c). Contained within this file is the initialization of [an instance of] the struct GPIO_v0_Config.

     

    I did some testing after finding this fix and still found that I had to include the GPIO initialization changes to spi_arm.cfg that I mentioned above. Can you confirm that this is indeed correct and needed?

     

    I included a text file containing spi_arm.cfg and a version of the complete build log for reference.

    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 Memory = xdc.useModule('xdc.runtime.Memory')
    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 Clock = xdc.useModule('ti.sysbios.knl.Clock');
    var Swi = xdc.useModule('ti.sysbios.knl.Swi');
    var Task = xdc.useModule('ti.sysbios.knl.Task');
    var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
    var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
    var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
    var CpIntc = xdc.useModule('ti.sysbios.family.arm.a15.tci66xx.CpIntc');
    
    var devType                     = "k2g"
    
    /* Load the OSAL package */ 
    var osType = "tirtos"
    var Osal = xdc.useModule('ti.osal.Settings');
    Osal.osType = osType;
    Osal.socType = devType;
    
    /*use CSL package*/
    var Csl = xdc.loadPackage('ti.csl');
    Csl.Settings.deviceType = devType;
    
    /* Load the I2C package  - required by board */
    var I2c = xdc.loadPackage('ti.drv.i2c');
    I2c.Settings.socType = devType;
    
    /* Load the Board package and set the board name */
    var Board = xdc.loadPackage('ti.board');
    Board.Settings.boardName = "evmK2G";
    
    /* Load Profiling package */
    var Utils = xdc.loadPackage('ti.utils.profiling');
    
    /*XXX Load the gpio package ADDED*/
    var Gpio = xdc.loadPackage('ti.drv.gpio');
    Gpio.Settings.enableProfiling = true;    
    Gpio.Settings.socType = devType;
    
    /* Load the spi package */
    var Spi = xdc.loadPackage('ti.drv.spi');
    Spi.Settings.enableProfiling = true;     
    Spi.Settings.socType = devType;
    
    /* Load the uart package */
    var Uart = xdc.useModule('ti.drv.uart.Settings');
    Uart.socType = devType;
    
    /* 
     * 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;
     */
    
    
    /* No runtime stack checking is performed */
    Task.checkStackFlag = false;
    
    
    /* Reduce the number of task priorities */
    //XXX changed to 5 from 4
    Task.numPriorities = 5;
    
    /* ================ Task configuration ================ */
    var task0Params = new Task.Params();
    task0Params.instance.name = "echo";
    task0Params.stackSize = 0x1000;
    Program.global.echo = Task.create("&spi_test", task0Params);
    
    /*
     * The BIOS module will create the default heap for the system.
     * Specify the size of this default heap.
     */
    BIOS.heapSize = 0x10000;
    
    /*
     * Build a custom SYS/BIOS library from sources.
     */
    BIOS.libType = BIOS.LibType_Custom;
    
    /* System stack size (used by ISRs and Swis) */
    Program.stack = 0x20000;
    
    /* Circular buffer size for System_printf() */
    SysMin.bufSize = 0x400;
    
    /* 
     * Create and install logger for the whole system
     */
    var loggerBufParams = new LoggerBuf.Params();
    loggerBufParams.numEntries = 32;
    var logger0 = LoggerBuf.create(loggerBufParams);
    Defaults.common$.logger = logger0;
    Main.common$.diags_INFO = Diags.ALWAYS_ON;
    
    System.SupportProxy = SysMin;
    var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
    
    var Cache  = xdc.useModule('ti.sysbios.family.arm.a15.Cache');
    var Mmu    = xdc.useModule('ti.sysbios.family.arm.a15.Mmu');
    
    /* Enable the cache                                                           */
    Cache.enableCache = true;
    
    // Enable the MMU (Required for L1/L2 data caching)
    Mmu.enableMMU = true;
    
    // descriptor attribute structure
    var peripheralAttrs = new Mmu.DescriptorAttrs();
    
    Mmu.initDescAttrsMeta(peripheralAttrs);
    
    peripheralAttrs.type = Mmu.DescriptorType_BLOCK;  // BLOCK descriptor
    peripheralAttrs.noExecute = true;                 // not executable
    peripheralAttrs.accPerm = 0;                      // read/write at PL1
    peripheralAttrs.attrIndx = 1;                     // MAIR0 Byte1 describes
                                                      // memory attributes for
                                                      // each BLOCK MMU entry
    
    // Define the base address of the 2 MB page
    // the peripheral resides in.
    var peripheralBaseAddrs = [ 
      { base: 0x4ae00000, size: 0x00100000 },  // PRM
      { base: 0x02530C00, size: 0x00000400 },  // UART 0 regs
      { base: 0x02531000, size: 0x00000400 },  // UART 1 regs
      { base: 0x21805400, size: 0x00000800 },   // SPI 0/1/2/3 regs
      { base: 0x02603000, size: 0x00000100 },  // GPIO 0 regs
      { base: 0x0260a000, size: 0x00000100 }   // GPIO 1 regs
    ];
    
    // Configure the corresponding MMU page descriptor accordingly
    for (var i =0; i < peripheralBaseAddrs.length; i++)
    {
      for (var j = 0; j < peripheralBaseAddrs[i].size; j += 0x200000)
      {
          var addr = peripheralBaseAddrs[i].base + j;
          Mmu.setSecondLevelDescMeta(addr, addr, peripheralAttrs);
        }
    }                           
                               
    /* Define and add one Task Hook Set */
    Task.addHookSet({
    	registerFxn: '&TaskRegisterId',
    	switchFxn: '&mySwitch',
    });
    

    **** Clean-only build of configuration Debug for project SPI_BasicExample_evmK2G_armTestProject ****
    
    "C:\\ti\\ccs910\\ccs\\utils\\bin\\gmake" -k -j 8 clean -O 
     
    DEL /F  "SPI_BasicExample_evmK2G_armTestProject.hex"  "configPkg\linker.cmd" "configPkg\compiler.opt"  "SPI_BasicExample_evmK2G_armTestProject.out" 
    DEL /F "GPIO_board_SPI.o" "GPIO_soc.o" "main_spi_flash_read_write_test.o" 
    DEL /F "GPIO_board_SPI.d" "GPIO_soc.d" "main_spi_flash_read_write_test.d" 
    RMDIR /S/Q  "configPkg\" 
    Could Not Find C:\Source\Next_Gen_Coll\SPI_BasicExample_evmK2G_armTestProject\Debug\SPI_BasicExample_evmK2G_armTestProject.hex
    Finished clean
     
    
    **** Build Finished ****
    
    **** Build of configuration Debug for project SPI_BasicExample_evmK2G_armTestProject ****
    
    "C:\\ti\\ccs910\\ccs\\utils\\bin\\gmake" -k -j 8 all -O 
     
    Building file: "C:/ti/pdk_k2g_1_0_14/packages/ti/drv/spi/test/spi_flash/k2g/armv7/bios/spi_arm.cfg"
    Invoking: XDCtools
    "C:/ti/xdctools_3_51_01_18_core/xs" --xdcpath="C:/ti/bios_6_75_02_00/packages;C:/ti/pdk_k2g_1_0_14/packages;C:/ti/edma3_lld_2_12_05_30E/packages;C:/ti/ipc_3_50_03_05/packages;C:/ti/ndk_3_60_00_13/packages;C:/ti/uia_2_30_01_02/packages;" xdc.tools.configuro -o configPkg -t gnu.targets.arm.A15F -p ti.platforms.evmTCI66AK2G02 -r debug -c "C:/ti/ccs910/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32" "C:/ti/pdk_k2g_1_0_14/packages/ti/drv/spi/test/spi_flash/k2g/armv7/bios/spi_arm.cfg"
    making package.mak (because of package.bld) ...
    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
    configuring spi_arm.xa15fg from package/cfg/spi_arm_pa15fg.cfg ...
    	 SoC Type is k2g
    	 SoC Type is k2g
    generating custom ti.sysbios library makefile ... 
    	Linking with library ti.drv.spi:./lib/k2g/a15/release/ti.drv.spi.profiling.aa15fg
    	Linking with library ti.drv.gpio:./lib/k2g/a15/release/ti.drv.gpio.profiling.aa15fg
    	Linking with library ti.board:./lib/evmK2G/a15/release/ti.board.aa15fg
    	Linking with library ti.drv.uart:./lib/k2g/a15/release/ti.drv.uart.aa15fg
    	Linking with library ti.drv.i2c:./lib/k2g/a15/release/ti.drv.i2c.aa15fg
    	Linking with library ti.osal:./lib/tirtos/k2g/a15/release/ti.osal.aa15fg
    	Linking with library ti.utils.profiling:./lib/a15/release/ti.utils.profiling.aa15fg
    	Linking with library ti.csl:./lib/k2g/a15/release/ti.csl.aa15fg
    Starting build of library sources ...
    making C:/ti/pdk_k2g_1_0_14/packages/ti/drv/spi/test/spi_flash/k2g/armv7/bios/src/sysbios/sysbios.aa15fg ...
    Build of libraries done.
    cla15fg package/cfg/spi_arm_pa15fg.c ...
    Finished building: "C:/ti/pdk_k2g_1_0_14/packages/ti/drv/spi/test/spi_flash/k2g/armv7/bios/spi_arm.cfg"
     
    Building file: "C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/soc/k2g/GPIO_soc.c"
    Invoking: GNU Compiler
    "C:/ti/ccs910/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a15 -mtune=cortex-a15 -marm -mfloat-abi=hard -Dk2g02 -Darm0 -DUSE_BIOS -DSOC_K2G -DevmK2G -I"C:/Source/Next_Gen_Coll/SPI_BasicExample_evmK2G_armTestProject" -I"C:/ti/ccs910/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/arm-none-eabi/include/newlib-nano" -I"C:/ti/pdk_k2g_1_0_14/packages/ti/drv/spi" -I"C:/ti/pdk_k2g_1_0_14/packages" -I"/packages" -I"C:/ti/ccs910/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -c -finstrument-functions -MMD -MP -MMD -MP -MF"GPIO_soc.d" -MT"GPIO_soc.o"  @"configPkg/compiler.opt" -o"GPIO_soc.o" "C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/soc/k2g/GPIO_soc.c"
    Finished building: "C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/soc/k2g/GPIO_soc.c"
     
    Building file: "C:/ti/pdk_k2g_1_0_14/packages/ti/drv/spi/test/spi_flash/src/main_spi_flash_read_write_test.c"
    Invoking: GNU Compiler
    "C:/ti/ccs910/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a15 -mtune=cortex-a15 -marm -mfloat-abi=hard -Dk2g02 -Darm0 -DUSE_BIOS -DSOC_K2G -DevmK2G -I"C:/Source/Next_Gen_Coll/SPI_BasicExample_evmK2G_armTestProject" -I"C:/ti/ccs910/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/arm-none-eabi/include/newlib-nano" -I"C:/ti/pdk_k2g_1_0_14/packages/ti/drv/spi" -I"C:/ti/pdk_k2g_1_0_14/packages" -I"/packages" -I"C:/ti/ccs910/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -c -finstrument-functions -MMD -MP -MMD -MP -MF"main_spi_flash_read_write_test.d" -MT"main_spi_flash_read_write_test.o"  @"configPkg/compiler.opt" -o"main_spi_flash_read_write_test.o" "C:/ti/pdk_k2g_1_0_14/packages/ti/drv/spi/test/spi_flash/src/main_spi_flash_read_write_test.c"
    In file included from C:/ti/pdk_k2g_1_0_14/packages/ti/drv/spi/test/spi_flash/src/main_spi_flash_read_write_test.c:23:0:
    C:/ti/pdk_k2g_1_0_14/packages/ti/drv/spi/test/spi_flash/src/main_spi_flash_read_write_test.c: In function 'Board_initGPIO':
    C:/ti/pdk_k2g_1_0_14/packages/ti/drv/gpio/src/v0/GPIO_v0.h:157:15: warning: statement with no effect [-Wunused-value]
                   ((((port) << GPIO_CFG_PORT_NUM_SHIFT) & (GPIO_CFG_PORT_NUM_MASK)) | \
                   ^
    C:/ti/pdk_k2g_1_0_14/packages/ti/drv/spi/test/spi_flash/src/main_spi_flash_read_write_test.c:62:4: note: in expansion of macro 'GPIO_DEVICE_CONFIG'
        GPIO_DEVICE_CONFIG(GPIO_PWM1_OUT_PORT_NUM, GPIO_PWM1_OUT_PIN_NUM) | GPIO_CFG_OUTPUT;
        ^~~~~~~~~~~~~~~~~~
    At top level:
    C:/ti/pdk_k2g_1_0_14/packages/ti/drv/spi/test/spi_flash/src/main_spi_flash_read_write_test.c:229:13: warning: 'GeneratePattern' defined but not used [-Wunused-function]
     static void GeneratePattern(uint8_t *txBuf, uint8_t *rxBuf, uint32_t length)
                 ^~~~~~~~~~~~~~~
    Finished building: "C:/ti/pdk_k2g_1_0_14/packages/ti/drv/spi/test/spi_flash/src/main_spi_flash_read_write_test.c"
     
    Building target: "SPI_BasicExample_evmK2G_armTestProject.out"
    Invoking: GNU Linker
    "C:/ti/ccs910/ccs/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major-win32/bin/arm-none-eabi-gcc.exe" -mtune=cortex-a15 -marm -Dk2g02 -Darm0 -DUSE_BIOS -DSOC_K2G -DevmK2G -Og -g -gdwarf-3 -gstrict-dwarf -Wall -finstrument-functions -MMD -MP -mfloat-abi=hard -Wl,-Map,"SPI_BasicExample_evmK2G_armTestProject.map" -nostartfiles -static -Wl,--gc-sections -L"C:/ti/bios_6_75_02_00/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/hard" -Wl,--defsym,ARM_CORE=1 -Wl,--defsym,STACKSIZE=0x10000 -Wl,--defsym,HEAPSIZE=0x400 --specs=nano.specs -o"SPI_BasicExample_evmK2G_armTestProject.out" "./GPIO_soc.o" "./main_spi_flash_read_write_test.o" -Wl,-T"configPkg/linker.cmd" -Wl,--start-group -lrdimon -lgcc -lm -lnosys -lc -Wl,--end-group 
    makefile:147: recipe for target 'SPI_BasicExample_evmK2G_armTestProject.out' failed
    C:\ti\pdk_k2g_1_0_14\packages\ti\drv\gpio\lib\k2g\a15\release\ti.drv.gpio.profiling.aa15fg(GPIO_v0.oa15fg): In function `GPIO_toggle_v0':
    C:\ti\pdk_k2g_1_0_14\packages\ti\drv\gpio/src/v0/GPIO_v0.c:572: undefined reference to `GPIO_v0_config'
    C:\ti\pdk_k2g_1_0_14\packages\ti\drv\gpio/src/v0/GPIO_v0.c:580: undefined reference to `GPIO_v0_config'
    C:\ti\pdk_k2g_1_0_14\packages\ti\drv\gpio/src/v0/GPIO_v0.c:580: undefined reference to `GPIO_v0_config'
    C:\ti\pdk_k2g_1_0_14\packages\ti\drv\gpio\lib\k2g\a15\release\ti.drv.gpio.profiling.aa15fg(GPIO_v0.oa15fg): In function `GPIO_setCallback_v0':
    C:\ti\pdk_k2g_1_0_14\packages\ti\drv\gpio/src/v0/GPIO_v0.c:380: undefined reference to `GPIO_v0_config'
    C:\ti\pdk_k2g_1_0_14\packages\ti\drv\gpio/src/v0/GPIO_v0.c:380: undefined reference to `GPIO_v0_config'
    C:\ti\pdk_k2g_1_0_14\packages\ti\drv\gpio\lib\k2g\a15\release\ti.drv.gpio.profiling.aa15fg(GPIO_v0.oa15fg):C:\ti\pdk_k2g_1_0_14\packages\ti\drv\gpio/src/v0/GPIO_v0.c:608: more undefined references to `GPIO_v0_config' follow
    collect2.exe: error: ld returned 1 exit status
    gmake[1]: *** [SPI_BasicExample_evmK2G_armTestProject.out] Error 1
    gmake: *** [all] Error 2
    makefile:143: recipe for target 'all' failed
    
    **** Build Finished ****

    Thank you, 

    Jorg