The host LaunchPad development kit project sends two different images to the target device, using a push button for user interaction. USB connection to a computer is not required on either LaunchPad development kit to run the demo; however, each kit should be powered either by a USB connection through the eZ-FET or with a steady 3.3-V external power supply to the VCC and GND pins (ensure that the eZ-FET is disconnected in this instance). Because both the host and target LaunchPad development kits are of the same derivative, it might be helpful to label each board accordingly to avoid confusion. The demo is run using these steps, regardless of communication type or image mode used:
- Build and download MSPBoot as described in Section 4.3.1, and build App1 and App2.
- Convert App1 and App2 according to Section 4.3.2.
Note: Batch file PrepareCCSOutput_[FR derivative].bat shows how to convert to C and copy the output files. In this host implementation, the MSP430 MCU holds the target image without CRC, so it calculates the CRC value assuming that unimplemented locations are 0xFF.
- Build and download the host application as described in Section 5.2.
- Connect the boards according to the desired communication type (UART as described in Section 5.1 or one of the CC110x solutions described in Section 4.2).
- Reset and execute code in both devices.
- To enter the target bootloader mode (indicated by both LED1 and LED2 remaining on):
- If the target does not have a valid application (default), the target stays in bootloader mode.
- Bootloader mode can be forced in hardware by pressing and holding the S2 button on the target device while pressing and releasing the reset button.
- If running an application:
- APP1 jumps to bootloader mode when the S2 button is pressed on the target device.
- APP2 jumps to bootloader mode when it receives the Force Boot command (supported only if CI PHY-DL is shared).
- Press the S1 button on the host board. The host device performs the following sequence of commands:
- Toggles LED1 twice.
- Sends “Force Boot” command (0xAA).
- If the target device is already in bootloader mode, it discards the packet, because the CRC is incorrect.
- If the target is running APP2, the target device enters bootloader mode.
- Requests the bootloader version (sends the TX_VERSION command).
- If the target response is 0xA0 (expected from BSL protocol), the host continues.
- If the target response is any other value, the host aborts transaction.
- Erases the target application area (sends the ERASE_APP command).
- Sends APP1 (uses the RX_DATA_BLOCK commands).
- Programs CRC of APP1 (uses the RX_DATA_BLOCK command).
- Forces the target application to run (sends the JUMP2APP command).
- Toggles LED1 twice to indicate successful transfer, and keeps LED1 on to show that the host is now ready to send APP2.
- Target starts running APP1 upon completion of transfer.
- The target device blinks LED1.
- LED1 blinks at a periodic interval using the timer.
- Press the S2 button on the target board to enter bootloader mode.
- With the target in bootloader mode, press S2 button on the host board to send APP2. When finished and done toggling, LED1 of the host board stays off to indicate that APP1 is now ready to be sent.
- Target starts running APP2 upon completion of transfer.
- The target device blinks LED2.
- Press the S2 button on the target board to toggle LED2.
- Because the CI is initialized, the host can send a Force Boot command to force bootloader mode in the target device at the start of a new transfer sequence.
- Press the S1 button on the host to start a new sequence sending APP1 again.
Dual-image mode contains a brief pause from the host after the transfer is complete while it validates the download area, transfers the memory into the application space, and erases the download area after the application area is validated by a CRC-CCITT check.
Note: Due to a pin conflict on the MSP-EXP430FR2433, disconnet LED2 from P1.1 by removing the jumper and physically wire to P1.2, instead.