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.

RM57L843: Crash in __TI_auto_init

Part Number: RM57L843
Other Parts Discussed in Thread: HALCOGEN, TLK111, DP83640

Tool/software:

Hi,

I am currently working on a bootloader which resides at 0x00000000. The bootloader code was generated by halcogen and all it does is to call the function at 0x00200000 from it's main function using a function pointer. At 0x00200000, I manually places blinky binary which is acting like an application code. The blinky code is compiled as per the linker script below and so the exception vectors of the blinky code are at 0x00200000.

The idea here is when the processor starts at 0x00000000, it completes the intialization and in main function of the bootloader, it jumps to the reset vector of blinky code at 0x00200000. The branch instruction at 0x00200000 then branches to _c_int00 of blinky and reinitialize everything again and then executes it's main. 

I am able to get it to jump from bootloader to blinky's reset handler and then start the initialization. However, the code gets into prefetch abort while it is in blinky's _TI_auto_init() function (specifically in run_cinit). Could someone tell me if I am missing something here. Is _TI_auto_init (or run_cinit) function not location independent?

Blinky code linker script is as below:

/*----------------------------------------------------------------------------*/
/* Linker Settings */

--retain="*(.intvecs)"

/* USER CODE BEGIN (1) */
/* USER CODE END */

/*----------------------------------------------------------------------------*/
/* Memory Map */

MEMORY
{
/* USER CODE BEGIN (2) */
/* USER CODE END */
VECTORS (X) : origin=0x00000000 length=0x00000020
FLASH0 (RX) : origin=0x00000020 length=0x001FFFE0
FLASH1 (RX) : origin=0x00200000 length=0x00200000
STACKS (RW) : origin=0x08000000 length=0x00001500
RAM (RW) : origin=0x08001500 length=0x0007EB00

/* USER CODE BEGIN (3) */
/* USER CODE END */
}

/* USER CODE BEGIN (4) */
/* USER CODE END */


/*----------------------------------------------------------------------------*/
/* Section Configuration */

SECTIONS
{
/* USER CODE BEGIN (5) */
/* USER CODE END */
.intvecs : {} > VECTORS
.text align(32) : {} > FLASH0 | FLASH1
.const align(32) : {} > FLASH0 | FLASH1
.cinit align(32) : {} > FLASH0 | FLASH1
.pinit align(32) : {} > FLASH0 | FLASH1
.bss : {} > RAM
.data : {} > RAM
.sysmem : {} > RAM

/* USER CODE BEGIN (6) */
/* USER CODE END */
}

/* USER CODE BEGIN (7) */
/* USER CODE END */


/*----------------------------------------------------------------------------*/
/* Misc */

