I am trying to store my hex file in another sector of the flash memory i.e (0x00050000) I want to store a hex file at different sector of the flash and to change the execution point to that address through my bootloader. I am able store and change the address through the MCUExpress IDE. Now i want achieve the same without using the IDE.
Through IDE:-
I have flashed the .hex file at 0x00050000 and i'm changing the execution pointer to this address through MCUExpress IDE settings. At 0x00000000 i have my boot loader code which changes the execution point to 0x00050000.
When i write the .hex file(Some data)(Image 2) content at the location 0x00050000 , i observe that the stored hex data at the address is different . I checked it through flash magic. My data is being displayed in the ASCII region rather than the Hex region of the display memory in flash magic.
Image 1 : The Hex Data and its ascii form when observed through flash-magic when actual hex is flashed through IDE
Image 2 : Hex data when written through the application code. 
So how to copy the hex into flash through application code ? Is there any conversion happens while flashing the hex file ?
