NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

DA8xx Secondary Boot Loader Customization for SPI Master Boot

From Texas Instruments Wiki
Jump to: navigation, search

Introduction[edit]

This page describes the Secondary Boot Loader customization for SPI Master boot. Secondary boot loader can realize:

  1. Auto boot: you can boot DSP itself just reset. Communication with uC is not needed.
  2. Normal boot: Use communication with uC and boot DSP. This process needed if you want to flash update function. Every time you specify Normal boot or flash update from uC when booting
  3. Flash update: Use communication with uC and boot DSP's SBL. Then you can update contents of flash. Detail sequence is described in Boot Sequence of Typcal Customization process needed if you want to flash update function.

Procedure[edit]

Build sbl.out[edit]

  1. Delete spiflash_wb.c and add your customized spiflash_xx.c. Edit da8xx_spi.h if necessary. Please refer H/W Bring-up to know how to make.
  2. Add pre-define “FLASH_UPDATE_SPI” to sbl.pjt. If you use auto boot, this is not necessary
  3. Add pre-define “USE_COMPRESSION” if you use compression
  4. Build sbl.pjt

Generate factory.bin[edit]

  1. Generate sbl.bin from sbl.out using AISgen tool. [AISgen tool is available at [1] ]
  2. Generate pa.bin from following command.. use -z option for enabling compression. Please see appendix B for detail.
    $ coff2pfimg.exe -b 0x00010000 -u pa.bin pa.out
  3. Combine both bin's using binc.exe to generate factory.bin. Please see appendix C for detail.
    $ binc.exe 0=sbl.bin 0x00010000=pa.bin -ofactory.bin
  4. Program factory.bin to SPI flash using spiwriter.pjt

Appendix A: Boot/update time[edit]

  • To Do: Add sample data of boot/flash update time on EVM

Appendix B: coff2pfimg[edit]

coff2pfimg: Convert COFF File to Parallel Flash Boot Image

Usage:
  coff2pfimg [OPTIONS] <infile.out> ...
Options:
  One or more of the following options may be used:
  -h This help

  -v Increase verbosity (Use multiple -v for more debug prints)

  -q Decrease verbosity

  -z Turn compression ON

  -m Generate image with structure suitable for holding multiple boot images on the same flash.
     If more than one .out is specified on the command line, then -m is implicit.

  -c <filename> Generate C file suitable for linking into another program (Used for generating
     the "factory" image)

  -u <filename> Generate the image as a binary file suitable for sending over I2C/SPI for upgrade
 
  -l <rfile> Create a "loader" file named <rfile> The loader file has an array of type FLASH_PRINT
     specifying the RAM print of the input .out file. It also will contain the entry point of the
    .out. It is intended to be used by the bootloader running from the top 1K of the flash

  -r <bfile> Create a "burner" file named <bfile>
     The burner file contains the section data for all sectons in the input .out file and is
     intended to be used by the program that burns into the flash

  -n <name> Name of the table to used for the array in the "burner" file.

  -b <flashbase> Base address of the boot image in flash This will at 0x90000000 plus some
     multiple of flash block size used for "safe" code The default is 0x90004000 (i.e., 
     16KB is reserved for "safe" boot and upgrade code) Either the -c or -u or -r option must
     be specified coff2pfimg.exe reads input COFF file and generates a data file

Appendix C: binc[edit]

binc v0.2

Usage: binc.exe <offset1=file1.bin> <offset2=file2.bin> ..<offsetn=filen.bin> -o<output.bin>
Combines different binaries at specified offsets ..

SPI Driver Customization[edit]

Editing da8xx_spi.h, spiflash_xx.c (xx is vender name of flash). Spiflash_wb.c is provided as example of TI EVM[edit]

  • Customization of SPI flash driver. These are used both sbl.pjt and spiwrite.pjt
  1. spiflash_wb.c contains all the flash specific implementaion. Create a new file spiflash_xx.c specific to customer and copy content of spiflash_wb.c.
  2. Update the various flash commands and flash declarations based on the flash specific data sheet. All SPIFlash commands are implemented as specific functions, So all the below functions needed to be updated as per flash command definition.
    1. SPIFLASH_ManufacturerID ()
      • Function to read Manufactured ID of the flash. Data format is different among venders.
    2. SPIFLASH_DeviceID()
      • Function to read device ID of the flash. Data format is different among venders.
    3. SPIFLASH_Status ()
      • Function to read the SPI flash device status.
    4. SPIFLASH_Read (void *pDst, void *pSrc, Uint32 nlength)
      • Function to read the content of flash from pSrc to pDst of size nLength bytes. By default sequential read of SPI flash is implemented.
    5. SPIFLASH_BlockErase (Uint32 blk_no)
      • Function to erase the content of block number specified by blk_no.
    6. SPIFLASH_Write (void *pDst, void *pSrc, Uint32 nlength)
      • Function to write content to flash from pSrc to pDst of size nLength bytes. Flash programming and erasing are performed at the block level. Each block of flash is programmed in terms of page size.
    7. SPIFLASH_Unlock()
      • Some vender’s have “write protection” at default, in this case, you need to unlock.
E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article DA8xx Secondary Boot Loader Customization for SPI Master Boot here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article DA8xx Secondary Boot Loader Customization for SPI Master Boot here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article DA8xx Secondary Boot Loader Customization for SPI Master Boot here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article DA8xx Secondary Boot Loader Customization for SPI Master Boot here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article DA8xx Secondary Boot Loader Customization for SPI Master Boot here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article DA8xx Secondary Boot Loader Customization for SPI Master Boot here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article DA8xx Secondary Boot Loader Customization for SPI Master Boot here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article DA8xx Secondary Boot Loader Customization for SPI Master Boot here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article DA8xx Secondary Boot Loader Customization for SPI Master Boot here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity