GithubHelp home page GithubHelp logo

roboy / vidornina-esp32 Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 104.08 MB

Template to use Vidor 4000k with clean fpga and AVALON Bridge to Nina W-10*

Verilog 4.79% Tcl 0.64% SystemVerilog 2.43% Stata 0.02% HTML 0.15% VHDL 0.04% Makefile 65.63% C 25.04% CMake 0.01% C++ 0.76% Java 0.01% Coq 0.49%
vidor arduino-mkr-vidor-4000 vidor4k vidor4000 nina-w10 esp32-nina esp-idf roboy quartus

vidornina-esp32's Introduction

VidorNina-ESP32

Template to use Vidor 4000k with clean fpga and AVALON Bridge to Nina W-10*

NOTE FOR Sausi .... TODO: REMOVE MQTT

The aim of this project is to use the power of the nina (esp32) with an clean Cyclon10.

Required software

  • Quartus 18.1 light (could also work with other Quartus versions >= 17.0 )
  • espressif toolchain

Quartus setup

the following enviroment vars have to be set (could be added to ~/.profile)

export QSYS_ROOTDIR=~/intelFPGA_lite/18.1/quartus/sopc_builder/bin
export QUARTUS_ROOTDIR=~/intelFPGA_lite/18.1/quartus/

Espressif setup

the following enviroment vars have to be set (could be added to ~/.profile)

export IDF_PATH=~/esp/esp-idf
export PATH="$IDF_PATH/tools:$PATH"
export PATH=$PATH:$HOME/esp/xtensa-esp32-elf/bin

HOW TO COMPILE

!!! UPDATE ... when compiling the project quartus already generates and copies the *.tff + app.h file to software/vidorSAM

Gen FPGA *.ttf File (obsolet)

Open the Quartus Project
Open the Quartus project

If you only want to compile it without creating sim data doubleclick compile_quartus.png

Converter to *.ttf >> open the "output_file.cof" file
compile_quartus.png

! AND DON't FORGET TO PRESS GENERATE

Gen app.h Arduino lib (obsolet)

Open a Terminal change in to the project folder and

cd software/vidorSAM
java ReverseByte outputfile.ttf app.h 

the java script was provided by a private person that has some nice intro to FPGA development on the Vidor https://systemes-embarques.fr/wp/telechargement/ the script basicly just inverts the bitstream, because Quartus generats it the wronge way around

Programm the FPGA and SAM core

just open the Arduino IDE and Flash programm the vidorSAM.ino onto the vidor

Compile/Programm Nina-Esp32

This part is planed to be simplified in the future, to just add the bitstream to the vidorSAM.ino Project like the FPGA bitstream. But for now a few steps have to be taken to programm it.

Hardware setup

Whats needed

  • usb to serial converter
  • breakoutboard (just needed for the two buttons, this could also be done via two resistors and two wires)

NOTE FOR Sausi .... TODO: add Pictures

Compile the esp32 code

Open a Terminal change in to the project folder and

cd software/nina
make flash

CODE explanation

FPGA to NINA

The FPGA code originates from https://github.com/vidor-libraries/VidorFPGA which is the official Arduino Repo

To programm NINA the UART pins have to be tunneled through the fpga to the vidor pinout. To do that add the HDL code

//=====nina esp32 programm interface===============
//DEF
wire iRx_header,iCts_header,iDtr_header;
wire oTx_header;
wire iTx_esp;
wire oRx_esp,oCts_esp,oDtr_esp;
wire iRESET_button,iBOOT_button;

//PIN - MAP
assign {iRESET_button,iBOOT_button} = {bMKR_AREF,bMKR_A[0]};
assign {iTx_esp,iRx_header,iCts_header,iDtr_header} = {iWM_TX,bMKR_D[13:11]};
assign {bMKR_D[14],oWM_RX,bWM_PIO27,oWM_RESET} = {oTx_header,oRx_esp,oCts_esp,oDtr_esp};

//LOGIC
assign oTx_header = iTx_esp;
assign oRx_esp   = iRx_header;
assign oCts_esp   = iBOOT_button;//(iBOOT_button == 1) ? iCts_header : 1'b0;
assign oDtr_esp   = iRESET_button;//(iRESET_button == 1) ? iDtr_header : 1'b0;
//=================================================

SPI AVALON bridge between FPGA and NINA

This one was a bit tricky to implement, first of all the payload convert code was taken from the official IP CORE ("SPI Slave to Avalon Master Bridge Intel") that can be found in "~/intelFPGA_lite/18.1/ip/altera/sopc_builder_ip/altera_avalon_spislave_to_avalonmm_bridge/Drivers/"

workingNinaSPi

AVALON Explained

TODO: finish docu

after adjusting it to the needs of the esp32,

mySPI.fpga_write(0x40000, addr_offset, data);
uint32_t foo = mySPI.fpga_read(0x40000, addr_offset);

vidornina-esp32's People

Contributors

sausy avatar

Stargazers

 avatar  avatar

Watchers

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