Firmware Quick Start
You can easily edit or create your custom firmware for TOWER Core Module on every major operating system.
Getting your first TOWER firmware
If you are returning to the project use the Open folder option in VSCode. Go to the File -> Open Folder...
or use Ctrl + K
then Ctrl + O
.
- Open VSCode and click the HARDWARIO Icon on the left sidebar
- In the section TOWER: Start select From Skeleton Project...
- Select Folder where the new firmware project folder should be created
- You will be prompted to name the folder, default twr-skeleton is just fine for now
- Wait for the firmware to finish downloading
- Visual Studio Code will reopen with the new firmware opened
You can also download the firmware with the git command.
git clone --recursive https://github.com/hardwario/twr-skeleton.git
You can select From Existing Project... instead of From Skeleton Project... to clone any other project from GitHub.
Project Structure
This is the file structure of the twr-skeleton project that you just cloned. It is a Git-initialized repository ready to be used out of the box.
This project can be immediately compiled and flashed to the Core Module or Radio Dongle
.
├── .git
│ └── ...skipped
├── .github
│ └── CI files, you can put some workflow for GitHub Actions here
├── .vscode
│ └── ...skipped
├── sdk
│ └── a lot of files (mostly not important for normal user)
├── src
│ └── application.c
| └── application.h
| └── CMakeLists.txt
├── .editorconfig
├── .gitignore
├── .gitmodules
├── CMakeLists.txt
├── LICENSE
└── README.md
The place where you should edit your code is in the src
directory.
Usually, you will not need to modify other files than those.
Therefore your first step most likely will be to open the src/application.c file.
If you are using HARDWARIO Code Visual Studio Code extension the src/application.c
will be opened automatically.
If you want to see some firmware examples, you can visit our GitHub repository or some of the How to: chapters in the Firmware SDK section.
Development Cycle
Normally, the development cycle is the repetition of the following 4 steps.
- Edit the
src/application.c
and save changes Ctrl + S - Click on Build + Flash (Console) to compile, flash and open the serial console for logging.
- You can also work with the CLI Tools
- Test your firmware
- If you need to debug your application, please follow the Debugging chapter.
Programming Language
Firmware is implemented in pure C language, which is an industrially accepted language for embedded and low-power devices.
There are the main reasons for choosing this technology.
- Efficient use of hardware resources
- Stability and long-time available development environment
- Simple and understandable syntax
You can use all known C language structures and also our SDK that is implemented so you can quickly and easily, without any problems with compatibility, create your custom firmware.
Troubleshooting
If you can't detect or flash the Radio Dongle or Core Module it can be a driver or OS issue. You can try some fixes based on your system
- On Windows and macOS please install the FTDI VCP drivers
- On Ubuntu, you need to be in
dialout
user group. Please use the commandsudo usermod -a -G dialout $USER
and restart the computer
Next steps
From now you should be able to create firmware and update existing ones.
To know more about our modules and see some examples you can read the Hardware Modules section or Firmware SDK section