Hi @MarkShen__
S32M276 is based on S32K3, so you can take a look at S32K3 resources.
I'm talking about AB SWAP feature and OTA demos here in this post:
https://community.nxp.com/t5/S32K/S32K3-Bootloader/m-p/2075115/highlight/true#M47533
Then we have Unified bootloader:
https://community.nxp.com/t5/S32K-Knowledge-Base/Unified-bootloader-Demo/ta-p/1423099
This is unofficial demo only, provided AS IS with no guarantees and no support. It’s not production code. Notice that this bootloader does not use HSE firmware, so it does not take an advantage of AB SWAP feature.
If you are looking for production code, take a look at third parties like:
https://www.vector.com/int/en/products/products-a-z/embedded-software/flash-bootloader/#
If you are going to use AB SWAP feature of HSE firmware, the flash is divided to active and passive partition automatically by installation of HSE firmware (AB_SWAP version of the firmware). You can take a look at "Table 141. Memory map in AB swap configuration" in the reference manual:
https://www.nxp.com/webapp/Download?colCode=S32M27XRM
If you don't want to use HSE firmware and AB SWAP feature, it's just a matter of software, so it's up to user to adjust the linker files of bootloader and application(s) accordingly.
Regards,
Lukas