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.

TMS570LC4357: Jump to boot loader from application software

Part Number: TMS570LC4357

Tool/software:

Hi 

I have a number of problems with bootloader.

1. When I load the code from TI to flash the bootloader, it was able to flash the application bin file and run the application software when directed. While in the application software, I send a serial command to tell the application software to jump to bootloader. I do so by the following code:

EEP_tstBtldData stBL_Data=EEP_vRead_BL_FlashRequest();
static bool bl_flash=false;
if(stBL_Data.u16Bdld_flag==0x5A5A )
{
;
uint32_t JumpAddress = 0; //(uint32_t)APP_START_ADDRESS;
//JumpAddress = 0;
((void (*)(void))JumpAddress)();

}

Is the jump to bootloader software correct.? Bootloader starts from location 0? 

The bootloader loader software has a few printf lines. Sometimes, after the jump, nothing appears on the screen. Sometimes the bootloader menu appears. After doing a power off and on, the bootloader menu will appear.

Boot loader menu:

================== Main Menu ==========================
1. Download Application Image To the Internal Flash
2. Upload The Application Image From the Internal Flash
3. Execute The Application Code

2. When a jump occurs and the bootloader menu appears. When command "1" is entered to download the application, there is the '"C" command from mcu and the teraterm which I am using will start the ymodem transfer..

However, after sending the first 128bytes to the mcu, the mcu will stop responding. We call this a hang situation. Why did the mcu hang? When I do a power off/on, the bootloader menu will appear and the download will perform normally. Why is it that a power off/on is needed to enable proper working of the bootloader. Is it possible to have a solution whereby we can move easily between bootloader and application and back to bootloader without external power off/on?

