diff options
author | Jens Arnold <amiconn@rockbox.org> | 2008-10-30 00:34:43 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2008-10-30 00:34:43 +0000 |
commit | 601afcbd0bfea8ec37f34a9cdf41c7dc7a964989 (patch) | |
tree | 2724261dc8ca4c9d74c2b044e4bbbfbdbbd48376 | |
parent | 5456859dd787e44921934f1b30aa3b82cda4195f (diff) | |
download | rockbox-601afcbd0bfea8ec37f34a9cdf41c7dc7a964989.tar.gz rockbox-601afcbd0bfea8ec37f34a9cdf41c7dc7a964989.zip |
Minimon is loaded to 0x0ffff000 by uart_boot, so it needs to be linked to that address as well, or it won't work. Also add that hint to the README, fix a warning, and fix the disassembly base address (was wrong either way).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18930 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | flash/minimon/Makefile | 2 | ||||
-rw-r--r-- | flash/minimon/README | 3 | ||||
-rw-r--r-- | flash/minimon/minimon.c | 2 | ||||
-rw-r--r-- | flash/minimon/minimon.lds | 20 |
4 files changed, 15 insertions, 12 deletions
diff --git a/flash/minimon/Makefile b/flash/minimon/Makefile index 57ae13e940..16b6c2724e 100644 --- a/flash/minimon/Makefile +++ b/flash/minimon/Makefile | |||
@@ -40,7 +40,7 @@ LINKFILE = $(OBJDIR)/$(TARGET).lds | |||
40 | 40 | ||
41 | $(OBJDIR)/$(TARGET).bin : $(OBJDIR)/$(TARGET).elf | 41 | $(OBJDIR)/$(TARGET).bin : $(OBJDIR)/$(TARGET).elf |
42 | $(OC) -O binary $(OBJDIR)/$(TARGET).elf $(OBJDIR)/$(TARGET).bin | 42 | $(OC) -O binary $(OBJDIR)/$(TARGET).elf $(OBJDIR)/$(TARGET).bin |
43 | $(TOOLSDIR)/sh2d $(OBJDIR)/$(TARGET).bin -o 0900000 > $(OBJDIR)/$(TARGET).asm | 43 | $(TOOLSDIR)/sh2d $(OBJDIR)/$(TARGET).bin -o 0x0ffff000 > $(OBJDIR)/$(TARGET).asm |
44 | 44 | ||
45 | $(OBJDIR)/$(TARGET).elf : $(OBJS) | 45 | $(OBJDIR)/$(TARGET).elf : $(OBJS) |
46 | $(CC) -Os -nostdlib -o $(OBJDIR)/$(TARGET).elf -L$(OBJDIR) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$(TARGET).map | 46 | $(CC) -Os -nostdlib -o $(OBJDIR)/$(TARGET).elf -L$(OBJDIR) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$(TARGET).map |
diff --git a/flash/minimon/README b/flash/minimon/README index 4eca81e7e9..d2dc1707a6 100644 --- a/flash/minimon/README +++ b/flash/minimon/README | |||
@@ -4,3 +4,6 @@ MiniMon is the tiny but powerful-enough piece of code that can be loaded | |||
4 | with the UART boot mod. | 4 | with the UART boot mod. |
5 | It allows to read and write memory, flash program, execute code. | 5 | It allows to read and write memory, flash program, execute code. |
6 | This is suitable to reflash the box, load Rockbox or the gdb stub, etc. | 6 | This is suitable to reflash the box, load Rockbox or the gdb stub, etc. |
7 | |||
8 | The SVN version is linked to 0x0ffff000, i.e. start of IRAM. | ||
9 | This address has to match the address uart_boot downloads it to. \ No newline at end of file | ||
diff --git a/flash/minimon/minimon.c b/flash/minimon/minimon.c index e7981f2d09..f34e94ac62 100644 --- a/flash/minimon/minimon.c +++ b/flash/minimon/minimon.c | |||
@@ -46,7 +46,7 @@ int main(void) | |||
46 | UINT32 size; | 46 | UINT32 size; |
47 | UINT32 content; | 47 | UINT32 content; |
48 | volatile UINT8* paddr = 0; | 48 | volatile UINT8* paddr = 0; |
49 | volatile UINT8* pflash; // flash base address | 49 | volatile UINT8* pflash = 0; // flash base address |
50 | 50 | ||
51 | while (1) | 51 | while (1) |
52 | { | 52 | { |
diff --git a/flash/minimon/minimon.lds b/flash/minimon/minimon.lds index dbdbdc3faa..14150b2123 100644 --- a/flash/minimon/minimon.lds +++ b/flash/minimon/minimon.lds | |||
@@ -3,7 +3,7 @@ INPUT(minimon.o) | |||
3 | 3 | ||
4 | MEMORY | 4 | MEMORY |
5 | { | 5 | { |
6 | DRAM : ORIGIN = 0x09000000, LENGTH = 0x200000 | 6 | IRAM : ORIGIN = 0x0FFFF000, LENGTH = 0x500 |
7 | } | 7 | } |
8 | 8 | ||
9 | SECTIONS | 9 | SECTIONS |
@@ -12,22 +12,22 @@ SECTIONS | |||
12 | { | 12 | { |
13 | *(.startvector) | 13 | *(.startvector) |
14 | . = ALIGN(0x4); | 14 | . = ALIGN(0x4); |
15 | } > DRAM | 15 | } > IRAM |
16 | 16 | ||
17 | .got : | 17 | .got : |
18 | { | 18 | { |
19 | *(.got) | 19 | *(.got) |
20 | } > DRAM | 20 | } > IRAM |
21 | 21 | ||
22 | .got.plt : | 22 | .got.plt : |
23 | { | 23 | { |
24 | *(.got.plt) | 24 | *(.got.plt) |
25 | } > DRAM | 25 | } > IRAM |
26 | 26 | ||
27 | .rela.got : | 27 | .rela.got : |
28 | { | 28 | { |
29 | *(.rela.got) | 29 | *(.rela.got) |
30 | } > DRAM | 30 | } > IRAM |
31 | 31 | ||
32 | .text : | 32 | .text : |
33 | { | 33 | { |
@@ -35,26 +35,26 @@ SECTIONS | |||
35 | *(.entry) | 35 | *(.entry) |
36 | *(.text) | 36 | *(.text) |
37 | . = ALIGN(0x4); | 37 | . = ALIGN(0x4); |
38 | } > DRAM | 38 | } > IRAM |
39 | 39 | ||
40 | .data : | 40 | .data : |
41 | { | 41 | { |
42 | *(.data) | 42 | *(.data) |
43 | } > DRAM | 43 | } > IRAM |
44 | 44 | ||
45 | .rodata : | 45 | .rodata : |
46 | { | 46 | { |
47 | *(.rodata) | 47 | *(.rodata) |
48 | . = ALIGN(0x4); | 48 | . = ALIGN(0x4); |
49 | } > DRAM | 49 | } > IRAM |
50 | 50 | ||
51 | .bss : | 51 | .bss : |
52 | { | 52 | { |
53 | *(.bss) | 53 | *(.bss) |
54 | } > DRAM | 54 | } > IRAM |
55 | 55 | ||
56 | .stack : | 56 | .stack : |
57 | { | 57 | { |
58 | *(.stack) | 58 | *(.stack) |
59 | } > DRAM | 59 | } > IRAM |
60 | } | 60 | } |