Skip to content
Snippets Groups Projects
Commit 5e3274aa authored by Damiano Procaccia's avatar Damiano Procaccia
Browse files

zero-init ram on boot; fix timing reg value

parent aaeb0766
No related branches found
No related tags found
No related merge requests found
...@@ -82,6 +82,12 @@ void Reset_Handler() ...@@ -82,6 +82,12 @@ void Reset_Handler()
miosix::configureSdram(); miosix::configureSdram();
#endif //__ENABLE_XRAM #endif //__ENABLE_XRAM
for(uint32_t address = 0xd0000000; address < 0xd1000000; address += 4) {
*((volatile uint32_t*) address) = (uint32_t) 0;
}
/* /*
* Load into the program stack pointer the heap end address and switch from * Load into the program stack pointer the heap end address and switch from
* the msp to sps. * the msp to sps.
......
...@@ -211,8 +211,8 @@ void configureSdram() { ...@@ -211,8 +211,8 @@ void configureSdram() {
// 8. Program the refresh rate (4K / 32ms) // 8. Program the refresh rate (4K / 32ms)
// 64ms / 8192 = 7.8125us // 64ms / 8192 = 7.8125us
#ifdef SYSCLK_FREQ_216MHz #ifdef SYSCLK_FREQ_216MHz
// 7.8125us * 133MHz = 1039 - 20 = 1019 // 7.8125us * 108MHz = 844 - 20 = 824
FMC_Bank5_6->SDRTR = 1019 << FMC_SDRTR_COUNT_Pos; FMC_Bank5_6->SDRTR = 824 << FMC_SDRTR_COUNT_Pos;
#else #else
#error No SDRAM refresh timings for this clock #error No SDRAM refresh timings for this clock
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment