Skip to main content

Waterloop Cosa is a commandline tool used to help create, build, and upload AVR projects built using Cosa, an object-oriented platform for Arduino. This project is built on top of arduino-cmake to provide a CMake toolchain for Cosa, and wrapped in a Python script.

Cosa

Cosa boasts better performance and lower power consumption, while more powerful but complex than standard Arduino libraries. Cosa, being object oriented integrates well with other C++ program written in OOP style.

WCosa

This project provides wcosa, a build script written in Python. The script allows user to create, build, upload, and monitor AVR projects. This tool uses the cmake toolchain behind the scenes. Running the creation scripts generates a project with the structure

project/
    lib/
    src/
    wcosa/
        bin/
        CMakeLists.txt
    .gitignore
    config.json
    CMakeLists.txt
    CMakeListsPrivate.txt

Sources files should be placed in the src directory, and libraries should be placed in folders inside the lib directory. Build files are contained in wcosa and needs to be generated for each environment that is running the WCosa project.

Commands and Usage

Using commands has the format wcosa [action] where [action] is one of create, update, build, clean, upload.

Here is an example of creating a project:

mkdir wcosa-project
cd wcosa-project
wcosa create --board uno --ide clion

The --board flag specifies the desired target board for project build, and --ide clion tells WCosa to generate files to enable project import into CLion for code suggestion and completion. Use wcosa boards to see the list of available boards, supported Cosa. This command will generate environment-specific files such as CMakeListsPrivate.txt and the wcosa folder.

To build the project, creating uploadable binaries, use wcosa build, and to clean the project, run wcosa clean. If a microcontroller is plugged into your PC, running wcosa upload will attempt to autodetect the port and upload the program. If you have multiple microcontrollers or if WCosa cannot detect the port, use wcosa upload --port [port_name] to specify the desired upload port.

The command wcosa update can be used to update the target board with wcosa update --board [new_board] or if config.json is modified. To add build definitions to the main project or to submodules, modify build-flags to something as

{
    "build-flags": "MAX_ALLOCATORS=4u STATIC_MEMORY"
}

To specify definitions for modules added under lib,

{
    "build-flags": "...",
    "module-flags": {
        "wlib": "BLOCK_SIZE=64u NUM_BLOCKS=400u"
    }
}

Then run wcosa update to update the internal config.

The command wcosa update should also be called when checking out a project from source control to create the environment files. For example,

git clone --recursive https://github.com/teamwaterloop/goose-sensors.git
cd goose-sensors
wcosa update

Installation

pip install wcosa

WCosa requires either gcc-avr or the Arduino SDK to be installed. CMake is also required to build projects.

Windows

We recommend installing the Arduino SDK. 1. Download and install the Arduino IDE 2. Add the Arduino installation directory and the subdirectory \hardware\tools\avr\bin to your System PATH; these may look like * C:\Program Files (x86)\Arduino * C:\Program Files (x86)\Arduino\hardware\tools\bin

There are some avr-gcc builds available for Windows but these are untested.

Linux

You may choose to install the Arduino SDK or the required tools and binaries from the commandline.

Ubuntu

sudo apt-get install gcc-avr avr-libc avrdude

Arch

sudo pacman -S avr-gcc avr-libc avrdude

MacOS

You may install the Arduino SDK or build avr-gcc using brew. Keep in mind that building avr-gcc may take some time.

xcode-select --install
brew tap osx-cross/avr
brew install avr-gcc
brew install avrdude

Committers

Deep Dhillon (@dhillondeep) Jeff Niu (@mogball)

Release files for WCosa 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for WCosa 1.1.1
File Size Uploaded
WCosa-1.1.1.tar.gz 1.6 MB Details

Release files / WCosa-1.1.1.tar.gz

Download URL WCosa-1.1.1.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
c478a3123baca0ff88f062eb915628ee12f1dd0edae4606ef33aa45db4b6f802
BLAKE2b-256 checksum
How to use checksums
b420e50576f233feb22c1c10d88dd33ab55b6c473148c39222182a87d653e8e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.1.1 This release

1 release file

1.1.0

1 release file

1.0.7

1 release file

1.0.6

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page