Giter Site home page Giter Site logo

darkberg / buildroot_ext_lichee_rv Goto Github PK

View Code? Open in Web Editor NEW

This project forked from grant-olson/buildroot_ext_lichee_rv

0.0 0.0 0.0 33 KB

Buildroot support for RISC-V Lichee RV hardware

License: GNU General Public License v2.0

Shell 57.03% Makefile 42.97%

buildroot_ext_lichee_rv's Introduction

Buildroot Externals for Lichee RV Dock

This adds support for the RISC-V based Lichee RV products to buildroot to allow you to easily build new systems. Buildroot has support for the main Nezha board, but it does not have built in support for the additional hardware on these boards. This package attempts to add support for all hardware.

Building an image

  1. Download this package and the buildroot source in peer directories:

    +-- src
      |- buildroot
      |- buildroot_ext_lichee_rv
    
  2. Patch buildroot until I get the updates to the bootloader accepted upstream or figure out how to patch it via the extensions:

    grant@NUC:~/src$ cd buildroot
    grant@NUC:~/src/buildroot$ patch -d . -p1 < ../buildroot_ext_lichee_rv/0001-fix-sun20i-d1-spl-in-buildroot.patch 
    patching file boot/sun20i-d1-spl/sun20i-d1-spl.hash
    patching file boot/sun20i-d1-spl/sun20i-d1-spl.mk
    grant@NUC:~/src/buildroot$ git diff
    diff --git a/boot/sun20i-d1-spl/sun20i-d1-spl.hash b/boot/sun20i-d1-spl/sun20i-d1-spl.hash
    deleted file mode 100644
    index 6ca60e5278..0000000000
    --- a/boot/sun20i-d1-spl/sun20i-d1-spl.hash
    +++ /dev/null
    @@ -1,2 +0,0 @@
    -# Locally computed
    -sha256  69063601239a7254fb72e486b138d88a6f2b5c645b24cdfe9792123f975d4a8f  sun20i-d1-spl-771192d0b3737798d7feca87263c8fa74a449787.tar.gz
    diff --git a/boot/sun20i-d1-spl/sun20i-d1-spl.mk b/boot/sun20i-d1-spl/sun20i-d1-spl.mk
    index 2462ce2322..1f1cd99b2d 100644
    --- a/boot/sun20i-d1-spl/sun20i-d1-spl.mk
    +++ b/boot/sun20i-d1-spl/sun20i-d1-spl.mk
    @@ -5,7 +5,7 @@
     ################################################################################
     
     # Commit on the 'mainline' branch
    -SUN20I_D1_SPL_VERSION = 771192d0b3737798d7feca87263c8fa74a449787
    +SUN20I_D1_SPL_VERSION = 525883d3721f4c4d78b498e780b44e85d0676abf
     SUN20I_D1_SPL_SITE = $(call github,smaeul,sun20i_d1_spl,$(SUN20I_D1_SPL_VERSION))
     SUN20I_D1_SPL_INSTALL_TARGET = NO
     SUN20I_D1_SPL_INSTALL_IMAGES = YES
    grant@NUC:~/src/buildroot$ 
    
    
  3. Enter the buildroot directory, enable the external package, and grab a lichee rv configuration.

    For RV DOCK:

    grant@NUC:~/src/buildroot2$ make BR2_EXTERNAL=~/src/buildroot_ext_lichee_rv licheedock_defconfig
    

    For RV PANEL:

    grant@NUC:~/src/buildroot2$ make BR2_EXTERNAL=~/src/buildroot_ext_lichee_rv lichee86panel_defconfig
    
  4. You will probably want to do some minimal configuration. For example adding dropbear for ssh access and nano so you don't need to use vi to edit files.

    make menuconfig

  5. Build the system.

    make

  6. Grab the image in output/images/sdcard.img and deploy it.

Disabling external package

  1. If you want to remove the external package run make BR2_EXTERNAL= menuconfig

Connecting with Serial Console

You will want to have access to a serial console for initial configuration. Get a cheap UART adapter that support 3.3 Volt logic levels. I usually buy one that has a jumper to switch between 5 and 3.3 Volts.

    <USB A CONNECTOR>

                  +------+
		  | .  . |
		  | .  . |
		  | .  . | - GROUND
		  | .  . | - TX
		  | .  . | - RX
		  | .  . |
		  | .  . |
		  | .  . |
		  | .  . |
		  | .  . |
		  | .  . |
		  | .  . |
		  | .  . |
		  | .  . |
		  | .  . |
		  | .  . |
		  | .  . |
		  | .  . |
		  | .  . |
		  | .  . |
                  +------+
		  

    <HDMI CONNECTOR>

Remember that the TX on the board should be connected to the RX on the UART adapter, and the RX on the board should connect to the TX on the UART adapter!

Setting up wifi credentials

  1. Connect to serial console

  2. Generate a wpa configuration:

    # wpa_passphrase "MyNetwork" foobar88
    network={
            ssid="MyNetwork"
            #psk="foobar88"
            psk=67224fb26d73f404f3c12d2576bc9cb220d068318f9a44b97ad548f15d71058c
    }
    
    
  3. Replace the network section of /etc/wpa_supplicant.conf on the Lichee RV.

    # cat /etc/wpa_supplicant.conf 
    ctrl_interface=/var/run/wpa_supplicant
    ap_scan=1
    
    network={
            ssid="MyNetwork"
            #psk="foobar88"
            psk=67224fb26d73f404f3c12d2576bc9cb220d068318f9a44b97ad548f15d71058c
    }
    
  4. Reboot: /sbin/reboot

  5. get the ip:

    # ifconfig
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    
    wlan0     Link encap:Ethernet  HWaddr 2C:05:47:35:8D:E1  
              inet addr:192.168.1.109  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::2e05:47ff:fe35:8de1/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:28 errors:0 dropped:4 overruns:0 frame:0
              TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:5422 (5.2 KiB)  TX bytes:1904 (1.8 KiB)
    
    
    

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.