This is my little 'Cortex M3 from scratch' project. No external libraries or IDEs are used. Everything is written from scratch. My development environment consist of nothing more than:
* GCC-arm-none (standard ARM cross compiler)
* VIM editor
* stm32flash
The board I use is a cheap Chinese STM32F103 ripoff. In theory, you should be able to port this code to any Cortex M0/M3/M4/M7 board.
- Setup bare development environment [COMPLETED] -- FILES: Makefile, link.d
- Boot and jump to C [COMPLETED] -- FILES: start.asm, main.c, include/sys/mmap.h, include/sys/robsys.h
- Interrupt Handling [COMPLETED] -- FILES: ivt.c, lib/string.c
- Basic input and output (UART) [COMPLETED] -- FILES: driver/uart.c, lib/stdio.c
- SysTick [COMPLETED] -- FILE: systick.c
- System Info [COMPLETED] -- FILE: sysinfo.c
- High Speed External Clock / tuning [COMPLETED] -- FILE: clock.c
- RTC (Real Time Clock) [COMPLETED] -- FILE: rtc.c
- Built-in-shell [COMPLETED] -- FILE: term.c
- Port printf/libc library [COMPLETED] -- FILE: lib/tinyprintf.c
- Basic drivers:
- EEPROM: drivers/at24c.c [COMPLETED]
- UART drivers/uart.c [COMPLETED]
- LED segment display: drivers/tm1637.c [COMPLETED]
- Temperature sensor: drivers/tsensor.c [COMPLETED]
- OLED display [PLANNED]
- Joystick: drivers/mk450_joystick.c [COMPLETED]
- TFT Screen: drivers/st7735s.c, include/libs/fonts/wogfont.h [COMPLETED]
- Memory Management [IN PROGRESS] -- FILE: lib/pool.c
- Kernel heap [COMPLETED] -- FILE: heap.c
- User Mode Switch [IN PROGRESS]
- System Calls [IN PROGRESS] -- FILE: syscall.c lib/syscall.c
- Scheduler based on PendSV system call [IN PROGRESS]
- Stack trace debug [IN PROGRESS]
- Memory Protection Unit [SUSPENDED] (STM32F103 board has no MPU)
- Loadable programs from EEPROM [PLANNED]
- Multiple processes [IN PROGRESS] -- FILES: process.h, main.c
- Driver "abstraction" [PLANNED]
Here are some screenshots that shows the terminal just after booting:
Serial (over UART)
TFT screen output (SPI):