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.

F2837xD_CodeStartBranch.asm what do

Other Parts Discussed in Thread: CONTROLSUITE

Hello,

I have a question.

In every CONTROLSUITE project I see that is included F2837xD_CodeStartBranch.asm

and entry point is set to "--entry_point=code_start",

so I believe that is mandatory.

If I don't remember to include F2837xD_CodeStartBranch.asm and specify code start,

what problems can happened ? thankyou

  • Mauro,

    The CodeStartBanch.asm contains a branch instruction that is linked to the bootloader jump-to-"mode" location (e.g., jump-to-flash address in flash for flash bootmode).  This branch is the first instruction in the user code that gets executed after the ROM bootloader completes its operations (because the ROM bootloader will branch to that address).  Typically, the branch in CodeStartBranch branches to a short ASM routine that disables the watchdog timer, and then branches to the _c_int00 which is the C-environment setup routine from the compiler runtime support library.  _c_int00 calls main() at its end.

    If you don't have the branch instructions from CodeStartBranch.asm in your code, then the ROM bootloader will not transition execution to your code correctly.  Your code will crash since the jump-to-flash (for example) address will not contain valid code.

    The --entry_point=code_start is purely a Code Composer Studio thing.  When you do a 'Restart' in CCS, it sets the PC to the entry point.  You do not need this configured in order for your code to work correctly.  It is only for debugger use.  Personally, I do use Restart in CCS much.  I prefer to always do a Reset in CCS and run from there.

    Regards,

    David

  • So you are tell me
    that If I create stand-alone code
    it will work perfectly without "CodeStartBranch.asm",

    but If I want to debug the code in CCS it's better to include "CodeStartBranach.asm"
    and obviously you have to specify the debugger entry point
  • Hi Mauro,

    Mauro Fantina said:
    So you are tell me
    that If I create stand-alone code
    it will work perfectly without "CodeStartBranch.asm",

    but If I want to debug the code in CCS it's better to include "CodeStartBranach.asm"
    and obviously you have to specify the debugger entry point

    No, that's not what I'm saying.  You MUST have CodeStartBranch.asm in order for the code to run correctly from a reset.  Doesn't matter if it is standalone or debugger.

    Setting the code entry point is only a debugger thing.  Standalone code is not affected by this.

    - David

  • Can I ask a related question about this routine...

    I've just spent a couple of hours trying to work out why my code won't run on cold-start vs in debugger mode.

    It turns out I had DSP2833x_CodeStartBranch.asm in a library that I was linking with, not the executable project.

    Can you explain why this routine needs to be in the main executable project (rather than a library) ?

    The symbols seem to be OK to me, and there were no warnings about missing SECTIONS specifications etc.

    i.e. "codestart" was defined in SECTIONS to point to BEGIN, which was set to the correct address in flash...

    I got it working, but I'm curious as to why (since it ate half my day to chase down ;-))