I just had a look at the most recent libpic30.h from the xc16 include directories
Copyright 2007-2016 Microchip Technology, all rights reserved
#define _FLASH_ERASE_CODE 0x4042
#define _FLASH_WRITE_ROW_CODE 0x4001
#define _FLASH_WRITE_WORD_CODE 0x4003
#define _FLASH_PAGE 512
#define _FLASH_ROW 64
While the header file contains a copyright from 2016, these definitions did not change since 8 years (which is not bad in itself).
But e.g. the Flash Programming manual for the GB6 (DS30010057F) clearly states that
4003h erases a page of program or executive memory.
This is correct, I'm using NVM functions for GB1, GB4 and GB6 families
The meaning for 4003h for GB1 and GB6 family is definitely different, but the libpic30.h does not reflect that.
So my assumption is the include file is simply wrong and it does not just reveal a single mistake, but was never updated to reflect the newer members of the PIC24 family
post edited by rodims - 2017/07/17 08:55:44