Create SDRAM memory region
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
16
sw/main.c
16
sw/main.c
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user