prepping RPI for embedded dev

2021-02-14 ยท 2 min read

    SSH into new rpi #

    $ ssh raspberrypi.local

    Set password #

    $ passwd

    Install git, tmux, etc... #

    $ sudo apt-get install git tmux vim

    Set rpi hostname #

    It takes too long to build a new image with a different hostname, so we'll set the hostname after the fact. Make sure the hostname is not the default raspberrypi.

    $ sudo hostname <new_hostname>

    Replace raspberrypi in /etc/hosts and /etc/hostname with <new_hostname>.

    Add MBP ssh pubkey #

    Forgot to add this when formatting the SD card...

    $ echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB3x6Xx0674lyf2DGstduaGjyA1ARqdeGc6PgHZMbwCK philiphayes@philiphayes-mbp" >> ~/.ssh/authorized_keys

    (Optional) Enable I2C Bus #

    $ sudo raspi-config

    select Interface Options > Enable I2C

    (Optional) Enable SPI Bus #

    $ sudo raspi-config

    select Interface Options > Enable SPI

    (Optional) PWM controller #

    In /boot/config, add the line: dtoverlay=pwm.

    Reboot #

    $ sudo reboot

    Test SSH with new hostname #

    $ ssh <new_hostname>.local

    On Host again, setup rust for cross-compiling to rpi0 #

    Attempt 1: (didn't work on WSL)

    $ sudo apt-get install gcc-arm-linux-gnueabihf libc6-armhf-cross libc6-dev-armhf-cross
    $ rustup target add arm-unknown-linux-gnueabihf

    Attempt 2: (worked)

    $ cd ~/
    $ wget "" -o gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz
    $ tar -xvf gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz
    $ rm -rf gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz

    Add $HOME/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin to $PATH.

    $ rustup target add arm-unknown-linux-gnueabihf