xWRL6432 MMWAVE-L-SDK  05.04.00.01
Booting Over SPI

Introduction

xWRL6432 devices support booting over SPI interface in the absence of serial flash memory (where application usually resides). This example demonstrates the booting of xWRL6432 device with no serial flash memory using another xWRL6432 device. The device that is running this example sends the user application to another device without flash via SPI interface.

Booting Over SPI

ROM bootloader (or RBL) is a software that resides in a on-chip read-only memory (ROM) of application subsystem (APPSS) to assist the customer in transferring and executing their application code. It will do the Reset cause check and Device initialization. After that It will check the SOP lines and SFLASH connection to proceed with either the flashing or execution mode. In Flashing Mode, ROM bootloader (or RBL) performs the serial flash programming over UART interface. In functional mode, the bootloading of an image from the Flash memory is the first bootmode attempted by the bootloader. When not using a serial flash device to store the application image, the bootloader will look for an image to be loaded via SPI or UART interface, if the first ping/command is initiated through SPI interface then RBL switch to SPI mode of image download. This image can be loaded in from a host PC or processor using the protocol documented below. A simplified diagram for command response flow is shown below.

SPI Booting Command Response flow

Supported Combinations

Parameter Value
CPU + OS m4fss0-0 freertos
Toolchain ti-arm-clang
Board xWRL6432-evm
Example folder examples/drivers/boot/spibooting

Using SDK with SysConfig

A GUI tool SysConfig is used to configure different modules and peripherals of the example. Using this tool, users can select and customize different modules and peripherals. The SysConfig tool will generate the code for initializing and configuring these modules. This configuration is saved to a file called example.syscfg for every example. To know more about how to use SDK with SysConfig, Visit this page

Using SDK with SysConfig

SPI Settings

SPI Controller xWRL6432 where this example is running
SPI Peripheral xWRL6432 without Flash

This example implements the standard SPI protocol as detailed in Multichannel Serial Port Interface (McSPI) with settings as below

Setting Value
SPI Mode 0 (Polarity 0, Phase 0)
SPI Clock Frequency 22 MHz

Steps to Run the Example

  • Generate appimagedata.h file: User is expected to generate the application they wanted to send via SPI in a data array. Users can use python script available for generating this(appimagdata.h file). For Example: If user wants to send power example application, follow these steps:
    cd ${MCU_PLUS_SDK_PATH}\examples\drivers\boot\spibooting
    python appimageToHex.py ${MCU_PLUS_SDK_PATH}\examples\drivers\power\power_modes\xwrL64xx-evm\m4fss0-0_freertos\ti-arm-clang\power_modes.release.appimage
    This will generate the appimagedata.h file in same folder. The appimagedata.h file will have a byte array of the application image and size of that array.
  • Connection of Controller with Peripheral, SPI connection between Controller device and Peripheral device are as below: Note Ensure device acting as peripheral does not have flash because bootloader will look for an image to be loaded via SPI or UART interface only when there is no flash memory. Also ensure that application being sent does not try to use flash memory.

SPI Interface
  • Switch settings for Host and Peripheral
    S1.1 S1.2 S1.3 S1.4 S1.5 S1.6
    ON OFF X X X ON
  • When using CCS projects to build, import the CCS project for the required combination and build it using the CCS project menu (see Using SDK with CCS Projects).
  • When using makefiles to build, note the required combination and build using make command (see Using SDK with Makefiles)

Note Before running the example, reset the device without flash (peripheral) using the "Reset_SWT" on EVM.

Output on Controller & Peripheral

After the controller successfully transmits the user application image, output log will be

Booting via SPI ...
Transferring appimage via SPI ...
Booting via SPI is completed

We can see the output on peripheral side by using Tera Term. It will appear as shown below. For example, When power example is transferred.