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.

CCS/TMS320F28335: Can user re-map IRQ vector table in TMS320F28335?

Part Number: TMS320F28335

Tool/software: Code Composer Studio

Hi sir,

I have a question about vector table.

If there are two project : bootloader(start from flash 0x33FFF6) + application(starting from the middle sector of the whole flash).

And both bootloader and application have the same IRQ ISR.

My question is:

How to deal with the vector table of IRQ ?  Is it need to re-map the vector table? (as ARM7, Cortex-M3, it has vector table re-map register to setting it.)

Thanks.

Best Regards,

Vincent

  • Vincent,

    You cannot re-map the interrupt vectors.  But the scenario you describe will handle itself.  Both secondary bootloader and app are independent projects with their own interrupt table.  Bootloader runs first, and initializes the PIE RAM with its interrupt table.  After transferring control to the app, the app initializes the PIE RAM with its interrupt table.

    Regards,

    David

  • Hi David,

    Thanks for your response.

    So my understanding is :

    1.  DSP28335 cannot re-map the interrupt vectors. 

    2.  Use "InitPieVectTable();" in both secondary bootloader and app to init their own interrupt table.

         But how to distinguish between these two vector tables ?

         For example: (address in below is just an example ,not actual address)

            1) Secondary boot base address = 0x0000h;  App base address = 0x6000h

            2) Both secondary boot and app have SCI interrupt.  And solid address of SCI interrupt vector table is 0xfc(when IRQ occur, the first address to access).

            3) In secondary boot :  SCI isr route entry address =  0x1234. (this address is compiled by compiler)  

                So data of  address 0xfc in flash:

                       Flash address      Data

                       0xfc                      0x12

                       0xfd                      0x34             

             4) In app  : SCI isr route entry address = 0x789a  (this address is compiled by compiler, app data of hex should be transmitted by upgrade function and write to flash)  

                 So data of address 0x60fc(If there is re-map function)           Data

                            0x60fc                                                                           0x78

                            0x60fd                                                                           0x9a

               Now there is no re-map function, so I do not know how the isr route entry address be arranged.  

              Certainly the secondary boot can not use IRQ , use inquiry mode to receive data from PC. But my question is : how to find isr entry address of app when there is no vector re-map funciton.

             I used MSP430 of TI without vector re-map function before, and my solution of MSP430 is :

               1) In secondary boot , not use IRQ ,only use inquiry mode. 

               2) In secondary boot,  wrote an assembly sentence to force PC jump to address 0x60fc, so it can find the correct isr route entry address of app when IRQ occur while PC run in application.

            So my question is :

            a. If i must follow MSP430 method to handle vector table in DSP 28335?

            b. Any other solution of handling vector table or there is no need to handle it , just only use InitPieVectTable() to init vector table ? Or additional configuration need to be config?

    Thanks.

    Best Regards,

    Vincent

     

         

  • Hi Vincent,

    Each of the two projects (bootloader and app) are independent CCS projects.  Each has its own PIE interrupt vectors that point to its own ISR.  These addresses are resolved by the linker at project build time.  You do not need to do anything special here.  You only run one project at a time.  The bootloader will generally run after reset.  It will initialize the PIE vectors, and then do whatever it is that you want it to do (e.g., validate the app or download a new app to flash).  It will then transfer control over to the app.  There are e2e posts on how to do this, for example, here:

    https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/273790

    At that point, the app will run from the beginning and init the PIE vectors with its vectors.  The bootloader doesn't run anymore.  If you need the bootloader to run, you have to link the execution back to the start of the bootloader, at which time the PIE vectors get initialized with the bootloader vectors again.

    Does this clear it up?

    Regards,

    David

  • Hi David,

    Thanks very much for your professional response.

    As I did not use DSP before, so my experience all based on ARM7 or Cortex-Mx, different core with DSP.  After read your response and link thread about jump from boot to app.  I am evaluating the upgrade design and will try this method first later , maybe there will be new question , then i think I need create a new thread topic. 

    Current I only confirm two points with you:

    1.  About vector table, i do not need modify anything about it in two project (secondary boot + app). The only thing i need to do is assign different flash sector of secondary_boot and app,right ?

         It seems very simple to handle this vector table.   Is there any document to describe the vector table in detail ?  

    2.  You mentioned jump from boot to app in the link thread is use "asm(" LB 0x123456");" . My question is if my application size large than one flash section, for example, app size > one section size , app size is in  Flash_E + Flash_D  (from 0x31 8000h to 0x32 7FFFh) . In this case, when jump from boot to app,

    I need use:

    asm(" LB 0x327FFFE");  ,

    Right?  The jump address always is the last two bytes of the last flash section of app project ?

    Thanks again for your help.

    Best Regards,

    Vincent  

     

  • Vincent,

    Vincent Hu said:

    1.  About vector table, i do not need modify anything about it in two project (secondary boot + app). The only thing i need to do is assign different flash sector of secondary_boot and app,right ?

    Correct.

    Vincent Hu said:

    2.  You mentioned jump from boot to app in the link thread is use "asm(" LB 0x123456");" . My question is if my application size large than one flash section, for example, app size > one section size , app size is in  Flash_E + Flash_D  (from 0x31 8000h to 0x32 7FFFh) . In this case, when jump from boot to app,

    I need use:

    asm(" LB 0x327FFFE");  ,

    Right?  The jump address always is the last two bytes of the last flash section of app project ?

    I think you meant 0x327FFE.  Yes, assuming you choose the hard address to be the last (highest addressed) two words of the flash sectors containing the program.  That is what was suggested in the other e2e thread.  The idea here is just to keep the hard address out of the way of the program.  By using the last two words of the memory containing the program, the hard address LB instruction will not break up the memory the program uses.

    Regards,

    David

  • Hi David,

    Got it and thanks a lot again.

    I'll try it later.

    BTW :  Is there any special  document which described vector table of TI ?

    Thanks.

    Best Regards,

    Vincent

  • HI Vincent,

    Vincent Hu said:

    BTW :  Is there any special  document which described vector table of TI ?

    The PIE is documented in the System Control User's Guide, SPRUFB0.

    Regards,

    David

  • Hi David,

    Thank you very much.

    BTW: Is there any IAP example from TI I could use directly ?  As I know , IAP example should include : secondary_boot + user_app projects.

    Best Regards,

    Vincent

  • Vincent,

    Vincent Hu said:

    Is there any IAP example from TI I could use directly ?  As I know , IAP example should include : secondary_boot + user_app projects.

    I do not know of such an example.  Sorry.

    - David