Giter VIP home page Giter VIP logo

efm8-arduino-programmer's Introduction

efm8-arduino-programmer

Program EFM8 devices using an Arduino Nano.

Thanks to jaromir-sukuba and racerxdl for working on firmware to implement C2 protocol via arduino GPIO. This work largely pulls from them.

Pre-Steps

Currently, it is for Arduino Nano and maps C2D and C2CK to digital pins 2 and 3, respectively.

C2 is a 2-pin protocol. Any arduino should work to implement the protocol via GPIO. Just need to make sure that the correct pins are mapped for your Arduino.

Update Pins

Check the firmware file and change the pins to map to your device if needed.

Arduino Uno support

To use it for Arduino Uno you can just swap from E to D. Just replace all PORTE, DDRE and PINE with PORTD, DDRD and PIND. You can read about Port Registers here: https://www.arduino.cc/en/Reference/PortManipulation

Write firmware to Arduino

Program the firmware to the arduino and connect C2D, C2CK, and GND to your target device.

Setup for flashing EFM8

It is set up in a client/server model to be able to easily support programming multiple targets at the same time.

Requirements

  • You need to have Python (2.7) installed.
  • Then, install some required python modules.
pip install -r requirements.txt

Setup of Server & Client

Server

First you must run the server that will handle communication to the arduino.

python prog_server.py <serial-port> [<serial-port2> ...]

Supply a list of serial ports (you can use more than one Arduino at a time) to handle programming. E.g /dev/USB1 or COM1 or /dev/cu.usbmodem*.

Client

Then you can finally program something using the client script.

python prog_client.py <serial-port> <firmware.hex>

This will connect to the server and tell it to download specified firmware via specified arduino.

Troubleshooting

  • If your server can't start make sure you have port 4040 available
  • If you get python errors make sure you're not running python3
  • Some modules need sudo on some systems

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.