ev5-dev-tools
v1.1.3
Published
CLI tool to scaffold EV5 C SDK projects
Readme
EV5 Dev Tools
EV5 Dev Tools is an npm-based CLI utility that helps you scaffold and manage KAZI-EV5 ANSI C projects. It streamlines your development workflow by providing commands to create, build, and upload projects directly from the command line.
The generated project includes:
- A basic
main.cor chosen program source file. - A preconfigured
.vscode/settings.jsonfor the correct compiler, include paths, and IntelliSense. - Built-in CLI commands to build and upload without relying on PowerShell scripts.
Prerequisites
Required Tools
- Node.js must be installed.
arm-none-eabi-gccandarm-none-eabi-objcopymust be available in yourPATH.
Setup: EV5 SDK
Download Kazi-Scratch from your EV5 hardware provider (Windows
.exeinstaller).- Linux users: May need to extract the
.exeusing Wine or another method.
- Linux users: May need to extract the
Extract the compiler resources:
- Find the
includeRTOSEV5folder under the installation directory (e.g.,C:\Program Files (x86)\Scratch2-KAZI\compiler\...). - Copy it to a safe location, e.g.,
C:\ev5-sdk\includeRTOSEV5.
- Find the
Set up environment variable:
- Create an environment variable named
EV5_SDKthat points to the root SDK directory (e.g.,C:\ev5-sdk). - This allows the CLI to locate headers and linker scripts for builds.
- Create an environment variable named
Ensure
arm-none-eabi-*tools are available globally (can be downloaded from ARM or installed via package managers).Ensure the compiled
.cprogram has access toRTOSEV5object files (typically found inEV5_SDK/includeRTOSEV5/o/).
Setup: Uploading via USB
- Plug in the EV5 device via USB.
- Power on the EV5 and enter Download mode (usually via a button on the brick).
- The device must be mounted and visible with the volume label
EV5.
WiFi Upload is not yet supported.
Optional: Install globally for convenience:
npm install -g ev5-dev-toolsCLI Usage
Create a New Project
To create a new project using the default template:
ev5-dev-tools create my-projectTo use a specific template (e.g., display):
ev5-dev-tools create my-project --template=displayThis pulls templates from the ev5-dev-tools-templates repo.
Build a Program
Compile your program by specifying the name of the .c file (without extension):
ev5-dev-tools build --program=wifi16If --program is omitted, it defaults to main, compiling main.c.
The resulting .bin file will be created in the current directory.
Upload to EV5
Upload the compiled .bin file to an EV5 USB device:
ev5-dev-tools upload --program=wifi16- The tool auto-detects the EV5 USB drive based on the volume label
EV5. - Works on Windows, macOS, and Linux.
- If
--programis omitted, it defaults tomain.
Other Commands
Show version:
ev5-dev-tools --versionShow help:
ev5-dev-tools --helpExample Project Structure
my-project/
├── .vscode/
│ └── c_cpp_properties.json
├── main.c
├── .gitignore
└── (other template files)Notes
Please, consider the following guidance for your development workflow.
Intended Use
Compiling
These commands mimic the ones we originally tested with the Kazi SDK compiler:
.ofile creation:
..\..\compiler\ARM\bin\arm-none-eabi-gcc -I..\..\compiler\includeRTOSEV5 -mcpu=cortex-m3 -mthumb -Os -fsigned-char -w -gdwarf-2 -DF_CPU=72000000UL -std=gnu99 -c main.c -o main.o.elffile creation:
..\..\compiler\ARM\bin\arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -L..\..\compiler\includeRTOSEV5/o -T..\..\compiler\includeRTOSEV5\o\stm32_flash.ld --% -Wl,--gc-sections -Wl,-Map=main.map,-cref main.o -lm -o main.elf.binconversion:
..\..\compiler\ARM\bin\arm-none-eabi-objcopy.exe -O binary main.elf main.binLinux Support
- Full Linux support is planned.
- However, since the build and upload logic is implemented in Node.js, core functionality may already work on Linux systems without modification.
Compiler
The CLI now supports using the officially distributed arm-none-eabi compiler instead of the bundled version from Kazi-Scratch.
Original compiler reference:
arm-none-eabi-gcc:
arm-none-eabi-gcc.exe (GNU Tools for ARM Embedded Processors) 4.8.4 20140526 (release)arm-none-eabi-objcopy:
GNU objcopy (GNU Tools for ARM Embedded Processors) 2.23.2.20140529We installed a nearly identical version from Launchpad GCC ARM Embedded Downloads.
Next Steps
- Add WiFi-based program uploading.
- Finalize full Linux support.
- Test and document compatibility with newer versions of
arm-none-eabi.
Template Repository
Templates are maintained separately:
You can view, extend, or contribute to available templates.
License
MIT
