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.

Where can I find errors returned from GIO_create?

Other Parts Discussed in Thread: CCSTUDIO

Hello,

I have problems with the GIO_create function and SPI0. I look for at the forum and I found that you can know which error returns the function by the &status parameter:

GIO_create("/SPI0",IOM_INOUT,&status,&chanParams,&gioAttrs);

It returns -5. Anyone knows where can I find what it means?

Thanks!

  • You can find the status codes at the file: C:\CCStudio_v3.3\bios_5_33_06\packages\ti\bios\include\iom.h

    /*
     * IOM Error Codes
     */
    #define  IOM_EBADIO        -1      /* Generic failure condition */
    #define  IOM_ETIMEOUT      -2      /* Timeout occurred */
    #define  IOM_ENOPACKETS    -3      /* No packets available for I/O */
    #define  IOM_EFREE         -4      /* Unable to free resources */
    #define  IOM_EALLOC        -5      /* Unable to alloc resource */
    #define  IOM_EABORT        -6      /* I/O was aborted before completed */
    #define  IOM_EBADMODE      -7      /* Illegal device mode */
    #define  IOM_EOF           -8      /* End-of-File was encountered */
    #define  IOM_ENOTIMPL      -9      /* Operation not implemented or supported */
    #define  IOM_EBADARGS      -10     /* Illegal arguments specified */
    #define  IOM_ETIMEOUTUNREC -11     /* Unrecoverable timeout occurred */
    #define  IOM_EINUSE        -12     /* Device already in use */

  • Ok, my error is IOM_EALLOC and means that I don't have enough heap. I put the -heap option but it still not working.

    In the watch window the values of spiHandle variables (fxns, mode, timeout...) are "memory map prevented read of target memory at 0x000000000". What this means and how can I solve it?

  • cerilet.com said:
    I put the -heap option but it still not working.

    What do you mean by that? Did you change the size of the heap in the cmd file or in the build options? As you are using DSP/BIOS, please change the hep at the tcf file.

    Open the .tcf file, expand the contents of the Memory Section Manager, Right Click on the memory that you want the heap (for example SDRAM)=> Choose Properties.  Select create a heap in this memory and choose the size. The should now be an option in the drop down menu for the "Segment for malloc()/free()" and Segment for DSP/BIOS Objects" fields of Memory Section Manager's properties.

  • I did something wrong with the heap, but I think only put a 0x0001600 heap. The CCS gave me an error and was closed and now my project is not working anymore. I amb going start a new project.

    Thanks for your help Mariana.