r. Searching for the right PIC32 Program Executive (PE)

Not all PIC32 microcontrollers are alike. 28-bin PIC32s are the newest additions to PIC32 family. Though they share many features with the older members, there are also important differences. If you consider PIC32MX250F128B for instance, you would quickly discover that many PIC32 family capable programmers do not support it. This seems to be due to its smaller flash RAM write buffer that can only hold 32 32-bit words instead of usual 128 words.

Chapter 16 in PIC32 Flash Programming Specification describes the use of PE functions in detail. However, it seems that the block transfer functions (like ROW_PROGRAM, PROGRAM, PROGRAM_CLUSTER) not written for the microcontrollers with 32 words write buffers. All functions require the blocks starting addresses to be aligned to the 512 byte boundaries and the block lengths to be multiples of 512 (see page 37 of PIC32 Flash Programming Specification (DS61145L) from www.microchip.com). If one tries to use these functions to program a microcontroller with a 32 words write buffer, all of them would only program the first 32 bytes of each block and leave the remaining bytes within a 512 byte area unprogrammed (values: 0xFFFFFFFF).

The problem can be solved either with writing your own PE, or if you use the slow WORD PROGRAM function. If you decide to write your own PE, you can use Program loader code (see page 21 of PIC32 Flash Programming Specification (DS61145L)) as a raw model.