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.

Pointer points outside memory space

Other Parts Discussed in Thread: TMS320F28016

Hi,

Still a bit of a newbie to embedded programming...

I'm using CCS 4 with an XDS100 JTAG Programmer to target a development board with a TMS320F28016.

I'm trying to create a file system for an SD card that I'm targeting and am using FatFs, a generic File System Module developed by ChaN.

When I debug it seems that one static defined pointer points outside the memory space where FatFs module is sending all the important bits that interface with my lower level functions. The pointer value is > 0x400000 where the memory map ends at 0x3FFFFF. At this moment I cannot check, but I am pretty sure the pointer points outside the memory map.

The assignment is done with the following line:

static
FATFS *FatFs[_DRIVES];

Where FATFS is type defined as the following struct:

typedef struct _FATFS_ {
    BYTE    fs_type;    /* FAT sub type */
    BYTE    drive;        /* Physical drive number */
    BYTE    csize;        /* Number of sectors per cluster */
    BYTE    n_fats;        /* Number of FAT copies */
    BYTE    wflag;        /* win[] dirty flag (1:must be written back) */
    BYTE    fsi_flag;    /* fsinfo dirty flag (1:must be written back) */
    WORD    id;            /* File system mount ID */
    WORD    n_rootdir;    /* Number of root directory entries (0 on FAT32) */

And _DRIVES = 1;

I can't imagine the problem lying with the module as many people use it with no problem.I have requested help from the developer's website and still waiting for feedback,

I fear that I have set up something in the wrong way in the IDE... but my memory map in CMD file does not specify any space outside the memory space

Any help would be appreciated.

Thanks,

Hanz

  • Hanz Rauch said:
    The pointer value is > 0x400000 where the memory map ends at 0x3FFFFF

    What method did you use to determine it was pointing here?

    The compiler can generate a .map file (should be in your debug directory) - you can check this to see where the linker ended up placing everything after the link step.

    Hanz Rauch said:
    typedef struct _FATFS_ {
        BYTE    fs_type;    /* FAT sub type */
        BYTE    drive;        /* Physical drive number */
        BYTE    csize;        /* Number of sectors per cluster */
        BYTE    n_fats;        /* Number of FAT copies */
        BYTE    wflag;        /* win[] dirty flag (1:must be written back) */
        BYTE    fsi_flag;    /* fsinfo dirty flag (1:must be written back) */
        WORD    id;            /* File system mount ID */
        WORD    n_rootdir;    /* Number of root directory entries (0 on FAT32) */

    As a side note - to make sure it won't catch you by surprise - a char and int on 28x are both 16-bit.  

    -Lori