/* USER CODE BEGIN (8) */
/* USER CODE END */
/*----------------------------------------------------------------------------*/

  • Hi Ravi Teja,

    Can you please refer simple UART bootloader example in the below link:

    (+) [FAQ] TMS570LC4357: Step by step procedure to execute UART Bootloader on TMS570LC4357 - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    Here i attached the codes for both bootloader and application and they are executing successfully without any issues.

    Please refer them once.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    I instead tried using Ethernet Bootloader mentioned here since it is more close to what I want.

    https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1251208/faq-rm57l843-describing-step-by-step-procedure-to-use-ethernet-bootloader-in-static-ip-for-hercules-device-rm57x

    However, when I imported the project and tried compiling, I am seeing following messages. Could you help me setup this project?


    **** Clean-only build of configuration Debug for project Build-LAUNCHXL2-RM57Lx-tftpBoot ****

    "C:\\ti\\ccs1271\\ccs\\utils\\bin\\gmake" -k clean

    DEL /F "Build-LAUNCHXL2-RM57Lx-tftpBoot.hex" "Build-LAUNCHXL2-RM57Lx-tftpBoot.out"
    DEL /F "Boot\Fapi_UserDefinedFunctions.obj" "Boot\bl_flash.obj" "Boot\bl_tftp.obj" "Boot\main.obj" "Boot\tftp.obj" "Boot\uartstdio.obj" "Boot\ustdlib.obj" "HALCoGen-RM57Lx\source\HL_emac.obj" "HALCoGen-RM57Lx\source\HL_epc.obj" "HALCoGen-RM57Lx\source\HL_errata.obj" "HALCoGen-RM57Lx\source\HL_errata_SSWF021_45.obj" "HALCoGen-RM57Lx\source\HL_esm.obj" "HALCoGen-RM57Lx\source\HL_gio.obj" "HALCoGen-RM57Lx\source\HL_mdio.obj" "HALCoGen-RM57Lx\source\HL_nmpu.obj" "HALCoGen-RM57Lx\source\HL_notification.obj" "HALCoGen-RM57Lx\source\HL_phy_dp83640.obj" "HALCoGen-RM57Lx\source\HL_phy_tlk111.obj" "HALCoGen-RM57Lx\source\HL_pinmux.obj" "HALCoGen-RM57Lx\source\HL_sci.obj" "HALCoGen-RM57Lx\source\HL_sys_core.obj" "HALCoGen-RM57Lx\source\HL_sys_dma.obj" "HALCoGen-RM57Lx\source\HL_sys_intvecs.obj" "HALCoGen-RM57Lx\source\HL_sys_mpu.obj" "HALCoGen-RM57Lx\source\HL_sys_pcr.obj" "HALCoGen-RM57Lx\source\HL_sys_phantom.obj" "HALCoGen-RM57Lx\source\HL_sys_pmm.obj" "HALCoGen-RM57Lx\source\HL_sys_pmu.obj" "HALCoGen-RM57Lx\source\HL_sys_startup.obj"
    DEL /F "HALCoGen-RM57Lx\source\HL_sys_vim.obj" "HALCoGen-RM57Lx\source\HL_system.obj" "lwIP-1.4.1\apps\httpserver_raw\fs.obj" "lwIP-1.4.1\apps\httpserver_raw\httpd.obj" "lwIP-1.4.1\ports\hdk\lwiplib.obj" "lwIP-1.4.1\src\core\def.obj" "lwIP-1.4.1\src\core\timers.obj" "lwIP-1.4.1\src\netif\ethernetif.obj"
    DEL /F "Boot\Fapi_UserDefinedFunctions.d" "Boot\bl_flash.d" "Boot\bl_tftp.d" "Boot\main.d" "Boot\tftp.d" "Boot\uartstdio.d" "Boot\ustdlib.d" "HALCoGen-RM57Lx\source\HL_emac.d" "HALCoGen-RM57Lx\source\HL_epc.d" "HALCoGen-RM57Lx\source\HL_errata.d" "HALCoGen-RM57Lx\source\HL_errata_SSWF021_45.d" "HALCoGen-RM57Lx\source\HL_esm.d" "HALCoGen-RM57Lx\source\HL_gio.d" "HALCoGen-RM57Lx\source\HL_mdio.d" "HALCoGen-RM57Lx\source\HL_nmpu.d" "HALCoGen-RM57Lx\source\HL_notification.d" "HALCoGen-RM57Lx\source\HL_phy_dp83640.d" "HALCoGen-RM57Lx\source\HL_phy_tlk111.d" "HALCoGen-RM57Lx\source\HL_pinmux.d" "HALCoGen-RM57Lx\source\HL_sci.d" "HALCoGen-RM57Lx\source\HL_sys_dma.d" "HALCoGen-RM57Lx\source\HL_sys_pcr.d" "HALCoGen-RM57Lx\source\HL_sys_phantom.d" "HALCoGen-RM57Lx\source\HL_sys_pmm.d" "HALCoGen-RM57Lx\source\HL_sys_startup.d" "HALCoGen-RM57Lx\source\HL_sys_vim.d" "HALCoGen-RM57Lx\source\HL_system.d" "lwIP-1.4.1\apps\httpserver_raw\fs.d" "lwIP-1.4.1\apps\httpserver_raw\httpd.d" "lwIP-1.4.1\ports\hdk\lwiplib.d"
    DEL /F "lwIP-1.4.1\src\core\def.d" "lwIP-1.4.1\src\core\timers.d" "lwIP-1.4.1\src\netif\ethernetif.d"
    DEL /F "HALCoGen-RM57Lx\source\HL_sys_core.d" "HALCoGen-RM57Lx\source\HL_sys_intvecs.d" "HALCoGen-RM57Lx\source\HL_sys_mpu.d" "HALCoGen-RM57Lx\source\HL_sys_pmu.d"
    Could Not Find C:\Users\rdarbha\workspace_ti\Hercules_Ethernet_Bootloader\LAUNCHXL2-RM57Lx\Build-LAUNCHXL2-RM57Lx\Debug\Build-LAUNCHXL2-RM57Lx-tftpBoot.hex
    Could Not Find C:\Users\rdarbha\workspace_ti\Hercules_Ethernet_Bootloader\LAUNCHXL2-RM57Lx\Build-LAUNCHXL2-RM57Lx\Debug\Boot\Fapi_UserDefinedFunctions.obj
    Could Not Find C:\Users\rdarbha\workspace_ti\Hercules_Ethernet_Bootloader\LAUNCHXL2-RM57Lx\Build-LAUNCHXL2-RM57Lx\Debug\HALCoGen-RM57Lx\source\HL_emac.obj
    Could Not Find C:\Users\rdarbha\workspace_ti\Hercules_Ethernet_Bootloader\LAUNCHXL2-RM57Lx\Build-LAUNCHXL2-RM57Lx\Debug\HALCoGen-RM57Lx\source\HL_sys_vim.obj
    Could Not Find C:\Users\rdarbha\workspace_ti\Hercules_Ethernet_Bootloader\LAUNCHXL2-RM57Lx\Build-LAUNCHXL2-RM57Lx\Debug\lwIP-1.4.1\apps\httpserver_raw\fs.obj
    Could Not Find C:\Users\rdarbha\workspace_ti\Hercules_Ethernet_Bootloader\LAUNCHXL2-RM57Lx\Build-LAUNCHXL2-RM57Lx\Debug\lwIP-1.4.1\ports\hdk\lwiplib.obj
    Could Not Find C:\Users\rdarbha\workspace_ti\Hercules_Ethernet_Bootloader\LAUNCHXL2-RM57Lx\Build-LAUNCHXL2-RM57Lx\Debug\lwIP-1.4.1\src\core\def.obj
    Could Not Find C:\Users\rdarbha\workspace_ti\Hercules_Ethernet_Bootloader\LAUNCHXL2-RM57Lx\Build-LAUNCHXL2-RM57Lx\Debug\lwIP-1.4.1\src\netif\ethernetif.obj
    Could Not Find C:\Users\rdarbha\workspace_ti\Hercules_Ethernet_Bootloader\LAUNCHXL2-RM57Lx\Build-LAUNCHXL2-RM57Lx\Debug\Boot\Fapi_UserDefinedFunctions.d
    Could Not Find C:\Users\rdarbha\workspace_ti\Hercules_Ethernet_Bootloader\LAUNCHXL2-RM57Lx\Build-LAUNCHXL2-RM57Lx\Debug\HALCoGen-RM57Lx\source\HL_emac.d
    Could Not Find C:\Users\rdarbha\workspace_ti\Hercules_Ethernet_Bootloader\LAUNCHXL2-RM57Lx\Build-LAUNCHXL2-RM57Lx\Debug\lwIP-1.4.1\apps\httpserver_raw\fs.d
    Could Not Find C:\Users\rdarbha\workspace_ti\Hercules_Ethernet_Bootloader\LAUNCHXL2-RM57Lx\Build-LAUNCHXL2-RM57Lx\Debug\lwIP-1.4.1\ports\hdk\lwiplib.d
    Could Not Find C:\Users\rdarbha\workspace_ti\Hercules_Ethernet_Bootloader\LAUNCHXL2-RM57Lx\Build-LAUNCHXL2-RM57Lx\Debug\lwIP-1.4.1\src\core\def.d
    Could Not Find C:\Users\rdarbha\workspace_ti\Hercules_Ethernet_Bootloader\LAUNCHXL2-RM57Lx\Build-LAUNCHXL2-RM57Lx\Debug\lwIP-1.4.1\src\netif\ethernetif.d
    Could Not Find C:\Users\rdarbha\workspace_ti\Hercules_Ethernet_Bootloader\LAUNCHXL2-RM57Lx\Build-LAUNCHXL2-RM57Lx\Debug\HALCoGen-RM57Lx\source\HL_sys_core.d
    Finished clean

    **** Build Finished ****

    **** Build of configuration Debug for project Build-LAUNCHXL2-RM57Lx-tftpBoot ****

    Nothing to build for project Build-LAUNCHXL2-RM57Lx-tftpBoot

    Thanks,

    Ravi

  • Hi Ravi,

    Share your code i will try to rectify these errors and will reshare the code again.

    --
    Thanks & Regards,
    Jagadish.

  • Hi Ravi Teja,

    It looks like due to not configuring the folder paths properly.

    You can see the exclamation marks on the folders

    If you see these marks then do the following thing:

    First right click on the corresponding folder and go through its properties:

    And then now click on the Edit path button like as shown above.

    Now click on the Folder option like below:

    Once you click on the folder option then navigate to the corresponding folder directory and select the folder:

    Do the same process for other exclamation mark folders as well, once you did that then build the project and verify it. It should build successfully.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    I tried this bootloader coe and when I try to load it to RM57 HDK board, I am getting verification failed error.

    CortexR5: GEL Output: Memory Map Setup for Flash @ Address 0x0CortexR5: GEL Output: Memory Map Setup for Flash @ Address 0x0 due to System Reset
    CortexR5: Loader: One or more sections of your program falls into a memory region that is not writable. These regions will not actually be written to the target. Check your linker configuration and/or memory map.
    CortexR5: File Loader: Verification failed: Values at address 0xF0407FF0 do not match Please verify target memory and memory map.
    CortexR5: GEL: File: C:\Users\rdarbha\workspace_ti\Hercules_Ethernet_Bootloader\LAUNCHXL2-RM57Lx\Build-LAUNCHXL2-RM57Lx\Debug\Build-LAUNCHXL2-RM57Lx-tftpBoot.out: a data verification error occurred, file load failed.
    CortexR5: GEL Output: Memory Map Setup for Flash @ Address 0x0 due to System Reset

    Ravi

  • Hi Ravi,

    For this ethernet bootloader application code we are programming ECC through linker cmd file instead of from CCS.

    So, in this case it would be better to keep the verification as none in the CCS debug settings like as below:

    Make sure above two settings and do the program.

    --
    Thanks & regards,
    Jagadish.