Skip to content

hellerve-project-based-learning/carpi0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

carpi0

Bare-metal Raspberry Pi Zero (BCM2835) project in Carp with:

  • PL011 UART console
  • IRQ-driven UART RX/TX ring buffers
  • monitor shell (help, uptime, sleep, peek, poke, hexdump, reboot, crash, logdump, tasks, yield, fbtest, dash on|off|once|rate|reset)
  • 1 kHz system timer tick
  • scheduler tick queue drained in main loop
  • mailbox framebuffer bring-up demo (fbtest)
  • UART SREC RAM loader (loadsrec, endsrec, boot)

Build

Prereqs:

  • arm-none-eabi-gcc toolchain
  • carp

Build:

make -f tooling/Makefile

Output image:

  • build/kernel.img

Flash to Pi Zero SD Card

Assuming boot volume mounted at /Volumes/BOOT:

cp build/kernel.img /Volumes/BOOT/kernel.img
sync

config.txt should contain:

kernel=kernel.img
arm_64bit=0
enable_uart=1
init_uart_clock=3000000

Serial Console

PL011 serial on GPIO14/15:

  • TXD0: GPIO14 (pin 8)
  • RXD0: GPIO15 (pin 10)
  • GND: pin 6

Serial settings: 115200 8N1, no flow control.

Example:

screen /dev/tty.usbserial-BG02PQ2J 115200

Serial regression check:

make -f tooling/Makefile serial-regress PORT=/dev/tty.usbserial-BG02PQ2J

Upload Over UART (SREC)

Build RAM-linked SREC (entry at 0x00100000):

make -f tooling/Makefile srec

In monitor:

  1. Type loadsrec and press Enter.
  2. Paste build/kernel_ram.srec lines into the serial terminal.
  3. After S7, loader exits SREC mode and prints entry/line/byte stats.
  4. Type boot to jump to loaded entry.

Accepted record types:

  • data: S1, S2, S3
  • entry: S7, S8, S9

Address window accepted by loader: 0x00100000..0x01FFFFFF.

Docs

  • docs/monitor.md: monitor command reference

About

a rpi0 firmware (w/ serial reflash using motorola s-records) in carp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors