]> git.donarmstrong.com Git - kiibohd-controller.git/blobdiff - Lib/mk20dx.c
Preparing for mk20dx256vlh7
[kiibohd-controller.git] / Lib / mk20dx.c
index 4ae27dc064cd50334d2b902f19318c55ffc5846e..77c1c9abe6f279ef29fa9a245defccc8c5ffbf12 100644 (file)
@@ -377,6 +377,27 @@ const uint8_t flashconfigbytes[16] = {
        0xFF, // EEPROM Protection Byte FEPROT
        0xFF, // Data Flash Protection Byte FDPROT
 };
+#elif defined(_mk20dx256vlh7_) && defined(_bootloader_)
+// XXX Byte labels may be in incorrect positions, double check before modifying
+//     FSEC is in correct location -Jacob
+__attribute__ ((section(".flashconfig"), used))
+const uint8_t flashconfigbytes[16] = {
+       0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Backdoor Verif Key 28.3.1
+
+       //
+       // Protecting the first 8k of Flash memory from being over-written while running (bootloader protection)
+       // Still possible to overwrite the bootloader using an external flashing device
+       // For more details see:
+       //  http://cache.freescale.com/files/training/doc/dwf/AMF_ENT_T1031_Boston.pdf (page 8)
+       //  http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4507.pdf
+       //  http://cache.freescale.com/files/32bit/doc/ref_manual/K20P64M72SF1RM.pdf (28.34.6)
+       //
+       0xFF, 0xFF, 0xFF, 0xFE, // Program Flash Protection Bytes FPROT0-3
+
+       0xBE, // Flash security byte FSEC
+       0x03, // Flash nonvolatile option byte FOPT
+       0xFF, // EEPROM Protection Byte FEPROT
+       0xFF, // Data Flash Protection Byte FDPROT
 #endif