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

@@ -1,7 +1,8 @@
MEMORY
{
ZP: start = $0, size = $100, type = rw, define = yes;
RAM: start = $0200, size = $7D00, type = rw, define = yes;
RAM: start = $0200, size = $3D00, type = rw, define = yes;
SDRAM: start = $4000, size = $3ff00, type = rw, define = yes;
ROM: start = $8000, size = $8000, fill = yes, fillval = $ff, file = %O;
}

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;
}