Hello Yaniv
I have no knowledge with your bootloader, so I cannot tell exactly why it returns ERR_SIZE and ERR_ACCERR error. Below is only a tip for your hex data align question.
The HEX file is not generated by compiler, it is created by tool “arm-none-eabi-objcopy.exe” from ELF file, this tool locates at:
C:\Freescale\CW MCU v10.6.4\Cross_Tools\arm-none-eabi-gcc-4_7_3\bin
For its options, please run “arm-none-eabi-objcopy.exe -help” to get the descriptions. Or refer to this link:
https://manned.org/arm-none-eabi-objcopy
Unfortunately This tool does not support align Hex data, I found a workaround, that is to first generate S-record file as below (this tool supports to align S-record data):

Then run “arm-none-eabi-objcopy.exe” to convert S-record data into hex, like below:
arm-none-eabi-objcopy.exe -I srec -O ihex sfs.srec fixed_result.hex
This is the comparison of HEX file generated in KDS IDE, and the one converted from S-record file.

Best Regards
Fiona Kuang
TIC - Technical Information Center
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Mark Correct button. Thank you!
-----------------------------------------------------------------------------------------------------------------------