Using the D800K001 bootloader in SPI Slave mode

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

This page is an extension to the existing application report [1] and provides a detailed description of the boot procedure from host perspective when SPI Slave boot mode is selected on the DSP side.

D800K001 Signal Connection SPI.jpg


Contents

Generating an Application Image Script (AIS)

The AIS format is a format of storing the boot image which can be interpreted by the D800K001 bootloader. The AISgen tool converts a COFF-file for the DSP into AIS format (either a binary or a header file). Therefore several settings can be configured in the GUI of this tool:

Please refer to the application report [2] for a detailed description the AISgen tool and the required steps to generate AIS files.

Note: AIS files do not perform all of the configuration steps that a GEL file typically handles during development. Notably, AIS will not setup the Pin Multiplexing Control Register (PINMUX) and the Power and Sleep Controller Register (PSC) for any peripheral devices your DSP application uses. Be sure to add the necessary configuration steps to your application code before generating the AIS file.


SPI Slave boot procedure

About the AIS interpreter on the Host

When booting from an external host processor, the host acts as the communication master, and the bootloader acts as the slave. Since the bootloader doesn’t have direct access to the AIS, the host processor must transfer it to the bootloader through a well-defined protocol explained in the following sections. An AIS interpreter is required on the host processor to control this transfer.

The AIS interpreter on the host processor is responsible for transferring the AIS to the bootloader. Therefore, the host has to understand the transfer protocol and implement the required handshake mechanism. It is important to establish a reliable link between the host and the bootloader before starting a serial boot load using the AIS. Once this link is established, the AIS can be transferred to the bootloader. This complete synchronization and transmission process is divided into three states:

Start-word synchronization (SWS)

After power ON reset (POR), the bootloader takes some time to initialize and configure the boot peripheral. Similarly, the host also takes its own time to initialize and prepare to boot the device. A SWS mechanism is used to synchronize the device and host after POR. To achieve SWS, the host repeatedly sends transmit-start-word (XMT_START) to the device until it receives the receive-start-word (RECV_START) from the bootloader.

Flow SWS.jpg

For the SPI slave modes, the bootloader operates the SPI peripheral in 16-bit mode, so that both start words are 16-bit values:

Note: While XMT_START and RECV START are 16-bit in SPI Slave mode, all other data including op-codes are 32 bit, and all 32 bits need to be transmitted to the bootloader regardless of the boot mode.


Ping Op-code synchronization (POS)

The POS is used to further ensure that the serial link between the host and the device is reliable for exchanging boot information.

After successful SWS:

Note: All multi-word values transmitted by the host should be sent in little-endian order. For instance, the Ping opcode (0x5853590B) is sent as 0x590B, 0x5853 in 16-bit mode. The same applies to responses received from the bootloader.

The count (N) is selected by the host and should be appropriate to assure successful communication between the device and host. The recommended value of N is 2.

Flow POS.jpg

After the successful execution of POS, the host starts reading AIS commands (magic number is checked and ignored by the host) from its source and starts booting the device.


Op-code synchronization (OS)

As the bootloader may take an indeterminate amount of time to execute an AIS command, a handshake mechanism is needed between the host and the bootloader before the host can send any command to the bootloader. The following opcode synchronization method is used for this purpose:

Flow OS.jpg

All opcodes that are transmitted by the host to the bootloader are of the form 0x585359##, where ## varies for individual opcodes. The bootloader acknowledges each opcode with a corresponding RECV opcode. The RECV opcodes are generated from the original opcodes by changing the most significant byte to 0x52. Thus, they are of the form 0x525359##. Not getting a correct response (RECV opcode) from the bootloader indicates that the bootloader is busy executing the previous command. The host should continue sending the opcode until it is successfully acknowledged by the bootloader. After the correct RECV opcode was received by the host, it has to transmit the arguments belonging to this opcode. The arguments only have to be transmitted one by one, i.e. the bootloader is not sending these data back to the host.


Note: Before the PLL is configured it is bypassed, i.e. the device is operating at the oscillator frequency. Because of that it is required to insert a delay between the transmission/reception of each 16-bit block, to ensure that the DSP can receive and process the data correctly (e.g. for-loop counting up to 0x3FF @ 160MHz). After the PLL was configured (frequency as selected in the AISgen tool) this delay could either be completely removed or at least reduced tremendously (e.g. for-loop counting up to 0x3 @ 160MHz), depending on the baudrate and the configured PLL frequency.


Boot Requirements, Hardware Setup and Default Settings

Boot modeBOOT[7]BOOT[2]BOOT[1]BOOT[0]BOOT[3]
SPI0 Slave10010
SPI1 Slave10011
SPI signal sampling.JPG

References

E2e.jpg For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Using the D800K001 bootloader in SPI Slave mode here.
Hyperlink blue.png Links
ARM Microcontroller MCU ARM Processor Digital Media Processor Digital Signal Processing Microcontroller MCU Multi Core Processor
Ultra Low Power DSP 8 bit Microcontroller MCU 16 bit Microcontroller MCU 32 bit Microcontroller MCU

Leave a Comment
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox