CPU pins used in WiFiNINA example

It seems impossible to have the FPGA part code to use in order to include the
WiFiNINA into my FPGA projects.

Well, why don't try mayself?

Here the WiFININA example works, so,
first info needed: what pins the CPU use to connect the NINA through the FPGA and what
is their direction?
I see it uses the SPI, MISO/MOSI/CLK, but I suspect there are other pins.

Thanks.
F.

Hi Famo,

Not sure if you have seen the schematic already, but I've made a listing of all the pins involved: Imgur: The magic of the Internet. All pins for NINA control go directly to the FPGA.

Commands are sent to the NINA module over SPI. With the IP from Arduino on the FPGA (VidorPeripherals), the CPU and the FPGA can communicate via an RPC protocol. The CPU instructs the FPGA to do SPI with NINA. You can see this on GitHub.

There might be a way to just route the connections in the FPGA through to the CPU so it can use SPI directly, but you will have to modify the WifiNINA library. I've confirmed that the pins used for SPI by the CPU are also connected to the FPGA. The assignments are PA19 (MISO) => C16, PA17 (SCK) => F15, PA16 (MOSI) => F16.

Otherwise, you can try to include the VidorPerpiherals in your final bitstream, I haven't seen any pages on how to do this yet though.

Edit: pins from pin assignment in default FPGA project:

# NINA interface
set_location_assignment PIN_J13 -to WM_PIO32
set_location_assignment PIN_T11 -to WM_PIO1
set_location_assignment PIN_R10 -to WM_PIO2
set_location_assignment PIN_P11 -to WM_PIO3
set_location_assignment PIN_R11 -to WM_PIO4
set_location_assignment PIN_N6  -to WM_PIO5
set_location_assignment PIN_P6  -to WM_PIO7
set_location_assignment PIN_N5  -to WM_PIO8
set_location_assignment PIN_T5  -to WM_PIO18
set_location_assignment PIN_R6 -to WM_PIO21
set_location_assignment PIN_R5 -to WM_PIO20
set_location_assignment PIN_N9  -to WM_PIO27
set_location_assignment PIN_N11 -to WM_PIO28
set_location_assignment PIN_T10 -to WM_PIO29
set_location_assignment PIN_T4 -to WM_PIO31
set_location_assignment PIN_M6  -to WM_PIO34
set_location_assignment PIN_R4 -to WM_PIO35
set_instance_assignment -name IO_STANDARD "2.5 V" -to WM_PIO36
set_location_assignment PIN_N1 -to WM_PIO36
set_location_assignment PIN_E15 -to WM_TX
set_location_assignment PIN_T6  -to WM_RX
# Aliases for WM_PIO20 WM_PIO21 respectively
# set_location_assignment PIN_R5  -to WM_RTS
# set_location_assignment PIN_R6  -to WM_CTS
set_instance_assignment -name IO_STANDARD "2.5 V" -to WM_RESET
set_location_assignment PIN_R1  -to WM_RESET

Here's the pins used by NINA for SPI.

Puirsame,
thanks for the material, I'll look deeply into it.
In the while,
do you have the complete NINA manual including commands and SPI protocol?
Maybe it will be more easy to develop myself the communication ... buuuh!

The Arduino WIFI library communicates over SPI with the firmware flashed onto the NINA. The firmware can be anything, even embedded linux, or another communication protocol like AT commands which I saw somebody did with MKR wifi.

If you have an FPGA SPI library/IP block, you could interface with the Arduino NINA firmware directly instead of using the WIFI library on the microcontroller by copying what the SPI drivers do. I think it would be a lot of work though.

mmm ...
Is the program resident in a non-voltatile way on the NINA after I use the first time
the demo program?
If yes, I MUST communicate with it, isn't it?

Is there a program to flash in NINA which implements a UART-to-WiFi bridge?

In another application (several years ago) I've employed a USR-C322 ready to be used
through its UART port.
For my purpose it is more than enough, for the moment.

Well, I'll try to navigate in the docs/infos you've provided.

Thanks again.

famo:
mmm ...
Is the program resident in a non-voltatile way on the NINA after I use the first time
the demo program?
If yes, I MUST communicate with it, isn't it?

