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.

F28335 Crash With Memory Clear

Other Parts Discussed in Thread: TMS320F28335

Greetings,

 

                I am using the F28335, and on startup, I am trying to clear the memory which we will be using.  At some point during the memory clear, the code crashes and ends up at address 0x3FF9FA.  The point during the clear when this happens is random.  I have been able to boil it down to a very simple program which always crashes.  I’m guessing that I need to setup something before I begin this process, but I don’t know what it is.  Any help would be appreciated.  The code is as follows:

 

void main()

{

       Uint16 * Buff = (Uint16 *)0xC000;

       for (int i = 0 ; i < 0x1000 ; i++)

       {

              Buff[i] = 0;

       }

}

 

Thank you,

 

Ed

 

  • Hi Edward,

    Look like it's clearing the spec which is getting used in program execution. Please check your linker cmd file to see what is mapped in the memory space which you are clearing.

    Regards,

    Vivek Singh

  • Hi Vivek,

     

                    I don't understand what "clearing the spec" means.  But in the 28335_RAM_Lnk.cmd file, that address is assigned to RAML4 PAGE 1, and nothing overlaps it.  RAML4 is assigned to .Buffers which consists of two arrays.  The definitions are as follows:

     

    MEMORY

    {

    PAGE 0 :

       BEGIN      : origin = 0x000000, length = 0x000002

       RAMM0      : origin = 0x000050, length = 0x0003B0

       RAML0      : origin = 0x008000, length = 0x001000

       RAML12     : origin = 0x009000, length = 0x002000

       RAML3      : origin = 0x00B000, length = 0x001000

       ZONE7A     : origin = 0x200000, length = 0x00FC00

       CSM_RSVD   : origin = 0x33FF80, length = 0x000076

       CSM_PWL    : origin = 0x33FFF8, length = 0x000008

       ADC_CAL    : origin = 0x380080, length = 0x000009

       RESET    : origin = 0x3FFFC0, length = 0x000002

       IQTABLES   : origin = 0x3FE000, length = 0x000b50

       IQTABLES2  : origin = 0x3FEB50, length = 0x00008c

       FPUTABLES  : origin = 0x3FEBDC, length = 0x0006A0

       BOOTROM    : origin = 0x3FF27C, length = 0x000D44

     

    PAGE 1 :

       BOOT_RSVD  : origin = 0x000002, length = 0x00004E

       RAMM1      : origin = 0x000400, length = 0x000400

       RAML4      : origin = 0x00C000, length = 0x001000

       RAML56     : origin = 0x00D000, length = 0x002000

       RAML7      : origin = 0x00F000, length = 0x001000

       ZONE7B     : origin = 0x20FC00, length = 0x000400

    }

     

    SECTIONS

    {

       codestart        : > BEGIN,     PAGE = 0

       ramfuncs         : > RAML0,     PAGE = 0

       .text            : > RAML12,    PAGE = 0

       .cinit           : > RAML0,     PAGE = 0

       .pinit           : > RAML0,     PAGE = 0

       .switch          : > RAML0,     PAGE = 0

       .ebss            : > RAML3,     PAGE = 0

       .econst          : > RAML3,     PAGE = 0

       .esysmem         : > RAML3,     PAGE = 0

       .GlobalData      : > RAML3,     PAGE = 0

     

       .stack           : > RAMM1,     PAGE = 1

       .Buffers         : > RAML4,     PAGE = 1

       .ProcessingBuffs : > RAML56,    PAGE = 1

       .Results       : > RAML7,     PAGE = 1

     

       IQmath           : > RAML12,    PAGE = 0

       IQmathTables     : > IQTABLES,  PAGE = 0, TYPE = NOLOAD

     

       FPUmathTables    : > FPUTABLES, PAGE = 0, TYPE = NOLOAD

     

       DMARAML4         : > RAML4,     PAGE = 1

       DMARAML56        : > RAML56,    PAGE = 1

       DMARAML7         : > RAML7,     PAGE = 1

     

       ZONE7DATA        : > ZONE7B,    PAGE = 1

     

       .reset           : > RESET,     PAGE = 0, TYPE = DSECT

       csm_rsvd         : > CSM_RSVD   PAGE = 0, TYPE = DSECT

       csmpasswds      : > CSM_PWL    PAGE = 0, TYPE = DSECT

     

       .adc_cal     : load = ADC_CAL,  PAGE = 0, TYPE = NOLOAD

    }

     

    // In the file which defines the memory.

    #define C_NUM_ADC_SAMPLES                              2048

    #pragma SET_DATA_SECTION( ".Buffers" )

    volatile Uint16 AdcCaptureData[C_NUM_ADC_SAMPLES];

    Uint16 ProcessedAdcCaptureData[C_NUM_ADC_SAMPLES];

    #pragma SET_DATA_SECTION()

     

    Thanks,

     

    Ed

     

  • Edward Sanders said:
    I have been able to boil it down to a very simple program which always crashes.  I’m guessing that I need to setup something before I begin this process, but I don’t know what it is.

    After a reset the watchdog in the TMS320F28335 is enabled, and will will generate a reset after 131072 OSCCLKs unless the watchdog is disabled or patted. When I tried your simple example in a TMS320F28335 debugging showed that a watchdog reset occurred, since the WDFLAG bit got set in the Watchdog Control Register (WDCR) after the device had been reset by the watchdog. After the reset occurred the device entered the boot loader in the boot ROM. Your address  0x3FF9FA is in the "Boot loader functions" as shown by Figure 1-1. Memory Map of On-Chip ROM in the TMS320x2833x, 2823x Boot ROM Reference Guide.

    Therefore, think you either need to disable the watchdog or pat the watchdog during the memory clear.

  • That was it. I disabled the WDT, and now it runs.

    Thank you,

    Ed