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.

TMS320F28379D: SCI serial Flash programming fail

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

Hello

I am trying to down load firmware to TMS320F28379D though UART. The folowing methods are what I have tried but I didnot get a good result so far.

1. set GPIO72 low and GPIO 84 high (boot from SCI mode), connect GPIO28 with Tx of UART and GPIO29 with Rx, and run serial_flash_programmer.exe and get the result as picture 1 and the signal on GPIO28 is shown as picture 2.

2. set GPIO72 and GPIO 84 high( Get Mode), down load firmware F2837xD_sci_flash_kernels_cpu01 to silicon and run serial_flash_programmer.exe the result is the same. the kernels is staying at while(SciaRegs.SCIFFCT.bit.ABD != 1) {} waiting for correctly read an 'A'. I also try to send '0x0A', '0xA0', 0xAA to the silicon by hyperterminal, the kernel still stay at that step.

3. I tried the firmware of sci_echoback_cpu01 and get that the SCI works well.

It seems that the kernel can not get 'A' for autobaud correctly. Could you please give me some advices about it. 

picture1

picture2

  • Hi,

    There were some fixes made in the new release C2000Ware v2.00.00.02

    I think you might have used the existing F2837xD_sci_flash_kernels_cpu01.txt in the C2000Ware_X_XX_XX_XX\utilities\flash_programmers\serial_flash_programmer\f2837xD_fw_upgrade_example

    Could you please create a new text file by building the project at

    \C2000Ware_2_00_00_02\device_support\f2837xd\examples\dual\F2837xD_sci_flash_kernels\cpu01

    Also please create the application file blinky_dc_cpu01.txt again. 

    As part of the new change, you need to use 128-bit alignment in application linker command file i.e. use ALIGN(8) instead of ALIGN(4).

    Please let me know if you see any other issue.

    Thanks, Katta

  • Hi Katta

    I have tried to rebuild kernel firmware and blinky firmware and generate .txt file by following command. The issue is still same with above desciption. And I try to disconnect the silicon, the phenomenent after running serial_flash_programmer.exe is the same with normal connection status. I feel there is something wrong with hardware configuration or connection so that the silicon cannot recieve the 'A' Command correctly. Could you please give me some advices?

    hex2000.exe -boot -a -sci8 blinky_cpu01.out -o blinky_cpu01.txt
    hex2000.exe -boot -a -sci8 F2837xD_sci_flash_kernels_cpu01.out -o F2837xD_sci_flash_kernels_cpu01.txt

    As part of the new change, you need to use 128-bit alignment in application linker command file i.e. use ALIGN(8) instead of ALIGN(4).

    when and where should I set ALIGN(8)? 

  • Hi,

    In your procedure 1, can you skip providing the baud rate and use the latest files you have created?

    I missed to mention you one more point. In the example \C2000Ware_2_00_00_02\device_support\f2837xd\examples\dual\F2837xD_sci_flash_kernels\cpu01, file F2837xD_sci_flash_kernels_cpu01.c

    Please modify the highlighted section as provided as you are using GPIO28,29.

    //
    // parameter SCI_BOOT for GPIO84,85; parameter SCI_BOOT_ALTERNATE
    // for GPIO28,29
    //
    EntryAddr = SCI_GetFunction(SCI_BOOT_ALTERNATE);

    Rebuild the project again. You need not create F2837xD_sci_flash_kernels_cpu01.txt as it would already have been created when you build the project F2837xD_sci_flash_kernels.

    The serial flash programmer will send the required character 'A' to the kernel. So, you need not send again through the terminal.

    Currently please focus to make the kernel get programmed. 

    Regarding the ALIGN(8), please check the blinky example's linker command file.

    Thanks, Katta

  • Hi Katta

    I have tried your sugestion, but the phenominent is the same.

    it still lock at 'Attemping autobaud to load kernel'.

    Is it correct that using a USB to UART with 3,3V TTL level module to transfer the data?

    Can I do some other method to debug it?

    Best Regards

    Pengfei

  • Hi,

    You mentioned the sci echo back example is working as expected. Do you see the characters get echo back on the terminal?

    Could you please share your file \C2000Ware_2_00_00_02\device_support\f2837xd\examples\dual\F2837xD_sci_flash_kernels\cpu01\F2837xD_sci_flash_kernels_cpu01.c?

    You can attach the file to the reply.

    As I mentioned earlier, did you skip providing baud rate in the input in the terminal?

    Thanks, Katta

  • Hi Katta

    Thank you for your patient guidance.

    SCI echo back works as below picture. And attached file is my F2837xD_sci_flash_kernels_cpu01.c file.

    I have tried to not provide baud rate in the input terminal as below picture and result is the same.

    Do I need to do some thing with CPU02?

    F2837xD_sci_flash_kernels_cpu01.c
    //###########################################################################
    //
    // FILE:   F2837xD_sci_flash_kernels_cpu01.c
    //
    // TITLE:  Flash Programming Solution using SCI for F2837xD.
    //
    //! \addtogroup dual_example_list
    //! <h1>Flash Programming Solution SCI for Single or Dual Core</h1>
    //!
    //! In this example, we set up a UART connection with a host using SCI, receive
    //! commands for CPU1 to perform which then sends ACK, NAK, and status packets
    //! back to the host after receiving and completing the tasks.  This kernel has
    //! the ability to program, verify, unlock, reset, run, and boot CPU2 to SCI
    //! boot loader.  Each command either expects no data from the command packet
    //! or specific data relative to the command.
    //!
    //! In this example, we set up a UART connection with a host using SCI, receive
    //! an application for CPU01 in -sci8 ascii format to run on the device and
    //! program it into Flash.
    //
    //###########################################################################
    // $TI Release: F2837xD Support Library v3.06.00.00 $
    // $Release Date: Mon May 27 06:48:24 CDT 2019 $
    // $Copyright:
    // Copyright (C) 2013-2019 Texas Instruments Incorporated - http://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.
    // $
    //###########################################################################
    
    //
    // Included Files
    //
    #include "F28x_Project.h"
    #include "F2837xD_Ipc_drivers.h"
    #include "Shared_Erase.h"
    #include <string.h>
    #include "flash_programming_c28.h" // Flash API example header file
    #include "c1_bootrom.h"
    #include "F021_F2837xD_C28x.h"
    
    //
    // Defines
    //
    #define C1C2_BROM_IPC_EXECUTE_BOOTMODE_CMD    0x00000013
    #define C1C2_BROM_BOOTMODE_BOOT_FROM_SCI      0x00000001
    #define C1C2_BROM_BOOTMODE_BOOT_FROM_RAM      0x0000000A
    #define C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH    0x0000000B
    
    //
    // Function Prototypes
    //
    void Example_Error(Fapi_StatusType status);
    void Init_Flash_Sectors(void);
    extern Uint32 SCI_GetFunction(Uint32  BootMode);
    
    //
    // Main
    //
    uint32_t main(void)
    {
    //
    // SCIA Flush
    //
        while(!SciaRegs.SCICTL2.bit.TXEMPTY)
        {
        }
    
    //
    // Step 1. Initialize System Control:
    // Enable Peripheral Clocks
    // This example function is found in the F2837xD_SysCtrl.c file.
    //
        InitSysCtrl(); //PLL activates
    
    //
    // Step 2. Initialize GPIO:
    // This example function is found in the F2837xD_Gpio.c file and
    // illustrates how to set the GPIO to it's default state.
    //
        InitGpio();
    
    //
    // Step 3. Clear all interrupts and initialize PIE vector table:
    // Disable CPU interrupts
    //
        DINT;
    
    //
    // Initialize the PIE control registers to their default state.
    // The default state is all PIE interrupts disabled and flags
    // are cleared.
    // This function is found in the F2837xD_PieCtrl.c file.
    //
    //    InitPieCtrl();
    
    //
    // Disable CPU interrupts and clear all CPU interrupt flags:
    //
        IER = 0x0000;
        IFR = 0x0000;
    
    //
    // Initialize the PIE vector table with pointers to the shell Interrupt
    // Service Routines (ISR).
    // This will populate the entire table, even if the interrupt
    // is not used in this example.  This is useful for debug purposes.
    // The shell ISR routines are found in F2837xD_DefaultIsr.c.
    // This function is found in F2837xD_PieVect.c.
    //
    //    InitPieVectTable();
        InitIpc();
        InitFlash();
    
    //
    // Gain pump semaphore
    //
        SeizeFlashPump();
        Init_Flash_Sectors();
    
        Uint32 EntryAddr;
    
    //
    // parameter SCI_BOOT for GPIO84,85; parameter SCI_BOOT_ALTERNATE
    // for GPIO28,29
    //
        EntryAddr = SCI_GetFunction(SCI_BOOT_ALTERNATE);
    
        return(EntryAddr);
    }
    
    //
    // Init_Flash_Sectors - Initialize flash API and active flash bank sectors
    //
    void Init_Flash_Sectors(void)
    {
        EALLOW;
        Flash0EccRegs.ECC_ENABLE.bit.ENABLE = 0x0;
        Fapi_StatusType oReturnCheck;
    
        oReturnCheck = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS, 150);
        if(oReturnCheck != Fapi_Status_Success)
        {
            Example_Error(oReturnCheck);
        }
    
        oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank0);
        if(oReturnCheck != Fapi_Status_Success)
        {
            Example_Error(oReturnCheck);
        }
        Flash0EccRegs.ECC_ENABLE.bit.ENABLE = 0xA;
        EDIS;
    }
    
    //
    // Example_Error - For this example, if an error is found just stop here
    //
    #ifdef __TI_COMPILER_VERSION__
        #if __TI_COMPILER_VERSION__ >= 15009000
            #pragma CODE_SECTION(Example_Error,".TI.ramfunc");
        #else
            #pragma CODE_SECTION(Example_Error,"ramfuncs");
        #endif
    #endif
    void Example_Error(Fapi_StatusType status)
    {
        //
        // Error code will be in the status parameter
        //
        __asm("    ESTOP0");
    }
    
    //
    // End of file
    //
    

     

  • Hi,

    There are a few more things you can do to further debug the issue.

    1. Could you please load boot rom symbols library to check if it is really stuck in SCI boot in ROM?

    2. Could you please let me know your use case? if it is fine can you use the SCI emulation boot mode?

    Thanks, Katta

  • Hi,

    Any update from your side? Could you use the SCI emulation boot mode?

    Thanks, Katta