Hi everyone,
I noticed that working in full speed mode, attached FLASH in not actually erased. Application note BRT_AN_033 - BT81X Series Programming Guide, version 1.1, table at chapter 2.8 Flash Interface, states it's possible, though. I'm wondering if I'm making any mistake.
The following pseudo-code fills buffer with 0x55 and FLASH content is not wiped out (running the code again returns actual data over and over):
unsigned ram_g = 0xff00;
unsigned flash_addr = 4096
char buffer[256];
// FLASH contains proper unified.blob
flashfast();
flashread(ram_g, flash_addr, sizeof(buffer));
read_memory(ram_g, buffer, sizeof(buffer)); // buffer contains actual data
flasherase();
flashread(ram_g, flash_addr, sizeof(buffer));
read_memory(ram_g, buffer, sizeof(buffer)); // buffer is filled with 0x55
If I comment out the line with flashfast(), FLASH gets erased (process takes much longer) and buffer is filled with 0xff.
There's no counterpart to CMD_FLASHFAST, thus I believe one should go through the CMD_FLASHDETACH → CMD_FLASHATTACH → CMD_FLASHERASE → CMD_FLASHWRITE(unified.blob) → CMD_FLASHFAST cycle. I didn't experiment with it because I can live with writing FLASH at normal speed.