Giter VIP home page Giter VIP logo

nuvoton8051rpiprogrammer's Introduction

nu8051 utility

This project contains utility for Raspberry Pi (and other Linux capable SBCs) that allows you to program Nuvoton 8051 serie microcontrollers attached to Raspberry Pi's GPIO. Utility does not depends on any other external part. At Release page it is avalaible precompiled as a single exacutable binary for armv7l platform (standard 32bit Raspbian) and also for the aarch64 which is used on more modern OSs like 64bit Ubuntu or Alpine Linux.

Installation

On 32bit OS like Raspbian run the following commands:

wget https://github.com/misaz/Nuvoton8051RpiProgrammer/releases/download/1.0/nu8051_armv7l
sudo cp nu8051_armv7l /usr/bin/nu8051
sudo chmod +x /usr/bin/nu8051

On 64bit OS like Ubuntu or Alpine Linux run the following commands:

wget https://github.com/misaz/Nuvoton8051RpiProgrammer/releases/download/1.0/nu8051_aarch64
sudo cp nu8051_aarch64 /usr/bin/nu8051
sudo chmod +x /usr/bin/nu8051

Pinout

Connect your Nuvoton to the Raspberry Pi using following connections.

โš ๏ธ You MUST disconnect any 5V source from your Nuvoton otherwise you will burn your Raspberry Pi. If you need to power your nuvoton with 5V while programming you must use voltage level converter on RST, ICPCLK and ICPDAT line and diconnect VCC line. Common GND must remain. Note that some pasive level converters do not support signals as fast as 1MHz which is used when programming device.

Nuvoton's    GND <------> GND   (pin #9) on Raspberry Pi
Nuvoton's    VCC <------> 3V    (pin #1) on Raspberry Pi
Nuvoton's    RST <------> GPIO2 (pin #3) on Raspberry Pi
Nuvoton's ICPCLK <------> GPIO3 (pin #5) on Raspberry Pi
Nuvoton's ICPDAT <------> GPIO4 (pin #7) on Raspberry Pi

Usage

Read device info

To detect that device is connected properly try reading some device informations. Following command reads CID of connected device. If the result is ff check your wiring and check that Nuvoton is powered.

sudo nu8051 dinfo cid

Program using BIN file

If you have your firmare in binary form you can flash it using following command. firmware.bin is name of the binary file that will be flashed to the device.

sudo nu8051 ld write firmware.bin

Program using HEX file

If you have your firmware in Intel HEX format you need to convert it to BIN first. This could be done using following commands that expectes that your HEX file is firmware.hex.

objcopy -I ihex firmware.hex -O binary firmware.bin
sudo nu8051 ld write firmware.bin

More examples

Utility support another commands. Use help command to print help.

nu8051 help
nu8051 ld help
nu8051 dinfo help
nu8051 cbytes help

Disclaimer

Program is provided without any warranty. Use it on your own risk.

Building from sources

You can build program yourself. To compile and install output binary to /usr/bin folder run following.

git clone https://github.com/misaz/Nuvoton8051RpiProgrammer
cd Nuvoton8051RpiProgrammer
make
make install

Under the hoods

It is userspace wrapper for my Nuvoton 8051 Serie MCU Programming library library. Library is generic and program uses platform specific implementation accesing GPIO features using /sys/class/gpio Linux virtual file system.

If you need to automate flashing chips you can write own program based on that library directly.

nuvoton8051rpiprogrammer's People

Contributors

misaz avatar

Watchers

 avatar

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.