2.1 BM78 and RN4678 Flash Memory Programming
To perform any memory programming operation, the user needs to follow the process shown in the
following figure with respect to the command protocols. The following are the steps to
perform the Flash memory programming process:
- Enter Flash Memory Programming Mode – Set the BM78 module or the RN4678 module into the write Flash mode using the pins P2_0/P2_4/EAN. Set the pins P2_0/P2_4/EAN to the ON state, and, then, initiate a hardware reset using the RST_N pin; see the following table for details. For more details, refer to the BM78 Evaluation Board (EVB) User’s Guide (DS70005246) and the RN4678 PICtail™/PICtail Plus Daughter Board User’s Guide (DS50002566).
- Connect to the Flash – Use the CSEQ Get Flash ID command to get the Flash ID for verification to connect to the Flash in the BM78 module or the RN4678 module.
- Use the following Flash operations commands to implement the DFU:
- CSEQ Flash Erase command
- CSEQ Bank Switch command
- CSEQ Write Flash command
- Disconnect from Flash – After the
DFU, the host MCU sets the BM78 module or the
RN4678 module into Application mode
using the pins P2_0/P2_4/EAN. Set the pins P2_0/P2_4/EAN to the OFF state, and,
then, initiate a hardware reset using the RST_N pin; see the following table.
For more details, refer to the BM78 Evaluation Board (EVB) User’s Guide
(DS70005246) and the RN4678 PICtail™/PICtail Plus
Daughter Board User’s Guide (DS50002566).
Mode | Switch Positions | Pin Definition | |||
---|---|---|---|---|---|
1/P2_0 | 2/P2_4 | 3/EAN | |||
Flash | Write Flash | ON | ON | ON | |
ROM | Test (Write EEPROM) | ON | OFF | ON | |
Application (default) | OFF | OFF | ON | ||
Flash | Test (Write EEPROM) | ON | OFF | OFF | |
Application (default) | OFF | OFF | OFF |
Device Firmware Upgrade (DFU) Process
The following are the steps in the DFU process:
- Entering Flash Programming
Mode – Set the pins P2_0, P2_4 and EAN into the write Flash mode; see the
preceding table. For more details, refer to the BM78 Bluetooth® Dual-Mode
Module Data Sheet (DS60001380) and the RN4678
Bluetooth® Dual Mode Module Data Sheet (DS50002519). The following table provides the
system configuration settings for the BM78 module and the RN4678
module.
Table 2-2. System Configuration Settings Module P2_0 P2_4 EAN Operational Mode BM78SPPx5NC2 (ROM variant) Low High High Test mode (write EEPROM) High High High Application mode (APP mode) (normal operation) BM78SPPx5MC2 (Flash variant) Low Low High Write Flash Low High Low Test mode (write EEPROM) High High Low APP mode (normal operation) - Connect to the Flash – Use
the following Command Sequence (CSEQ) commands 0x70 and 0x50 to connect to
the Flash via UART in the Flash memory programming process:
- CSEQ Set Flash (Opcode: 0x70) – Use the CSEQ Set Flash command to set the Flash as the external Flash. During the DFU, the BM78 module or the RN4678 module receives the CSEQ Set Flash command as the first Flash operation command.
- CSEQ Get Flash ID (Opcode: 0x50) – Use the CSEQ Get Flash ID command to read the Flash ID from the BM78 module or the RN4678 module. The CSEQ Get Flash ID command returns the Flash ID. For confirmation, after sending the CSEQ Set Flash command, the host MCU performing the DFU must check the Flash ID.
- CSEQ Flash Operations – After
connecting to the Flash, the host MCU carries the following CSEQ Flash
operations:
- CSEQ Flash Erase command (Opcode: 0x51) – Erases the entire external Flash of the BM78 module or the RN4678 module.
- CSEQ Switch Bank command (Opcode: 0x63) – Before the write Flash command, use the CSEQ Switch Bank command to switch to the target bank.
- CSEQ write Flash command (Opcode: 0x45) – To write the current bank of Flash with data specified in the CSEQ write Flash command. The maximum data limit is 240 bytes.
- Disconnect from Flash – After the completion of the DFU, perform a hardware reset after setting the pins P2_0, P2_4 and EAN to APP mode.