Software for Competition 1 of the "Not-A-Boring" Competition
Linux
- Ensure you have python3 installed
python3 -m venv .venv
source .venv/bin/activate
Prerequisite: Node.js(LTS version will be fine) and npm
- First, open your terminal. Navigate to
/comp1-software
directory. - Navigate to
/OnLand/ControlLaptop/angular-UI
.
If you are in the root of the 'comp1-software' folder, then just run:
Windows:
cd OnLand\ControlLaptop\angular-UI
Linux/Mac:cd OnLand/ControlLaptop/angular-UI
- When you in the angular-UI folder. Run
npm install -g @angular/cli
then runnpm install
- To build and serves the app locally, run
ng serve
.
If it's build successfully, there should be a link that look like this: http://localhost:4200/.
- Navigate to the link in your browser, and your should be able to see the app.
- Open a NEW terminal (don't close the front-end terminal if already running). Navigate to
/comp1-software
directory. - Ensure python environment is activated
- First, navigate to
/OnLand
directory, then runpip install -r requirements.txt
- Then, navigate to
/Examples/socketio-python
directory, and run:python3 server.py
(orpython server.py
)
Prerequisites:
- CMake (at least version 3.13)
- A compiler:
- MacOS - gcc 9 -
brew install gcc
or install through xcode - Linux - gcc 9 -
sudo apt install build-essential
- Arm64 Linux (Pi 4)- gcc 9.3 - Manually install from here
- Arm32 Linux (Pi 3B+) - gcc 9.3 - Manually install from here
- Windows - Visual Studio 2019 cl.exe should work fine
- Note: Ensure that C++ Cmake tools for Windows is installed along with Desktop development with C++
- MacOS - gcc 9 -
Setup:
- In a command prompt (Windows)/terminal (MacOS/Linux), navigate to
comp1-software/Subsurface/FlightComputer
- Make a build directory, and enter it
- Building for Raspberry pi:
Invoke cmake usingcmake -DCMAKE_TOOLCHAIN_FILE=../arm-linux-gnueabihf-gcc.cmake ..
, this should automatically find the cross compiler (assuming it has been added to your PATH), and generate a Makefile.
Building for everything else:
Invoke cmake usingcmake ..
, this should generate a Visual Studio Solution (Windows), or a Makefile (MacOS/Linux) - On Windows: Open the .sln file in Visual Studio, and in the solution explorer set the FlightComputer project as the startup project (right click, "set as startup project"), then build and run.
On Linux/MacOS/Arm64 Linux: Runmake
, and this should build the project, and then run the executable with./FlightComputer
Prerequisites:
- STM32CubeMx (Version 6.1.0)
- Windows Users will need WSL
- The following packages (should be able to install from package manager):
- build-essential (
sudo apt install build-essential
) - gcc-arm-none-eabi Version 9.2.1 (
sudo apt install gcc-arm-none-eabi
)- For macOS users, do the following:
brew tap PX4/homebrew-px4 brew update brew install gcc-arm-none-eabi
- CMake (see below instructions)
- build-essential (
CMake
- Execute CMake --version, if your version is below 3.15.3 - perform the following
- Remove your current version of cmake with:
sudo apt-get remove --auto-remove cmake && sudo apt-get purge --auto-remove cmake
- Ensure you are in the project python environment and execute
pip install cmake
- Remove your current version of cmake with:
Setup
-
Open STM32CubeMx, select "File -> Load Project...", and open to
/comp1-software/Examples/Blink/Blink.ioc
-
Navigate to the Project Manager tab, ensure that the "Toolchain/IDE" is set to "Makefile", and hit the "GENERATE CODE" button. This will create all the required HAL code in to allow for the project to be built
-
In a terminal window, navigate to
comp1-software/Examples/Blink
-
First, cd into
Core/Src
, and removemain.c
-
Cd back to the root of the project, and issue the following commands:
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../arm-none-eabi-gcc.cmake -DCMAKE_BUILD_TYPE=Debug ..
make
There should now be
nucleo-f303re.out
, plus some other files with the same name, and different file extension. This confirms that you have build the project successfully.