[Cryptech-Commits] [sw/stm32] 06/11: We really do need that delay before initializing FMC while Novena is booting.

git at cryptech.is git at cryptech.is
Mon Nov 16 21:43:08 UTC 2015


This is an automated email from the git hooks/post-receive script.

paul at psgd.org pushed a commit to branch master
in repository sw/stm32.

commit df8f45c0d06e64b3901f1cce4e74cbde038737f2
Author: Paul Selkirk <paul at psgd.org>
Date:   Tue Nov 10 17:35:48 2015 -0500

    We really do need that delay before initializing FMC while Novena is booting.
---
 main.c               | 15 ++++++++++++++-
 self-test/fmc-perf.c | 16 ++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/main.c b/main.c
index 2572927..6d19a7e 100644
--- a/main.c
+++ b/main.c
@@ -3,15 +3,28 @@
  */
 
 #include "stm-init.h"
+#include "stm-led.h"
 #include "stm-fmc.h"
 #include "stm-uart.h"
 
 extern void __main(void);
 
-void main(void)
+int main(void)
 {
     stm_init();
+
+    // Blink blue LED for six seconds to not upset the Novena at boot.
+    led_on(LED_BLUE);
+    for (int i = 0; i < 12; i++) {
+	HAL_Delay(500);
+	led_toggle(LED_BLUE);
+    }
     fmc_init();
+    led_off(LED_BLUE);
+    led_on(LED_GREEN);
+
     __main();
+
     uart_send_string("Done.\r\n\r\n");
+    return 0;
 }
diff --git a/self-test/fmc-perf.c b/self-test/fmc-perf.c
index cf6fe19..0c753a7 100644
--- a/self-test/fmc-perf.c
+++ b/self-test/fmc-perf.c
@@ -3,6 +3,7 @@
  */
 #include "stm32f4xx_hal.h"
 #include "stm-init.h"
+#include "stm-led.h"
 #include "stm-fmc.h"
 #include "stm-uart.h"
 
@@ -98,7 +99,21 @@ static void test_write(void)
 int main(void)
 {
     stm_init();
+
+    uart_send_string("Keep calm for Novena boot...\r\n");
+
+    // Blink blue LED for six seconds to not upset the Novena at boot.
+    led_on(LED_BLUE);
+    for (int i = 0; i < 12; i++) {
+	HAL_Delay(500);
+	led_toggle(LED_BLUE);
+    }
+    led_off(LED_BLUE);
+
+    // initialize rng
     MX_RNG_Init();
+
+    // prepare fmc interface
     fmc_init();
 
     sanity();
@@ -106,5 +121,6 @@ int main(void)
     time_check("read  ", test_read());
     time_check("write ", test_write());
 
+    uart_send_string("Done.\r\n\r\n");
     return 0;
 }



More information about the Commits mailing list