GithubHelp home page GithubHelp logo

majbthrd / nuc121usb Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 204 KB

NUC121/NUC125 USB device sample code (gcc/clang-friendly)

C 99.67% Makefile 0.12% C++ 0.21%
nuvoton nuc121 nuc125 nutiny-nuc121s nutiny-nuc125s usb usb-devices usb-hid usb-cdc

nuc121usb's Introduction

sample Nuvoton NUC121/NUC125 USB device code

The Nuvoton NUC121 and NUC125 are Cortex-M0 based USB microcontrollers capable of crystal-less USB operation. They could be compared to the Atmel/Microchip SAMD11, but have more memory than that device.

At present, source code is provided for these sample devices:

  • USB CDC to UART bridge
  • USB HID mouse emulator

To their credit, Nuvoton already does provide sample code in their NUC121_Series_BSP_CMSIS download. However, that code is focused on the IAR and Keil toolchains.

This code, in contrast, is written for gcc and clang.

It uses a new USB device stack written specifically for the NUC121/NUC125 and uses an API modeled on vcp. vcp was written for the SAMD11 / SAMD21. Since the USB stack APIs are nearly the same, code can be more easily ported between the ataradov vcp USB stack and this NUC121usb one (as well as NUC126usb). Another advantage of this approach is that the code size is a little more efficient than the Nuvoton reference code.

Alternatives

I've also contributed a NUC121/NUC125/NUC126 driver to TinyUSB. Since TinyUSB runs on many different microcontrollers, code originally written for one device can often be readily adapted to many others.

Build Requirements

One approach is to use Rowley Crossworks for ARM to compile this code. It is not free software, but has been my favorite go-to ARM development tool for a decade and counting. Rowley does not officially support the Nuvoton NUC121/NUC125, but you can download an open-source CPU support package for the NUC121/NUC125.

OR

I've modified the build environment provided by mcu-starter-projects to work with the NUC121. With this approach, the code can be built using only open-source software. In Ubuntu-derived distributions, this is likely achieved with as little as:

sudo apt-get install gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential

nuc121usb's People

Contributors

majbthrd avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.