convert_greenpak_hex.sh 435 B

1234567891011121314
  1. #!/bin/bash -ex
  2. # This script converts .hex file from GreenPAK GP6 design tool
  3. # to a .h file that can be included in code.
  4. INFILE="greenpak/SCSI_Accelerator_SLG46824.hex"
  5. TMPFILE="/tmp/greenpak.bin"
  6. OUTFILE="lib/zuluSCSI_platform_GD32F205/greenpak_fw.h"
  7. objcopy --input-target=ihex --output-target=binary $INFILE $TMPFILE
  8. echo 'const uint8_t g_greenpak_fw[] = {' > $OUTFILE
  9. cat $TMPFILE | xxd -i >> $OUTFILE
  10. echo '};' >> $OUTFILE