Looking forward to your reply. The matter is urgent. Thanks. 

  • Hi LayEng,

     Please refer below FAQ, here you can find several bootloader examples:

    (14) [FAQ] TMS570LC4357: Examples and Demos available for Hercules Controllers (E.g. TMS570x, RM57x and RM46x etc) - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    Try to compare your code and configurations with these bootloader example codes and try to find out the root cause for the issue.

    It doesn't help then i will look into your code and will debug the issue.

    --
    Thanks & regards,
    Jagadish.

  • Dear Jagadish

    Great to hear from you and a big thank you for your continuous support. I have some questions regarding your reply.

    1. I find it hard to find the CAN bootloader demo. Is it possible for you to give me a direct link.

    2. You supported me in January regarding the uart bootloader and I have implemented your solution. It works. The way the bootloader does is after flashing, I can choose  a selection to run the loaded image by using the following code:

    JumpAddress = (uint32_t)APP_START_ADDRESS; //this location is 0x20000
    //JumpAddress = 0;
    ((void (*)(void))JumpAddress)();

    While running in the application, I want to update my application software so I need to get back to bootloader. I do it by doing this code:

    if(stBL_Data.u16Bdld_flag==0x5A5A && bl_flash==false)
    {
         bl_flash=true;
        uint32_t JumpAddress = 0;//0 is address of bootloader
       ( (void (*)(void))JumpAddress)();


       //systemREG1->SYSECR = ((uint32)0x2u << 14u);
    }

    It does go back to bootloader location because I have a bootloader menu and it is displayed. Sometimes it is not displayed.

    While in bootloader, I do a selection to download the application image using ymodem transfer. The 'C' is sent by mcu, and the first 128bytes from PC is sent but the mcu does not respond after that. So mcu appears to hang in that there is no response. If I do power off/on of the mcu, the bootloader menu will appear and the downloading will take place without error.

    Question: Why do I need to power off/on the mcu to do a proper resent. Can I use the soft reset somewhere to do it? The soft reset instruction is

    systemREG1->SYSECR = ((uint32)0x2u << 14u);

    Looking forward to your reply. Thank you

  • HL_sys_link.cmd bootloader.txt
    /*----------------------------------------------------------------------------*/
    /* sys_link.cmd                                                               */
    /*                                                                            */
    /* 
    * Copyright (C) 2009-2018 Texas Instruments Incorporated - www.ti.com  
    * 
    * 
    *  Redistribution and use in source and binary forms, with or without 
    *  modification, are permitted provided that the following conditions 
    *  are met:
    *
    *    Redistributions of source code must retain the above copyright 
    *    notice, this list of conditions and the following disclaimer.
    *
    *    Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in the 
    *    documentation and/or other materials provided with the   
    *    distribution.
    *
    *    Neither the name of Texas Instruments Incorporated nor the names of
    *    its contributors may be used to endorse or promote products derived
    *    from this software without specific prior written permission.
    *
    *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
    *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
    *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
    *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
    *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
    *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    *
    */
    
    /*                                                                            */
    /*----------------------------------------------------------------------------*/
    /* USER CODE BEGIN (0) */
    /* USER CODE END */
    
    
    /*----------------------------------------------------------------------------*/
    /* Linker Settings                                                            */
    
    --retain="*(.intvecs)"
    
    /* USER CODE BEGIN (1) */
    /* USER CODE END */
    
    /*----------------------------------------------------------------------------*/
    /* Memory Map                                                                 */
    
    MEMORY
    {
    /* USER CODE BEGIN (2) */
    #if 0
    /* 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) */
    #endif
    
    #if 1
        VECTORS (X)  : origin=0x00000000 length=0x00000020  fill = 0xffffffff
        FLASH0  (RX) : origin=0x00000020 length=0x001FFFE0 vfill = 0xffffffff
        FLASH1  (RX) : origin=0x00200000 length=0x00200000 vfill = 0xffffffff
        /* Bank 7 (128kB, FEE) */
        FLASH7   (R) : origin=0xF0200000 length=0x00020000 vfill = 0xffffffff
    
        STACKS  (RW) : origin=0x08000000 length=0x00001000
        RAM     (RW) : origin=0x08002500 length=(0x0002EB00-0x2500)
    /* Bank 0 ECC */
        ECC_VEC  (R) : origin=(0xf0400000 + (start(VECTORS) >> 3))
                       length=(size(VECTORS) >> 3)
                       ECC={algorithm=algoL2R5F021, input_range=VECTORS}
    
        ECC_FLA0 (R) : origin=(0xf0400000 + (start(FLASH0)  >> 3))
                       length=(size(FLASH0)  >> 3)
                       ECC={algorithm=algoL2R5F021, input_range=FLASH0 }
    
    /* Bank 1 ECC */
        ECC_FLA1 (R) : origin=(0xf0400000 + (start(FLASH1)  >> 3))
                       length=(size(FLASH1)  >> 3)
                       ECC={algorithm=algoL2R5F021, input_range=FLASH1 }
    
    /* Bank 7 ECC */
        ECC_FLA7 (R) : origin=0xF0100000
                       length=(size(FLASH7)  >> 3)
                       ECC={algorithm=algoL2R5F021, input_range=FLASH7 }
    #endif
    /* USER CODE END */
    }
    
    /* USER CODE BEGIN (4) */
    #if 1
    ECC {
        algoL2R5F021 : address_mask = 0xfffffff8 /* Address Bits 31:3 */
                       hamming_mask = R4         /* Use R4/R5 build in Mask */
                       parity_mask  = 0x0c       /* Set which ECC bits are Even and Odd parity */
                       mirroring    = F021       /* RM57Lx and TMS570LCx are build in F021 */
    }
    #endif
    /* USER CODE END */
    
    
    /*----------------------------------------------------------------------------*/
    /* Section Configuration                                                      */
    
    SECTIONS
    {
    /* USER CODE BEGIN (5) */
    #if 0
    /* 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
    	
        FEE_TEXT_SECTION  : {} > FLASH0 | FLASH1
        FEE_CONST_SECTION : {} > FLASH0 | FLASH1
        FEE_DATA_SECTION  : {} > RAM
    
    /* USER CODE BEGIN (6) */
    #endif
    
    #if 1
       .intvecs    : {} palign=8 > VECTORS
       flashAPI:
       {
          .\Boot\Fapi_UserDefinedFunctions.obj (.text, .data)
          .\Boot\bl_flash.obj (.text, .data)
          --library = F021_API_CortexR4_BE_L2FMC.lib (.text, .data)
       } palign=8 load = FLASH0 |FLASH1, run = RAM, LOAD_START(apiLoadStart), RUN_START(apiRunStart), SIZE(apiLoadSize)
    
       .text    : {} palign=8 > FLASH0 |FLASH1
       .const   : {} palign=8 load=FLASH0 |FLASH1
       .cinit   : {} palign=8 > FLASH0 | FLASH1
       .pinit   : {} palign=8 > FLASH0 | FLASH1
       .bss     : {} > RAM    /* Uninitialized global and static variables */
       .data    : {} > RAM    /* Global and static non-const variables that are explicitly initialized. */
       .sysmem  : {} > RAM    /* Memory pool (heap) for dynamic memory allocation */
        FEE_TEXT_SECTION  : {} > FLASH0 | FLASH1
        FEE_CONST_SECTION : {} > FLASH0 | FLASH1
        FEE_DATA_SECTION  : {} > RAM
    
    
    #endif
    /* USER CODE END */
    }
    
    /* USER CODE BEGIN (7) */
    /* USER CODE END */
    
    
    /*----------------------------------------------------------------------------*/
    /* Misc                                                                       */
    
    /* USER CODE BEGIN (8) */
    /* USER CODE END */
    /*----------------------------------------------------------------------------*/
    
    

    This is the bootloader link cmd file. The HL_sys_startup.c is command to all applications running from location 0.

    Below is the application link cmd file.

    HL_sys_link.cmd_blapp.txt
    /*----------------------------------------------------------------------------*/
    /* sys_link.cmd                                                               */
    /*                                                                            */
    /* 
    * Copyright (C) 2009-2018 Texas Instruments Incorporated - www.ti.com  
    * 
    * 
    *  Redistribution and use in source and binary forms, with or without 
    *  modification, are permitted provided that the following conditions 
    *  are met:
    *
    *    Redistributions of source code must retain the above copyright 
    *    notice, this list of conditions and the following disclaimer.
    *
    *    Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in the 
    *    documentation and/or other materials provided with the   
    *    distribution.
    *
    *    Neither the name of Texas Instruments Incorporated nor the names of
    *    its contributors may be used to endorse or promote products derived
    *    from this software without specific prior written permission.
    *
    *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
    *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
    *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
    *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
    *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
    *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    *
    */
    
    /*                                                                            */
    /*----------------------------------------------------------------------------*/
    /* USER CODE BEGIN (0) */
    /* USER CODE END */
    
    
    /*----------------------------------------------------------------------------*/
    /* Linker Settings                                                            */
    
    --retain="*(.intvecs)"
    
    /* USER CODE BEGIN (1) */
    /* USER CODE END */
    
    /*----------------------------------------------------------------------------*/
    /* Memory Map                                                                 */
    
    MEMORY
    {
    /* USER CODE BEGIN (2) */
    /* USER CODE END */
        VECTORS (X)  : origin=0x00020020 length=0x00000020
        FLASH0  (RX) : origin=0x00020040 length=(0x001FFFE0-0x00020020)
        FLASH1  (RX) : origin=0x00200000 length=0x00200000
        STACKS  (RW) : origin=0x08000000 length=0x00043000
        RAM     (RW) : origin=0x08043000 length=0x0003d000
    
    /* 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
    	
        FEE_TEXT_SECTION  : {} > FLASH0 | FLASH1
        FEE_CONST_SECTION : {} > FLASH0 | FLASH1
        FEE_DATA_SECTION  : {} > RAM
    
    /* USER CODE BEGIN (6) */
    /* USER CODE END */
    }
    
    /* USER CODE BEGIN (7) */
    /* USER CODE END */
    
    
    /*----------------------------------------------------------------------------*/
    /* Misc                                                                       */
    
    /* USER CODE BEGIN (8) */
    /* USER CODE END */
    /*----------------------------------------------------------------------------*/
    
    

    The sys startup.c file is the one you have given me before. Let me know if you me to attach.

    When you ask me to check the configuration of the other ref bootloaders and my bootloader, can you tell me which file I should compare?

    Looking forward to your reply. A big thanks in advance.

  • Hi Jagadish

    Do you have any response to my info above? Looking forward to your reply. Thank you

  • I sent 2 link cmd files. One for bootloader and one for application. I find it strange that I didn't get an email sent to my inbox for the 2 files attached so I am attaching again. Hope it doesn't mess up your inbox. Thank you.

    Bootloader cmd link file

    0564.HL_sys_link.cmd bootloader.txt
    /*----------------------------------------------------------------------------*/
    /* sys_link.cmd                                                               */
    /*                                                                            */
    /* 
    * Copyright (C) 2009-2018 Texas Instruments Incorporated - www.ti.com  
    * 
    * 
    *  Redistribution and use in source and binary forms, with or without 
    *  modification, are permitted provided that the following conditions 
    *  are met:
    *
    *    Redistributions of source code must retain the above copyright 
    *    notice, this list of conditions and the following disclaimer.
    *
    *    Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in the 
    *    documentation and/or other materials provided with the   
    *    distribution.
    *
    *    Neither the name of Texas Instruments Incorporated nor the names of
    *    its contributors may be used to endorse or promote products derived
    *    from this software without specific prior written permission.
    *
    *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
    *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
    *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
    *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
    *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
    *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    *
    */
    
    /*                                                                            */
    /*----------------------------------------------------------------------------*/
    /* USER CODE BEGIN (0) */
    /* USER CODE END */
    
    
    /*----------------------------------------------------------------------------*/
    /* Linker Settings                                                            */
    
    --retain="*(.intvecs)"
    
    /* USER CODE BEGIN (1) */
    /* USER CODE END */
    
    /*----------------------------------------------------------------------------*/
    /* Memory Map                                                                 */
    
    MEMORY
    {
    /* USER CODE BEGIN (2) */
    #if 0
    /* 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) */
    #endif
    
    #if 1
        VECTORS (X)  : origin=0x00000000 length=0x00000020  fill = 0xffffffff
        FLASH0  (RX) : origin=0x00000020 length=0x001FFFE0 vfill = 0xffffffff
        FLASH1  (RX) : origin=0x00200000 length=0x00200000 vfill = 0xffffffff
        /* Bank 7 (128kB, FEE) */
        FLASH7   (R) : origin=0xF0200000 length=0x00020000 vfill = 0xffffffff
    
        STACKS  (RW) : origin=0x08000000 length=0x00001000
        RAM     (RW) : origin=0x08002500 length=(0x0002EB00-0x2500)
    /* Bank 0 ECC */
        ECC_VEC  (R) : origin=(0xf0400000 + (start(VECTORS) >> 3))
                       length=(size(VECTORS) >> 3)
                       ECC={algorithm=algoL2R5F021, input_range=VECTORS}
    
        ECC_FLA0 (R) : origin=(0xf0400000 + (start(FLASH0)  >> 3))
                       length=(size(FLASH0)  >> 3)
                       ECC={algorithm=algoL2R5F021, input_range=FLASH0 }
    
    /* Bank 1 ECC */
        ECC_FLA1 (R) : origin=(0xf0400000 + (start(FLASH1)  >> 3))
                       length=(size(FLASH1)  >> 3)
                       ECC={algorithm=algoL2R5F021, input_range=FLASH1 }
    
    /* Bank 7 ECC */
        ECC_FLA7 (R) : origin=0xF0100000
                       length=(size(FLASH7)  >> 3)
                       ECC={algorithm=algoL2R5F021, input_range=FLASH7 }
    #endif
    /* USER CODE END */
    }
    
    /* USER CODE BEGIN (4) */
    #if 1
    ECC {
        algoL2R5F021 : address_mask = 0xfffffff8 /* Address Bits 31:3 */
                       hamming_mask = R4         /* Use R4/R5 build in Mask */
                       parity_mask  = 0x0c       /* Set which ECC bits are Even and Odd parity */
                       mirroring    = F021       /* RM57Lx and TMS570LCx are build in F021 */
    }
    #endif
    /* USER CODE END */
    
    
    /*----------------------------------------------------------------------------*/
    /* Section Configuration                                                      */
    
    SECTIONS
    {
    /* USER CODE BEGIN (5) */
    #if 0
    /* 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
    	
        FEE_TEXT_SECTION  : {} > FLASH0 | FLASH1
        FEE_CONST_SECTION : {} > FLASH0 | FLASH1
        FEE_DATA_SECTION  : {} > RAM
    
    /* USER CODE BEGIN (6) */
    #endif
    
    #if 1
       .intvecs    : {} palign=8 > VECTORS
       flashAPI:
       {
          .\Boot\Fapi_UserDefinedFunctions.obj (.text, .data)
          .\Boot\bl_flash.obj (.text, .data)
          --library = F021_API_CortexR4_BE_L2FMC.lib (.text, .data)
       } palign=8 load = FLASH0 |FLASH1, run = RAM, LOAD_START(apiLoadStart), RUN_START(apiRunStart), SIZE(apiLoadSize)
    
       .text    : {} palign=8 > FLASH0 |FLASH1
       .const   : {} palign=8 load=FLASH0 |FLASH1
       .cinit   : {} palign=8 > FLASH0 | FLASH1
       .pinit   : {} palign=8 > FLASH0 | FLASH1
       .bss     : {} > RAM    /* Uninitialized global and static variables */
       .data    : {} > RAM    /* Global and static non-const variables that are explicitly initialized. */
       .sysmem  : {} > RAM    /* Memory pool (heap) for dynamic memory allocation */
        FEE_TEXT_SECTION  : {} > FLASH0 | FLASH1
        FEE_CONST_SECTION : {} > FLASH0 | FLASH1
        FEE_DATA_SECTION  : {} > RAM
    
    
    #endif
    /* USER CODE END */
    }
    
    /* USER CODE BEGIN (7) */
    /* USER CODE END */
    
    
    /*----------------------------------------------------------------------------*/
    /* Misc                                                                       */
    
    /* USER CODE BEGIN (8) */
    /* USER CODE END */
    /*----------------------------------------------------------------------------*/
    
    

    Application link cmd file. I added the .txt in order to be able to insert file easily here.

    0564.HL_sys_link.cmd_blapp.txt
    /*----------------------------------------------------------------------------*/
    /* sys_link.cmd                                                               */
    /*                                                                            */
    /* 
    * Copyright (C) 2009-2018 Texas Instruments Incorporated - www.ti.com  
    * 
    * 
    *  Redistribution and use in source and binary forms, with or without 
    *  modification, are permitted provided that the following conditions 
    *  are met:
    *
    *    Redistributions of source code must retain the above copyright 
    *    notice, this list of conditions and the following disclaimer.
    *
    *    Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in the 
    *    documentation and/or other materials provided with the   
    *    distribution.
    *
    *    Neither the name of Texas Instruments Incorporated nor the names of
    *    its contributors may be used to endorse or promote products derived
    *    from this software without specific prior written permission.
    *
    *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
    *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
    *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
    *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
    *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
    *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    *
    */
    
    /*                                                                            */
    /*----------------------------------------------------------------------------*/
    /* USER CODE BEGIN (0) */
    /* USER CODE END */
    
    
    /*----------------------------------------------------------------------------*/
    /* Linker Settings                                                            */
    
    --retain="*(.intvecs)"
    
    /* USER CODE BEGIN (1) */
    /* USER CODE END */
    
    /*----------------------------------------------------------------------------*/
    /* Memory Map                                                                 */
    
    MEMORY
    {
    /* USER CODE BEGIN (2) */
    /* USER CODE END */
        VECTORS (X)  : origin=0x00020020 length=0x00000020
        FLASH0  (RX) : origin=0x00020040 length=(0x001FFFE0-0x00020020)
        FLASH1  (RX) : origin=0x00200000 length=0x00200000
        STACKS  (RW) : origin=0x08000000 length=0x00043000
        RAM     (RW) : origin=0x08043000 length=0x0003d000
    
    /* 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
    	
        FEE_TEXT_SECTION  : {} > FLASH0 | FLASH1
        FEE_CONST_SECTION : {} > FLASH0 | FLASH1
        FEE_DATA_SECTION  : {} > RAM
    
    /* USER CODE BEGIN (6) */
    /* USER CODE END */
    }
    
    /* USER CODE BEGIN (7) */
    /* USER CODE END */
    
    
    /*----------------------------------------------------------------------------*/
    /* Misc                                                                       */
    
    /* USER CODE BEGIN (8) */
    /* USER CODE END */
    /*----------------------------------------------------------------------------*/
    
    

  • Hi LayEng,

    1. I find it hard to find the CAN bootloader demo. Is it possible for you to give me a direct link.

    Here is the tested and working CAN bootloader example project for TMS570LC4357:

    TMS570LC4357_CAN_Bootloader_Example.zip

    Please verify this project, it had well written documents as well, please go through them.

    --
    Thanks & regards,
    Jagadish.

  • Dear Jagadish

    I have downloaded the zip files. I have problem compiling. I would like to only use TMS570 MCU. When I try to open the project from TMS570LC4357_CAN_Bootloader_Example folder, I see 2 projects. Please see below. How should I choose such that I can see only one mcu and can compile using ccs.. Looking forward to your advice. Thanks. When I do a make_all, I also get errors like folder not found ... 

    f

  • Dear Jagadish

    I notice there is no application code to test the bootloader in your examples. Is it possible for you to provide a sample code which I can use with the sample bootloader, to test the bootloader.

    I have also created a bootloader and application code which is essentially the same code as the bootloader which I got from you. For the application code, I added the option to jump back to the bootloader. No downloading/uploading in the application code. Please have a look and give your comments. As expected, the application code don't run. BL_App DCUGen2V3.zipUART_Bootloader_DCUGen2.zip

  • Hi LayEng,

    I redownloaded and verified, i could only see one CCS project:

    Can you try it again,

    use below import CCS project option once:

    --
    Thanks & regards,
    Jagadish.

  • Dear Jagadish

    Actually the project can be selected by using one of my options above. Anyway, I have done it using your method. I got below errors. Please see img.

    The problem is caused by the compiler not knowing where is F021_FLASH_API. Please advise. Thank you.

    Actually I have briefly gone through the CAN code. If I am interested, can I just do define UART_ENABLE_UPDATE and discuss with you? Reason for doing so is it is easier to test using UART. Looking forward to your reply. Thank you

  • Dear Jagadish

    Sorry for some missing text in my reply as I sometimes think faster than I write. "If I am interested in UART, can I just do define UART_ENABLE_UPDATE and discuss with you? Reason for doing so is it is easier to test using UART."

  • Hi LayEng,

    You need to include the include folder of the F021:

    Copy above path,

    And paste it in below section:

    Now click apply and close:

    After this rebuild the project again.

    --
    Thanks & regards,
    Jagadish.

  • Dear Jagadish

    I still got errors after doing what you advise. Please see below. 

    Please advise. Thank you

  • Hi LayEng,

    Please include "F021_API_CortexR4_BE_L2FMC" library file in below path.

    You can find the file here:

    --
    Thanks & regards,
    Jagadish.

  • Dear Jagadish

    I still get errors. Please see below. Basically, it was already included but the system doesn't know ${F021_FLASH_API}. How to declare it or change this declaration.

    Please advise. Thank you

  • Dear Jagadish

    I also add the directory in the search path. Still got errors. I think I need to just plug in the lib in the source folder? Please advise. Thanks

  • Hi LayEng,

    Maybe paths got changed, please include it again. Do the following steps to include:

    Click on Add:

    Click on Browse:

    Now browse to the library path and select the file:

    Now click on open in above screenshot.

    After clicking open and now click on ok button:

    Now library should be added like below and then click on Apply and close.

    After this rebuild the project again.

    --
    Thanks & regards,
    Jagadish.

  • Dear Jagadish

    I did all your prescribed steps above in my last msg. Still got errors. For good measure, I am pasting everything here.

  • Hi LayEng,

    Can you try by deleting the old one (that is below highlighted one)?

  • If you still have the issues, 

    we can setup one live debugging session, if required.

  • Dear Jagadish

    I can finally compile without errors. Can I use UART_ENABLE_UPDATE to test the software? When I undef CAN_ENABLE_UPDATE and define UART_ENABLE_UPDATE, I get another set of errors:

    Can you help to get this error rectified? Thanks. Hope I can use UART to continue to explore my problem and get the solution. Thanks.

  • Hi LayEng,

    You want CAN bootloader or UART bootloader?

    If you want CAN bootloader then you no need to enable the UART_ENABLE_UPDATE.

    If you enable the UART_ENABLE_UPDATE, that means we need to give the binary file through UART. Which is nothing but UART bootloader code.

    I never tested UART bootloader in this example, If you want UART bootloader then i will suggest you refer below FAQ.

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

    --
    Thanks & regards,
    Jagadish.

  • Dear Jagadish

    Thank you for your great support. I just realise we haven't been communicating too well. I was actually working on a uart bootloader. I just realised that I should have mentioned that instead of just talking about bootloader. I can use your blinky application code. My problem is I can't jump from blinky application code to the bootloader(uart) menu again. In our application, we need to update our application software because of feature update or bugs correction. We can't use the debugger probe to update so have to use serial port. So we write some eeprom data like 0x5A5A to the eeprom using a serial port. When the application software reads the eeprom at this location and sees 0x5A5A, it will then jump to the bootloader menu and allow update of a new application bin. My problem is when I jump from the application to the bootloader after reading 0x5A5A, the bootloader menu sometimes appear and sometimes don't appear. When it appears, and I choose '1' on the bootloader menu, it should allow me to download a new bin. But the problem is the bootloader software will receive the first 128 byte and then stop working after that. I can only get a proper working of the bootloader software after I do a power off and then on. My question is can I do a second download of bin file without any power off and on of the mcu. Can you try this on your blinky software? If yes, please put this feature in and I will try on my side. Thanks. Sorry for all the confusion. I actually tried to tell you what I am doing by using the bootloader loader software which I uploaded above. My device is using sci4 instead of sci1 so you have to change it if you want to test my software on hdk. 

    Hope you understand my problem now. Very sorry for all the confusion.

  • When you add the change in the blinky software, please add a menu like the bootloader sw

                               Application menu

                    3. Jump to bootloader software

    When 3 is entered, write this value 0x5a5a in the eeprom location, any block and then jump to bootloader software. When the bootloader software reads this value, it will redisplay the bootloader menu for new selection instead of jumping straight to application. 

    Hope you understand me. Thank you

  • Dear Jagadish

    I feel that my problem of jumping from application code to bootloader code is such that the mcu is not properly reset resulting in jumping to undefined locations. So I hope you can correct my mistake by trying on your code. I will then see the changes you make when you jump from application code to bootloader and implement your change to my code. Thank you

  • Dear Jagadish

    I find that my problem has something to do with HL_sys_startup.c of bootloader. When the application jump to location 0 of bootloader, the type of reset is NO_RESET (=0). So nothing is initialised when sw jump to bootloader software. Therefore some functions don't work. I added these to bootloader sys startup:

    /* USER CODE BEGIN (22) */
    systemInit();
    _coreEnableIrqVicOffset_();
    //vimInit();
    esmInit();
    _coreEnableEventBusExport_();

    /* USER CODE END */

    The flashing of software works, het_init works but not  TI_Fee_Init(); Can you tell me what I should add in bootloader HL_sys_startup.c in order to get bootlloader initialised or what command should I add in the application code just before jumping to bootloader in order to solve the eeprom init? Looking forward to your reply. I am attaching my modified bootloader HL_sys_startup.c

    6087.HL_sys_startup.c
    /** @file HL_sys_startup.c 
    *   @brief Startup Source File
    *   @date 11-Dec-2018
    *   @version 04.07.01
    *
    *   This file contains:
    *   - Include Files
    *   - Type Definitions
    *   - External Functions
    *   - VIM RAM Setup
    *   - Startup Routine
    *   .
    *   which are relevant for the Startup.
    */
    
    /* 
    * Copyright (C) 2009-2018 Texas Instruments Incorporated - www.ti.com  
    * 
    * 
    *  Redistribution and use in source and binary forms, with or without 
    *  modification, are permitted provided that the following conditions 
    *  are met:
    *
    *    Redistributions of source code must retain the above copyright 
    *    notice, this list of conditions and the following disclaimer.
    *
    *    Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in the 
    *    documentation and/or other materials provided with the   
    *    distribution.
    *
    *    Neither the name of Texas Instruments Incorporated nor the names of
    *    its contributors may be used to endorse or promote products derived
    *    from this software without specific prior written permission.
    *
    *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
    *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
    *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
    *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
    *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
    *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    *
    */
    
    
    /* USER CODE BEGIN (0) */
    /* USER CODE END */
    
    
    /* Include Files */
    
    #include "HL_sys_common.h"
    #include "HL_system.h"
    #include "HL_sys_vim.h"
    #include "HL_sys_core.h"
    #include "HL_esm.h"
    #include "HL_sys_mpu.h"
    #include "HL_errata_SSWF021_45.h"
    
    /* USER CODE BEGIN (1) */
    /* USER CODE END */
    
    /* USER CODE BEGIN (2) */
    /* USER CODE END */
    
    /* External Functions */
    
    /*SAFETYMCUSW 218 S MR:20.2 <APPROVED> "Functions from library" */
    extern void __TI_auto_init(void);
    /*SAFETYMCUSW 354 S MR:NA <APPROVED> " Startup code(main should be declared by the user)" */
    extern int main(void);
    /*SAFETYMCUSW 122 S MR:20.11 <APPROVED> "Startup code(exit and abort need to be present)" */
    /*SAFETYMCUSW 354 S MR:NA <APPROVED> " Startup code(Extern declaration present in the library)" */
    extern void exit(int _status);
    
    
    /* USER CODE BEGIN (3) */
    /* USER CODE END */
    void handlePLLLockFail(void);
    /* Startup Routine */
    void _c_int00(void);
    #define PLL_RETRIES 5U
    /* USER CODE BEGIN (4) */
    /* USER CODE END */
    
    #pragma CODE_STATE(_c_int00, 32)
    #pragma INTERRUPT(_c_int00, RESET)
    #pragma WEAK(_c_int00)
    
    /* SourceId : STARTUP_SourceId_001 */
    /* DesignId : STARTUP_DesignId_001 */
    /* Requirements : HL_CONQ_STARTUP_SR1 */
    void _c_int00(void)
    {
    	register resetSource_t rstSrc;
    /* USER CODE BEGIN (5) */
    /* USER CODE END */
    
        /* Initialize Core Registers to avoid CCM Error */
        _coreInitRegisters_();
    	
        /* Initialize Stack Pointers */
        _coreInitStackPointer_();
    
        /* Reset handler: the following instructions read from the system exception status register
         * to identify the cause of the CPU reset.
         */
    	rstSrc = getResetSource();
        switch(rstSrc)
        {
            case POWERON_RESET:
    		/* Initialize L2RAM to avoid ECC errors right after power on */
    		_memInit_();
    
    		/* Add condition to check whether PLL can be started successfully */
            if (_errata_SSWF021_45_both_plls(PLL_RETRIES) != 0U)
    		{
    			/* Put system in a safe state */
    			handlePLLLockFail();
    		}
    		
    /*SAFETYMCUSW 62 S MR:15.2, 15.5 <APPROVED> "Need to continue to handle POWERON Reset" */
            case DEBUG_RESET:
            case EXT_RESET:
    
    /* USER CODE BEGIN (6) */
    /* USER CODE END */
    
            /* Initialize L2RAM to avoid ECC errors right after power on */
    		if(rstSrc != POWERON_RESET)
    		{
    			_memInit_();
    		}
    
    /* USER CODE BEGIN (7) */
    /* USER CODE END */
    
    /* USER CODE BEGIN (8) */
    /* USER CODE END */
    
    
    /* USER CODE BEGIN (9) */
    /* USER CODE END */
    
            /* Enable CPU Event Export */
            /* This allows the CPU to signal any single-bit or double-bit errors detected
             * by its ECC logic for accesses to program flash or data RAM.
             */
            _coreEnableEventBusExport_();
    
    /* USER CODE BEGIN (10) */
    /* USER CODE END */
    
            /* Check if there were ESM group3 errors during power-up.
             * These could occur during eFuse auto-load or during reads from flash OTP
             * during power-up. Device operation is not reliable and not recommended
             * in this case. */
            if ((esmREG->SR1[2]) != 0U)
            {
               esmGroup3Notification(esmREG,esmREG->SR1[2]);               
            }
    	
            /* Initialize System - Clock, Flash settings with Efuse self check */
            systemInit();
    
    /* USER CODE BEGIN (11) */
    /* USER CODE END */
    
            /* Enable IRQ offset via Vic controller */
            _coreEnableIrqVicOffset_();
                
            /* Initialize VIM table */
    	    vimInit();
    
    /* USER CODE BEGIN (12) */
    /* USER CODE END */
            /* Configure system response to error conditions signaled to the ESM group1 */
            /* This function can be configured from the ESM tab of HALCoGen */
            esmInit();
    
    /* USER CODE BEGIN (13) */
    /* USER CODE END */
    
            break;
    
            case OSC_FAILURE_RESET:
    /* USER CODE BEGIN (14) */
    /* USER CODE END */
            break;
    		
            case WATCHDOG_RESET:
            case WATCHDOG2_RESET:
    				
    /* USER CODE BEGIN (15) */
    /* USER CODE END */
            break;
        
            case CPU0_RESET:
    /* USER CODE BEGIN (16) */
    /* USER CODE END */
    
    /* USER CODE BEGIN (17) */
    /* USER CODE END */
    		
    /* USER CODE BEGIN (18) */
    /* USER CODE END */
    
            /* Enable CPU Event Export */
            /* This allows the CPU to signal any single-bit or double-bit errors detected
             * by its ECC logic for accesses to program flash or data RAM.
             */
            _coreEnableEventBusExport_();
    		
    /* USER CODE BEGIN (19) */
    /* USER CODE END */
            break;
        
            case SW_RESET:
    		
    /* USER CODE BEGIN (20) */
    /* USER CODE END */
            break;
        
            default:
    /* USER CODE BEGIN (21) */
    /* USER CODE END */
            break;
        }
    
        /* USER CODE BEGIN (22) */
            systemInit();
            _coreEnableIrqVicOffset_();
            //vimInit();
            esmInit();
           _coreEnableEventBusExport_();
    
        /* USER CODE END */
    
        _mpuInit_();
    	
    /* USER CODE BEGIN (23) */
    /* USER CODE END */
    
    /* USER CODE BEGIN (24) */
    /* USER CODE END */
    
    
    /* USER CODE BEGIN (25) */
    /* USER CODE END */
    
            /* initialize global variable and constructors */
        __TI_auto_init();
    /* USER CODE BEGIN (26) */
    /* USER CODE END */
        
            /* call the application */
    /*SAFETYMCUSW 296 S MR:8.6 <APPROVED> "Startup code(library functions at block scope)" */
    /*SAFETYMCUSW 326 S MR:8.2 <APPROVED> "Startup code(Declaration for main in library)" */
    /*SAFETYMCUSW 60 D MR:8.8 <APPROVED> "Startup code(Declaration for main in library;Only doing an extern for the same)" */
        main();
    /* USER CODE BEGIN (27) */
    /* USER CODE END */
    /*SAFETYMCUSW 122 S MR:20.11 <APPROVED> "Startup code(exit and abort need to be present)" */
        exit(0);
    
    
    /* USER CODE BEGIN (28) */
    /* USER CODE END */
    
    }
    
    /* USER CODE BEGIN (29) */
    /* USER CODE END */
    
    /** @fn void handlePLLLockFail(void)
    *   @brief This function handles PLL lock fail.
    */
    /* USER CODE BEGIN (30) */
    /* USER CODE END */
    void handlePLLLockFail(void)
    {
    /* USER CODE BEGIN (31) */
    /* USER CODE END */
    	while(1)
    	{
    		
    	}
    /* USER CODE BEGIN (32) */
    /* USER CODE END */
    }
    /* USER CODE BEGIN (33) */
    /* USER CODE END */
    

  • Dear Jagadish

    Now I am back to the original problem. Besides the TI_Fee_Init() getting hang after jumping from application software to bootloader, then flashing also don't work. Badly need your help. Thanks.

  • Hi LayEng,

    My problem is when I jump from the application to the bootloader after reading 0x5A5A, the bootloader menu sometimes appear and sometimes don't appear. When it appears, and I choose '1' on the bootloader menu, it should allow me to download a new bin.

    How are you jumping to the bootloader from application?

    Are you directly calling 0x00000000 address?

    Can we setup one live debugging session so that i can guide you well by watching the code lively.

    I will be available from 10AM to 8PM IST (Indian Standard Time).

    Please create a meeting on tomorrow based on your availability and share the meeting details.

    --
    Thanks & regards,
    Jagadish.

  • Dear Jagadish

    FINALLY you get my problem after more than a wk. I thought you won't be working this wk because TI is off for thanksgiving. I have been on course since Monday-Tuesday, today MC. Can we chat tomorrow at 1.30 pm sg time, 11am IST? Or you want to have it after your lunch? Do let me know. The problem is with sys startup. When I jump directly from application code to bootloader using jump 0, the source for entering sys startup is NO_RESET (or 0). I added the same code which you advised me to add in application code sys startup but it does not work for  TI_Fee_Init() which I added in the init path . The software went into an undefined entry. Even if I bypass that by not having eeprom init although I must have, and went straight to bootloader download, the flashing doesn't work. The problem disappears if I were to do a power off and on of the device. So I suspect it is either the wrong way of jumping to bootloader, ie I use jump 0 . Should I have done something like, changing the pc jump location for sw reset and then do sw reset? Looking forward to your reply. 

  • Hi LayEng.

    I thought you won't be working this wk because TI is off for thanksgiving. I have been on course since Monday-Tuesday, today MC. Can we chat tomorrow at 1.30 pm sg time, 11am IST?

    I don't have any leave plan and i will work.

    I am okay with tomorrow 11AM IST.

    When I jump directly from application code to bootloader using jump 0, the source for entering sys startup is NO_RESET (or 0).

    Instead of jump 0 which is NO_RESET, why don't you try software reset?

    I mean when application sees 0x5A5A, it will do software reset of the board.

    In below thread i mentioned procedure for software reset:

    (+) [FAQ] RM57L843: SOFTWARE RESET ON RM57L843 - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    --
    Thanks & regards,
    Jagadish.

  • "Are you directly calling 0x00000000 address?"

    Yes. See code below

    EEP_tstBtldData stBL_Data=EEP_vRead_BL_FlashRequest();
    static bool bl_flash=false;
    if(stBL_Data.u16Bdld_flag==0x5A5A )
    {
    ;
             uint32_t JumpAddress = 0; //(uint32_t)APP_START_ADDRESS;
              //JumpAddress = 0;
             ((void (*)(void))JumpAddress)();

    }

    Btw, how do you add quote of a msg?

  • Dear Jagadish

    I think I have tried software reset long ago, but I think it went to a no man's land. I think it went to location 0x20020 which is the start location of the application software. I can check again tomorrow. What do you think? Can you try on your side using blinky? Looking forward to your reply. 

  • Dear Jagadish

    I tried your suggestion and it works. I need more time to test the CAN bus flashing with this solution. Previously I use this code to do sw reset.

     systemREG1->SYSECR = ((uint32)0x2u << 14u);

    Now I follow your eg which is  systemREG1->SYSECR = ((uint32)0x3u << 14u);

    Below is my code. 

    if(((stBL_Data.u16Bdld_flag==0x5A5A) || (stBL_Data.u16Bdld_flag==0x5B5B))&& bl_flash==false)
    {
          bl_flash=true;
          //uint32_t JumpAddress = 0;//0; 0 is bootloader start address
          //((void (*)(void))JumpAddress)();
         systemREG1->SYSECR = ((uint32)0x3u << 14u);
    }

    We will postpone the meeting until another time. Thanks a lot. I shall close this case next wk if everything is fine. Thanks

  • Hi LayEng,

    I tried your suggestion and it works.

    Good to hear that.

    We will postpone the meeting until another time. Thanks a lot. I shall close this case next wk if everything is fine.

    Sure.

    --
    Thanks & regards,
    Jagadish.

  • Dear Jagadish

    I have closed the case. Actually, long time ago, I tried the solution of soft reset but it didn't work. That is why I used jump 0. If you look at my post 20 days ago, it is up there. I have repasted it here.

    Any difference between systemREG1->SYSECR = ((uint32)0x3u << 14u);

    and systemREG1->SYSECR = ((uint32)0x2u << 14u);

    Looking forward to your reply. Thank you

  • Hi LayEng,

    Any difference between systemREG1->SYSECR = ((uint32)0x3u << 14u);

    and systemREG1->SYSECR = ((uint32)0x2u << 14u);

    According to TRM they both had no difference. If they are different then they will definitely mention, there.

    And also, i verified all the old threads, and i didn't see any explanation for these two, so i think they both should have same behavior.

    --
    Thanks & regards,
    Jagadish.