Atlas-SoC board preloader troubleshooting - preloader

I just bought a new Cyclone V board from Terasic ( Atlas-SoC ) and planned to build a bare metal application. At first, I used the GSRD provided by Terasic. The example project is from version 14.0 and my 17.1 Quartus asked me to launch an update to those 14.0 IP, but I saw that they already compile everything and I had a handoff file folder. All I needed to do was just make a preloader and uboot. Then I followed these steps (from rocketboard and many places else):
Generate .rbf file.
I made a preloader using the bsp-editor tool from EDS-SoC.
Compile successfully the preloader and obtain
preloader-mkpimage.bin.
Generate uboot and also uboot script file.
Load preloader into SD card using alt-boot-disk-util.
Copy all the rbf file, uboot and uboot script to an SD card. At this moment I did not make any application because I wanted to check if the preloader loaded or not.
Plug SD card into the board and then power up 8. In Putty, I saw the U-boot spl and Uboot worked fine.
With the first success, I tried to make my own HPS-FPGA design. I based on HPS configuration to make my own HPS ( initialize I2C, UART, no sdram, etc. ). For the FPGA part, I put some LEDs PIO, JTAG UART, System ID peripheral, etc.
After finish my Platform designer ( Qsys), I made a VHDL top file and connect all the nodes ( just like GSRD design). At this point, I did not add any IP such as HPS reset, debounce, etc. because I just wanted to see if the preloader worked or not.
Then I followed exactly those steps as I did with GSRD design, however this time on Putty I received nothing. U-Boot SPL did not even appear. Feeling weird, I came back to GSRD to check. I copied the whole folder of GSRD design and made it my own new project. Then I launched an update for those IP and compiled the whole thing again. After that, preloader and uboot were made in the same steps and the result amazed me: On Putty terminal, I only had this single line
U-Boot SPL 2013.01.01 (Mar 08 2019 - 10:28:04)
and nothing else happened. I think that something wrong with the preloader, it has something mismatched with my Quartus design or I have made mistakes during building the preloader.
I have searched in a lot of places, came up with many hypotheses, and tried to fix this. I even contacted Terasic and visited the Intel community forum, but I still haven't got an answer.

If U-boot is not showing up, then the preloader is not doing its job. There are some settings that you need to check when building the preloader for baremetal designs (Watchdog timer must be disabled for instance).
If U-boot starts and you can enter commands in it it means your preloader works fine. You could enter commands manually on u-boot at first to configure the FPGA (enable bridges, load rbf and go to the software application start address) If by following this method you get the application and FPGA running, it means all your files are correctly generated but you need to script the necessary u-boot commands and run the script to automatically configure the FPGA and run the application from u-boot.
Here is a link to a github repository for DE1-SoC where you can find a full tutorial on how to boot HPS-FPGA system in baremetal : https://github.com/sahandKashani/SoC-FPGA-Design-Guide/blob/master/DE1_SoC/SoC-FPGA%20Design%20Guide/SoC-FPGA%20Design%20Guide%20%5BDE1-SoC%20Edition%5D.pdf
I hope it helps!

Related

Install v4l2loopback in WSL2

