Thanks Mario –
Below is an example of the beginning of the Intel Hex file that is generated by my build and that my secondary bootloader will be using to update the JN5169 Flash for updating the firmware.
The “Record Type” field of 02 (shown in red below) specifies that until otherwise indicated, all the addresses for following data should have the provided offset (shown in green below) shifted left 4 bits and added to the “normal” address provided in the “data” records that follow.
1. So the 1st line says “add 0x70000 to the following addresses”
2. Then the 2nd line says “put the data(0x0f03000b) at address 0x0007fffc”
3. The 3rd line says “now, for the following addresses, add 0x80000 to the provided address”
4. So the 4th line and the following lines write data to addresses 0x80000, 0x80010, 0x80020, etc…
:0200000270008C
:04FFFC000F03000BE4
:0200000280007C
:10000000123456781122334455667788080100006F
:1000100000000000000000000000000000000000E0
:1000200000014F2000094A6C0013012D014013FC10
The first two lines of the Hex File indicate writing the value of 0x0f03000b to address 0x7fffc. My guess is that this has something to do with the reset vector, is that correct?
As you know, Flash writes can only change “1” bits to “0” bits, so any Sector in which data is to be written must be erased in entirety before writing data to Flash addresses in that Sector.
So if my secondary boot loader needs to write 0x0f03000b to address 0x7fffc (as indicated by the Hex File), then I would need to first erase the entire sector from 0x78000 to 0x7ffff,and then write a 16-byte Pageword to 0x7fff0,but JN-AN-1003 indicates that this address range is in the “Reserved” area from 0x00002000 – 0x0007ffff, so I’m not sure I can even erase and write there…
I’m hoping that this value of 0x0f03000b at address 0x7fffc will remain constant from build to build and once the target has been programmed via the normal (NXP based) method the first time, I can just remove these first two lines from the subsequent Hex Files that will be used by my secondary bootloader, and just reprogram the JN5169 flash for the sectors starting at 0x80000.
So my question for you is just this: What are these 4 bytes at addresses 0x7fffc–0x7ffff, and can they change from build to build or will they remain constant from build to build?
For the builds I have looked at, the value has remained unchanged, but not knowing what these bytes are, I cannot know if that will always be the case…
Thanks Mario,
Matt