I have an issue with the code generated by Harmony for the bootloader SPI.
I am experiencing data loss in the flash memory after a programming command.
In the "bootloader_spi.c" file, I noticed that when I modify the "spiBLData" struct to use "CACHE_ALIGN," it appears to resolve the problem.
static SPI_BL_DATA CACHE_ALIGN spiBLData;
During the execution of the "NVM_RowWrite()" function, it seems that the data must reside in a non-cache memory.
NVM_RowWrite((uint32_t*)&spiBLData.cmd.programCommand.data[spiBLData.dataBufferAlignOffset + spiBLData.nFlashBytesWritten], (spiBLData.cmd.programCommand.memAddr + spiBLData.nFlashBytesWritten));
PIC32MZ2048EFM100
operating_system: Windows 10
mcc_mode: IDE # [IDE|Standalone|Headless]
mcc_version: v5.3.7
mcc_core_version: v5.5.7
mplabx_version: v6.05 # if MPLAB X plugin only
harmony_version: v1.3.2
compiler: XC32 (v4.30)
modules:
- {name: "csp", version: "v3.17.0"}
- {name: "core", version: "v3.13.0"}
- {name: "dev_packs", version: "v3.17.0"}
- {name: "bootloader", version: "v3.6.0"}
I have an issue with the code generated by Harmony for the bootloader SPI.
I am experiencing data loss in the flash memory after a programming command.
In the "bootloader_spi.c" file, I noticed that when I modify the "spiBLData" struct to use "CACHE_ALIGN," it appears to resolve the problem.
static SPI_BL_DATA CACHE_ALIGN spiBLData;During the execution of the "NVM_RowWrite()" function, it seems that the data must reside in a non-cache memory.
NVM_RowWrite((uint32_t*)&spiBLData.cmd.programCommand.data[spiBLData.dataBufferAlignOffset + spiBLData.nFlashBytesWritten], (spiBLData.cmd.programCommand.memAddr + spiBLData.nFlashBytesWritten));PIC32MZ2048EFM100
operating_system: Windows 10
mcc_mode: IDE # [IDE|Standalone|Headless]
mcc_version: v5.3.7
mcc_core_version: v5.5.7
mplabx_version: v6.05 # if MPLAB X plugin only
harmony_version: v1.3.2
compiler: XC32 (v4.30)
modules:
- {name: "csp", version: "v3.17.0"}
- {name: "core", version: "v3.13.0"}
- {name: "dev_packs", version: "v3.17.0"}
- {name: "bootloader", version: "v3.6.0"}