I am currently struggling with v4l2loopback installation on WSL2.
Some context:
Recently, I have read about create a virtual video device in Linux and then mock its output from an image or video file.
This is quite important for testing or developing purposes, for example in order to attach a virtual webcam that reproduces a video file as a loop to the android emulator.
After some research I got to the conclusion I don't want to use desktop applications and it might be easy to run even in a CI or similar, therefore v4l2loopback looks nice, but I am currently a Windows user.
I enabled WSL2 on my machine, downloaded the repo, and tried to execute make command like in the repo description.
Building v4l2-loopback driver...
make -C /lib/modules/`uname -r`/build M=/home/angel/v4l2loopback modules
make[1]: *** /lib/modules/4.19.84-microsoft-standard/build: No such file or directory. Stop.
make: *** [Makefile:43: v4l2loopback.ko] Error 2
I googled a little bit and i found that issue on GitHub where a similar output (for another tool) is mentioned.
There, someone mentioned that WSL2 Kernel Config can be adjusted in order to add more modules ( maybe and hopefully one of them could make work v4l2-loopback 😂 or at least that I think).
I also googled in order to check out custom WSL builds but I am not really sure what I need to make it work or even if I am going in the right direction.
Is there something I 've missed in order to make v4l2loopback work?
In the case only a custom WSL2 build would work, how should I proceed?
Thanks in advance 🤘
I am not familiar with WSL...
-- Ah, it appears WSL doesn't have a linux kernel at all: see
https://unix.stackexchange.com/questions/594470/wsl-2-does-not-have-lib-modules .
So it's useless building the v4l2loopback mod; even if you'd be able to build it, there's nothing, no kernel, to load it!
Maybe an alternative for you might be running Virtualbox (it's free, and available for Windows) on your windows machine, and load a real Linux distro of your own choice in it. Then build the v4l2loop module, after installing the kernel development headers, and install the mod (after building, as root do insmod v4l2loop.ko) and play with it.
Thus, you are on your way. Far more elegant, and far easier. Also will have you make an enormous and important climb on the 'getting familiar with Linux' ladder, as well as maybe familiarize yourself with a virtual machine(?).
I'd definitely go for that.

Monitor RAM from serial port; Labview DLL with change in system language

I have an executable written in Visual Basic that reads data from a serial port through a DLL made in Labview. The data is then plotted on a chart in real time.
After reinstalling the software with a different installer package, the serial port appeared to hang on read or write. I pulled up Portmon and ran the software again; read worked just fine, and write was labeled successful too, but the chart showed no data, and hardware plugged into the serial port was not properly returning to its base location after timeout.
This issue was only happening on the computers with French system settings rather than English, so I changed one of the computers to English system settings in the Language area of the control panel, then reinstalled the software. It worked!
Does anyone know why this is? I'm trying to figure out if the culprit is the Format settings, the non-unicode program settings, or just the windows language and location.
Are labview drivers different between languages? Is the format setting changing how the data is plotted, causing a failure?
Any suggestions are welcome.
If you would like more information, I made a post in NI before I tested Portmon or the language settings HERE
Changing system language / regional settings also changes decimal separators and other things. I have installed software developed in C# in different machines, producing different results and simply not running due to that fact.
I do not know the reality of the software and hardware you are using, but this might help pointing in the right direction :)
Thank you, BlunT! I just wanted to add some extra information:
I tested different settings for the software using the old installer, but changing it's config file to pull the new executables. What I didn't realize was that the old installer installed to each user's AppData/Roaming files; I got the executable to run for my user, but it wasn't running for the others.
I reverted back to the new installer (which saves the executables to ProgramData), changed all language settings to French Canadian, and changed the decimal separator from "," to "."
It is now working for my user name, and should be working for others' now, as well.
Just another reason to make sure you install to ProgramData if the installed files aren't specified to each user!

Is there an emulator of MSP430 chip that works without the actual chip and integrates with Code Composer Studio?

