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.

LAUNCHXL-F280049C: Rom Boot to flash & reset button fails INTOS1

Guru 56358 points

Part Number: LAUNCHXL-F280049C
Other Parts Discussed in Thread: UNIFLASH, C2000WARE

Hello,

After migrating x49c to run with MCSDK using x49c_flash_cpu_is_eabi.cmd file and copied matching SDK flash Sections from 2x_flash_cpu_is_eabi.cmd, the ROM Boot to flash fails. However, the code runs to main.c only via INOS2 in CCS debug? or UniFlash firmware loads INTOS2. The MCSDK project has the same device files migrated from x49c device folders but it refuses to run from INTOS2 clock set up from x49c HAL. Something in the MCSDK project seems to be causing ROM boot to Flash and Reset button both to fail via INTOS1. The x49 also fails ROM Boot to Flash mode after POR launch pad via USB port.

There seems to be linker CMD file sections are being coded wildly different via MCSDK sets flash bank 0 CODE and flash sections f28002x_flash_cpu_is_eabi.cmd.

Has the x25 MCU ever been tested to ROM boot via INTOS1 and Reset button both run to (main.c) in the MCSDK?

/* BEGIN is used for the "boot to Flash" bootloader mode */
BEGIN : origin = 0x080000, length = 0x000002
RESET : origin = 0x3FFFC0, length = 0x000002

  • I'm having a little trouble following your description. Are you porting your application from F28004x to F28002x? Are you saying it successfully boots to main, but is failing to make it past the clock initialization depending on which INTOSC you choose?

    Do note that the recommended clock initialization routines are different between F28004x and F28002x, so make sure that you are using the appropriate driverlib for your device.

    As far as linker command files go, BEGIN is the key section for booting from flash. Flash entry point (0x80000) is the same between these two devices. Beyond that, F28002x only has bank 0, but it's at the same location. How you divide it up between code and data shouldn't matter much as long as code start goes at 0x80000. Are you using the default CodeStartBranch.asm file from C2000Ware or have you customized it?

    Whitney

  • I'm having a little trouble following your description. Are you porting your application from F28004x to F28002x?

    No, from 4x configured for 2x hal.c and yes below used to set INTOS2 derived via 4x, not 2x 

    // Set up PLL control and clock dividers
    // PLLSYSCLK = 20MHz (XTAL_OSC) * 10 (IMULT) * 1 (FMULT) / 2 (PLLCLK_BY_2)
    CLK_Missing = SysCtl_setClock(SYSCTL_OSCSRC_XTAL |
    SYSCTL_IMULT(5) |
    SYSCTL_FMULT_NONE |
    SYSCTL_SYSDIV(1) |
    SYSCTL_PLL_ENABLE); 

    Are you saying it successfully boots to main, but is failing to make it past the clock initialization depending on which INTOSC you choose?

    Correct, there is No XCLKOUT via GPIO J2-pin 15 when we push reset button after ending debug or UniFlash or POR. Only has XCLKOUT 25MHz from INTOS2 via UniFlash run or run from CCS debug INTOSC1? it seems. The same basic ROM Boot to flash works in the SDK firmware when loaded but not the MCSDK derived from pragma sections of F28002x_flash_is_cpu_eabi.cmd but with Flash sector addresses of x49c.

    Are you using the default CodeStartBranch.asm file from C2000Ware or have you customized it?

    It's the one from SDK4.0 x49c project ported to MCSDK.  

    SECTIONS
    {
    codestart : > BEGIN, PAGE = 1, ALIGN(4)

    Notice a major difference how flash sectors 2x were configured versus 4x CMD file. Commented BOOT/CODE lines made no difference. Appears code was never tested to boot from flash other than perhaps CCS debug. I recently reported a similar issue where SDK4.0 pragma section was corrupted during POR ROM boot to flash. Yet INTOS2 was producing XCLOCKOUT after reset button pushed and UniFlash too but not after POR cause NMI fault. I have not had any NMI faults in debug runtime of the universal motor control, MCSDK.

    MEMORY
    {
    PAGE 0 :

    /* Flash sectors */
    /* BANK 0 */
    // FLASH_BANK0_SEC0 : origin = 0x080002, length = 0x000FFE /* on-chip Flash */
    FLASHBANK0_BOOT : origin = 0x080002, length = 0x000FFE /* remote update */
    FLASHBANK0_CODE : origin = 0x081000, length = 0x00D000 /* control code */


    /* BANK 1 */
    // FLASH_BANK1_SEC0 : origin = 0x090000, length = 0x001000 /* on-chip Flash */
    // FLASH_BANK1_SEC1 : origin = 0x091000, length = 0x001000 /* on-chip Flash */

    PAGE 1 :

       BOOT_RSVD        : origin = 0x000002, length = 0x0000F3      /* Part of M0, BOOT rom will use this for stack */

    /* BEGIN is used for the "boot to Flash" bootloader mode */
    BEGIN : origin = 0x080000, length = 0x000002
    RESET : origin = 0x3FFFC0, length = 0x000002

    Are you using the default CodeStartBranch.asm file from C2000Ware

    This code branch was part of SDK 4.0 project copied to MCSDK project and of course excluded any x2 files from the build. 

    ***********************************************************************
    
    WD_DISABLE  .set  0    ;set to 1 to disable WD, else set to 0
    
        .ref _c_int00
        .global code_start
    
    ***********************************************************************
    * Function: codestart section
    *
    * Description: Branch to code starting point
    ***********************************************************************
    
        .sect "codestart"
    
    code_start:
        .if WD_DISABLE == 1
            LB wd_disable       ;Branch to watchdog disable code
        .else
            LB _c_int00         ;Branch to start of boot._asm in RTS library
        .endif
    
    ;end codestart section
    
    ***********************************************************************
    * Function: wd_disable
    *
    * Description: Disables the watchdog timer
    ***********************************************************************
        .if WD_DISABLE == 1
    
        .text
    wd_disable:
        SETC OBJMODE        ;Set OBJMODE for 28x object code
        EALLOW              ;Enable EALLOW protected register access
        MOVZ DP, #7029h>>6  ;Set data page for WDCR register
        MOV @7029h, #0068h  ;Set WDDIS bit in WDCR to disable WD
        EDIS                ;Disable EALLOW protected register access
        LB _c_int00         ;Branch to start of boot._asm in RTS library
    
        .endif
    
    ;end wd_disable
    
        .end
    
    ;//
    ;// End of file.
    ;//

  • You mentioned INTOSC1 and INTOSC2, but the code you shared above says SYSCTL_OSCSRC_XTAL (external osc source). Where are the internal oscillators being used? Only to run XCLKOUT but not SYSCLK?

    One thing we recommend when people are having trouble getting booting from flash to work is to try changing WD_DISABLE in the CodeStartBranch.asm file to 1. If you have a lot of varibles, c_int00 can take quite a while to execute which can cause a watchdog reset if you don't disable it.

    Whitney

  • Where are the internal oscillators being used? Only to run XCLKOUT but not SYSCLK?

    XCLOCK out only works with INTOSC2 in UniFlash and assuming CCS debug. As XCLOCKOUT is missing when POR or reset button is pushed upon exiting, ending XDC110 debug state. 

    WD_DISABLE in the CodeStartBranch.asm file to 1.

    It is disabled in hal.c so CodeStartBranch should leave it disable. The WD peripheral timeout is not even configured so why is CSB trying to enable it is the bigger question? Seemingly the WD is executing before the CPU even loads the IP due to CSB doing unexpected things with a disabled peripheral.

    One thing we recommend when people are having trouble getting booting from flash to work

    It was disabled in 2x CSB but not in 4x of the original SDK4.0 and that was having POR Boot to flash issues for reasons other than WD being enabled. Hence totally bamboozled, bewildered and few other B words come to mind Blush

  • Can you tell where it's getting stuck when you do the reset, but it fails to boot? Like if you reconnect the debug connection after the POR, what is it executing? There are some routines in this post and in this video that can help you reconnect the debugger without resetting the device and losing the device state you want to debug.

    It is disabled in hal.c so CodeStartBranch should leave it disable. The WD peripheral timeout is not even configured so why is CSB trying to enable it is the bigger question? Seemingly the WD is executing before the CPU even loads the IP due to CSB doing unexpected things with a disabled peripheral.

    The watchdog is enabled after a reset. CSB isn't taking any action to enable it--it's just giving you a chance to disable it before your application can do it since c_int00 may take a little while to run.

    Whitney

  • Thank you Whitney, that explains a lot of the mystery though haven't done anything with C2000 WD up to this point.

    Hugging