
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… My guess is that this has something to do with the reset vector, is that correct?Īs 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. The first two lines of the Hex File indicate writing the value of 0x0f03000b to address 0x7fffc.

So the 4th line and the following lines write data to addresses 0x80000, 0x80010, 0x80020, etc… The 3rd line says “now, for the following addresses, add 0x80000 to the provided address”Ĥ. Then the 2nd line says “put the data(0x0f03000b) at address 0x0007fffc”ģ. So the 1st line says “add 0x70000 to the following addresses”Ģ.

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.ġ.
#IHEX VS HEX UPDATE#
Isn't this syntax provided by the AN1174_154 project correct?īelow 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. $(OBJCOPY) -S -O binary $< I am confused about why you are indicating that I need all the "-j" command line options. In this makefile (used with Beyond Studio for NXP) the command lines for the output file are: The original makefile used to generate the ".bin" file I've been using all along was provided in the project I started from (AN1174_154). What are these sections that should not be included? I am inferring from your comments that this command will copy memory sections which should not be included in the ".bin" or ".hex" file. You also wrote: "The command $(OBJCOPY) -S -O binary $< command copies all the memory section." stack -S -O binary $< am assuming then that the correct syntax for generating a ".hex" file would simply be: You presented the following makefile syntax for generating the ".bin" file: I had mentioned in my previous post the importance of using TAB characters instead of SPACE characters in the makefile, so when you wrote "please use tab instead of space in the Makefile" I thought you had not read my post yet. Please excuse my misunderstanding of your last post. I hope this will help anyone else trying to modify their makefile to generate.
#IHEX VS HEX CODE#
The makefile requires "tabs", not "spaces" for the indentations in the above code sections. I got errors when trying to build if I used 4 "space" characters instead of a "tab". THIS IS IMPORTANT: (and I thought this was very obscure) makefile does not treat all whitespace equally.

hex file when doing a clean (this is not needed for the build however). hex file in the "Build" folder.Īdditionally, the string "$(TARGET)_$(JENNIC_CHIP)*.hex" was added to the "clean:" line to remove the. $(OBJCOPY) -S -O ihex $< above modifications to the makefile resulted in the generation of the desired. $(OBJCOPY) -S -O binary $< The modified makefile adds the additional code as follows:

hex file.Īll: $(TARGET)_$(JENNIC_CHIP)$(BIN_SUFFIX).binġb) The modified makefile changes this line to:Īll: $(TARGET)_$(JENNIC_CHIP)$(BIN_SUFFIX).bin $(TARGET)_$(JENNIC_CHIP)$(BIN_SUFFIX).hexĢa) Original makefile had the code section: Per the suggestion of LPCXpresso Support above, the original makefile was augmented to include the generation of the desired.
