cancel
Showing results for 
Search instead for 
Did you mean: 

Confusing about Sram

ling ling
Associate
Posted on June 27, 2017 at 10:53

Please give me some time to describe the problem I met, please give me some advice or comments. The

http://www.kynix.com/uploadfiles/pdf65976/STM32F030C8T6.pdf

 is also given below.

Source Program is given below:

       [code] for(i=0;i<1024*1024;i+=4096)

        {

                FSMC_SRAM_WriteBuffer(&temp_fsmc,i,1);

                temp_fsmc++;

        }                  

        for(i=0;i<1024*1024;i+=4096) 

        {

                  FSMC_SRAM_ReadBuffer(&temp_fsmc_3,i,1);

                printf('%d ', temp_fsmc_3);

        }[/code]

The printing result:

3 1 1 3 7 5 7 7 11 9 9 11 15 13 13 15 19 17 17 19 23 21 21 23 27 25 25 27 31 29 29 31 35 33 33 35 39 37 37 39 43 41 41 43 47 45 45 47 51 49 51 51 55 53 55 55 59 57 57 59 63 61 61 63 67 65 67 67 71 69 71 71 75 73 73 75 79 77 79 79 83 81 81 83 87 85 85 87 91 89 89 91 95 93 93 95 99 97 97 99 103 101 101 103 107 105 105 107 111 109 109 111 115 113 115 115 119 117 117 119 123 121 121 123 127 125 125 127 131 129 131 131 135 133 135 135 139 137 137 139 143 141 143 143 147 145 147 147 151 149 149 151 155 153 153 155 159 157 159 159 163 161 161 163 167 165 165 167 171 169 169 171 175 173 175 175 179 177 179 179 183 181 183 183 187 185 185 187 191 189 191 191 195 193 195 195 199 197 197 199 203 201 201 203 207 205 207 207 211 209 209 211 215 213 213 215 219 217 217 219 223 221 221 223 227 225 227 227 231 229 229 231 235 233 233 235 239 237 239 239 243 241 243 243 247 245 245 247 251 249 251 251 255 253 255 255

There are many wrongs...

After I modified it:

        [code]for(i=0;i<1024*1024;i+=4096)

        {

                FSMC_SRAM_WriteBuffer(&temp_fsmc,i,1);

                FSMC_SRAM_ReadBuffer(&temp_fsmc_2,i,1);

                printf('%d ', temp_fsmc_2);

                temp_fsmc++;

        }          

        for(i=0;i<1024*1024;i+=4096) 

        {

                  FSMC_SRAM_ReadBuffer(&temp_fsmc_3,i,1);

                        printf('%d ', temp_fsmc_3);

        }[/code]

The printing result:

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 3 1 1 3 7 5 7 7 11 9 9 11 15 13 13 15 19 17 17 19 23 21 21 23 27 25 25 27 31 29 29 31 35 33 33 35 39 37 37 39 43 41 41 43 47 45 45 47 51 49 51 51 55 53 53 55 59 57 57 59 63 61 61 63 67 65 65 67 71 69 69 71 75 73 75 75 79 77 79 79 83 81 81 83 87 85 87 87 91 89 91 91 95 93 95 95 99 97 99 99 103 101 101 103 107 105 107 107 111 109 109 111 115 113 113 115 119 117 119 119 123 121 123 123 127 125 125 127 131 129 129 131 135 133 135 135 139 137 139 139 143 141 143 143 147 145 147 147 151 149 149 151 155 153 153 155 159 157 157 159 163 161 163 163 167 165 165 167 171 169 169 171 175 173 175 175 179 177 179 179 183 181 181 183 187 185 185 187 191 189 191 191 195 193 195 195 199 197 197 199 203 201 203 203 207 205 205 207 211 209 209 211 215 213 213 215 219 217 219 219 223 221 221 223 227 225 225 227 231 229 231 231 235 233 235 235 239 237 239 239 243 241 241 243 247 245 247 247 251 249 251 251 255 253 253 255

Still wrong here

My second question:

u32 testsram[25000] __attribute__((at(0X68000000)));//Measured using array    

When I using it in sram,such as:

        for(ts=0;ts<2500;ts++)

                testsram[ts]=ts;//The stored test data        

        for(ts=0;ts<2500;ts++) printf('%d ', testsram[ts]);

There are some troubles occurred at the first byte of the printing data? Why?

Please give me some help!

Appreciated it a lot!

#stm32
1 REPLY 1
Posted on June 27, 2017 at 11:30

STM32F0xx don't have external memory controller = FSMC.

JW