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.

Enter error break when jumping to application

Other Parts Discussed in Thread: RM57L843

Hi Team,

An error interrupt is triggered after the bootloader downloads the program. (The application can run normally after being downloaded through the emulator)

The following is the allocation of memory in the bootloader program. The starting address of the application download is 0x00010020.

The following is the allocation of memory in the cmd file of the application.

At this point, after using the can port to download the program into the flash, after calling ((void (*)(void))g_ulTransferAddress)(), the program enters the prefetchEntry.

The following is the allocation of memory after changing the cmd file of the application.

At this time, after using the can port to download the program into the flash, after calling ((void (*)(void))g_ulTransferAddress)(), the program enters undefEntry.

May I know how to modify the cmd file of the application?

Thanks,

Annie

  • Hello Annie,

    Please provide more information.  What processor is being used? 

    Thank you,

    ~Leonard  

  • Hi Leonard,

    Development board for RM57L843.

    Thanks,

    Annie

  • Hi Annie,

    Please change the memory allocated to VECTORS and FLASH_CODE in your Application Linker CMD file:

    VECTORS  (x)  : origin=0x00010020  length=0x00000020

    FLASH_CODE (RX) :origin=0x00010040 length=0x30000-0x40

  • Hi QJ,

    After changing the CMD file of the Application as you said, when it runs to ((void (*)(void))g_ulTransferAddress)(), the prefetchEntry interrupt is entered, g_ulTransferAddress = 0x00010020. May I know what is the reason?

    At the same time, after downloading the Application program to 0x10020 through the emulator, the bootloader program is debugged at 0x00000000. At this time, after running ((void (*)(void))g_ulTransferAddress)(), the program that jumps to 0x10020 can run normally. Why can't the program downloaded to flash through can transfer normally jump?

    Thanks.

    Annie

  • Hi QJ,

    May I know is there any suggestion for this case?

    Thanks,

    Annie

  • Hi Annie,

    In Application's sys_startup.c, since SYSESR register is cleared in bootloader, the return value of getResetSource() is 0x0. Please add some code to default section as I did below:

    The following is the code (blue) in my application example:

    rstSrc = getResetSource();
    switch(rstSrc)
    {
      case POWERON_RESET:

       ... ...

       ... ...

      default:
             /* USER CODE BEGIN (21) */

    if(rstSrc != POWERON_RESET)
    {
    _memInit_();
    }
    _coreEnableEventBusExport_();

    if ((esmREG->SR1[2]) != 0U)
    {
    esmGroup3Notification(esmREG,esmREG->SR1[2]);
    }
    systemInit();
    _coreEnableIrqVicOffset_();
    vimInit();
    esmInit();

             /* USER CODE END */

       break;

    }

  • Hi QJ,

    Changed the application's cmd file and sys_startup.c as you said.

    After downloading the application program through the bootloader, run it to ((void (*)(void))g_ulTransferAddress)(), and the program enters the undefEntry interrupt again.

    Would you help to check again?

    Thanks,

    Annie

  • Hi Annie,

    Doesn't the code execution jump to the Application at 0x10020?

    when it runs to ((void (*)(void))g_ulTransferAddress)(), the prefetchEntry interrupt
    run it to ((void (*)(void))g_ulTransferAddress)(), and the program enters the undefEntry interrupt again.

    Which exception did you get: prefetch abort or undef?

    Can you check the content at 0x10020 manually to make sure it is correct?

  •  Please check the value of the Instruction Fault Status Register of the Cortex-R CPU:

          

  • Hi QJ,

    Enter the undefEntry interrupt after changing the cmd file and sys_startup.c as per your suggestion. The content at 0x10020 is consistent with the content of the delivered hex file.

    The value of the error status register is shown in the figure.

    Does the hex file choose binary type?

    Thanks,

    Annie

  • Hi Annie,

    If you use the TI bootloader example, please use the approach below to generate binary file for the application:

    Post-build steps

    "${CCS_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/armofd" "${CG_TOOL_ROOT}/bin/armhex" "${CCS_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin" 

    The bootloader example doesn't support other binary formats or hex formats.