I'am currently trying to do something very simple:
But if i read back the code with mikroProg i get this very strange byte order as you can see on the attached picture.unsigned long bootAddressOffset = 0x20000;
memset( flashData, 0xFF, 2048 );
flashData[0] = 0x00;
flashData[1] = 0x01;
flashData[2] = 0x02;
flashData[3] = 0x03;
flashData[4] = 0x04;
flashData[5] = 0x05;
flashData[6] = 0x06;
flashData[7] = 0x07;
flashData[8] = 0x08;
flashData[9] = 0x09;
flashData[10] = 0x10;
flashData[11] = 0x11;
flashData[12] = 0x12;
flashData[13] = 0x13;
flashData[14] = 0x14;
flashData[15] = 0x15;
flashData[16] = 0x16;
flashData[17] = 0x17;
flashData[18] = 0x18;
flashData[19] = 0x19;
address = 0x1FC00000 + bootAddressOffset; // To be in the upper aliased boot area
Flash_Write_Row( address, flashData );
Does anyone have an idea why this is happening?
From where are the zeros comming?
Looks like it needs to be shifted left by 2 bytes.
Note: I've completely erased the PIC before.
Its a PIC32MZ2048ECH144.