MEMORY
{
- rom : ORIGIN = 0x00007000, LENGTH = 0x1000
- ram : ORIGIN = 0x00004000, LENGTH = 0x1000
+ rom : ORIGIN = 0x00000000, LENGTH = 0x1000
+ ram : ORIGIN = 0x00001000, LENGTH = 0x1000
}
SECTIONS
void uart_write(char c)
{
- struct uart_regs *regs = 0x5000;
+ struct uart_regs *regs = 0x2000;
while (!read32(®s->tx_rdy));
write32(®s->tx_data, c);
}
uart_writestr("Writing to 0x");
uart_writeuint32(&ram[i]);
uart_write('\n');
- ram[i] = 0xDEADBEEF;
+ ram[i] = 0xDEAF0000 | i*4;
}
for (size_t i = 0; i < 1000; i++) {
- if (ram[i] != 0xDEADBEEF) {
+ if (ram[i] != (0xDEAF0000 | i*4)) {
uart_writestr("fail : *(0x");
uart_writeuint32(&ram[i]);
uart_writestr(") = ");