I need to learn to program MSP430, but don't have the actual chip yet. All configurations that I've tried at Code Composer Studio (except Snapshot, but it does not count, right?) require something on my USB. How do I learn to program the chip without the chip?
And what is an emulator that requires a USB?
Online emulator (used chrome): http://www.msp430emulator.com
This MSP430 Emulator is open source, and can be used directly online without downloading anything. Still under construction but has a good debug interface. Unfortunately no integration with CCS.
It is on the TI Open source page: TI Open Source Project Page
"The MSP430 Online Emulator provides a complete software model of the MSP430 16-bit instruction set. It is an interactive debugger for advanced development and in depth firmware/hardware analysis. Peripherals include UART, GPIO Ports, BCM+, Timer_A, and more! Open source, and absolutely free - access to the TI MSP430 Launchpad allows you to effectively build and debug firmware. No hardware setup, emulate anytime anywhere!"
open source on github:
https://github.com/RudolfGeosits/MSP430-Emulator
If you need something implemented you can add to the code yourself and run a local emulation server for real time applications.
This emulator is pretty awesome, once you can get it running. Note that it does claim GDB support, which likely means you can get a pure eclipse CDT C project & CDT-GDB-HW-Debugging session up and running against it (making sure to compile with the msp430's tool chain, of course).
http://opencores.org/project,openmsp430
As far as a simulator, the answer is truly 'no'. I would like to be wrong on that... But consider for a moment the number of variants of the msp430, the peripherals, and so on. Not sure if any company can justify that kind of cost!
Especially when launchpad/etc are so cheap and fast.
If you can afford £10 then the launchpad is the way to go just to teach yourself about the MSP430. You can use either IAR Embedded Workbench or Code Composer Studio, both which come in code size limited version which will be plenty big enough to learn with. I don't like either, but of the two the IAR one is, IMHO, the better bet as it's not Eclipse based. If you don't mind Java and Eclipse, then CCS is a viable option for you. One huge advantage with CCS is it runs on Linux, but really, it's still not a patch on Rowley Crossworks which runs on Linux. The latter has a cheap educational licence.
As far as the emulator and USB question is concerned, it's maybe being slightly pedantic, but it's not an emulator, it's a debug interface. There is a debugger built into the chip that enables you to load the code into the chip, set breakpoints, single step through code.
This kit is a great way to start because the debugger interface is built into the kit, you can access pins on the processor, see LEDs come on and all that good stuff that gives you the warm feeling you're programming a chip properly. For the sake of £10 you'd be mad not to!

Optimizing JRE and JVM loading time from DVD

I am shipping private JRE along with jar program in the DVD. It takes about 3 minutes if I directly run the program from the DVD. Probably it takes time to load the JRE libraries to main memory as optical disks speed is slow. However when I close the program and re-launch , it gets launched instantaneously as if JRE is installed in the local computer (which is not). I think JRE stays in the memory even after I close the program.
3 minutes is a big waiting time for users, is there any way I can optimize the code (which is the only thing under my control) that it loads only few libraries to launch and load the the other necessary ones on demand. Now probably it is trying to load everything from DVD before showing the program window as suggested by
$java.exe -verbose -jar myProgram.jar
Is there any other solution to launch the program quickly even in the 1st time ? Currently the only workaround is to use the Launch4J .bmp splash screen buts that is very static.
Note: I know installing JRE in local machine will solve the problem but the program is not for technical users, my Launch4J does not find it if installed in custom directory. Also my DVD is copy protected so that the program can not be distributed.
Package your app together with the private JRE into a single EXE that would self-extract into the user's temporary directory and automatically run your app. The startup time improvement will blow you away:
http://www.excelsior-usa.com/blog/excelsior-jet/java-app-as-a-single-exe/
(Download the sample packaged apps and burn them onto a DVD to quickly verify my claim.)
Let me emphasize that you can achieve the result using free tools only, and optionally improve it a bit further with Excelsior JET. Refer to our Knowledge Base article for full instructions (most of which apply whether you use Excelsior JET or not):
HOWTO: Create a single EXE from your Java application
Disclaimer: As you may have already guessed, I work for Excelsior. But again, it all works for the private JRE, and the result, in terms of startup time improvement, is almost as good.

Where is there good information about low level PC booting?

I'm interested in writing a boot loader for USB sticks that looks for a directory of ISOs and gives you the option to boot one of them as if it were a bootable CD. This is basically so I have a menu driven program that allows me to install one of several different distributions off of a USB stick.
Where would I go to figure out how to make this work? Do I need to install some kind of BIOS hack to allow remapping of CD blocks to blocks in the filesystem? How would that work once the boot from the CD had enough marbles to start trying to access the device directly?
are you looking to learn how bootloading works? if so, you could check out the grub docs here: http://www.gnu.org/software/grub/
otherwise, if you're trying to create a usb bootloader that can load a variety of operating systems, this tutorial looks like it covers it quite nicely: http://www.freesoftwaremagazine.com/articles/grub_intro/
I don't think it will dynamically build a loader of operating systems as they are available by reading the contents of a directory.