The PIC32MZ1024EFE NVM sizes are: Erase (page) = 16K, must erase on these boundries Write (row) = 2K, must write on these boundries Read (byte) = 1 byte, can read any size Note that Harmony uses virtual addressing while the programmer uses physical addressing. In Harmony - Drivers - NVM - NVM Media Start Address: set IDH_HTML_NVM_MEDIA_START_ADDRESS to default 0x9D010000 (the virtual address). This is the start (low address) of the webpages and UNVM (User NVM). The web pages are allocated 4 erase pages (64K) and the UNVM gets 1 erase page (16K). The compiler starts the webpages at IDH_HTML_NVM_MEDIA_START_ADDRESS so the UNVM must go above that. Write to UNVM with: DRV_NVM_EraseWrite(handNVM, &handNvmCmd, &Params, 32, 4); "Params" is the structure to write. The units are in (2k) write rows but the erase must be on (16K) erase page boundries. The first number - "32" - is the start address of the UNVM. It means the UNVM starts 32 write rows above IDH_HTML_NVM_MEDIA_START_ADDRESS. The second number - "2" - is the number of write rows to write, which is 4K. The remaining 12K in that erase page is ignored but is erased. Read from UNVM with: DRV_NVM_Read(handNVM, &handNvmCmd, &Params, DRV_NVM_PAGE_SIZE*4, sizeof(Params)); "Params" is the structure to read. The units are bytes. The first number - "DRV_NVM_PAGE_SIZE*4" - is the start address of the UNVM. It means 4 erase pages above IDH_HTML_NVM_MEDIA_START_ADDRESS. The second number - "sizeof(Params)" - is simply the number of bytes to read. This whole space can be preserved when programming. During debug programming of the device, this preserved region will be read just before erasing and merged into the program written, effectively keeping its contents. In File - Project Properties - ICD3 (or programmer of your choice) - Memories to Program, select: Auto select: Manually select memories and ranges Program Memory Ranges: 0x1d000000-0x1d0fffff (this is the default of 1MB) Preserve Program Memory: check Preserve Program Memory Range: 0x1d020000-0x1d024000 (this is the UNVM, the top 16K of the 96K) In summary, using the above example: ITEM PHYSICAL VIRTUAL ========================================= Webpage start = 0x1D01 0000 = 0x9D01 0000 Webpage end = 0x1D01 FFFF = 0x9D01 FFFF UNVM start = 0x1D02 0000 = 0x9D02 0000 UNVM end = 0x1D02 3FFF = 0x9D02 3FFF