10.3 Write Memory Command (HCI-ISDAP Opcode - 0x0111)
The HCI-ISDAP command allows the host MCU to write values to the internal nonvolatile memory of the BM70/71 module. The BM70/71 module contains a Harvard memory architecture with segmented memory. Each of the four-memory bank/segments in the code space and two memory bank/segments in the data space are 64 Kbytes in size.
- Most Significant bit (MSb), 16 bits of the address value – The target memory bank/segments, starting at a logical value of zero
- Least Significant bit (LSb), 16 bits – To address a specific memory location with the memory bank/segment
When the host MCU/programmer is initially setting up communication with the BM70/71 module, the host MCU finds the maximum packet (HCI ACL data or HCI command packets) length the BM70/71 module can process. The host MCU must not exceed this packet length value when sending programming data to the BM70/71 module using HCI-ISDAP packets. In most of the cases, it is common for the maximum packet length of the BM70/71 module to be a smaller value than the maximum size of an HCI-ISDAP packet. Generally, the maximum packet length the BM70/71 module can process is approximately 250 bytes; whereas, the maximum allowable packet length of an HCI ACL data packet is up to 65535 bytes, including a few bytes of overhead. (Embedding HCI-ISDAP programming protocol in an HCI data packet reduces this value to 32767 bytes of data in a single packet.) This means, even though the programmer can technically send up to 65535 bytes of programming data in a single packet, the BM70/71 module can only receive a packet length of approximately 250 bytes.
To reduce communication overhead when performing large write operations where entire banks of memory are programmed, the HCI-ISDAP write command has a setting embedded in the HCI-ISDAP data length field. The most significant bit in the 16-bit field represents a flag referred to as the continue flag. If this flag is set to ‘1
’, all subsequent write messages must be sent as a write continue command (HCI-ISDAP opcode – 0x0001) packet. The rest of the 16-bit ISDAP data length field (bit[14:0]) now represents the total amount of data in this packet. The size field of the HCI-ISDAP write command now indicates the total amount of data to be programmed into the device (this includes all subsequent HCI-ISDAP write continue packets). With write continue operations, the BM70/71 module assumes the memory contents are written sequentially, starting from the address value originally sent by the host MCU in the first HCI-ISDAP write memory command packet. These write continue operations allow the programmer to use the smaller write continue packet to reduce communication overhead. For more details, refer to Write Continue Command (HCI-ISDAP Opcode – 0x0001).