Since this commit, the Trusted-Firmware M project requires the embedded public keys to be in a "raw" (not RFC5840) form.
As far as I can tell, there is currently no way to export a key in this form from imgtool.
It can be hacked into getpub by adding the following (P-384 needs 48 byte integers instead of 32):
numbers = key._get_public().public_numbers()
raw_key = b'\x04' + numbers.x.to_bytes(32, 'big') + numbers.y.to_bytes(32, 'big')
print(','.join([f'0x{b:02x}' for b in raw_key]))
I've spent some time on trying to add this feature simply, but I'm not sure on the best approach given this is probably quite ECDSA specific.