/aarch64-baremetal

Primary LanguageCApache License 2.0Apache-2.0

AArch64 from scratch on RPi

This repository hosts the baremetal source code which is used to explore AArch64 architecture on Raspberry-Pi 4B.

OpenOCD and GDB

  1. Prerequisites

    sudo apt install binutils libtool pkg-config make libusb-1.0-0-dev gdb-multiarch python3-pygments
    
  2. Install openocd version - 0.12

    cd ~/Downloads
    git clone https://github.com/openocd-org/openocd.git
    cd openocd
    ./bootstrap
    ./configure --enable-ftdi
    make
    sudo make install
    
  3. Confirm openocd version to be as expected

    $ openocd -v
    Open On-Chip Debugger 0.12.0+dev-01444-ge8e09b1b5 (2023-12-16-22:31)
    Licensed under GNU GPL v2
    For bug reports, read
    	http://openocd.org/doc/doxygen/bugs.html
    
  4. Change the adptor settings in the openocd configuration file

    1. edit: sudo nano /usr/local/share/openocd/scripts/interface/ftdi/ft232h-module-swd.cfg
    2. find and replace transport select swd with transport select jtag
  5. Attached openocd to the board using the following command:

    sudo openocd -f interface/ftdi/ft232h-module-swd.cfg -f target/bcm2711.cfg
    
  6. Install GDB dashboard

    wget -P ~ https://git.io/.gdbinit
    
  7. start gdb

    gdb-multiarch kernel8.elf -ex "target extended-remote localhost:3333"
    

Documentation Links

  1. Raspberry-Pi Documents
    1. BCM2711-ARM-Peripherals
    2. GPIO PIN Header
  2. OpenOCD and JTAG setup