I suspect you need to load the AM5718 firmware via JTAG, however I'm not far too familiar with this CPU family.
The STM32 (like many other ARM CPU's these days) have a ROM bootloader built in by ST. On some STM32 series this is done by holding BOOT0 pin high during reset. To boot your normal program you need to hold the pin low. This however is conveniently not always in the datasheet, but often in the user manual.
The ST bootloader often supports several protocols, and UART is a very common one. Not all UARTs or pin locations on the STM32 chip are supported though - so you need to choose the serial port pins. This document is very helpful if you can find the right family.
The procedure Armandas describes is correct. If you have some spare pins on your AM5718 CPU you could automate the activation of ST's bootloader via software. This does cost some GPIO pins on the CPU - in theory 1 additional reset line for every CPU added. You may also need to consider how your board will boot-up in this setup while the AM5718 is not completely running.
A little caveat: on some STM32 parts the ROM bootloader is turned off once you enable read protection. You can still access the chip via JTAG (after erase), but not via the bootloader.
Additionally if you cannot make the automated activation seem fit in hardware, you may need to do it manually via jumpers & a paper procedure. This however is only practical to do in the factory - it is not a very field serviceable solution.
Both reasons may steer you towards an in-house bootloader which can be activated via a serial command. It also adds the advantage of 'protecting' of your firmware images via encryption, given that you handle decryption inside the bootloader itself.