#!/bin/sh

arm-none-eabi-as source/mandelboot.s -o build/mandelboot.o
arm-none-eabi-ld -o build/mandelboot.elf -T source/mandelboot.ld build/mandelboot.o
arm-none-eabi-objdump -D build/mandelboot.elf > build/mandelboot.list
arm-none-eabi-objcopy build/mandelboot.elf build/mandelboot_without_crc.bin -O binary

ls -l build/mandelboot_without_crc.bin
md5sum mandelboot.bin

tools/pad_checksum_binary -p256 -s-1 build/mandelboot_without_crc.bin mandelboot.bin
tools/uf2conv.py --family 0xE48BFF56 --base 0x10000000 mandelboot.bin -o mandelboot.uf2
