Use example of Intel University program in Intel Quartus - problem with Board support package? - intel

I want to use a example from the Intel FPGA Monitor Program 18.1 and use it in Quartus 18.1.
It is the video example, which creates a blue box on the HDMI output and writes a littel String with white letters on top of it.
I want to use it in Intel Quartus environment , do some test-outputs on my screen and finally add some more Hardware to the Avalon system. Unfortunately it doesnt work for me as i thought xD:
short file overview:
Project File: DE10_Nano_Computer.qpf
QSYS Konfiguration File: Computer_System.sopcinfo
SRAM File : DE10_Nano_Computer.sof
NIOSII Main: video.c
NIOSII library: address_map_nios2.h
Project includes:
DE10-Nano_Computer_NiosII.pdf
I/O Peripheral | Qsys Core
On-chip memory
character buffer Character Buffer for Video Display
SD Card SD Card Interface
Red LED parallel port Parallel Port
Expansion parallel ports Parallel Port
Slider switch parallel port Parallel Port
Pushbutton parallel port Parallel
Port JTAG port JTAG UART
Interval timer Interval timer
System ID System ID
Peripheral Audio port Audio
Video port Pixel Buffer DMA Controller
Test1: Open FPGA Monitor Program 18.1 - create new project - select video example - sof is downloaded on FPGA - compile & load video.c Result: works HDMI shows test-string
Test2: download .sof to FPGA - Eclipse for Nios - new project simple hello world with bsp -work with .sof-put video.c and address_map_nios2.h into project- use video.c as main, Result: works HDMI shows test-string
Test 3: do the same as Test2 , Result: random pixels in the first ~20 lines
Test 4: reinstall FPGA Monitor Program 18.1 do the same as Test2 Result: works HDMI shows test-string
Test 5: do the same like Test2, doesnt work, do the same like Test4 Result: random pixels in the first ~20 lines
Test 6: copy .elf from my FPGA Monitor Program 18.1 software directory into project folder, run this this elf Result: works HDMI shows test-string
Test 7: change something of the video.c of Test 6, Result: works HDMI shows test-string but without the blue box !
Test 8: do the same like Test2 Result: random pixels in the first ~20 lines
Test 9: Check run configurations : select all combinations of processor and byte stream devices Result: random pixels in the first ~20 lines
Test 10: Switch to FPGA Monitor Program 18.1, compile & Load video.c Result: works HDMI shows test-string
Check: Description in https://home.isr.uc.pt/~jfilipe/files/Final_Project_Simplified_Tutorial.pdf
( they do nearly the same...)
Check: Book EMBEDDED SoPC DESIGN WITH NIOS II PROCESSOR AND VERILOG EXAMPLES : They say: BSP Editor will get the sopcinfo file and support you with your access to the Hardware. Without configuring much
Check: Intel BSP documents : hey say: BSP Editor will get the sopcinfo file and support you with your access to the Hardware. Without configuring much
Check: Intel The NiosĀ® II Processor: Hardware Abstraction Layer in youtube: https://www.youtube.com/watch?v=HF7Low_sUig
I suppose that something is wrong eather with my selected sopcinfo or with the BSP. Maybe you can give me some advice, tell me if you need more information ! :)
Thank you :D
Here are some screenshots of my development environment:
https://de.scribd.com/document/452954331/Altera-Nios-II-BSP-Summary
https://de.scribd.com/document/452954367/Question-1

Related

What are the files boot_app0.bin and bootloader_dio_80m.bin for? (ESP32 - Arduino IDE)

