[Cryptech-Commits] [sw/stm32] 01/06: Use a delay loop, so sdram can be initialized from the startup code, before the clock is running.

git at cryptech.is git at cryptech.is
Mon Jun 13 20:55:42 UTC 2016


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 f76f5e172fc7c177b042df64d6aa040d2864cef3
Author: Paul Selkirk <paul at psgd.org>
AuthorDate: Mon Jun 13 14:50:28 2016 -0400

    Use a delay loop, so sdram can be initialized from the startup code, before the clock is running.
---
 stm-sdram.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/stm-sdram.c b/stm-sdram.c
index 0ec8065..52bab98 100644
--- a/stm-sdram.c
+++ b/stm-sdram.c
@@ -51,7 +51,7 @@ HAL_StatusTypeDef sdram_init(void)
     static int initialized = 0;
 
     if (initialized) {
-	return;
+	return HAL_OK;
     }
     initialized = 1;
 
@@ -184,6 +184,8 @@ HAL_StatusTypeDef _sdram_init_params(SDRAM_HandleTypeDef *sdram1, SDRAM_HandleTy
     HAL_StatusTypeDef ok;			// status
     FMC_SDRAM_CommandTypeDef cmd;		// command
 
+#define HAL_Delay(n) for (int i = 0; i < 1000 * n; ++i)
+
     /*
      * enable clocking
      */



More information about the Commits mailing list