Coder Social home page Coder Social logo

custom_mangopi's Introduction

MangoPi MQ Pro Support

CircleCI Hex version

This is the base Nerves System configuration for the MangoPi MQ Pro.

This is a work in progress. It may change in backwards incompatible ways and the documentation might be lacking.

To do:

  • Bring up WiFi
  • Verify Blue PWM LED
  • [?] Fix MicroSD flakiness on boot (seems much better now?)
  • Verify USB host-only port (works with USB Flash drive)
  • Fix USB gadget mode on OTG port
  • Verify SPI (spidev1.0 and spidev1.1)
  • Verify I2C
  • Verify all GPIO work (GPIO inputs seem to work)
  • Verify HW watchdog
  • Check that TARGET_GCC_FLAGS are right
  • Update Linux kernel to 5.18
  • Implement A/B firmware updates work
  • Use SID for serial number
  • Reduce prints and shorten boot time
  • Verify HDMI
  • Verify camera

MangoPi MQ Pro
Image credit

Feature Description
CPU 1 GHz 64 bit RISC-V
Memory 512 MB or 1 GB DRAM
Storage MicroSD
Linux kernel 5.19 w/ patches
IEx terminal UART ttyS0
GPIO, I2C, SPI Yes - Elixir Circuits
Display Yes, but not supported yet
ADC No
PWM Yes, but no Elixir support
UART ttyS0
Camera Yes, but not supported yet
Ethernet No
WiFi Onboard WiFi
RTC No
HW Watchdog Yes

Using

The most common way of using this Nerves System is create a project with mix nerves.new and add mangopi references where needed and in a similar way to the default systems like bbb, etc. Then export MIX_TARGET=mangopi. See the Getting started guide for more information.

If you need custom modifications to this system for your device, clone this repository and update as described in Making custom systems.

Example use

This example assumes some familiarity with Nerves. To use this system, you'll need OTP 25. Follow the Nerves installation instructions for additional system dependencies.

Creating a new hello world application:

mix nerves.new hello_mango
cd hello_mango

Open up your mix.exs and add :mangopi_mq_pro to the @all_targets list at the top. It's ok to delete targets that you don't plan on using.

Then add the :nerves_system_mango_mq_pro dependency to the deps function:

    {:nerves_system_mangopi_mq_pro, "~> 0.1", runtime: false, targets: :mangopi_mq_pro},

This will load the latest released version. To use the latest code on the main branch here, add the following line:

    {:nerves_system_mangopi_mq_pro, runtime: false, targets: :mangopi_mq_pro, nerves: [compile: true], git: "https://github.com/fhunleth/nerves_system_mangopi_mq_pro", branch: "main"}

To build and write to a MicroSD card, run:

export MIX_TARGET=mangopi_mq_pro
mix deps.get
mix firmware
mix burn

Console access

The console is configured to output to the UART on pins 8 and 10 on the 40-pin GPIO connector. This is just like the Raspberry Pi. A 3.3V FTDI cable is needed to access the output.

Networking

The board has two network interfaces, a WiFi module and a virtual Ethernet on the USB C connector marked "OTG". If virtual Ethernet isn't working for you, try a different USB cable. You're welcome.

GPIO

The following table is a mapping between the logical GPIO numbers used in software (sysfs, Circuits.GPIO), and the pin numbers on the 20x2 Raspberry Pi header. For example, to control pin 11 you would open a connection to GPIO 117:

{:ok, pin} = Circuits.GPIO.open(117, :output)
GPIO Pin Pin GPIO
1 2
205 3 4
204 5 6
39 7 8 40
9 10 41
117 11 12 37
118 13 14
32 15 16 33
17 18 110
19 20
21 22 65
23 24
25 26 111
145 27 28 144
42 29 30
43 31 32 64
44 33 34
38 35 36 34
113 37 38 35
39 40 36

Schematics and datasheets

Thanks

The most helpful Allwinner D1 information comes from linux-sunxi.org/Allwinner_Nezha. All of the work here wouldn't have been possible with out it. Thanks especially to smaeul's Allwinner D1 Linux fork

Here are more useful links:

Image credit: This image is from mangopi.cc.

custom_mangopi's People

Contributors

fhunleth avatar amclain avatar spunkedy avatar

Stargazers

Connor Rigby avatar

Watchers

Joshua Miertschin 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.