Yes, esptool is used to flash firmware onto the NINA that is loaded whenever the board is powered. It's an ESP32 but on the Vidor.

famo:
Is there a program to flash in NINA which implements a UART-to-WiFi bridge?

In another application (several years ago) I've employed a USR-C322 ready to be used
through its UART port.
For my purpose it is more than enough, for the moment.

Well, I'll try to navigate in the docs/infos you've provided.

Thanks again.

Not sure, I'm still pretty new to embedded stuff other than FPGAs so haven't had a chance to use UART. Hope this helped though!

I'm more and more "pretty new" on esp32 and esptool.

I would like to focus my efforts in developping my application but it seems I have to reinvent the wheel
trying to make it not so squared.

I've already developed the Verilog code for my application, also implementing
a VGA interface with 80x60 chars RAM and ROM for chars pixel mapping.
(my topic about the Vidor4000 clock jitter)

6 real-time counters are displayed on a monitor, strings and numbers can be written anywhere
with a simple command, but the biggest effort (for me) is to ... reinvent the
way to use WiFiNINA because there isn't a tutorial to allow anyone to put
NINA in its application.

My initial topic on the forum was "A clear and simple flow" that produced, thanks to Philippe,
a clear and simple flow to use the FPGA for personal projects.

:o

famo:
I'm more and more "pretty new" on esp32 and esptool.

I would like to focus my efforts in developping my application but it seems I have to reinvent the wheel
trying to make it not so squared.

From what I understand, the idea of the Vidor was that you could use pre-built blocks on the FPGA via an Arduino sketch and they would do the heavy lifting for you. This is all well and good, but if we want to write our own HDL code, I don't know how to colocate it on the board with the pre-built blocks. There must be a way, but idk how you would handle conflicting pin usage.

famo:
I've already developed the Verilog code for my application, also implementing
a VGA interface with 80x60 chars RAM and ROM for chars pixel mapping.
(my topic about the Vidor4000 clock jitter)

6 real-time counters are displayed on a monitor, strings and numbers can be written anywhere
with a simple command, but the biggest effort (for me) is to ... reinvent the
way to use WiFiNINA because there isn't a tutorial to allow anyone to put
NINA in its application.

That's pretty cool. Are you thinking of eventually using the micro-HDMI port?

famo:
My initial topic on the forum was "A clear and simple flow" that produced, thanks to Philippe,
a clear and simple flow to use the FPGA for personal projects.

Thank you for posting that. I don't have experience with Xilinx or Lattice, and I didn't want a bulky Altera board, so seeing the Vidor being programmed with Quartus led me to purchase it.

"That's pretty cool. Are you thinking of eventually using the micro-HDMI port?"

No, I have and old VGA monitor and VGA controller is easy to implement, just a couple
of counters.
I have no idea on HDMI standard and anyway I don't know how to test it at least here at home.

"Thank you for posting that. I don't have experience with Xilinx or Lattice, and I didn't want a bulky Altera board, so seeing the Vidor being programmed with Quartus led me to purchase it."

Your right, Vidor is the right choice.
TinyFPGA-BX seems to be interesting, I've evaluated it including my project (counters and VGA)
and it works fine.
But ... but ... when I tried to include a USB interface the compatibility and "open" keywords
result to be in conflict.
The yosys/arachne tools are not reliable from the timing-driven compillation point of view and
a working design becomes not working if you add just a register.
More, if you try to port the Verilog code on the Lattice iceCube tool, the code itself
results to be not compatible with Lattice contraints.
After a lot of efforts, remains a lot of warnings about ignored init values and the USB interface
continue to fail to work.
Don't ask to me to decipher the project. I've posted my complaints on the TinyFPGA forum
but no answer.

What to say?
Beatifull "open" products, cross the fingers about the results. Good to play.
Continue to use the FTDI USB-UART chip.

famo:
"That's pretty cool. Are you thinking of eventually using the micro-HDMI port?"

No, I have and old VGA monitor and VGA controller is easy to implement, just a couple
of counters.
I have no idea on HDMI standard and anyway I don't know how to test it at least here at home.

If you are interested, I have implemented HDMI and made a demo of HDMI on the Vidor.

