aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gdbinit (renamed from 02-usart/.gdbinit)0
-rw-r--r--.ycm_extra_conf.py (renamed from 02-usart/.ycm_extra_conf.py)0
-rw-r--r--00-hello/Makefile17
-rw-r--r--00-hello/README19
-rw-r--r--00-hello/linker_script.ld14
-rw-r--r--00-hello/main.c354
-rw-r--r--01-system-clock/Makefile.preamble21
-rw-r--r--01-system-clock/README17
-rwxr-xr-x01-system-clock/genmake.pl70
-rw-r--r--01-system-clock/include/clock.h118
-rw-r--r--01-system-clock/include/common.h14
-rw-r--r--01-system-clock/include/flash.h20
-rw-r--r--01-system-clock/include/gpio.h120
-rw-r--r--01-system-clock/include/isr_vector.h20
-rw-r--r--01-system-clock/include/rcc.h81
-rw-r--r--01-system-clock/include/spin.h15
-rw-r--r--01-system-clock/linker/linker_script.ld36
-rw-r--r--01-system-clock/src/clock.c106
-rw-r--r--01-system-clock/src/delay.c9
-rw-r--r--01-system-clock/src/gpio.c37
-rw-r--r--01-system-clock/src/isr_vector.c165
-rw-r--r--01-system-clock/src/main.c36
-rw-r--r--01-system-clock/src/spin.c49
-rw-r--r--02-usart/include/kern/delay.h12
-rw-r--r--02-usart/src/kern/vector.c0
-rw-r--r--02.5-collatz/Makefile.preamble21
-rwxr-xr-x02.5-collatz/genmake.pl70
-rw-r--r--02.5-collatz/include/apb.h4
-rw-r--r--02.5-collatz/include/clock.h126
-rw-r--r--02.5-collatz/include/common.h30
-rw-r--r--02.5-collatz/include/delay.h12
-rw-r--r--02.5-collatz/include/flash.h20
-rw-r--r--02.5-collatz/include/gpio.h146
-rw-r--r--02.5-collatz/include/isr_vector.h20
-rw-r--r--02.5-collatz/include/rcc.h93
-rw-r--r--02.5-collatz/include/spin.h15
-rw-r--r--02.5-collatz/include/usart.h131
-rw-r--r--02.5-collatz/linker/linker_script.ld36
-rw-r--r--02.5-collatz/src/clock.c106
-rw-r--r--02.5-collatz/src/delay.c9
-rw-r--r--02.5-collatz/src/gpio.c52
-rw-r--r--02.5-collatz/src/isr_vector.c165
-rw-r--r--02.5-collatz/src/main.c93
-rw-r--r--02.5-collatz/src/spin.c49
-rw-r--r--02.5-collatz/src/usart.c80
-rw-r--r--02.5-collatz/src/vector.c0
-rw-r--r--03-refactor/Makefile.preamble21
-rwxr-xr-x03-refactor/genmake.pl70
-rw-r--r--03-refactor/include/apb.h4
-rw-r--r--03-refactor/include/clock.h112
-rw-r--r--03-refactor/include/common.h30
-rw-r--r--03-refactor/include/delay.h12
-rw-r--r--03-refactor/include/flash.h20
-rw-r--r--03-refactor/include/gpio.h146
-rw-r--r--03-refactor/include/isr_vector.h20
-rw-r--r--03-refactor/include/printf.h15
-rw-r--r--03-refactor/include/rcc.h181
-rw-r--r--03-refactor/include/spin.h15
-rw-r--r--03-refactor/include/usart.h219
-rw-r--r--03-refactor/linker/linker_script.ld36
-rw-r--r--03-refactor/src/clock.c131
-rw-r--r--03-refactor/src/delay.c9
-rw-r--r--03-refactor/src/gpio.c52
-rw-r--r--03-refactor/src/isr_vector.c275
-rw-r--r--03-refactor/src/main.c103
-rw-r--r--03-refactor/src/printf.c152
-rw-r--r--03-refactor/src/spin.c49
-rw-r--r--03-refactor/src/usart.c131
-rw-r--r--03-refactor/src/vector.c0
-rw-r--r--Makefile.preamble (renamed from 02-usart/Makefile.preamble)0
-rwxr-xr-xgenmake.pl (renamed from 02-usart/genmake.pl)0
-rw-r--r--include/arch/arm/arch.h (renamed from 02-usart/include/arch/arm/arch.h)0
-rw-r--r--include/arch/stm32l4xxx/peripherals/apb.h (renamed from 02-usart/include/arch/stm32l4xxx/peripherals/apb.h)0
-rw-r--r--include/arch/stm32l4xxx/peripherals/clock.h (renamed from 02-usart/include/arch/stm32l4xxx/peripherals/clock.h)0
-rw-r--r--include/arch/stm32l4xxx/peripherals/dma.h (renamed from 02-usart/include/arch/stm32l4xxx/peripherals/dma.h)0
-rw-r--r--include/arch/stm32l4xxx/peripherals/flash.h (renamed from 02-usart/include/arch/stm32l4xxx/peripherals/flash.h)0
-rw-r--r--include/arch/stm32l4xxx/peripherals/gpio.h (renamed from 02-usart/include/arch/stm32l4xxx/peripherals/gpio.h)0
-rw-r--r--include/arch/stm32l4xxx/peripherals/irq.h (renamed from 02-usart/include/arch/stm32l4xxx/peripherals/irq.h)0
-rw-r--r--include/arch/stm32l4xxx/peripherals/isrs.inc (renamed from 02-usart/include/arch/stm32l4xxx/peripherals/isrs.inc)0
-rw-r--r--include/arch/stm32l4xxx/peripherals/nvic.h (renamed from 02-usart/include/arch/stm32l4xxx/peripherals/nvic.h)0
-rw-r--r--include/arch/stm32l4xxx/peripherals/rcc.h (renamed from 02-usart/include/arch/stm32l4xxx/peripherals/rcc.h)0
-rw-r--r--include/arch/stm32l4xxx/peripherals/spi.h (renamed from 02-usart/include/arch/stm32l4xxx/peripherals/spi.h)0
-rw-r--r--include/arch/stm32l4xxx/peripherals/system.h (renamed from 02-usart/include/arch/stm32l4xxx/peripherals/system.h)0
-rw-r--r--include/arch/stm32l4xxx/peripherals/tables/stm32l432xx/gpio/afn_table.inc (renamed from 02-usart/include/arch/stm32l4xxx/peripherals/tables/stm32l432xx/gpio/afn_table.inc)0
-rw-r--r--include/arch/stm32l4xxx/peripherals/tables/stm32l432xx/gpio/port_table.inc (renamed from 02-usart/include/arch/stm32l4xxx/peripherals/tables/stm32l432xx/gpio/port_table.inc)0
-rw-r--r--include/arch/stm32l4xxx/peripherals/usart.h (renamed from 02-usart/include/arch/stm32l4xxx/peripherals/usart.h)0
-rw-r--r--include/arch/x86_64/arch.h (renamed from 02-usart/include/arch/x86_64/arch.h)0
-rw-r--r--include/kern/common.h (renamed from 02-usart/include/kern/common.h)0
-rw-r--r--include/kern/delay.h (renamed from 01-system-clock/include/delay.h)0
-rw-r--r--include/kern/dma/dma_manager.h (renamed from 02-usart/include/kern/dma/dma_manager.h)0
-rw-r--r--include/kern/gpio/gpio_manager.h (renamed from 02-usart/include/kern/gpio/gpio_manager.h)0
-rw-r--r--include/kern/gpio/sysled.h (renamed from 02-usart/include/kern/gpio/sysled.h)0
-rw-r--r--include/kern/init.h (renamed from 02-usart/include/kern/init.h)0
-rw-r--r--include/kern/lib.h (renamed from 02-usart/include/kern/lib.h)0
-rw-r--r--include/kern/log.h (renamed from 02-usart/include/kern/log.h)0
-rw-r--r--include/kern/mem.h (renamed from 02-usart/include/kern/mem.h)0
-rw-r--r--include/kern/string.h (renamed from 02-usart/include/kern/string.h)0
-rw-r--r--linker/linker_script.ld (renamed from 02-usart/linker/linker_script.ld)0
-rw-r--r--src/arch/stm32l4xxx/peripherals/clock.c (renamed from 02-usart/src/arch/stm32l4xxx/peripherals/clock.c)0
-rw-r--r--src/arch/stm32l4xxx/peripherals/irq.c (renamed from 02-usart/src/arch/stm32l4xxx/peripherals/irq.c)0
-rw-r--r--src/arch/stm32l4xxx/peripherals/usart.c (renamed from 02-usart/src/arch/stm32l4xxx/peripherals/usart.c)0
-rw-r--r--src/kern/delay.c (renamed from 02-usart/src/kern/delay.c)0
-rw-r--r--src/kern/dma/dma_manager.c (renamed from 02-usart/src/kern/dma/dma_manager.c)0
-rw-r--r--src/kern/gpio/gpio_manager.c (renamed from 02-usart/src/kern/gpio/gpio_manager.c)0
-rw-r--r--src/kern/gpio/sysled.c (renamed from 02-usart/src/kern/gpio/sysled.c)0
-rw-r--r--src/kern/init.c (renamed from 02-usart/src/kern/init.c)0
-rw-r--r--src/kern/lib.c (renamed from 02-usart/src/kern/lib.c)0
-rw-r--r--src/kern/log.c (renamed from 02-usart/src/kern/log.c)0
-rw-r--r--src/kern/main.c (renamed from 02-usart/src/kern/main.c)0
-rw-r--r--src/kern/mem.c (renamed from 02-usart/src/kern/mem.c)0
-rw-r--r--src/kern/stdlibrepl.c (renamed from 02-usart/src/kern/stdlibrepl.c)0
-rw-r--r--src/kern/string.c (renamed from 02-usart/src/kern/string.c)0
-rw-r--r--src/kern/vector.c (renamed from 01-system-clock/src/vector.c)0
-rw-r--r--test_harness/Makefile (renamed from 02-usart/test_harness/Makefile)0
-rw-r--r--test_harness/fake_env.c (renamed from 02-usart/test_harness/fake_env.c)0
-rw-r--r--test_harness/fake_env.h (renamed from 02-usart/test_harness/fake_env.h)0
-rw-r--r--test_harness/test_harness.c (renamed from 02-usart/test_harness/test_harness.c)0
-rw-r--r--test_harness/test_harness.h (renamed from 02-usart/test_harness/test_harness.h)0
-rw-r--r--tests/metatest.c (renamed from 02-usart/tests/metatest.c)0
-rw-r--r--tests/test_dma.c (renamed from 02-usart/tests/test_dma.c)0
-rw-r--r--tests/test_gpio.c (renamed from 02-usart/tests/test_gpio.c)0
-rw-r--r--tests/test_irq.c (renamed from 02-usart/tests/test_irq.c)0
-rw-r--r--tests/test_lib.c (renamed from 02-usart/tests/test_lib.c)0
-rw-r--r--tests/test_memory.c (renamed from 02-usart/tests/test_memory.c)0
-rw-r--r--tests/test_spi.c (renamed from 02-usart/tests/test_spi.c)0
-rw-r--r--tests/test_usart.c (renamed from 02-usart/tests/test_usart.c)0
126 files changed, 0 insertions, 4431 deletions
diff --git a/02-usart/.gdbinit b/.gdbinit
index 87932b3..87932b3 100644
--- a/02-usart/.gdbinit
+++ b/.gdbinit
diff --git a/02-usart/.ycm_extra_conf.py b/.ycm_extra_conf.py
index 8203412..8203412 100644
--- a/02-usart/.ycm_extra_conf.py
+++ b/.ycm_extra_conf.py
diff --git a/00-hello/Makefile b/00-hello/Makefile
deleted file mode 100644
index 9c62c90..0000000
--- a/00-hello/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-OPT?=-O3
-all: main.bin
-
-main.s: main.c
- arm-unknown-eabi-gcc $(OPT) -S main.c -mcpu=cortex-m4 -mthumb -g
-
-main.elf: main.c
- arm-unknown-eabi-gcc $(OPT) main.c -mcpu=cortex-m4 -mthumb -g -lgcc -T linker_script.ld -Xlinker --cref -Xlinker -Map -Xlinker main.map -nostartfiles -o main.elf
-
-main.bin: main.elf
- arm-unknown-eabi-objcopy -O binary main.elf main.bin
-
-flash: main.bin
- st-flash write main.bin 0x8000000
-
-clean:
- rm -f *.elf *.bin
diff --git a/00-hello/README b/00-hello/README
deleted file mode 100644
index b9d0788..0000000
--- a/00-hello/README
+++ /dev/null
@@ -1,19 +0,0 @@
-Welcome to Level 1
-------------------
-
-This is a VERY simple program for the STM32L432 Nucleo-32 board. It simply
-iterates turning on the status led (LD3) and the pin D6.
-
-There is NO clock setting or anything, everything is the default bootup.
-
-There is a single source file, main.c, which defines all the code needed.
-
-There is a linker script which sets up the binary format properly ready to
-be flashed.
-
-This code can be flashed with
-
- $ make flash
-
-this requires the program `st-flash` which is a part of the stlink programmer,
-which can be found at https://github.com/texane/stlink.git.
diff --git a/00-hello/linker_script.ld b/00-hello/linker_script.ld
deleted file mode 100644
index fe0c14b..0000000
--- a/00-hello/linker_script.ld
+++ /dev/null
@@ -1,14 +0,0 @@
-MEMORY
-{
- flash : org = 0x08000000, len = 256k
-}
-
-SECTIONS
-{
- /* This is where the code goes. */
- . = ORIGIN(flash);
- .text : {
- *(.vectors); /* All .vector sections go here. */
- *(.text); /* All .text sections go here. */
- } >flash
-}
diff --git a/00-hello/main.c b/00-hello/main.c
deleted file mode 100644
index fe2b9d5..0000000
--- a/00-hello/main.c
+++ /dev/null
@@ -1,354 +0,0 @@
-#define __IO volatile
-
-#include <stdint.h>
-#define RCC_BASE_2 0x40021000
-
-int main();
-void spin();
-
-/*
- * Interrupt service routine handlers.
- */
-const void* vectors[] __attribute__((section(".vectors"))) = {
- (void*)0x2000c000, /* Top of stack at top of sram1. 48k */
- main, /* Reset handler */
- spin, /* NMI */
- spin, /* Hard Fault */
- spin, /* MemManage */
- spin, /* BusFault */
- spin, /* UsageFault */
- spin,