diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2024-09-15 15:07:00 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2024-09-15 15:07:00 +0800 |
| commit | 9b8bc868509f3ec0fffcc85634e43535dc09b421 (patch) | |
| tree | 0ac2ac526c2628043f96a0481ba4c748b6295c80 | |
| parent | 177af7ea712d5fe70e1e96b453361db60dfffdab (diff) | |
| download | bare-metal-arduino-due-9b8bc868509f3ec0fffcc85634e43535dc09b421.tar.gz | |
Clean ups.
| -rw-r--r-- | Makefile | 35 | ||||
| -rw-r--r-- | main.c | 10 | ||||
| -rw-r--r-- | openocd-due.cfg | 5 | ||||
| -rw-r--r-- | script.ld | 4 |
4 files changed, 4 insertions, 50 deletions
diff --git a/Makefile b/Makefile deleted file mode 100644 index 846d463..0000000 --- a/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -CC = arm-none-eabi-gcc -CPU = cortex-m3 -TARGET = due - -SRC = main.c -OBJ = $(SRC:.c=.o) - -CFLAGS = -std=gnu99 -CFLAGS += -Os -CFLAGS += -Wall -CFLAGS += -mcpu=$(CPU) -CFLAGS += -mthumb - -LDFLAGS = -mcpu=$(CPU) -LDFLAGS += -Wl,--gc-sections - -HEX_FLAGS = -O ihex -HEX_FLAGS += -j .text -j .data - -%.o: %.c - $(CC) $(CFLAGS) -c -o $@ $< - -elf: $(OBJ) - $(CC) $(LDFLAGS) $(OBJ) -o $(TARGET).elf - -hex: elf - arm-none-eabi-objcopy $(HEX_FLAGS) $(TARGET).elf $(TARGET).hex - -#upload: hex -# openocd -f openocd-due.cfg -c "program $(TARGET) verify reset exit" - -.PHONY: clean - -clean: - rm *.o *.elf *.hex @@ -38,7 +38,7 @@ int main(void) return 0; } -__attribute__((noreturn)) void _rst_handler(void) { +__attribute__((noreturn)) void _reset(void) { unsigned long *dst, *src; extern unsigned long _sbss, _ebss, _sdata, _edata, _sidata; @@ -49,14 +49,8 @@ __attribute__((noreturn)) void _rst_handler(void) { *dst++ = *src++; main(); - - for (;;) - ; } extern const unsigned int _sp; -__attribute__ ((section(".vtor"))) const void* _tab[] = { - &_sp, - _rst_handler -}; +__attribute__ ((section(".vtor"))) const void* _tab[] = { &_sp, _reset }; diff --git a/openocd-due.cfg b/openocd-due.cfg index 8fba185..121a479 100644 --- a/openocd-due.cfg +++ b/openocd-due.cfg @@ -1,12 +1,7 @@ source [find interface/stlink.cfg] -#transport type SWD transport select hla_swd - -#swd frequency adapter speed 1800 - -#sam3x8e cpuid set CPUTAPID 0x2ba01477 source [find target/at91sam3ax_8x.cfg] @@ -4,8 +4,6 @@ MEMORY ram (rwx) : ORIGIN = 0x20000000, LENGTH = 96K } -_sp = ORIGIN(ram) + LENGTH(ram); - SECTIONS { .text : @@ -32,3 +30,5 @@ SECTIONS _ebss = . ; } > ram } + +_sp = ORIGIN(ram) + LENGTH(ram); |