famo:
Your right, Vidor is the right choice.
TinyFPGA-BX seems to be interesting, I've evaluated it including my project (counters and VGA)
and it works fine.
But ... but ... when I tried to include a USB interface the compatibility and "open" keywords
result to be in conflict.
The yosys/arachne tools are not reliable from the timing-driven compillation point of view and
a working design becomes not working if you add just a register.
More, if you try to port the Verilog code on the Lattice iceCube tool, the code itself
results to be not compatible with Lattice contraints.
After a lot of efforts, remains a lot of warnings about ignored init values and the USB interface
continue to fail to work.
Don't ask to me to decipher the project. I've posted my complaints on the TinyFPGA forum
but no answer.

What to say?
Beatifull "open" products, cross the fingers about the results. Good to play.
Continue to use the FTDI USB-UART chip.

I wanted to wait and buy the TinyFPGA-EX, but lost hope after seeing the last update was posted March 2019.

"From what I understand, the idea of the Vidor was that you could use pre-built blocks on the FPGA via an Arduino sketch and they would do the heavy lifting for you. This is all well and good, but if we want to write our own HDL code, I don't know how to colocate it on the board with the pre-built blocks. There must be a way, but idk how you would handle conflicting pin usage."

I don't know deeply the intention of inventors and what the people around the world
is doing with Vidor.
I don't know anything about the business.

What I can imagine is that the Vidor users fall into the following categories:

1- A new toy is born, buy it, try something downloading all the examples available, then
abandon it.

2- This is what I was waiting for, I can give the start to my ideas on video streaming etc.
I use Vidor to make a real final product to make business.

3- What a incredible CPU+FPGA+WiFi in a single little board, a lot of my projects can fit in
that board; I begin to use it in all projects I can, but I want to focus on my designs,
otherwise I continue to use several separated pieces ready to use as I did so far --- it's me ---

4- the outstanding hackers, non secrets for them, the hacking is the fun, it is the purpose

Well, 4 is out of the following reasoning.

If 2 >> 1+3 I cannot see the reason why the Vidor inventors cannot give me the single IP core
I need, because they have already developed it. I can pay for it ... but less than the Vidor price
please.

If 1 >> 2+3 ... okay, I understand why the inventors don't reply to my requests.

If 3 >> 1+2 ... go to the first "if"

Surely I'm wrong because I don't know anything about business and purpose of the Vidor
creation, but it seems to me the three "if" are legitimate.

What do you think about?

It would be unfortunate if #1 is common. I am #3, but because I went shopping for such a board after breaking my old one. Before the Vidor, the other Arduino product I used was the UNO for some class projects. Almost everything is documented, any project idea you look up for it will probably exist.

I think there is some "network effect" when there are enough people using something, all the common questions are answered. Most Arduino users are familiar with microcontrollers and haven't written HDL before. So I think not all the questions about the Vidor's FPGA haven't been asked/answered.

"for some class projects"

My project with counters, VGA, ecc. on Vidor is for educational purpose too!

It is a cosmic ray detector using up to 4 plastic scintillator detectors each one read by SiPM
(Silicon Photomultiplier).
Unfortunately the Coronavirus has interrupted my activity with schools.

A WiFi interface will allow to put the detector on the web to monitor its activity,
to show it to friends, collect data for statistics and so on, a good poit for students.

But ... if (NINA == 1) ...

famo:
“for some class projects”

My project with counters, VGA, ecc. on Vidor is for educational purpose too!

It is a cosmic ray detector using up to 4 plastic scintillator detectors each one read by SiPM
(Silicon Photomultiplier).

Wow, I have never heard of a SiPM. That is an interesting project.

famo:
Unfortunately the Coronavirus has interrupted my activity with schools.

Same for me, all my classes are online now.

famo:
A WiFi interface will allow to put the detector on the web to monitor its activity,
to show it to friends, collect data for statistics and so on, a good poit for students.

But … if (NINA == 1) …

Let me know if you make some progress with sending SPI commands, I will also need to do this in the future.

"Let me know if you make some progress with sending SPI commands, I will also need to do this in the future."

I can answer immediately: it is too complicate to switch my activity on it, if someone in the forum would like to contribute he is very welcome!

Give a look here: http://physicsopenlab.org/category/english-posts/