diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-04-03 15:34:41 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-04-03 15:34:41 -0600 |
commit | b515dab3c55920c11ae7bcece66f239bf69ae516 (patch) | |
tree | 1064a09fdfd0dd8237a59621b2f973f22c1cd96b /nuttx | |
parent | 4f5499ca878da3a0d3269e01c6680599512f0f67 (diff) | |
download | px4-nuttx-b515dab3c55920c11ae7bcece66f239bf69ae516.tar.gz px4-nuttx-b515dab3c55920c11ae7bcece66f239bf69ae516.tar.bz2 px4-nuttx-b515dab3c55920c11ae7bcece66f239bf69ae516.zip |
SAMA5 NOR boot: Use a static memory variable to determine if/when we boot to NOR FLASH
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/configs/sama5d3x-ek/src/nor_main.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/nuttx/configs/sama5d3x-ek/src/nor_main.c b/nuttx/configs/sama5d3x-ek/src/nor_main.c index 0a284b12f..f84091852 100644 --- a/nuttx/configs/sama5d3x-ek/src/nor_main.c +++ b/nuttx/configs/sama5d3x-ek/src/nor_main.c @@ -88,10 +88,19 @@ int nor_main(int argc, char *argv) { uint32_t regval; + /* Here we have a in memory value we can change in the debugger + * to begin booting in NOR Flash + */ + + static volatile uint32_t wait = 1; + #ifdef CONFIG_SAMA5D3xEK_NOR_START printf("Configuring and booting from NOR FLASH on CS0\n"); + wait = 0; + #else - printf("Configuring NOR FLASH on CS0 and halting\n"); + printf("Configuring NOR FLASH on CS0 and waiting\n"); + wait = 1; #endif /* Make sure that the SMC peripheral is enabled (But of course it is... we @@ -180,16 +189,14 @@ int nor_main(int argc, char *argv) cp15_invalidate_dcache_all(); cp15_invalidate_tlbs(); -#ifdef CONFIG_SAMA5D3xEK_NOR_START /* Then jump into NOR flash */ - NOR_ENTRY(); + while (!wait) + { + } -#else - /* Or just wait patiently for the user to break in with GDB. */ + NOR_ENTRY(); - for (;;); -#endif return 0; /* We should not get here in either case */ } |