Small playground bare-metal programming for raspberry pi 3+ (my own)
I have been inspired by https://github.com/bztsrc/raspi3-tutorial and https://github.com/rust-embedded/rust-raspi3-OS-tutorials
./setup.sh
- to compile rust programs
make
- to run the kernel and programs
setup the tty to simulate the serial
socat pty,link=cu.serial-master,raw,echo=0 pty,link=cu.serial-slave,raw,echo=0
prepare the sender
pip install pyserial
python3 load.py cu.serial-slave
run arguments
./run.sh
./run.sh -d in_asm,int
- wire the cable et setup the link
python3 load.py `ls /dev/cu.usb*`
- launch raspi (python will show the debug output)
Files to be found here : https://github.com/raspberrypi/firmware/tree/master/boot
- bootcode.bin
- start.elf
- fixup.dat
Schematics with my USB-to-serial
Reference : SysReg_xml_v85A-2019-06.pdf (page 418)
ELR : The execption returns (where the exception occured if data fault or synchronous) ESR_ELx : Register holding exception information :
EC : Exception Class
- Disassemble stripped version
aarch64-none-elf-objdump -b binary -maarch64 -D program.img
- Disassemble version with symbol
aarch64-none-elf-objdump -g -D target/aarch64-unknown-none/release/aos-kernel