This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Multiple HEX output file

Hi,Sir!

I want to get multiple hex file, for example, a boot section is a standlone hex file, other user code is another hex file? how to set up in UV4?

  • Take the bootloader's .hex file, remove the last line, paste the second file. Done.

  • you mean I can use Notepad to edit .hex file and take those records out and past them into a new txt file, and add end recorder line :00000001ff, save and exit.

    Is it right?

  • He means that you can take all lines of your boot loader build - except the final :00000001ff and put in a new file.

    You can then take all lines from your application build and concatenate to the previous file.

    That will give you a hex file that contains the information for both a boot loader and an application. So you can program both boot loader and an initial application into your device with a single programming operation.

    When you later create newer applications, you can feed these applications to the boot loader (or whatever update mechanism you want to make use of) to update your device with just a new application while keeping the original boot loader.

    The important issue here is that boot loader and application should always be created as separate builds. Either using two projects, or having two targets within the same project. But never ever should you try to have one compilation/link step process the sources for both boot loader and application and create a combined binary. You will most likely produce a binary where there are hidden linkage relations between the boot loader and application. And that will make your product fail when you later make changes to the application resulting in some symbols in the application binary to move around.

  • In fact, I use CY7C68013A in my project, when I select C2-load mode, hardware boot loader copy only 16K bytes in E2prom(24L256)into internal 16K XRAM and CODE space(0x0000~0x3fff). if code size is less than 16K Bytes, it is ok. but my code size is bigger than 16K bytes, so I have to make my project into two hex file, the code size of 1st hex file is less than 16K bytes(0x0000~0x3fff), the 2nd hex file is located from0x4000~0xDFFF(40K bytes).

    When the 1st code segment is loaded into internal 16K from I2C eeprom, FX2LP boots up and call TD_Init(), add my copy code:it will continue to read code data from eeprom and copy it into 0x4000~0xDFFF(movx inst).

    Of course,I attached one 64K SRAM with FX2LP, SRAM RD <---> FX2LP OE(RD and PSEN),SRAM CS <--->FX2LP CS. EA = 0. So, one unified space(0x4000~0xDFFF,XDATA and CODE) is added.

    I think this method can solve the bigger code code size case(>16K bytes) and can still work at C2 load mode.