This article will help you get setup if you have a M1 with a solution using Docker Desktop.
\uD83D\uDCD8 Instructions for Docker Setup
Info |
---|
This guide will provide instructions for getting a virtual environment setup with Docker which will allow you to simulate your code in a Linux environment |
Download Docker Desktop for Apple Silicon (https://www.docker.com/products/docker-desktop/ )
Install the latest version of vagrant (https://www.vagrantup.com/downloads )
For M1s, you can use brew or you can download the ARM64 version
Clone the repo:
git clone https://github.com/uw-midsun/box.git && cd box
Go to your box directory and switch to branch mainmaster branch
You can check if you are on the master branch if you run
git branch
Code Block ~ % cd box box % git checkout
master
Before running
vagrant up
, make sure that you have docker openThere is a current error with vagrant 2.4.1 (this issue may be fixed in future versions) which can be fixed with a one line change. Go into the box repository
If you get this type of error, follow the instructions below:Code Block ~ % cd box box % cd /opt/vagrant/embedded/gems/gems/vagrant-2.4.1/plugins/providers/docker # Using whatever code editor (or use sudo vim) to edit the driver.rb file in this directory # If you are not comfortable doing this, please ask a lead and they can help you # Go to line 352 and replace "if (config.size > 0 &&" with # if (defined?(config.size) && config.size > 0 &&
The end result will look like this, you will need to sudo save if you are using vscode or another editor:
...
Once this file is saved, you can return the box repository and continue on
Run
vagrant up --provider=docker
Run
vagrant ssh
Run
cd shared
Run
git clone https://github.com/uw-midsun/fwxv.git && cd fwxv
(if you clone with https, you will need to set up an ssh key later which is covered in our setup page)Run
scons sim --project=leds --platform=x86
to test that your environment is working correctly. If it compiles and runs your environment is set up. Correct output will be constant printing of “blink.” To stop the output, just click ctr + c.If you get to this step and are following the FW101 setup, please return to the setup page Setup and start at the ssh keygen section.
👾 Guide to flashing on M1s
Note |
---|
Only follow these instructions if you have already finished the instructions below and are ready to flash |
...
Ensure you are not in the linux environment (Docker environment)
Go to the box repository and start up your python virtual environment by running
source venv/bin/activate
Try running
arm-none-eabi-gcc --version
and look for output. If it says that it cannot findarm-none-eabi-gcc
then runsource ~/.zshrc
If it still doesn’t work, please contact a lead for help
Make the necessary connections you need with the hardware
cd shared/fwxv
then runscons flash --project=[project name]
(If you need some other scons command please reference the build_system.md file)
✨ Guide to setting up dependencies for flashing on M1s
Note |
---|
Ensure that these steps, including any future flashing activities, are performed outside the Linux/Docker environment |
...