The ESP32 flash command, as executed by the Arduino IDE, seems to flash two bootloader files: boot_app0.bin at offset 0xe000 and bootloader_dio_80m.bin at offset 0x1000. I wonder what these two bootloader files actually do, and why there are two of them. Below I give some more information.
1. Context
I'm part of a team developing a new, free IDE for microcontrollers: Embeetle IDE. We're planning to support the ESP32 microcontroller family in the near future. Therefore, I'm now studying the ESP32 build system - both the ESP-IDF tool and the Arduino IDE approach to ESP32 projects.
2. Arduino IDE flash procedure for ESP32 projects
After building the .elf file, the Arduino IDE launches a command to convert it into a binary:
python esptool.py --chip esp32 elf2image
--flash_mode dio
--flash_freq 80m
--flash_size 4MB
-o /tmp/arduino_build_852524/WiFiScan.ino.bin
/tmp/arduino_build_852524/WiFiScan.ino.elf
Finally, this WiFiScan.ino.bin file is flashed to the board, alongside two bootloader files and the partitions table:
python esptool.py --chip esp32
--port /dev/ttyUSB0
--baud 921600
--before default_reset
--after hard_reset write_flash
-z
--flash_mode dio
--flash_freq 80m
--flash_size detect
0xe000 ~/.arduino15/packages/esp32/hardware/esp32/1.0.6/tools/partitions/boot_app0.bin
0x1000 ~/.arduino15/packages/esp32/hardware/esp32/1.0.6/tools/sdk/bin/bootloader_dio_80m.bin
0x10000 /tmp/arduino_build_852524/WiFiScan.ino.bin
0x8000 /tmp/arduino_build_852524/WiFiScan.ino.partitions.bin
The default partitions table, as used by Arduino IDE, looks like this (in csv format):
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x140000,
app1, app, ota_1, 0x150000,0x140000,
spiffs, data, spiffs, 0x290000,0x170000,
The binary equivalent of this csv-file gets flashed to address 0x8000. There are also two bootloader files being flashed to addresses 0xe000 and 0x1000 respectively (see next paragraph).
3. Bootloader files
The two bootloader files being flashed are:
# flashed at 0xe000
~/.arduino15/packages/esp32/hardware/esp32/1.0.6/tools/partitions/boot_app0.bin
and:
# flashed at 0x1000
~/.arduino15/packages/esp32/hardware/esp32/1.0.6/tools/sdk/bin/bootloader_dio_80m.bin
Question 1: What do these two bootloader files do?
It's also interesting to observe their locations. The first one, boot_app0.bin is located in a folder named 'partitions'. It sits there alongside several partition .csv files. Why? But maybe that gets clear when Question 1 is answered.
The other one, bootloader_dio_80m.bin is located in a folder named 'sdk/bin/' and sits alongside other files that all start their name with the 'bootloader_' prefix:
Question 2: As for the bootloader file flashed at address 0x1000, I think the '_40m' and '_80m' suffixes stand for the flash speed in MHz. But I've no idea what the '_dio', '_dout' and '_qout' suffixes stand for.
Please enlighten me ^_^
Answer
Thanks to #Juraj, I now get a better insight into the startup procedure of an ESP32 chip. I believe it looks like this:
FIRST STAGE BOOTLOADER:The hardwired ROM-bootloader runs first. This first stage bootloader is outside the Flash memory and cannot be programmed. It loads the second stage bootloader (see next step).
SECOND STAGE BOOTLOADER:The first stage ROM-bootloader loads the second stage ESP-IDF Software bootloader at address 0x1000 in Flash. The code here is the bootloader_dio_80m.bin executable, which can be found in the components/bootloader directory of the ESP-IDF framework.
This second stage bootloader reads the partition table found by default at offset 0x8000. If OTA app partitions are found in the partition table, the bootloader consults the ota_data partition to determine which one should be booted.
BOOT SWITCHThe ota_data section can be considered as merely a switch, located at 0xe000 in Flash. It determines if either app0 or app1 should boot. The switch itself is the boot_app0.bin binary. As Juraj says, the 2kB size is also used to take notes during OTA flashing.
APPLICATIONThe application at app0 or app1 executes.
Thank you also for pointing me at these resources:
ESP32 bootloader
ESP32 startup procedure
The binary at 0x1000 is the bootloader. Arduino ESP32 has bootloader binaries corresponding to boards options in Tools menu in Arduino IDE (built from boards.txt).
The bootloader functions are documented here.
The ESP-IDF Software Bootloader performs the following functions:
Minimal initial configuration of internal modules;
Initialize Flash Encryption and/or Secure features, if configured;
Select the application partition to boot, based on the partition table and ota_data (if any);
Load this image to RAM (IRAM & DRAM) and transfer management to it.
The boot_app0.bin is the OTA data partition initial content. It is documented here.
The OTA data partition is two flash sectors (0x2000 bytes) in size, to prevent problems if there is a power failure while it is being written. Sectors are independently erased and written with matching data, and if they disagree a counter field is used to determine which sector was written more recently.
DIO, QIO, DOUT, QOUT are SPI modes for the flash memory. Different esp32 modules have different flash memory chips and their connection. (D is double, Q is quad)

