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.

RTOS/TMDXIDK5718: SPI Example for DSP

Part Number: TMDXIDK5718
Other Parts Discussed in Thread: SYSBIOS, AM5718

Tool/software: TI-RTOS

Hi

Im using the IDK51718 platform and I have Setup a SYSBIOS configuration for the C66 DSP.
To use the SPI Interface I added the Board_Init() function as described in the pdk example "pdk_am57xx_1_0_6\packages\ti\drv\i2c\example\eeprom_read"

Now when the Board_Init() is called program execution is stopped by the abort Routine. What is going wrong?

I have attached my Project as zip file.

Regards,
Markus

CTR_TC5_C66 (Crash during Board_Init).zip

  • Markus,

    There are multiple SPI examples under the directory path pdk_am57xx_1_0_6\packages\ti\drv\spi\example, why are you not using that as your starting point.

    I looked at your code, there is no code after BOARD_init other than BIOS_start which will start the task function that only has a sleep command. Shouldn`t your ADC_test function be called inside the task ? If ADC is connected to SPI, shouldn`t the pinmux and clock setup be called before the ADC_tests are run ?

    does the code get to BIOS_start or abort after the BOARD_init?

    Regards,
    Rahul
  • Hi Rahul

    I did not include further code concerning SPI because the program crashes within the BOARD_init() function.
    It does not get to BIOS_start(). So my thread title was misleading (I tried to rename but could not find out how).
    So my first problem is not concerning SPI but the program crash (the debugger stoppes in the abort() function).
    Meanwhile I found out that it crashes when it tries to read board info from I2C EEPROM. There is a funktion
    I2C_osalPendLock(object->mutex, SemaphoreP_WAIT_FOREVER); where object->mutex is NULL.
    Because this is all TI code I cannot figure out why this internal things are not setup properly.

    Regards,
    Markus

  • I looked at your configuration file and do think that you need to add 

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

    Spi.Settings.socType = socType;

    and 

    var I2c = xdc.loadPackage('ti.drv.i2c')

    I2c.Settings.socType  = socType

    this is critical for all the drivers to get the configuration specific to the SOC on which it is being used. The other alternative is to include SPI_soc.c and I2C_soc.c file for the AM571x from the soc directory of the 2 drivers. Those files provide the base address interrupt configuration, etc for the driver to use on a given SOC.

    This has been described in 

     

    Hope this helps resolve your issue.

    Regards,

    Rahul

    PS: Also refer to this app note for integrating all driver examples in the application:

    www.ti.com/.../sprac93.pdf 

  • Hi Rahul

    Unfortunately setting the socType vars did not help.
    I'm further trying to figure out the differences bewten my code an d the TI example.

    My own code origins from a TI sysbios example.
    Later I found out, that a preprocessor constant "SOC_AM571x" and "C66X" from the TI example
    was also missing in my code (the only predefines symbol from the TI sysbios example was "am5718")

    But setting these correcty did also not help to prevent the crash within BOARD_init().

    regards,
    Markus

  • Markus,

    The Key to have a driver to work with the platform and the SOC is to initialize the platform using board library and to use the SOC configuration along with the drivers. If you can add your build log to the E2E, I can see if I can spot anything missing during the build step.

    Also make sure all your peripheral related code is called after Board_Init call and not before as this can cause clocking /pinmux related issues.

    Regards,
    Rahul
  • Hi Rahul

    I stripped my project to the very basic (see attachement)
    There you should find the log files you are looking for .
    It still crashes within BOARD_init().

    Regards,
    Markus

    CTR_TC5_C66 V3 (Crash during Board_Init).zip

  • Hi Rahul

    Meanwhile I could solve the problem on my own.
    In the bios configuration file no heap memory was defined.
    After adding the lines below, BOARD_init() does not crash anymore.
    It is strange that no error message was given at compile time that this was missing...

    var Memory    =   xdc.useModule('xdc.runtime.Memory');
    var HeapMem   =   xdc.useModule('ti.sysbios.heaps.HeapMem');

    /* Create a default system heap using ti.bios.HeapMem. */
    var heapMemParams1              =   new HeapMem.Params;
    heapMemParams1.size             =   8192 * 25;
    heapMemParams1.sectionName      =   "systemHeap";
    Program.global.heap0            =   HeapMem.create(heapMemParams1);

    /* This is the default memory heap. */
    Memory.defaultHeapInstance      =   Program.global.heap0;
    Program.sectMap["systemHeap"]   =   Program.platform.stackMemory;

    Regards,
    Markus