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:
  1. 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).
  2. 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.
  3. Use the following Flash operations commands to implement the DFU:
    • CSEQ Flash Erase command
    • CSEQ Bank Switch command
    • CSEQ Write Flash command
  4. 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).
    Figure 2-1. Overview of Flash Memory Programming Process
Table 2-1. BM78 and RN4678 EVB Mode Switch Positions
ModeSwitch PositionsPin Definition
1/P2_02/P2_43/EAN
FlashWrite Flash
ONONON
ROMTest (Write EEPROM)
ONOFFON
Application (default)
OFFOFFON
FlashTest (Write EEPROM)
ONOFFOFF
Application (default)
OFFOFFOFF

Device Firmware Upgrade (DFU) Process

The following are the steps in the DFU process:
  1. 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
    ModuleP2_0P2_4EANOperational Mode
    BM78SPPx5NC2 (ROM variant)LowHighHighTest mode (write EEPROM)
    HighHighHighApplication mode (APP mode) (normal operation)
    BM78SPPx5MC2 (Flash variant)LowLowHighWrite Flash
    LowHighLowTest mode (write EEPROM)
    HighHighLowAPP mode (normal operation)
  2. 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.
  3. 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.
  4. 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.