mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Merge pull request #145 from ranma/libc-main-vectors
Rename bootloader to main
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
BOOTLOADER_ADDRESS=0x100
|
|
||||||
|
|
||||||
VERSION=0.1.0
|
VERSION=0.1.0
|
||||||
IMAGESIZE = 524288
|
IMAGESIZE = 524288
|
||||||
DEFAULT_CONFIG_LOCATION = 454656
|
DEFAULT_CONFIG_LOCATION = 454656
|
||||||
@@ -65,8 +63,8 @@ $(BUILDDIR)%.rel: $(BUILDDIR)%.asm
|
|||||||
${ASM} ${AFLAGS} -o $@ $<
|
${ASM} ${AFLAGS} -o $@ $<
|
||||||
# mv -f $(addprefix $(basename $^), .lst .rel .sym) .
|
# mv -f $(addprefix $(basename $^), .lst .rel .sym) .
|
||||||
|
|
||||||
$(BUILDDIR)rtlplayground.ihx: $(BUILDDIR)crtstart.rel $(OBJS) $(BUILDDIR)crc16.rel
|
$(BUILDDIR)rtlplayground.ihx: $(OBJS) $(BUILDDIR)crtstart.rel $(BUILDDIR)crc16.rel
|
||||||
$(CC) $(CC_FLAGS) -Wl-bHOME=${BOOTLOADER_ADDRESS} -Wl-bBANK1=0x14000 -Wl-bBANK2=0x24000 -Wl-r -o $@ $^
|
$(CC) $(CC_FLAGS) -Wl-bHOME=0x00000 -Wl-bBANK1=0x14000 -Wl-bBANK2=0x24000 -Wl-r -o $@ $^
|
||||||
|
|
||||||
$(BUILDDIR)rtlplayground.img: $(BUILDDIR)rtlplayground.ihx
|
$(BUILDDIR)rtlplayground.img: $(BUILDDIR)rtlplayground.ihx
|
||||||
objcopy --input-target=ihex -O binary $< $@
|
objcopy --input-target=ihex -O binary $< $@
|
||||||
|
|||||||
@@ -1,44 +1,4 @@
|
|||||||
.globl __start__stack
|
|
||||||
;--------------------------------------------------------
|
|
||||||
; Stack segment in internal ram
|
|
||||||
;--------------------------------------------------------
|
|
||||||
.area SSEG (DATA)
|
|
||||||
__start__stack:
|
|
||||||
.ds 1
|
|
||||||
|
|
||||||
.area VECTOR (CODE)
|
|
||||||
.globl __interrupt_vect
|
|
||||||
__interrupt_vect:
|
|
||||||
ljmp __sdcc_gsinit_startup
|
|
||||||
ljmp _isr_ext0 ; 0x03
|
|
||||||
.ds 5
|
|
||||||
ljmp _isr_timer0 ; 0x0b
|
|
||||||
.ds 5
|
|
||||||
ljmp _isr_ext1 ; 0x13
|
|
||||||
.ds 5
|
|
||||||
reti ; 0x1b TIMER 1 IRQ
|
|
||||||
.ds 7
|
|
||||||
ljmp _isr_serial ; 0x23
|
|
||||||
.ds 5
|
|
||||||
ljmp _isr_timer2 ; 0x2b TIMER 2 IRQ
|
|
||||||
.ds 5
|
|
||||||
reti ; 0x33 NOT used by DW8051
|
|
||||||
.ds 7
|
|
||||||
reti ; 0x3b Serial port 1 RX/TX IRQ
|
|
||||||
.ds 7
|
|
||||||
ljmp _isr_ext2 ; 0x43
|
|
||||||
.ds 5
|
|
||||||
ljmp _isr_ext3 ; 0x4b
|
|
||||||
|
|
||||||
.globl __start__stack
|
|
||||||
|
|
||||||
.area GSINIT0 (CODE)
|
|
||||||
|
|
||||||
__sdcc_gsinit_startup::
|
|
||||||
mov sp,#__start__stack - 1
|
|
||||||
|
|
||||||
.area GSFINAL (CODE)
|
.area GSFINAL (CODE)
|
||||||
ljmp _bootloader
|
|
||||||
|
|
||||||
__sdcc_banked_call::
|
__sdcc_banked_call::
|
||||||
push _PSBANK
|
push _PSBANK
|
||||||
|
|||||||
+1
-1
@@ -1942,7 +1942,7 @@ void check_and_flash_update_image(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void bootloader(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
ticks = 0;
|
ticks = 0;
|
||||||
stp_clock = STP_TICK_DIVIDER;
|
stp_clock = STP_TICK_DIVIDER;
|
||||||
|
|||||||
@@ -106,6 +106,10 @@ int main(int argc, char **argv)
|
|||||||
printf("Error reading input file.\n");
|
printf("Error reading input file.\n");
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
if (buffer[0] != 2) {
|
||||||
|
printf("Expected LJMP at offset 0.\n");
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
for (int b = BANK0_SIZE; b < BANK_STRIDE + BANK0_SIZE; b ++) {
|
for (int b = BANK0_SIZE; b < BANK_STRIDE + BANK0_SIZE; b ++) {
|
||||||
if (buffer[b]) {
|
if (buffer[b]) {
|
||||||
printf("WARNING: Bank 0: code segment too large at 0x%x!\n", b);
|
printf("WARNING: Bank 0: code segment too large at 0x%x!\n", b);
|
||||||
|
|||||||
Reference in New Issue
Block a user