Create SDRAM memory region
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
MEMORY
|
MEMORY
|
||||||
{
|
{
|
||||||
ZP: start = $0, size = $100, type = rw, define = yes;
|
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;
|
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"
|
#include "uart.h"
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
char s[16];
|
uint8_t* test;
|
||||||
|
uint8_t i;
|
||||||
|
|
||||||
|
test = (uint8_t*)0x5000;
|
||||||
|
|
||||||
clrscr();
|
clrscr();
|
||||||
cprintf("Hello, world!\n");
|
|
||||||
|
|
||||||
while (1) {
|
for (test = (uint8_t*)0x4000; test < (uint8_t*)0x5000; test++) {
|
||||||
cscanf("%15s", s);
|
for (i = 0; i < 64; i++) {
|
||||||
cprintf("Read string: %s\n", s);
|
*test = i;
|
||||||
|
if (*test != i)
|
||||||
|
cprintf("Failed to read/write %x to %x\n", i, test);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cprintf("Done! no SDRAM errors!\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user