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.

TMS320C6416T: about DSP C6416 Boot and Gpio interface problem

Part Number: TMS320C6416T

   Hi all experts:

       I have met two questions During Debugging  DSP C6416, one about C6416 Power on boot failed occasionally,another about C6416 GPIO Pin

      question 1:

      when C6416 boot failed, using emulator save Local memory form address 0x0 to 0x400 Data, when C6416 boot success,also save Local memory from address 0x0 to 0x400 Data.

       analysing failed and successful two grouops length 0x400 byte data, some datas different, What's the reason it cause to the first boot loading the Local memory data error?

      question 2:

       During test DSP C6416 and FPGA interconnect gpio pin, when I configure C6416 gpio pin 8 、pin 9、 pin 10 output and pin 8、pin 9、pin 10 configure the same, GPIO8、GPIO9、GPIO10

       output the same Frequence square-wave, FPGA can sample GPIO8、GPIO9 signal, but can not sample  GPIO pin 10 signal, I also confirm hard circurt connect no problem, What's the reason it cause to gpio 10 no output signal, which whether  related to chip ?

     

     

  • Hi Heng Ye,

    Could you give more details about software release, version and GPIO configuration?
    Do you have some logs?

    Regards,
    Tsvetolin Shulev
  • firstly  thank  Tsvetolin Shulev,  

        some boot logs and gpio configuration such as the following:boot 1K data logs, boot success data place left column,

        boot failed place right column,  file data_analysing .doc is comparing two data results

         gpio pin configure such as code,

          #define GPEN   *(volatile Uint32*)0x01b00000

          #define GPDIR  *(volatile Uint32*)0x01b00004

          #define GPVAL  *(volatile Uint32*)0x01b00008

         GPEN  |= ((1 <<8) | (1 <<9) | (1 << 10)|(1<<11)|(1<<12));

          GPDIR |= ((1 <<8) | (1 <<9) | (1 << 10)|(1<<11)|(1<<12));

          delay(1)   /*delay 1s*/

           /*pull pow*/

          GPVAL &= 0xE0FF;

           delay(1)   /*delay 1s*/

          /*pull high*/

          GPVAL |= 0x1F00;

    two_group_data_comparae.docx

  • Is this bare metal or DSP/BIOS?  If bare metal can you post your vectors.asm file?

  • To Brad Griffis:

          Thanks reply,  we run DSP C6416 Porgram with bare metal, without DSP/BIOS, we use vectors.asm, please reference such as:

    ********************************************************************************
    *           Copyright (C) 2000 Texas Instruments Incorporated.
    *                           All Rights Reserved
    *------------------------------------------------------------------------------
    * FILENAME...... vecs.asm
    * DATE CREATED.. 12/06/2000
    * LAST MODIFIED. 12/06/2000
    ********************************************************************************
    *------------------------------------------------------------------------------
    * Global symbols defined here and exported out of this file
    *------------------------------------------------------------------------------
    .global _vectors
    .global _c_int00
    .global _vector1
    .global _vector2
    .global _vector3
    .global _c_int04
    .global _c_int05
    .global _c_int06
    .global _c_int07
    .global _vector8 ; Hookup the c_int08 ISR in main() for EDMA
    .global _vec_dummy ; Hookup the c_int09 ISR in main() for DMA
    .global _vector10 
    .global _vec_dummy ; Hookup the c_int11 ISR in main() for DMA
    .global _vector12
    .global _vector13
    .global _vector14
    .global _vector15
    *------------------------------------------------------------------------------
    * Global symbols referenced in this file but defined somewhere else. 
    * Remember that your interrupt service routines need to be referenced here.
    *------------------------------------------------------------------------------
       .ref _c_int00
    *------------------------------------------------------------------------------
    * This is a macro that instantiates one entry in the interrupt service table.
    *------------------------------------------------------------------------------
    VEC_ENTRY .macro addr
    STW B0,*--B15
    MVKL addr,B0
    MVKH addr,B0
    B B0
    LDW *B15++,B0
    NOP 2
    NOP   
    NOP   
    .endm
    *------------------------------------------------------------------------------
    * This is a dummy interrupt service routine used to initialize the IST.
    *------------------------------------------------------------------------------
    .sect ".text:isr"
    _vec_dummy:
    B    B3
    NOP  5
    *------------------------------------------------------------------------------
    * This is the actual interrupt service table (IST). It is properly aligned and
    * is located in the subsection .text:vecs. This means if you don't explicitly
    * specify this section in your linker command file, it will default and link
    * into the .text section. Remember to set the ISTP register to point to this
    * table.
    *------------------------------------------------------------------------------
    .sect ".vector"
    .align 1024
    _vectors:
    _vector0: VEC_ENTRY _c_int00
    _vector1: VEC_ENTRY _vec_dummy
    _vector2: VEC_ENTRY _vec_dummy
    _vector3: VEC_ENTRY _vec_dummy
    _vector4: VEC_ENTRY _c_int04
    _vector5: VEC_ENTRY _c_int05
    _vector6: VEC_ENTRY _c_int06
    _vector7: VEC_ENTRY _c_int07
    _vector8: VEC_ENTRY _vec_dummy ; Hookup the c_int08 ISR in main() for EDMA
    _vector9: VEC_ENTRY _vec_dummy ; Hookup the c_int09 ISR in main() for DMA
    _vector10: VEC_ENTRY _vec_dummy
    _vector11: VEC_ENTRY _vec_dummy ; Hookup the c_int11 ISR in main() for DMA
    _vector12: VEC_ENTRY _vec_dummy
    _vector13: VEC_ENTRY _vec_dummy
    _vector14: VEC_ENTRY _vec_dummy
    _vector15: VEC_ENTRY _vec_dummy
    *------------------------------------------------------------------------------
    ********************************************************************************
    * End of vecs.asm
    ********************************************************************************
  • Don’t use VEC_ENTRY for vector0. B15 is undefined at reset and so it writes to and reads from a random address. This can cause boot failures. Instead do this:

    Mvkl _c_int00, b0

    Mvkh _c_int00, b0

    B b0

    Nop

    Nop

    Nop

    Nop

    Nop

  • thank Brad Griffis
    Let me have a try
  • Hi Brad Griffis:
    vector.asm only cause usr application progrom runing fail, Whether also cause boot fail, we find no run second bootloader, program load completely??
  • Hi Brad Griffis:
    reference your suggestion ,vector.asm modify such as code , but _c_int04\ _c_int05\ _c_int06 interrupt service not entry, What's the reason it cause to ??
    *------------------------------------------------------------------------------
    * Global symbols defined here and exported out of this file
    *------------------------------------------------------------------------------

    .global _vectors
    .global _c_int00
    .global _vector1
    .global _vector2
    .global _vector3
    .global _c_int04
    .global _c_int05
    .global _c_int06
    .global _c_int07
    .global _vector8 ; Hookup the c_int08 ISR in main() for EDMA
    .global _vec_dummy ; Hookup the c_int09 ISR in main() for DMA
    .global _vector10
    .global _vec_dummy ; Hookup the c_int11 ISR in main() for DMA
    .global _vector12
    .global _vector13
    .global _vector14
    .global _vector15

    *------------------------------------------------------------------------------
    * Global symbols referenced in this file but defined somewhere else.
    * Remember that your interrupt service routines need to be referenced here.
    *------------------------------------------------------------------------------
    .ref _c_int00

    *------------------------------------------------------------------------------
    * This is a macro that instantiates one entry in the interrupt service table.
    *------------------------------------------------------------------------------
    VEC_ENTRY .macro addr

    MVKL _c_int00,B0
    MVKH _c_int00,B0
    B B0
    NOP 2
    NOP
    NOP
    NOP
    .endm

    *------------------------------------------------------------------------------
    * This is a dummy interrupt service routine used to initialize the IST.
    *------------------------------------------------------------------------------
    .sect ".text:isr"
    _vec_dummy:
    B B3
    NOP 5

    *------------------------------------------------------------------------------
    * This is the actual interrupt service table (IST). It is properly aligned and
    * is located in the subsection .text:vecs. This means if you don't explicitly
    * specify this section in your linker command file, it will default and link
    * into the .text section. Remember to set the ISTP register to point to this
    * table.
    *------------------------------------------------------------------------------
    .sect ".vector"
    .align 1024

    _vectors:
    _vector0: VEC_ENTRY _c_int00
    _vector1: VEC_ENTRY _vec_dummy
    _vector2: VEC_ENTRY _vec_dummy
    _vector3: VEC_ENTRY _vec_dummy
    _vector4: VEC_ENTRY _c_int04
    _vector5: VEC_ENTRY _c_int05
    _vector6: VEC_ENTRY _c_int06
    _vector7: VEC_ENTRY _c_int07
    _vector8: VEC_ENTRY _vec_dummy ; Hookup the c_int08 ISR in main() for EDMA
    _vector9: VEC_ENTRY _vec_dummy ; Hookup the c_int09 ISR in main() for DMA
    _vector10: VEC_ENTRY _vec_dummy
    _vector11: VEC_ENTRY _vec_dummy ; Hookup the c_int11 ISR in main() for DMA
    _vector12: VEC_ENTRY _vec_dummy
    _vector13: VEC_ENTRY _vec_dummy
    _vector14: VEC_ENTRY _vec_dummy
    _vector15: VEC_ENTRY _vec_dummy

    *------------------------------------------------------------------------------


    ********************************************************************************
    * End of vecs.asm
    ********************************************************************************
  • Sorry my previous response wasn't very clear.  I was posting from my phone late at night to try to bridge the time difference between us.  Let me provide a more detailed response now.

    First, here is the portion of your vectors.asm that needs to be changed:

    heng ye said:
    *------------------------------------------------------------------------------
    .sect ".vector"
    .align 1024
    _vectors:
    _vector0: VEC_ENTRY _c_int00
    _vector1: VEC_ENTRY _vec_dummy
    _vector2: VEC_ENTRY _vec_dummy
    _vector3: VEC_ENTRY _vec_dummy
    _vector4: VEC_ENTRY _c_int04
    _vector5: VEC_ENTRY _c_int05
    _vector6: VEC_ENTRY _c_int06
    _vector7: VEC_ENTRY _c_int07
    _vector8: VEC_ENTRY _vec_dummy ; Hookup the c_int08 ISR in main() for EDMA
    _vector9: VEC_ENTRY _vec_dummy ; Hookup the c_int09 ISR in main() for DMA
    _vector10: VEC_ENTRY _vec_dummy
    _vector11: VEC_ENTRY _vec_dummy ; Hookup the c_int11 ISR in main() for DMA
    _vector12: VEC_ENTRY _vec_dummy
    _vector13: VEC_ENTRY _vec_dummy
    _vector14: VEC_ENTRY _vec_dummy
    _vector15: VEC_ENTRY _vec_dummy
    *------------------------------------------------------------------------------

    It's just the one highlighted line that is an issue.  The VEC_ENTRY macro itself is correct for "normal" interrupts, but the reset macro should not use that.  There is no need to use a macro for each of those vectors.  You can just insert 8 instructions instead.  Here's how it should look:

    *------------------------------------------------------------------------------
    .sect ".vector"
    .align 1024
    _vectors:
    _vector0:
       mvkl _c_int00, b0
       mvkh _c_int00, b0
       b b0
       nop
       nop
       nop
       nop
       nop
    _vector1: VEC_ENTRY _vec_dummy
    _vector2: VEC_ENTRY _vec_dummy
    _vector3: VEC_ENTRY _vec_dummy
    _vector4: VEC_ENTRY _c_int04
    _vector5: VEC_ENTRY _c_int05
    _vector6: VEC_ENTRY _c_int06
    _vector7: VEC_ENTRY _c_int07
    _vector8: VEC_ENTRY _vec_dummy ; Hookup the c_int08 ISR in main() for EDMA
    _vector9: VEC_ENTRY _vec_dummy ; Hookup the c_int09 ISR in main() for DMA
    _vector10: VEC_ENTRY _vec_dummy
    _vector11: VEC_ENTRY _vec_dummy ; Hookup the c_int11 ISR in main() for DMA
    _vector12: VEC_ENTRY _vec_dummy
    _vector13: VEC_ENTRY _vec_dummy
    _vector14: VEC_ENTRY _vec_dummy
    _vector15: VEC_ENTRY _vec_dummy
    *------------------------------------------------------------------------------
  • heng ye said:
    Hi Brad Griffis:
    vector.asm only cause usr application progrom runing fail, Whether also cause boot fail, we find no run second bootloader, program load completely??

    Can you please post your secondary bootloader code too?

  • Hi Brad Griffis:
    Thanks reply again, I use secondary bootloader code references:

    #pragma CODE_SECTION(cboot,".bootload");
    extern far void c_int00(void);

    void cboot(void)
    {
    register int code_i ;

    code_i = 0 ;
    // copy code form external flash to behind Local memory 0x400 address
    for((code_i) = 0;(code_i)<0xefff;(code_i)++)
    {
    *(char *)(0x00000400+code_i) = *(char *)(FLASH_CODE_ADDR + code_i);
    }
    c_int00();
    }
  • Hi Brad Griffis:
    Thanks reply again, I use second bootloader program such as reference:
    extern far void c_int00(void);

    void cboot(void)
    {
    register int code_i ;

    code_i = 0 ;
    // copy code from external flash to behind local memory 0x400 address
    for((code_i) = 0;(code_i)<0xefff;(code_i)++)
    {
    *(char *)(0x00000400+code_i) = *(char *)(FLASH_CODE_ADDR + code_i);
    }
    c_int00();
    }
  • Please post your command file too. I’ll need that to understand how these pieces fit together.
  • Hi Brad Griffis:
    Thanks reply again, I post cmd file contents , please reference the following:

    MEMORY
    {
    BOOT : o = 0x00000000 l = 0x00000400
    L2: o=0x00000400 l=0x00080000
    }
    SECTIONS
    {
    .bootload > BOOT
    .vector > L2
    .switch > L2
    .text:isr > L2
    .text > L2
    .cinit > L2
    .const > L2
    .far > L2
    .stack > L2
    .cio > L2
    .bss > L2
    .sysmem > L2
    .csldata > L2

    }
  • I have a number of concerns about your code.

    1. Your bootloader is C code, but it executes before any kind of C run-time has been established.  For example, there is no stack pointer that has been initialized so if your bootloader pushes or pops anything at all that is going to cause issues.
    2. There are inconsistencies in your memory map.  The 6416T has 1MB of L2 RAM, i.e. addresses 0 - 0x000FFFFF.  Your command file appears to define memory from 0 - 0x000803FF.  Your bootloader appears to copy data from external flash up to address 0x0000F3FF.  So it is possible that your program occupies more space than is actually being copied over.

    One other question that comes to mind is how you are converting your *.out file to a format that can be programmed to flash.

    At this point I'd like to suggest that you consider implementing your bootloader along the lines described in this app note:

    Creating a Second-Level Bootloader for FLASH Bootloading on TMS320C6000 Platform
    http://www.ti.com/lit/spra999

    It provides an assembly based bootloader (avoids the issue of C run-time) as well as the steps needed to utilize the hex conversion utility, etc.  So you might want to consider shifting gears and going this route.

    I also have some ideas with respect to continuing on your current path:

    1. Take a look at the map file corresponding to your current implementation.  Can you fit your vectors.asm, c_int00, and your bootloader all into the first 0x400 bytes?
    2. My thought would be to change your linker command file such that all of those sections fit into the first 0x400 bytes, you could have your vector table exist at address 0, branch to c_int00, and then have it branch to your bootloader code (e.g. you could make your bootloader main()).

    Best regards,
    Brad

  • Hi Brad,
    Thasnks again, I sure my second boot all into 0x400 and application memory size not out of allocation the Local memory size.
    I want to konw DSP will immediately jump c_int00, Then it Create C run-time and copy data from flash to Local memory begin address 0x400, when move Data completely, we again run c_int00 , Whether Operation is right or wrong?? if is not correct, how to do ?

    it boot very occasionally, how to sure it create because of B15 indefinitly??
  • Hi Brad,
    boot failed only happen a few product with C6416, we all run the same program and test , If it cause boot failed because of B15 indefinitly, why others can boot successful ?
  • The failures are unpredictable. Some devices may fail more than others. I’ve seen many such cases. You could include the c_int00 source code in your project and change it to first call your bootloader and then call main, if it will still fit in the first 0x400 bytes with the extra code.

  • Hi Brad:
    Thanks again,I find _c_int00 address pos in 0x00003bc0 acording map file, run second bootloader cboot pos in 0~0x400, first boot move 1K data, it run cboot . I have some question such as:

    question 1:

    I means if I want to run second load program in C-run time environment,Can you give me more explicit reference?

    question 2:

    I have modifyed vectors.asm according your last advising, delete B15 when it reset, contents such as
    _vector0:
    MVKL _c_int00,B0
    MVKH _c_int00,B0
    B B0
    NOP
    NOP
    NOP
    NOP
    NOP
    I want to know whether _c_int00 can run when power on reset only copy 1K byte cboot data to Local memory, cboot function such as:

    void cboot(void)
    {
    register int code_i ;

    code_i = 0 ;
    for((code_i) = 0;(code_i)<0x30000;(code_i)++)
    {
    *(char *)(0x00000400+code_i) = *(char *)(FLASH_CODE_ADDR + code_i);
    }
    c_int00();
    }

    according the cboot program, excute external flash to Local memory copping with C run-time , Then C run-time How to Create?

    question 3:

    I have also said only a few chip happen boot fail , How to make the best optimal way, make sure product run stable?



    /**************************************************************
    map file
    **************************************************************/
    OUTPUT FILE NAME: <./Debug/HELLO.out>
    ENTRY POINT SYMBOL: "_c_int00" address: 00003bc0


    MEMORY CONFIGURATION

    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    BOOT 00000000 00000400 00000080 00000380 RWIX
    L2 00000400 00080000 0000491c 0007b6e4 RWIX


    SECTION ALLOCATION MAP

    output attributes/
    section page origin length input sections
    -------- ---- ---------- ---------- ----------------
    .data 0 00000000 00000000 UNINITIALIZED

    .bootload
    * 0 00000000 00000080
    00000000 00000080 cboot.obj (.bootload)

    .cio 0 00000400 00000000 UNINITIALIZED

    .const 0 00000400 00000000 UNINITIALIZED

    .csldata 0 00000400 00000000 UNINITIALIZED

    .sysmem 0 00000400 00000000 UNINITIALIZED

    .text 0 00000400 000039c0
    00000400 00002180 main_DSP2.obj (.text)
    00002580 00000700 DSP6416_Flash.obj (.text)
    00002c80 00000280 SysInit.obj (.text)
    00002f00 000001e0 csl6416.lib : csl_irq.obj (.text:_IRQ_map)
    000030e0 000001a0 : csl.obj (.text:__CSL_init)
    00003280 00000140 : csl_timer.obj (.text:_TIMER_open)
    000033c0 00000100 : csl_timer.obj (.text:_TIMER_reset)
    000034c0 00000100 rts6400.lib : autoinit.obj (.text:__auto_init)
    000035c0 00000100 : exit.obj (.text:_exit)
    000036c0 00000100 : memset.obj (.text:_memset)
    000037c0 000000e0 : memcpy64.obj (.text:_memcpy)
    000038a0 000000c0 csl6416.lib : csl_irq.obj (.text:_mux2Tables)
    00003960 000000a0 : csl_emifa.obj (.text:_EMIFA_config)
    00003a00 000000a0 : csl_irq.obj (.text:_getMux)
    00003aa0 000000a0 : csl_irq.obj (.text:_setMux)
    00003b40 00000080 : csl_irq.obj (.text:__IRQ_init)
    00003bc0 00000060 rts6400.lib : boot.obj (.text:_c_int00)
    00003c20 00000040 csl6416.lib : csl_irq.obj (.text:_IRQ_disable)
    00003c60 00000040 rts6400.lib : args_main.obj (.text:__args_main)
    00003ca0 00000020 csl6416.lib : csl_irq.obj (.text)
    00003cc0 00000020 : csl.obj (.text:_CSL6416_LIB_)
    00003ce0 00000020 : csl_irq.obj (.text:_IRQ_clear)
    00003d00 00000020 : csl_irq.obj (.text:_IRQ_enable)
    00003d20 00000020 : csl_irq.obj (.text:_IRQ_globalEnable)
    00003d40 00000020 : csl_irq.obj (.text:_IRQ_nmiEnable)
    00003d60 00000020 : csl_irq.obj (.text:_IRQ_setVecs)
    00003d80 00000020 rts6400.lib : _lock.obj (.text:__nop)
    00003da0 00000020 : exit.obj (.text:_abort)
  • Please post the disassembly corresponding to cboot.
  • heng ye said:
    question 1:

    I means if I want to run second load program in C-run time environment,Can you give me more explicit reference?

    There's not enough space to do this in 1KB.  The bootloader must be written in assembly code in order to function correctly.  An assembly bootloader was provided in the app note I referenced previously.

    heng ye said:
    question 2:

    I have modifyed vectors.asm according your last advising, delete B15 when it reset, contents such as
    _vector0:
    MVKL _c_int00,B0
    MVKH _c_int00,B0
    B B0
    NOP
    NOP
    NOP
    NOP
    NOP
    I want to know whether _c_int00 can run when power on reset only copy 1K byte cboot data to Local memory, cboot function such as:

    void cboot(void)
    {
    register int code_i ;

    code_i = 0 ;
    for((code_i) = 0;(code_i)<0x30000;(code_i)++)
    {
    *(char *)(0x00000400+code_i) = *(char *)(FLASH_CODE_ADDR + code_i);
    }
    c_int00();
    }

    according the cboot program, excute external flash to Local memory copping with C run-time , Then C run-time How to Create?

    You need an assembly bootloader.

    heng ye said:
    question 3:

    I have also said only a few chip happen boot fail , How to make the best optimal way, make sure product run stable?

    I don't know for certain that this is the issue, but it is the most common issue I've seen that fails in the way you've described.  I expect that fixing your bootloader will resolve the issue.

    If you want to test further, here are a few things to check:

    1. Are you able to connect with JTAG to a board that fails to boot, or does CCS throw an error?
    2. If you are able to connect, where is the program counter?
    3. Do you have boards that regularly fail to boot?  Is the behavior consistent related to questions 1-2, i.e. does it never allow you to connect, or is program counter consistently in the same location?
    4. A test that you could run would be to create a "dummy program" which is simply an assembly instruction that branches to itself.  For example, if you locate vectors.asm inside the .bootload section and then change vector0 to load the address _vector0 instead of _c_int00, then the device should simply stick in that loop when it boots.  A good test is to see if you can consistently power-up the board and verify that you are inside that loop.  If that is the case, that will be strong evidence that something is happening in your software that crashes the device.  My assumption is that your C code is using uninitialized registers which is causing accesses (on some boards) to reserved memory locations.  This will crash the device.

  • Thanks Brad again, I  try to test again accroding your advising

  • Hi Brad:
    somethings to check reply:
    1. Are you able to connect with JTAG to a board that fails to boot, or does CCS throw an error?
    I am able to connect with JTAG to board when it boot fails, CCS not throw error

    2. If you are able to connect, where is the program counter?
    sorry,when I connect it successfully, I recoder the program counter , reset and restart load program.

    3.Do you have boards that regularly fail to boot? Is the behavior consistent related to questions 1-2, i.e. does it never allow you to connect, or is program counter consistently in the same location?
    I have not boards regularly fail to boot, boot fail happened very few , sorry, I do not recoder the program counter when boot fail
  • Hi Brad:
    I use cboot program asm code reference cboot_asm_code.doc file, cboot not ready C run-time also run normal, few few run fail ? where mostly cause cboot run failed acroding to asm code, Thanks!
  • I had a quick look at that document with the assembly code.  A few comments:

    1. The first instruction shows up as ".word" meaning it does not disassemble to a legitimate instruction.  That's never good and can result in undefined behavior.  Why is 0xFFFFFFFF the very first instruction?  Is that part of the binary that was flashed, or is something improper happening at the bus level to read that?
    2. Address 0x14 looks to be clearing bits 12:2 of register A0.  I'm not sure why only part of the register is being initialized. 
    3. Address 0x14 appears to be comparing against A3, but I don't see anywhere that A3 was initialized.  That looks like it could have random results.

    Rather than us trying to create and debug brand new assembly code for this task, I strongly recommend using the tried and true assembly code from the app note I referenced.

  • Hi Brad:

             sorry,I give your cboot asm code because of modifing  last time, please reference original file,   cboot_origianal_asm_code.doc

  • This is exactly the issue I have suspected all along.  The very first instruction is doing a "push".  The stack pointer (SP) is B15, and it is uninitialized coming out of reset.  So you're writing to a random address in the memory map as you come out of reset.

    I think if you wrote this as an assembly function it would be fine.  Just copy all the same instructions except for the very first one.  You can also drop the last 3 instructions (the pop, NOP, and return) since those never execute.

  • PS. Perhaps an even quicker/easier test would be to use a hex editor to change the first 32-bit opcode to 0x00000000 which corresponds to a NOP. I don't see why the compiler even bothers to push/pop that register given that it's not being used in the code.
  • heng ye said:
    2. If you are able to connect, where is the program counter?
    sorry,when I connect it successfully, I recoder the program counter , reset and restart load program.

    You need to configure CCS a bit different when debugging boot issues than you do for normal development.  Please see this wiki article which is highly relevant to debugging your issue:

    http://processors.wiki.ti.com/index.php/Debugging_Boot_Issues

    Specifically, make sure your target configuration does not use any gel files whatsoever.  The gel files will reconfigure things and destroy the evidence we're looking for.  Also, you can do "load symbols" for symbolic debug, but never use "load program".

    Finally, if you follow my main suggestion of writing a bootloader in assembly code, then it is easier to do things like inserting an assembly spin loop at the start of the bootloader like shown on that page.

    If inserting the NOP (instead of the PUSH) doesn't resolve your issue, you're going to need to leverage all of these techniques to understand the root cause.

  • One other quick thought -- please monitor the external flash interface in the case of a failure. You should be able to tell whether the first 0x400 got loaded and whether the rest of the code got loaded. In other words, how much activity do you observe on the bus in a successful boot compared to a failed boot?
  • Hi Brad:
    I sure the first 0x400 got loaded, the rest of the code got not loaded, when boot failed happened, only the first 0x400 got loaded, the rest of the code never got loaded
  • That points to your secondary bootloader as being the issue.

  • Hi Heng Ye,

    Any updates? Were you able to eliminate the access with the uninitialized register pointer? Hopefully that resolved your issue.

    Best regards,
    Brad