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.

Mistakes in Boot Image User Code when using eZdsp5535

when using eZdsp5535, a problem appears: my own user code works fine in CCS environment but fails to work after converted to boot image.

But when I use the demo codes supported by spectrum digital company, such as aic3204.out, eZdsp5535 works well out of CCS environment.

Therefore, I search online, and find a link below,

http://processors.wiki.ti.com/index.php/C5535_Boot-Image_Programmer

in it, there is a description about "Common Mistakes in Boot Image User Code", and it provides two possible causes.

1. A frequent issue is that the user code works fine in CCS environment but fails to work after converted to boot image. This is most likely because the user code relies on a GEL file in the CCS environment to initialize and setup PLL. This is easily corrected by not using GEL in CCS environment, but instead including all the necessary initialization steps in the user code. It is a good practice to re-initialize everything you need from within your bootloaded user code.

2. Another common mistake is allocating program code to SARAM31 memory. The bootloader writes to SARAM31 (byte address 0x4E000 – 0x4FFFF) thus any user code residing in SARAM31 will be corrupted. Do not use SARAM31 if you intend to convert this code to a boot image. Once the bootloader has finished loading the program into RAM, SARAM31 can be used.

My questions are:

1. how to re-initialize everything you need from within your bootloaded user code.

2. the second mistake can be avoided by appropriately edit the *.cmd file?

  • Hi,

    Here are my response.

    A1. The initialization steps such as PLL configuration etc that is been in the gel file, use the same initialization procedure in the your user code too. As mentioned in the wiki page It is a good practice to re-initialize everything you need from within your bootloaded user code.

    A2. Ensure that no program code is allocated to SARAM31 memory SARAM31 (byte address 0x4E000 – 0x4FFFF) which is reserved for the bootloader.

     

    For example in the command file <*.cmd> SARAM and DARAM is used, but ensuring SARAM31 memory space is not used:

     

    DARAM (RW) : origin = 0000400h length = 007A00h /* on-chip DARAM */

    SARAM (RW) : origin = 0008000h length = 01FE80h /* on-chip SARAM */

    // do not use the following memory space SARAM_31 as this is reserved for bootloader operations.

    // SARAM_31 (RW) : origin = 004E000h length = 002000h /* on-chip SARAM 31 */

     

    You can refer to CSL examples, to understand the allocation of memory using command file, “ look for *.cmd file in the example folder”.

     

    Hope you had already referred to bootloader app note - Bootloader APP Note  and the above information helps.

     

    Regards

    Vasanth

  • for initialization, I use the sample code provided by TI wiki:

    processors.wiki.ti.com/.../C5515_Boot-Image_Programmer

    I add the following code to my application code:

    // Bypass the PLL as the system clock source
    asm("*port(#0x1C1F)=#0x0"); //Clock Configuration MSW reg
    // program PLL to 100MHz with CLK_SEL = 0
    asm("*port(#0x1c20)=#0x8BE8"); //PLL Control 1 reg
    asm("*port(#0x1c21)=#0x8000"); //PLL Control 2 reg
    asm("*port(#0x1c22)=#0x0806"); //PLL Control 3 reg
    asm("*port(#0x1C23)=#0x0000"); //PLL Control 4 reg
    // wait at least 4 milli sec for PLL to lock
    asm("repeat(0xC350)");
    asm("nop");
    asm("*port(#0x1c1F)=#0x0001"); // Clock configuration MSW reg

    When building the project, CCS report errors:
    1. Illegal directive or mnemonic
    2.Only labels and comments may begin in the first column. Make sure that the label name is not a reserved keyword.
    3. parse error

    What's going on about theses inline assemblies?
  • Hi,

    You need to choose build as  algebraic by right clicking on the file, clicking on Properties, Runtime Model Options, then choose algebraic where it reads "Select assembly source language".

    You might also need to select option "codegen outputs algebraic assembly" in Runtime model Options.

    The following E2E post will provide more info - E2E_Post

    Hope the above info helps.

    Regards

     Vasanth