Create SDRAM memory region

This commit is contained in:
Byron Lathi
2022-03-17 13:37:34 -05:00
parent 15e3ae9688
commit 2a1f8df54e
2 changed files with 13 additions and 6 deletions

View File

@@ -5,16 +5,22 @@
#include "uart.h"
int main() {
char s[16];
uint8_t* test;
uint8_t i;
test = (uint8_t*)0x5000;
clrscr();
cprintf("Hello, world!\n");
while (1) {
cscanf("%15s", s);
cprintf("Read string: %s\n", s);
for (test = (uint8_t*)0x4000; test < (uint8_t*)0x5000; test++) {
for (i = 0; i < 64; i++) {
*test = i;
if (*test != i)
cprintf("Failed to read/write %x to %x\n", i, test);
}
}
cprintf("Done! no SDRAM errors!\n");
return 0;
}