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.

Jumping from Boot-loader to application

Other Parts Discussed in Thread: TMS470MF06607

hi,

   While i am jumping from boot-loader to application i getting hard fault exception . Whether we have to disable exception, I am using below instruction for  jumping to application

                 asm(" mov  r0,#0x10000");
                 asm(" blx r0");

Thanks,

Ram

  • Try setting bit 0 of the target address. As things stand, you are telling the CPU to switch from Thumb2 mode into ARM mode but it doesn't support that mode and you'll get a fault. The bottom bit of the address is used to signal the instruction set used at the branch target location.

  • hi Dave Wilson,

                           while jumping to application i spiked _init function and observed application code is running but i am able to get interrupts. please let know the changes required

  • Ram,

      Sorry - I don't understand what you are asking here. You will find example code that does exactly what you are trying to do in the boot_loader directory of the TivaWare or StellarisWare release. Look in one of the bl_startup_xxx.s files for a function called CallApplication.

  • Sorry - I don't understand what you are asking here.

    That last post of the OP sounds like the (garbled) output of the google translator.

    One might guess that he doesn't get proper interrupts, and probably needs to check if he updated the vtable correctly before jumping into his application.

  • Dave Wilson,

    Actually i am developing bootloader, in this process i am facing some issue.

     After jumping to appilication _init fuction which is in sys_startup.asm rising hard fault exception , Once i skip this function the application code is running, but interrupt are not generating.

    So, now my questions are

    1) why _init function is rising exception and how to solve.

    2) Regarding interrupt generation, i am updationg VECOFFSET(E000ED08) reg but interrupts are not generating. please let me know where to update the modified vector table base address.

    Thanks,

    Ram.

  • Dave Wilson,

    Not sure if TI employees are answering forum questions over the weekend ...

     After jumping to appilication _init fuction which is in sys_startup.asm rising hard fault exception , Once i skip this function the application code is running, but interrupt are not generating.

    There is actually not enough information to point to the actual reason. I hope you followed Dave's hint to set the LSB of your _init function target address. You can retrieve the reason of the hard fault (or at least a hint) from the HardFault Status Register in the SCB, see  here. Additionally, you can try to implement Joseph Yiu's hardfault handler routine (use your favourite search engine ) to gather more information.

    2) Regarding interrupt generation, i am updationg VECOFFSET(E000ED08) reg but interrupts are not generating. please let me know where to update the modified vector table base address.

    The vector table has special alignment requirements, see here.  You need to follow special precaution switching over to a new vtable, as interrupts used in the bootloader might still have left some pending flags set. De-initialize and clear everthing before switching over. And, of course, disable all interrupts before doing so.

  • Sorry for the delay. We typically answer weekend questions first thing on Monday morning.

    In addition to f.m's excellent advice, you will probably find this appnote on debugging fault conditions really helpful.

  • i am using tms470mf06607

    i changed vector table address  to 0x10000 and i modifying register as given below

    VECOFFSET = (Uint32 *)(E000ED08)

    *VECOFFSET = 0x10000 << 7;

    whether above mentioned value is correct for relative address,

  • Aha - that probably explains why some of the advice you've been getting seems a bit odd. This forum is supporting the Tiva microcontroller family and TivaWare software. Unfortunately, none of the TI folks answering questions here know anything at all about TMS470 parts. After posting this, I'll try to move your thread over to the correct forum so that the experts over there can help out.