From a7ef0e847b50358a1680610664fb8827b1181e38 Mon Sep 17 00:00:00 2001
From: schneider <schneider@blinkenlichts.net>
Date: Fri, 21 Jun 2019 01:24:32 +0200
Subject: [PATCH] fix(bootloader): Add support for the whole 1 MB flash

---
 bootloader/main.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/bootloader/main.c b/bootloader/main.c
index e62d88abb..0216e40e4 100644
--- a/bootloader/main.c
+++ b/bootloader/main.c
@@ -18,10 +18,8 @@
 #define GPIO_PORT_IN                PORT_1
 #define GPIO_PIN_IN                 PIN_6
 
-
 #define PARTITION_START (0x10000000 + 64 * 1024)
-#define PARTITION_END (0x10000000 + 512 * 1024 - 1) /* TODO: check if 1 MB also works. Might have to enable the second bank */
-//#define PARTITION_END (0x10000000 + 1024 * 1024 - 1)
+#define PARTITION_END (0x10000000 + 1024 * 1024 - 1)
 
 extern void run_usbmsc(void);
 
@@ -188,13 +186,14 @@ int main(void)
         while(1);
     }
 
+    //MXC_FLC0->clkdiv = 96;
+    //MXC_FLC0->clkdiv = 96;
 
     if(mount()) {
         if(check_integrity()) {
             printf("Found valid application image\n");
             if(is_update_needed()) {
                 printf("Trying to update application from external flash\n");
-                MXC_FLC0->clkdiv = 54;
                 erase_partition();
                 flash_partition();
             } else {
-- 
GitLab