Skip to content

Commit 7ac34c0

Browse files
committed
Correct SDRAM BANK1 settings
1 parent 7141149 commit 7ac34c0

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
tar ext :3333
2-
file lcd_ram_demo.elf
2+
file lcd-ram-demo.elf
33
mon reset halt
44
foc c

examples/stm32/f7/stm32f7-discovery/lcd-ram-demo/sdram.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,16 @@ void sdram_init(void)
103103
cr_tmp |= FMC_SDCR_NR_12;
104104
cr_tmp |= FMC_SDCR_NC_8;
105105

106-
/* We're programming BANK 1, but per the manual some of the parameters
107-
* only work in CR1 and TR1 so we pull those off and put them in the
108-
* right place.
106+
/* We're programming BANK 1
107+
* Per the manual some of the parameters only work in CR1 and TR1
108+
* So when using BANK2: we need pull those off and put them in the right place.
109+
* FMC_SDCR1 |= (cr_tmp); // & FMC_SDCR_DNC_MASK);
110+
* FMC_SDCR2 = cr_tmp;
109111
*/
110-
FMC_SDCR1 |= (cr_tmp & FMC_SDCR_DNC_MASK);
111-
FMC_SDCR2 = cr_tmp; // NEEDED?
112+
FMC_SDCR1 = (cr_tmp);
112113

113114
tr_tmp = sdram_timing(&timing);
114-
FMC_SDTR1 |= (tr_tmp & FMC_SDTR_DNC_MASK);
115-
FMC_SDTR2 = tr_tmp; // NEEDED?
115+
FMC_SDTR1 = (tr_tmp);
116116

117117
/* Now start up the Controller per the manual
118118
* - Clock config enable
@@ -135,7 +135,6 @@ void sdram_init(void)
135135
* set the refresh counter to insure we kick off an
136136
* auto refresh often enough to prevent data loss.
137137
*/
138-
//FMC_SDRTR = 683;
139138
FMC_SDRTR = ((uint32_t)0x0603); /* SDRAM refresh counter (100Mhz SD clock) */
140139
/* and Poof! a 8 megabytes of ram shows up in the address space */
141140

0 commit comments

Comments
 (0)