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.

Help! Custom boot loader ITRAP (F28335)

Other Parts Discussed in Thread: TMS320F28335

I have developed custom boot-loader for the TMS320F28335 .   I've partitioned the boot-loader and application code into two separate projects.  The boot-loader use flash sector A and the application uses flash sector B-C-D. Other flash sector are used to store data.

The boot mode for TMS320F28335 is configured to jump to flash. At the address 0x33FFF6 there is the first instruction of my boot loader.

At startup my custom boot make a system configuration and than jump to application without problem.

 

Now, some time I need to jump from my application to a specific istruction (address 0x338000) of my custom boot. To do this I call function prepare_to_jump:

    .text
_prepare_to_jump:
    SETC INTM;
      ZAPA;
      MOV @SP,#0;
      PUSH ACC;
     PUSH AL;
     MOV AL, #0x0a08;
      PUSH AL;
      MOVL XAR7, #0x33800;
      PUSH XAR7;
      POP RPC;
      POP ST1;
      POP ST0;
      POP IER;
      POP DBGIER;
      LRETR; 

By doing this I've an ITRAP istruction that generate a system reset! Where I'm doing wrong?

 

Thanks in advance,

Mauro.

 

  • MD said:

        .text

    _prepare_to_jump:
        SETC INTM;
          ZAPA;
          MOV @SP,#0;
    1      PUSH ACC;
     2    PUSH AL;
         MOV AL, #0x0a08;
     3     PUSH AL;
          MOVL XAR7, #0x33800;
     4     PUSH XAR7;
     4     POP RPC;
     3     POP ST1;
      2    POP ST0;
       1   POP IER;
       0   POP DBGIER;
          LRETR; 

    By doing this I've an ITRAP istruction that generate a system reset! Where I'm doing wrong?

     

    Looks like you are missing a PUSH statement - you are popping more off the stack than is on there which is probably causing the ITRAP.

     

    Tim

  • Hello Mauro,

    I am working to wite a boot loader program for  F28335. Did your bootloader work finally?

    Can you please share that code with me?

     

    Thanks

    Jigar

  • Hi Jigar,

    my bootloader now is working!

    Did you have wrote some code for your boot-loader?

    What is your problem?

  • No Sir,

    I am new to this. Learning how to write one.

    Reading some pdfs.

    Can you share your experince with me?

    How to write one?

     

    thanks

    Jigar

  • The boot mode for TMS320F28335 is configured to jump to flash?

    I wrote two application (two different project).

    The first one is stored into flash block A (bootloader) and the second one is stored into flash blocks B/C/D.

    To do this you must define properly the memory configuration into the file .cmd included into your project.

    The bootloader have the first instruction at address 0x33FFF6 and at startup the internal boot jump at this instruction. Inside the boot main function, after microcontroller initialization, jump to the first address of block B where is stored the first instruction of my application.

    The custom boot is a simply application that jump to a memory address where is stored the first instruction of "real" application.

    Now I'm not at office and I cannot post you my source code.

    Can you post your memory configuration file ?

  • Thank you very much for this wonderful explanation.

    I am in thetraining for the rest of the day. Let me find .Cmd file and I will send that to you.

    Again Thanks.

    Jigar

  • hello,

    I'm doing the same things with you.

    could you please share some code wiht me? 

    especially the code in your project, how to jump between bootloader and app?

    thank you very much!

  • hi

    i am so proud of your work.

    i have spent time for 1 month. to do like you.

    please send me your coustom boot-loader for 28335.

    thank you very very much.

    my e-mail is choiwonseok@lignex1.com