Serial Port not working on Surface Book

I have a Microsoft Surface Book that I've dual booted Linux Mint on. I'm writing a program that needs to read in data from a serial port, but my serial ports don't seem to be working. The behavior is consistent across Mint and Windows (Testing done through Cygwin). It gets a bit of data the first 2-5 seconds that the device is plugged in (viewing the data through screen, same thing happens if I just use pyserial to print data incoming from serial port), then nothing.
What could be happening? I think I've isolated the problem to the serial ports - the Surface Book has 2 USB ports and the same thing happens on both of them, and I've tested the hardware that I'm plugging into it on 2 other computers (One Linux and one Mac OS), and it works fine on both of those.
Your MS Surface, seemingly, has a yellow triangle exclamation mark icon (over the adapter icon) without any driver to install/download. And properties in the device status box window say This device cannot start. (Code 10) or A device which does not exist was specified. Right?
If it's so you should wait for an update from MS. It's notorious problem.
I ended up getting the computer replaced on warranty for an unrelated issue months later, and what do you know, on the new computer the serial ports work fine. That indicates to me some sort of hardware problem, given that the issue persisted across OS's.
maybe this will help:
see Arduino examples for serial port communication - search google:
arduino serial c++
arduino serial c#
arduino serial c++ linux
the point is to open port properly you need to open a file, not a port. not with usual c - assembly write to port code.
another option you are using an unintentionally bought fake USB to serial cable with a Fake PL2303 chip
then you need to install the old version of the driver.
search in google:
Fake PL2303 + your os name:
install driver Fake PL2303 windows 10
another option is maybe it conserves energy and closes the port because it feels it is unused.
in windows> device manager,> properties of a device - usually USB root hub > power management - allow the computer to turn off this device to save power - uncheck it.
https://superuser.com/questions/408683/why-my-usb-mouse-gets-suspended-after-3-seconds-of-inactivity
https://blogs.msdn.microsoft.com/usbcoreblog/2013/11/08/help-after-installing-windows-8-1-my-usb-device-doesnt-charge-or-it-disconnects-and-reconnects-frequently/
also, you could look in windows events - to see what happens. usually, failures like this are registered in the events log.
an unlikely option is it consumes too much current, like a short circuit. and the device protection circuit shuts the chip off. also probably it does not have such circuit. one possibility is to try with an external powered hub.
the most probable of these is the power saving mechanism
I was experiencing the same problem - came across the solution on another site. The USB 3 ports on Surface Book aren't compatible with something or other to do with Com Port but running the device through a cheap USB hub solved my problem straight away and it was instantly recognised by the Arduino IDE

Arduino - Burning Bootloader without External Crystal

