SPRACN1 May   2019 TMS320F2800132 , TMS320F2800133 , TMS320F2800135 , TMS320F2800137 , TMS320F2800152-Q1 , TMS320F2800153-Q1 , TMS320F2800154-Q1 , TMS320F2800155 , TMS320F2800155-Q1 , TMS320F2800156-Q1 , TMS320F2800157 , TMS320F2800157-Q1 , TMS320F280021 , TMS320F280021-Q1 , TMS320F280023 , TMS320F280023-Q1 , TMS320F280023C , TMS320F280025 , TMS320F280025-Q1 , TMS320F280025C , TMS320F280025C-Q1 , TMS320F280040-Q1 , TMS320F280040C-Q1 , TMS320F280041 , TMS320F280041-Q1 , TMS320F280041C , TMS320F280041C-Q1 , TMS320F280045 , TMS320F280048-Q1 , TMS320F280048C-Q1 , TMS320F280049 , TMS320F280049-Q1 , TMS320F280049C , TMS320F280049C-Q1

 

  1.   C2000 Software Controlled Firmware Update Process
    1.     Trademarks
    2. 1 Introduction
    3. 2 Configuring Custom Boot Mode
      1. 2.1 Custom Boot Pin Selection
      2. 2.2 Custom Boot Mode Definition
      3. 2.3 Writing the Values to User OTP
    4. 3 Hardware Modifications
    5. 4 Software Modifications
      1. 4.1 Application Software Modifications
      2. 4.2 Flash Kernel Modifications
      3. 4.3 Firmware Update Process
    6. 5 Flowchart
    7. 6 Summary
    8. 7 References

Application Software Modifications

The following care-about has to be considered in the application software.

  • Upon powering up, the application will boot to flash as GPIO15 will be low. In the beginning of the application drive GPIO as an output low to take care of any noise in the pin. This is just a precautionary measure to ensure we get into flash boot mode by default if reset happens at any time.
  • When the application decides to update the firmware, the GPIO15 pin is driven high by the application software in order to charge the capacitor up. A sufficient time (50 µs) is allowed to ensure the capacitor is charged enough so that, once a reset occurs and the pin turns back into an input, it can drive high long enough for the boot code to read it as high.
  • Then, trigger a software reset. Now when the boot code decodes the boot mode, it will read the GPIO15 pin as high and select the SCI boot mode.

The updated code has to be rebuilt and the hex files have to be generated by following the steps mentioned in readme.txt at \ti\c2000\C2000Ware_1_00_06_00\utilities\flash_programmers\serial_flash_programmer\.

The following is a code snippet from the led blink example highlighting the changes in red.

// // Included Files // #include "driverlib.h" #include "device.h" /* #pragma RETAIN(otp_z1_data) #pragma DATA_SECTION(otp_z1_data,"dcsm_zsel_z1"); const long otp_z1_data = 0x5AFFFF0F; #pragma RETAIN(otp_z1_data_2) #pragma DATA_SECTION(otp_z1_data_2,"dcsm_zsel_z1_2"); const long otp_z1_data_2 = 0xFFFF0103; */ // // Main // void main(void) { uint32_t index = 0; // // Initialize device clock and peripherals // Device_init(); // // Initialize GPIO and configure the GPIO pin as a push-pull output // Device_initGPIO(); GPIO_setPadConfig(DEVICE_GPIO_PIN_LED1, GPIO_PIN_TYPE_STD); GPIO_setDirectionMode(DEVICE_GPIO_PIN_LED1, GPIO_DIR_MODE_OUT); //// Drive GPIO pin low to take care of noises//GPIO_setPadConfig(15, GPIO_PIN_TYPE_STD);GPIO_setDirectionMode(15, GPIO_DIR_MODE_OUT);GPIO_writePin(15, 0);DEVICE_DELAY_US(50); // // Initialize PIE and clear PIE registers. Disables CPU interrupts. // Interrupt_initModule(); // // Initialize the PIE vector table with pointers to the shell Interrupt // Service Routines (ISR). // Interrupt_initVectorTable(); // // Enable Global Interrupt (INTM) and realtime interrupt (DBGM) // EINT; ERTM; // // Loop Forever // for(index = 0; index < 5; index++) { // // Turn on LED // GPIO_writePin(DEVICE_GPIO_PIN_LED1, 0); // // Delay for a bit. // DEVICE_DELAY_US(500000); // // Turn off LED // GPIO_writePin(DEVICE_GPIO_PIN_LED1, 1); // // Delay for a bit. // DEVICE_DELAY_US(500000); } //// Drive GPIO pin high to select flash boot mode//GPIO_writePin(15, 1);DEVICE_DELAY_US(50);SysCtl_resetDevice(); }