I have problem, I have to find a way to update code to my arm device without removing it, for that purpose I'll use serial communication. Does anyone have idea how to do it?
Having two application images uses the same theory that you would have with just one. Instead of having linker space carved out for bootloader and application, you now have space for boot-loader, application1 and application2. The boot-loader then needs to be more intelligent to know when application it should be updating and loading into on boot. Once again if you have managed to succeed with a single application then having the second just adds a few additional checks. Mainly
1) Which application to jump to?
2) Is this application checksum correct?
3) Which application space to erase and overwrite?
4) Should a failed update automatically revert to the other application area if checksum is valid?
One thing you need to make sure of is that you secure the flash space that the boot-loader is in. If power is removed during update the boot-loader should load and wait for instructions. I've seen poorly written boot-loaders that allow the boot-loader to be updated which in the event of power failure or other issues will brick the unit. The boot-loader needs to be extremely robust and secure or protected with an MPU (if one exists on chip).
I would recommend that instead of jumping straight to a two image system you first write a simple boot-loader, with minimal features and a single application. Get that working well and then add features to it like securing the device, adding the second application space, etc.