Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"ms-vscode.cpptools",
"marus25.cortex-debug",
"ms-vscode.makefile-tools",
"ms-vscode.cpptools-extension-pack",
"mcu-debug.memory-view"
]
}
27 changes: 0 additions & 27 deletions .vscode/settings.json.example

This file was deleted.

25 changes: 25 additions & 0 deletions .vscode/settings.json.linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"OS": "linux",
"makefile.makePath": "/usr/bin/make",

"makefile.configurations": [
{
"name": "MakeSingle",
"makeArgs": [
"-j1"
]
},
{
"name": "MakeParallel-8",
"makeArgs": [
"-j8"
]
},
{
"name": "MakeParallel-MAX",
"makeArgs": [
"-j"
]
}
]
}
25 changes: 25 additions & 0 deletions .vscode/settings.json.macos
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"OS": "macos",
"makefile.makePath": "/usr/bin/make",

"makefile.configurations": [
{
"name": "MakeSingle",
"makeArgs": [
"-j1"
]
},
{
"name": "MakeParallel-8",
"makeArgs": [
"-j8"
]
},
{
"name": "MakeParallel-MAX",
"makeArgs": [
"-j"
]
}
]
}
25 changes: 25 additions & 0 deletions .vscode/settings.json.windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"OS": "windows",
"makefile.makePath": "tools/windows/make/bin/make.exe",

"makefile.configurations": [
{
"name": "MakeSingle",
"makeArgs": [
"-j1"
]
},
{
"name": "MakeParallel-8",
"makeArgs": [
"-j8"
]
},
{
"name": "MakeParallel-MAX",
"makeArgs": [
"-j"
]
}
]
}
50 changes: 45 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,52 @@ AM32 Bootloader

This is the bootloader for the AM32 project

Building
Installing Build Tools
----------------------

To install the required build tools please run the script for your
operating system found in the env_setup_scripts directory. This will
download the required tools from
https://firmware.ardupilot.org/Tools/AM32-tools/ and unpack them in
tools. It will also setup your vscode settings for your OS.

Runing VSCode
-------------

When you run vscode it will recommend you install some key extensions:

- C/C++ tools
- Cortex-Debug
- Makefile Tools

You will need to install these before doing a build.

Command Line Build
------------------

To build with the command line use the command "make". If your
environment is setup correctly you should be able to tab complete the
available targets. Otherwise you can run "make targets" to see the
available build targets.

CI Builds
---------

All of the bootloaders are automatically built in CI using github
actions. See the Actions tab on
https://github.com/am32-firmware/AM32-bootloader for the latest
builds.

Releases
--------

The recommended build environment is vscode or command line make. You
will need the tools from here
The latest release is available here:

https://github.com/am32-firmware/AM32-bootloader/releases

https://firmware.ardupilot.org/Tools/AM32-tools/
Getting Help
------------

unpack the right tools for your OS before building
If you need help with bootloader development please ask on the AM32
discord server in the development channel
https://discord.com/invite/h7ddYMmEVV
4 changes: 4 additions & 0 deletions env_setup_scripts/gcc_setup_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sudo apt-get update
sudo apt-get install -y make
make arm_sdk_install
cp .vscode/settings.json.linux .vscode/settings.json
4 changes: 4 additions & 0 deletions env_setup_scripts/gcc_setup_macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install make
make arm_sdk_install
cp .vscode/settings.json.macos .vscode/settings.json
50 changes: 50 additions & 0 deletions env_setup_scripts/gcc_windows_env_setup.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
REM Change to the parent directory of the directory where this script is located
cd "%~dp0.."

REM Download location for tools
set WINDOWS_TOOLS=https://firmware.ardupilot.org/Tools/AM32-tools/windows-tools.zip

REM Set the destination directory for the download
set DOWNLOAD_DIR=%cd%\downloads

REM Create the downloads directory if it doesn't exist
if not exist "%DOWNLOAD_DIR%" (
mkdir "%DOWNLOAD_DIR%"
)

echo Downloading Windows tools to %DOWNLOAD_DIR%...
powershell -Command "Invoke-WebRequest -Uri '%WINDOWS_TOOLS%' -OutFile '%DOWNLOAD_DIR%\windows-tools.zip'"
if %errorlevel% neq 0 (
echo Failed to download windows-tools.zip
exit /b 1
)

REM Set the destination directory for the unzipped files
set UNZIP_DIR=%cd%

REM Create the windows directory if it doesn't exist
if not exist "%UNZIP_DIR%" (
mkdir "%UNZIP_DIR%"
)

echo Unpacking windows-tools.zip to %UNZIP_DIR%...
powershell -Command "Expand-Archive -Path '%DOWNLOAD_DIR%\windows-tools.zip' -Force -DestinationPath '%UNZIP_DIR%'"
if %errorlevel% neq 0 (
echo Failed to unpack windows-tools.zip
exit /b 1
)

REM Copy .vscode/settings.json.windows to .vscode/settings.json
if exist .vscode\settings.json.windows (
copy /Y .vscode\settings.json.windows .vscode\settings.json
if %errorlevel% neq 0 (
echo Failed to copy .vscode\settings.json.windows to .vscode\settings.json
exit /b 1
)
echo Copied .vscode\settings.json.windows to .vscode\settings.json
) else (
echo Source file .vscode\settings.json.windows not found.
exit /b 1
)

echo Script completed successfully.
Loading