SWCU193A April 2023 – August 2024 CC2340R2 , CC2340R5 , CC2340R5-Q1
The bootloader supports updating through the UART and SPI ports. The SPI port has the advantage of supporting higher and more flexible data rates, but it also requires more connections. The UART has the disadvantage of having slightly lower and possibly less flexible rates. However, the UART requires fewer pins and can be easily implemented with any standard UART connection.
Table 8-38 specifies which serial interface signals are configured to specific DIOs. There are three possible configurations for the serial interfaces. Configuration of the ROM Bootloader is done between the FCFG and the CCFG. There are defaults that are set in the FCFG that will take effect if a valid CCFG is not present on start-up. If the user wants to alter the defaults set by the FCFG they can update their CCFG to provide the behavior they desire. See Chapter 9.
Signal | serialIoCfgIndex == 0 | serialIoCfgIndex == 1 | serialIoCfgIndex == 2 |
---|---|---|---|
UART_RX | DIO20 | DIO12 | DIO22 |
UART_TX | DIO6 | DIO13 | DIO20 |
SPI_CLK | DIO8 | DIO24 | DIO24 |
SPI_CS | DIO11 | DIO11 | DIO11 |
SPI_POCI | DIO12 | DIO21 | DIO12 |
SPI_PICO | DIO13 | DIO13 | DIO13 |
The bootloader initially configures only the input pins on the two serial interfaces. By default, all I/O pins have their input buffers disabled, so the bootloader configures the required pins to be input pins so that the bootloader interface is not accessible from a host before this point in time. For this initial configuration of input pins, the firmware configures the IOC to route the input signals listed in Table 8-38 to their corresponding peripheral signals.
The bootloader selects the interface that is the first to be accessed by the external device. Once selected, the TX output pin for the selected interface is configured; the module on the inactive interface (UART or SPI) is disabled. To switch to the other interface, the device must be reset. The delayed configuration of the TX pin imposes special consideration on an SPI controller device regarding the transfer of the first byte of the first packet (see Section 8.5.1.2.2).