Build tools
The following instructions guide on setting up a development environment for building and running Mongoose Library examples, as well as developing new applications. The required tools are:
- Git, https://git-scm.com/ - for downloading source code and version control
- GCC / MinGW compiler - for compiling desktop / server programs
- GNU make, http://www.gnu.org/software/make/ - for build automation
If you are going to build for embedded systems, extra tools are required:
- for ARM embedded systems ARM GCC, https://launchpad.net/gcc-arm-embedded
- for RISCV embedded systems RISCV GCC,https://github.com/riscv-collab/riscv-gnu-toolchain
- for RP2040 devices CMake, https://cmake.org - for building
- for STM32 devices ST link, https://github.com/stlink-org/stlink - for flashing
- for TI devices Uniflash, https://www.ti.com/tool/UNIFLASH - for flashing
MacOS setup instructions
Start a terminal, and execute:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install gcc make git gcc-arm-embedded stlink cmake uniflash riscv-tools
Linux setup instructions
Assuming Ubuntu Linux. Start a terminal, and execute:
sudo apt -y update
sudo apt -y install build-essential make gcc-arm-none-eabi stlink-tools git cmake gcc-riscv64-unknown-elf
- for TI devices Download and install the Uniflash utility
Windows setup instructions
- Enable "Developer Mode" in Windows 10/11, for symbolic link support. "Open Settings" / "Privacy & Security" / "For developers", then set the "Developer Mode" to "on".
- Install Git from https://git-scm.com/download/win. Check "Enable symlink" during installation.
If you have Git already installed, either reinstall it with the symlink support on,
or run a
git config --global core.symlinks true
in the command prompt to enable symlinks in Git - Download and run mingwInstaller.exe
- Set install destination to
c:\
- Accept suggested default settings
- Go to
c:\mingw32\bin
folder and renamemingw32-make.exe
tomake.exe
- Add
c:\mingw32\bin
to thePath
environment variable
- Set install destination to
- for ARM embedded systems Download and install gcc-arm-none-eabi-10.3-2021.10-win32.exe.
- Enable "Add path to environment variable" during the installation
- for RISCV embedded systems Download and install risc-v-gcc10.1.0.exe, accept default installation settings.
- for RP2040 devices Install CMake; choose "Add CMake to the system PATH". You may also need to install Python 3
- for STM32 devices
Create
c:\tools
folder.- Download stlink-1.7.0.zip
and unpack
bin/st-flash.exe
into thec:\tools
folder - Add
c:\tools
to thePath
environment variable - If st-link does not work, you need a driver. Unplug your board and install ST's ST-LINK driver
- Alternatively, you may install Zadig; it will detect the device missing a driver and let you install a proper one. However, this is not compatible with Keil. Try WinUSB first:
- Download stlink-1.7.0.zip
and unpack
- for TI devices Download and install the Uniflash utility
Build and run an example
Now, when all required tools are installed, start terminal/command prompt, download Mongoose repository, go to HTTP server example, build it and run it:
git clone https://github.com/cesanta/mongoose
cd mongoose/examples/http-server
make