I created a bootloader image for my STM32 and I stored it in a specific area of the memory. I have a new Keil project which represents the application layer. By default, Keil generates a HEX file. What I want to do is to keep the bootloader image and flash the application layer in another area in the memory. The final FW will verify a GPIO input. If it is in a high level, the bootloader image will be launched and it will upgrade the application layer with a new image, otherwise (The GPIO input is in a low level), The normal mode is activated and the application will run. My question is:
- Should I convert the generated Hex file of the application layer to a BIN file in order to flash it to a specific area of the memory?
- How Can I specify the start address the application layer and its length ?.
- If I use a tool to convert a HEX file to binary, what should I do with the empty address reserved for the bootloader image ?