I have a ZYNQ running ubuntu on one of the processors (and baremetal code running on the other one). Everything is currently (and temporarily) running from the SD card, so that it has two partitions, one called BOOT (containing the files BOOT.BIN, image.ub and system.dtb), and another one with the rootfs tree. I have been working with it for a while and I have installed several packages and developed some applications.
My intention now is to use SWUpdate to update all the software everytime a new version is released, so that I should generate an image of each of the two partitions. I have seen some tutorials from Xilinx to make a boot image, but I have not seen how to make it from a complete and modified system as the one I've described above. Any help will be greatly welcome.
Related
Problem
I'm looking for a way to flash an ESP32 module's memory without installing the whole IDF software suite.
Why
Because I want to integrate ESP32 onto a custom board along with a low-performance ARM-powered CPU which runs a tiny Linux distro (based on Debian), and I want to flash ESP32 from this tiny Linux distro.
I know I could use the bootloader, but who will upload the initial bootloader? I don't want to do extra steps, so my idea is to embed the ESP32 module onto my custom board, and let the Linux to flash it from factory-state (when it's flash is empty, ie. no preloaded bootloader). Or is the serial bootloader always preinstalled on all ESP32 modules (like on ESP-WROOM-32)?
Why I don't want to use IDF? Because I don't want to build or debug anything, I just want to flash myprogram.bin onto ESP32. Also, as the board is low-performance, it would take ages to download everything for running IDF.
Current state
The ESP32 module is now visible via UART (RX,TX,GND), and if I held low the GPIO0, it runs the bootloader (my current module is embedded onto a NodeMCU - but there is no USB connected, this is raw UART!):
rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download
Could I expect the same behavior (controlling GPIO0 for running the bootloader) for all ESP32 modules, or this works just because guys at NodeMCU preprogrammed already some bootloader onto it?
I'm looking for a way to flash this ESP32 preferrably without any python script.
The ESP32 has a first-stage bootloader in ROM capable of writing to Flash - that's what's printing your output. You can talk to it if you know the protocol - this is implemented by the Python scripts in ESP IDF. If you don't want to use the official implementation because it's too heavy, you'll have to write your own implementation of this protocol which scratches your specific itch. Fortunately it's more or less documented and you can likely reverse engineer any missing knowledge from official Python scripts.
Actually Espressif also provides a nice and small binary for flashing ESPs:
https://github.com/espressif/esp-serial-flasher
Serial flasher component provides portable library for flashing Espressif SoCs (ESP32, ESP32-S2, ESP8266) from other host microcontroller. Espressif SoCs are normally programmed via serial interface (UART). Port layer for given host microcontroller has to be implemented, if not available.
One more (but very important) addition:
You have to modify this repo to make it work correctly, and also you might have to upload not just your binary, but also bootloader and partition_table.
I have been wanting to work with Vulkan, the new graphics API and have gotten it up and running with no problems on Windows 7. However I can't get Vulkan to work on linux. When I try running any of the LunarG samples, or even my own code, vkEnumeratePhysicalDevices always says that there are no physical devices. Here is my setup:
OS: Ubuntu 16.04 (LTS) [x64]
GPU: Nvidia Geforce GT 730 2GB GDDR5
Driver: NVIDIA Binary driver - version 364.19 from nvidia-364 (open source)
Vulkan SDK: LunarG v1.0.17.0 [ latest version]
I was wondering if maybe there's a file for my GPU that I need to set an environment variable for, but I really don't know. As I said before, this worked on Windows 7 perfectly, but I can't seem to get this to work this the above configuration. I am able to create an instance with the LunarG standard validation layer and the correct extensions, but vkEnumeratePhysicalDevices doesn't find any physical devices. It doesn't give an error, just says it can't find any physical devices. This has really got me stumped and I would really appreciate the help. Thanks!
Depending on your distribution you may have to install the nvidia-utils package. See this issue on my Vulkan repo for details.
If this isn't the case for you check the directories Karl mentioned and check if there is no other ICD (maybe one from Intel) that may cause troubles. If you're on an optimus system with dual GPU you may need to explicitly activate the NVIDIA GPU.
The 730 should work fine on Linux, at least judging from the Linux hardware reports I got on my database like this one.
You shouldn't have to set an environment variable if the driver installed properly.
One way to check for a proper installation is to look for the JSON file that identifies the driver. For example, an nvidia driver will place a file called nvidia_icd.json in /etc/vulkan/icd.d/. /usr/share/vulkan/icd.d/ is another standard, but less common location.
It may also be the case that your GPU does not support Vulkan. Be sure to check your GPU vendor's web pages to confirm support. You may want to download the driver straight from the vendor's site in order to get one that they say has Vulkan support.
And are you sure that using the "Additional Drivers" page is supposed to give you a Vulkan driver?
You can refer to the loader documentation in the docs section at https://vulkan.lunarg.com for more info.
I'm having a bit of a hard time fully understanding how the kernel starts in linux. I'm a wince developer and our company decided to run with linux instead now.
We outsourced all of the board bringup and the package I recieved is quit a bit different for the prototype board we have compared to the nitrogen6x we have been using.
Before i start listing the differences for the distro we created, the kernels are identical. The distro we have been using is a busybox system. The one we recieved from the vendor is sysvinit. I removed mdev from busybox and we are only using udev.
when I use the kernel on our busybox build the touch screen drivers breaks, or doesn' run, or does something totally magical. I'm not quit sure... there is a /dev/input/event0 device which when run on the sysvinit side is a touch device.. Is the kernel not the mechanism that binds the built-in drivers to a device node? I thought udev was for more dynamic events in the system.
On the other hand I can't really tell whats been loaded on my device. Is there a way to list running drivers that were built into the kernel? my touch pad is up? This is a fairly simple process of looking at the registry on wince to see which devices were loaded.
I guess what I'm really trying to discover, isn't so much how to add a driver to the kernel, its how the whole thing gets is plumbed together. I've found plenty of documents on createing kernel modules, but i haven't found a good resource on how to pull everything together from scratch so you can actually use said modules. Going back to the example of the touchscreen driver, its built into the kernel, how does that get plugged into /dev/input/event0??
I'm kind of having a difficult time finding good resources mostly because searching google for varations of linux/drivers/device nodes/ piles in tons of random crap from everywhere.
What you probably want to use now is evtest. It will allow you to know what are the input devices that are present and ready to use on your system.
To get more information on the input subsystem and more generic information on how the kernel is working, I can direct you to our training materials. The materials are free to download, use and redistribute.
The general answer is, there is no single, easy place to look to discover what drivers have been loaded by the kernel if they are compiled in. Of course, lsmod will display any drivers that were dynamically loaded after kernel boot.
The kernel does not create device nodes. That is, to quote your question, the kernel does not "bind" the driver to the device node. The association between kernel driver and device node is contained in the major and minor numbers registered when the driver is initialized. You can have a device node on your file system for which there is no corresponding driver (common especially in older devices where device nodes were statically created on the file system) and you can also have a driver installed for which there is no device node.
Modern Linux distros have dynamically created device nodes created on a mount point called /dev and this is usually a tmpfs file system, meaning it is volatile - it gets destroyed on every boot and recreated dynamically on each new boot.
udev is the magic that creates most device nodes based on events that it receives from the kernel when a new device is discovered (this can be after boot on device plugin, like a USB disk) or on startup when udev reads the queued events and acts on them. As you noted, busybox has a limited udev implementation called mdev.
Study udev and you will get a much better understanding of the process. Hope this helps a little.
I downloaded the hard float image of Raspbian here:
http://www.raspberrypi.org/downloads
I copied the recommended hard-float image on an SD card and the Raspberry Pi boots fine with it.
Then I downloaded the soft-float version of Raspbian because I need it to get some software running that does not work on the hard-float version. I formatted the SD card again, copied the soft-float image onto it and tried to boot the Raspberry Pi with it.
Problem: the Raspbery Pi doesn't boot with the soft-float version of Raspbian!! I see the green "ACT" LED light up for less than a second. After that only the red power LED is on and nothing happens after that.
I repeated this process a couple of times and redownloaded the images, checked the SHA of the downloaded file, etc. It just doesn't work. The hard-float image always boots up (green "ACT" light flashes rapidly like normal).
Any ideas?
Update: If you have a newer Raspberry Pi with Hynix memory then the older versions of Raspbian will not boot. Specifically you'll need at least the 2013-02-09 Debian 7 (Wheezy) build.
See this post.
Now, the 2013-02-09 Wheezy build is a hard-float version, so you can't use that, but you can update the kernel image of your soft-float version which is actually independent of the Linux OS (I'm told that basically the GPU boots the Raspberry Pi, and it runs the ARM as a kind of co-processor). So, you can run rpi-update to update your kernel, and it should be all OK.
There's a bit of a catch-22 if you don't own any of the older Raspberry Pis that will boot the older images--how can you update the OS if the only Raspberry Pi you have is a newer one which won't boot? In your case it sounds like you have access to an older one, so you're OK. For those who don't, maybe someone will eventually post an updated soft-float version, but until then perhaps you can try the following. I haven't; it's just a theory, but at this point you don't have much to lose :-)
Burn the latest Wheezy image (2012-02-09) to an extra SD card
Mount this SD card on Windows
Copy all the files except *gz ones which correspond to the Linux filesystem. Basically, all the boot images and configuration files
Mount the SD card containing your soft-float image and overwrite the boot image files
Hopefully have a beer to celebrate?
Previous post:
Yes, I had this same problem. I don't know exactly what is wrong, but the start_elf image won't boot, at least with the recent set of Raspberry Pis. I can't believe Raspbian would release something that broken, so I suspect it works for some Raspberry Pis, but not others. What you need to do is:
Burn the hard-float copy of Wheezy to an SD card. You're going to snatch off the boot image (which works) and copy it to the soft float one.
Mount the SD card on a Windows machine. The boot partition is FAT, so you'll be able to see it. Look for the file start.elf. Copy it to your Windows machine.
Burn the soft-float copy of Wheezy to an SD card and mount it on the Windows box.
Replace it's start.elf with the copy from your hard-float one.
Crack open a beer and enjoy.
See my related post.
Just image one card with hard-float(Raspbian “wheezy”), and the other
with soft-float(Soft-float Debian “wheezy”). Plug both into a Windows PC and
copy all files (you can see at all) from the hard-float onto the
soft-float card, replacing existing ones.
Explanation: http://www.raspberrypi.org/archives/3534
P.S. You can, of course, copy those files to a temporary folder first,
swap cards and then replace all files on the soft-float card with
those in the temporary folder.
bootcode.bin
start.elf
fixup.dat
From Raspberry Pi SD card with this Soft-float Debian "wheezy" did not want to boot
When you dd the image, make sure bs=1M...
After trying all the things in the other answers, it was finally the way to make it work on a latest Raspberry Pi out of the box. I've actually found this a good help with several Raspberry Pi applications/code.
I have used ATI Stream SDK on windows XP SP3 and implemented one algorithm on GPU. But Now I am interested in scaling this algorithm on multiple GPUs on mutiple machines I switched to UBUNTU to use MPI ( To send messages ).
I googled this but I got references for installation on SLES and RHEL but I am looking for UBUNTU 9.04.
Thanks
GG
AMD is switching to OpenCL based API soon. May be it will be worthwhile holding your horses till the OpenCL API stabilizes. Cuda is far ahead of the curve in terms of GPU usability, there is a nice project called MAGMA which is bringing together the LAPACK library for joint CPU-GPU usage.
I know of people who are using the ATI Stream SDK and ACML-GPU on Ubuntu without any special problems -- that is, no problems that they wouldn't have on any other Linux distro.
If you can get the Catalyst drivers installed correctly (which in this case will probably mean compiling your kernel modules) and your X windows configured correctly (especially DRI module, and there are security issues if you want Stream to work with remote access) it should work.
I'm tempted to ask/comment how you plan to share GPUs between multiple MPI processes, but that's probably wandering off-topic.