|
1 |
| -# N2CMU |
| 1 | +# N2CMU (Neural Network Coprocessing Microcontroller Unit) |
2 | 2 |
|
3 |
| -Neural Network Coprocessing Microcontroller Unit (via UART) for STM32F103C8T6 Bluepill Devboard written in TinyGo. |
| 3 | +N2CMU is a project aimed at implementing a neural network coprocessing microcontroller unit (MCU) for STM32F103C8T6 Bluepill development board using the TinyGo (Go programming language for embedded systems). This MCU enables offloading feedforward neural network computations to a dedicated hardware unit, allowing for efficient and low-power feedforward neural network training and inference on small hardware embedded systems. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- **Neural Network Coprocessing**: N2CMU allows offloading feedforward neural network computations to a dedicated coprocessing unit, freeing up the main microcontroller for other tasks. |
| 8 | +- **UART Communication**: Communication with N2CMU is facilitated via UART, enabling external devices to control and interact with the coprocessing unit. |
| 9 | +- **Flexible Configuration**: N2CMU supports dynamic configuration of neural network parameters such as input, hidden, and output neuron counts, as well as weights, biases, and gradients. |
| 10 | +- **Training and Inference**: The coprocessing unit supports both training and inference modes, allowing for the optimization of neural network models directly on the microcontroller. |
| 11 | + |
| 12 | +## Getting Started |
| 13 | + |
| 14 | +### Prerequisites |
| 15 | + |
| 16 | +To run N2CMU on your STM32F103C8T6 Bluepill development board, you'll need: |
| 17 | + |
| 18 | +1. STM32F103C8T6 Bluepill development board |
| 19 | +2. ST-Link v2 |
| 20 | +3. [TinyGo compiler](https://tinygo.org/getting-started/install/) |
| 21 | +4. [Qrepo](https://github.com/nthnn/Qrepo) package manager |
| 22 | + |
| 23 | +### Installation |
| 24 | + |
| 25 | +1. Clone the N2CMU repository to your local machine: |
| 26 | + |
| 27 | +```bash |
| 28 | +git clone https://github.com/nthnn/n2cmu.git |
| 29 | +``` |
| 30 | + |
| 31 | +2. Connect your STM32F103C8T6 Bluepill development board to your computer using a USB to UART converter. |
| 32 | + |
| 33 | +3. Flash the code to your STM32F103C8T6 Bluepill development board using your ST-Link v2: |
| 34 | + |
| 35 | +```bash |
| 36 | +cd n2cmu |
| 37 | +qrepo run flash |
| 38 | +``` |
| 39 | + |
| 40 | +4. You're now ready to interact with N2CMU and start utilizing its neural network coprocessing capabilities. Follow the example schematic below for Arduino UNO (but other boards will do). |
| 41 | + |
| 42 | +<p align="center"> |
| 43 | + <img alt="N2CMU Example Schematic" src="assets/n2cmu-schematics.png" /> |
| 44 | +</p> |
| 45 | + |
| 46 | +5. Alternatively, you can manufacture your own Arduino UNO shield for N2CMU. Here's the Gerber file and PDF schematic file for N2CMU shield: |
| 47 | + |
| 48 | + - [Arduino N2CMU shield PDF schematic](pcb/Arduino-N2CMU-Shield-Schematic.pdf) |
| 49 | + - [Arduino N2CMU Gerber file](pcb/Arduino-N2CMU-Shield-Gerber.zip) |
| 50 | + |
| 51 | +6. See [n2cmu-arduino](https://github.com/nthnn/n2cmu-arduino) library for interacting with Arduino-powered boards. |
| 52 | + |
| 53 | +## Contributing |
| 54 | + |
| 55 | +Contributions to N2CMU are highly encouraged and appreciated! To contribute new features, bug fixes, or enhancements, please adhere to the following guidelines: |
| 56 | + |
| 57 | +1. Fork the N2CMU repository. |
| 58 | +2. Create a new branch for your changes: `git checkout -b feature-name`. |
| 59 | +3. Implement your changes and commit them: `git commit -m "Added new feature"`. |
| 60 | +4. Push your changes to the branch: `git push origin feature-name`. |
| 61 | +5. Submit a pull request for review and inclusion. |
| 62 | + |
| 63 | +## License |
| 64 | + |
| 65 | +Copyright (c) 2024 Nathanne Isip |
| 66 | + |
| 67 | +N2CMU is distributed under the GNU General Public License v3.0. For further details, refer to the [LICENSE](LICENSE) file. |
| 68 | + |
| 69 | +``` |
| 70 | +This program is free software: you can redistribute it and/or modify |
| 71 | +it under the terms of the GNU General Public License as published by |
| 72 | +the Free Software Foundation, version 3. |
| 73 | +
|
| 74 | +This program is distributed in the hope that it will be useful, but |
| 75 | +WITHOUT ANY WARRANTY; without even the implied warranty of |
| 76 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 77 | +General Public License for more details. |
| 78 | +
|
| 79 | +You should have received a copy of the GNU General Public License |
| 80 | +along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 81 | +``` |
0 commit comments