No description
Find a file
mar c6d3cbdc3a added: device --flash.
Added a flash option within the device subcommand, that can directly
flash a firmware using avrdude behind the scenes, and the discovery
module to find the board/programmer.
2025-10-24 19:15:48 +02:00
device added: device --flash. 2025-10-24 19:15:48 +02:00
templates changed: avr_io version to v0.5.0 in codegen. 2025-10-12 16:40:04 +02:00
tests fixed: cmake codegen. 2025-10-12 15:21:08 +02:00
.gitignore added: v0.3.0 additions in readme. 2025-10-12 15:40:20 +02:00
avrman.nim added: device --flash. 2025-10-24 19:15:48 +02:00
avrman.nimble changed: bump nimble version. 2025-10-12 20:55:02 +02:00
codegen.nim fixed: cmake codegen. 2025-10-12 15:21:08 +02:00
compiler.nim changed: formatting and docstring. 2025-10-08 23:27:23 +02:00
config.nims changed: adding print error func + gitignore. 2025-05-10 17:03:15 +02:00
LICENSE added: license. 2024-03-01 20:18:27 +01:00
README.md changed: updated table of contents. 2025-10-12 18:39:36 +02:00

avrman

avrman (avr manager) is a tool for managing nim projects targetting AVR microcontrollers.

It is tightly coupled with the avr_io library, which is not a dependency, but it is used as the base dependency for projects created with this tool.

Dependencies

This tools does not use any third party libraries. Note that projects created with this tool depend on avr_io. If port discovery is used, avrdude should be separately installed.

Requires nim >= 2.0.0.

Notes

  • Currently tested with avr-gcc 15.2.0, binutils 2.45, avr-libc 2.2.1.
  • N.B. Port discovery is only available on linux and macosx.

Build

git clone https://github.com/Abathargh/avrman
cd avrman
nimble build

Or simply install using:

nimble install avrman

Usage

avr manager for nim and c projects.

    avrman [options] command [command_options]

Options:
  -h, --help        shows this help message
  -v, --version     shows the current version

Commands:
  init              initializes an avr project
  compile           compiles an avr file with the default avrman options
  device            interacts with the avr devices connected to this machine

You can use the -h option with each subcommand to get a command-specific help prompt.

Init

For example, the following command will initialize a project for an ATMega644 running at 8KHz, using atmelice as its programmer:

avrman init -m:atmega644 -f:8000000 -p:"atmelice" test644

Note that:

  • The m/mcu option is required. A complete list of supported microcontrollers can be obtained with the -s flag.
  • The frequency defaults to 16MHz if not specified.
  • If no prog string is provided, no flash* nimble targets will be generated.

You can also specify devices, that avrman may know about. In that case it will take care of mostly everything by itself (and even of port discovery):

avrman init --device:uno test_arduino

Creating C projects

You can also use this tool to manage a C project for an avr chip, by using the --cproject flag. For example, you can use the following command to initialize a Makefile-based C project for an arduino uno:

avrman init -m:atmega328p -f:16000000 -p:"arduino -b 115200 -P /dev/ttyACM0" \ 
  --cproject  test328p

If you wish to use CMake instead, you can use the --cmake flag:

avrman init -m:atmega328p -f:16000000 -p:"arduino -b 115200 -P /dev/ttyACM0" \ 
  --cproject --cmake  test328p

Device can also be used for c projects:

avrman init --device:uno --cproject test_arduino

But port discovery is only supported for make ones.

Compile

The compile subcommand can be used for quick, one-off checks, when you do not want to generate a whole project and take care of everything.

Let's say you have a simple nim program save into example.nim. Then to quickly compile it, you can use avrman compile example.nim.

This is useful if you want to quickly produce a hex/elf and check its content to compare code being generated.

Device

To get information about connected devices (e.g. programmers, arduino boards), the following command can be used:

avrman device uno
avrman device --list # to show the full list of supported devices

License

This application is licensed under the BSD 3-Clause "New" or "Revised" License.