Hi @Changhawn
Srecord format adds relatively high overhead to raw data.
Here you can find the format description:
https://en.wikipedia.org/wiki/SREC_(file_format)
S32 Design Studio generates S2 record file and the payload is usually 16 bytes. Each byte needs two ASCII characters, so it takes 32 characters in each record.
Then there's 'S2' marking, size of record, address and checksum. This takes another 12 characters.
If you have 4MB srecord file, the payload is about 3MB. And because each byte needs two ASCII characters as mentioned above, the real size of payload is 1.5MB.
An option is to use pure binary file. If it is continuous image, it would have only those 1.5MB. If there are some empty gaps (blank space without useful data) in the image, it could increase the size of file, of course. But that's the nature of binary files.
My understanding is that you are working on bootloader, right?
There are some application notes which shows how to write a bootloader and how to parse s-record files (these not directly for S32K3 but you can take a look):
S32K1xx Bootloader:
https://www.nxp.com/docs/en/application-note/AN12218.pdf
https://www.nxp.com/docs/en/application-note-software/AN12218SW.zip
Serial bootloader for MPC5748G:
https://www.nxp.com/docs/en/application-note/AN5319.pdf
https://www.nxp.com/docs/en/application-note-software/AN5319SW.zip
For S32K3, we have only a demo of UDS bootloader
https://community.nxp.com/t5/S32K-Knowledge-Base/Unified-bootloader-Demo/ta-p/1423099
However, please notice that this is a demo only provided AS IS with no support. It’s not production code.
Regards,
Lukas