I'm trying to burn the bootloader to an ATMEGA328P - AUR, the 32-pin SMD variation with my Arduino Uno. I've tried the recommended way that the Arduino website suggests to burn the bootloader. However, I don't have the 16MHz crystal recommended, so I tried the workaround method they describe to use the internal 8MHz oscillator. Burning the bootloader gives me the "Yikes! Invalid device signature" error. Do you think there is an incompatibility with the chip? Problem with using the internal oscillator? Should I just get the crystal?
For just invalid device signature - (this usually occurs if internal clock is on)
For the ATMEGA328p if it is preloaded with a bootloader for some reason there is a mismatch in signatures so you'll have to do this THEN UNDO IT << please don't forget or else you'll have to bootload everytime before you write a script until you UNDO this.
You'll want to open up the avrdude.conf file in Arduino's program files
for mac: show package contents for PC and Linux just search the Program Files
in this file search for " ATMEGA328P " under it should be a field named signature replace "0x1e 0x95 0x14" (the 328 signature) with "0x1e 0x95 0x0F" (the 328p signature)
Follow step 2 - 4 below, if this works you're all set.
if internal clock is not on a sync error occurs
The ATMEGA328p has an internal oscillator which operates at 8MHz but this oscillator is apparently turned off when the a 16MHz bootloader is burned to it. So if you are gonna burn an 8MHz (lilypad) type bootloader to it you'll have to do so with the 16MHz oscillator in place so the internal clock can be turned on.
To do this:
load ArduinoISP example script on the UNO R3 that you're going to be boot loading with
(Configure in Tools > Boards > LilyPad Arduino or ATMEGA328 on breadboard)
(Configure in Tools > Port > ArduinoISP)
Afterwards you should be ready to burn boot loader
if sync error persist it means that the clocks are missaligned meaning you've got to slow down the boot loader
in the Hardware folder search for a boards.txt file within the avr folder
edit the line in the file containing "atmega328bb.upload.speed=57600" to read "atmega328bb.upload.speed=19200"
try steps 2 - 4 just above again
Try each of these steps in various combinations or appropriately as the problem evolves. If this doesn't seem to work just continue search forums... I had found all this in about 3 hrs on google - good luck!

Arduino Not Uploading Program to Kit

I have a Boarduino Duemilanove w/Atmega 328. I want to upload my program to it. I have W8.1 on my laptop.
The power green led is running and the red led is blinking. When I put the serial cable, but before I upload my program, the arduino.exe gives me the message:
"Arduino: 1.6.5 (Windows 8.1), Board: "Arduino Duemilanove or
Diecimila, ATmega328"
and
Sketch uses 1,030 bytes (3%) of program storage space. Maximum is
30,720 bytes. Global variables use 9 bytes (0%) of dynamic memory,
leaving 2,039 bytes for local variables. Maximum is 2,048 bytes.
and then
avrdude: ser_open(): can't open device "\.\COM2": Access is denied.
Problem uploading to board. See
http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
This report would have more information with "Show verbose output
during compilation" enabled in File > Preferences."
anyone can help me please?.
I know this one is old but i had the same problem and for me it ended up being the cable. I found a smaller one to do the upload and it worked.
In the IDE, go to tools > board, then select your board. After that, you go to tools > port, and select the serial port or USB port the Arduino is hooked up to. If you are using a mac, the port name should be long, so look for USB in the name. On windows, it should say either COM5// or COM6// or something similar. If not, just play around with different ports and boards (in the ide selection) and see if one of the combinations works. You shouldn't need to play around with the board selection too much, but try different ports. One is bound to work.

Serial overclocking seems to occur when not attached to debugger on Windows CE device

I have a problem with Windows CE 6 and a DIGI device with processor Freescale IMX51. I wrote an application in C # using the BSP of DIGI, to use the ARM eSPI (enhanced Serial Peripheral Interface).
Then using the functions issued by DIGI, in debug, I can active a OLED using SPI, but when I launch the application on the device, the OLED no longer works.
I have seen with an oscilloscope that when I load the application in debug mode the number of bits is correct, i.e., the clock has 8 rising edges, but when the application is launched from the device, the clock increases somewhat, that is, I see 9 bits. This also happens when I use the .exe from the debug directory.
I do not understand why this is happening. Can anyone help me solve this problem?

Resources