These examples are part of the free ebook "Embedded Systems Security and TrustZone". You can read the book on https://embeddedsecurity.io