appfruits / buildroot-boards

This is a collection of build root boards that we have configured for our own project as a reference and starting point for others
GNU General Public License v2.0
4 stars 0 forks source link

Kernel panic at boot #2

Open ezamp opened 9 years ago

ezamp commented 9 years ago

Hi, after creating the sd with all the files I started the acquaA5. Unfortunately, the system goes into kernel panic, I include the output of the serial:

VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1
at91_rtc fffffeb0.rtc: setting system clock to 2007-01-01 00:00:05 UTC (1167609605)
atmel_mci f0000000.mmc: version: 0x505
atmel_mci f0000000.mmc: using dma0chan4 for DMA transfers
atmel_mci f0000000.mmc: Atmel MCI controller at 0xf0000000 irq 17, 1 slots
ALSA device list:
  No soundcards found.
VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
CPU: 0 PID: 1 Comm: swapper Not tainted 3.10.0 #1
[<c0012300>] (unwind_backtrace+0x0/0xf4) from [<c00108ac>] (show_stack+0x10/0x14)
[<c00108ac>] (show_stack+0x10/0x14) from [<c04160e8>] (panic+0x8c/0x1d0)
[<c04160e8>] (panic+0x8c/0x1d0) from [<c057ccb4>] (mount_block_root+0x1d8/0x268)
[<c057ccb4>] (mount_block_root+0x1d8/0x268) from [<c057cf38>] (mount_root+0x108/0x110)
[<c057cf38>] (mount_root+0x108/0x110) from [<c057d0d0>] (prepare_namespace+0x190/0x1d8)
[<c057d0d0>] (prepare_namespace+0x190/0x1d8) from [<c057c938>] (kernel_init_freeable+0x1ac/0x1bc)
[<c057c938>] (kernel_init_freeable+0x1ac/0x1bc) from [<c0414928>] (kernel_init+0x8/0x158)
[<c0414928>] (kernel_init+0x8/0x158) from [<c000de98>] (ret_from_fork+0x14/0x3c)

Thanks

pschuster commented 9 years ago

Did you create the SD card with all partitions? There is a tutorial at acmesystems.it. As far as I remember the SD card should have two partitions. One very small (it's name is KERNEL when I mount my SD on my Ubuntu PC) receiving the boot.bin the DTS and zImage (the Kernel). And another partition named rootfs into which you extract the tar.gz generated by build root. Please check the tutorials on acmesystems. There is a tutorial about how to compile the Linux kernel.

pschuster commented 9 years ago

Oh. Just to mention it. I got a lot of this error message with "Please append root=...". It drove me crazy as it sometimes worked. I found out that I did remove the SD card to fast.

In Ubuntu you eject the SD card (either KERNEL or rootfs as both are mounted but ejecting one of them ejects the other). These are removed from the devices list immediately but it takes longer for the system to savely unmount them.

After I recognized this to be a problem I ejected one of the partitions and after they are removed from the list I wait another 30 seconds until I physically remove the SD card.

I don't think this is your problem but wanted to document that if you get this error again after you successfully got it running.

ezamp commented 9 years ago

On my SD I created all the partitions necessary and I copied the files in the correct positions. I tried to replace the file boot.bin (copied from the folder output/images ) with the files present in the old SD already prepared by acmesystems. Making this substitution the kernel panic no longer occurs.

Now I just have to understand how configure QT5 ;)

Thanks

pschuster commented 9 years ago

Awesome! Thanks for coming back! This is what I meant in my initial eMail that I am not sure if the Bootstrap-Part (making boot.bin) in my buildroot setup works correctely. I will have to look into that.

Please let me know if you have trouble setting up QT5. As said before you should find all information neccessary in my Qt 4 guide which is essentially the same with QT5 and Acqua A5.

http://www.appfruits.com/2015/01/compiling-qt-4-8-5-for-arietta-g25/ (see Headline Preparing Qt Creator)

ezamp commented 9 years ago

I have encountered a difficulty. I added the device and set the compiler, but I do not know how to configure the version of Qt. I do not have the folder /usr/local/arm/qt. I have to download qt 4.8.5 and then compile it as shown at the beginning of the guide?

Thanks Emanuele

pschuster commented 9 years ago

Sorry for the late answer. Buildroot is separated in two parts: Toolchain and Root-FS. The Toolchain are the tools needed for your Host-PC to compile applications that run on the specified device within the operation system backed by the Root-FS.

The buildroot output directory contains these sub folders:

You have copied the files from images (*.dtb, zImage, rootfs.tar.gz) to your SD card. The toolchain is in host. Have a look there. There should be sub folders like /usr/bin/ or /usr/local/bin. Running Ubuntu just use the File Explorer to search for qmake. There are also compilers and debuggers like arm-linux-gnueabi-g++, etc.

Applications in host will run on your PC, but will produce files to be run on your embedded device.

The nice thing about buildroot is, that the toolchain is matched against the root-fs and the other way round. If you are using the debian rootfs you have to build the toolchain yourself, which often makes problems with different versions and packages.

In the Qt 4.8.5 tutorial the toolchain is installed with a Ubuntu/Debian package and therefore lies in /usr/local/arm.

I hope that helps.

ezamp commented 9 years ago

Perfect, I had not checked in the output folder.

I tried to create a project "Qt Quick Application" and execute the initial code, but the execution goes wrong: QML debugging is enabled. Only use this in a safe environment. Could not initialize egl display Aborted Application finished with exit code 134.

I will try to look for the problem.

Thanks again for the help.

pschuster commented 9 years ago

Unfortunately Acqua A5 does not have a GPU meaning that it does not support OpenGL. QtQuick2 (which is used in most example applications) relies on OpenGL, therefore these applications will not work. You will have to use the (older) QtQuick1, which is a port of QtQuick from Qt4 to Qt5. It will not gain new features but bugfixes will be released. Regarding pure rendering and UI it does not make a lot of difference if you use Qt4 or Qt5 as you cannot use the new Qt5 UI features like QtQuickControls and the like as all of these need OpenGL for rendering. But you can use new Qt features added on all other parts of the framework.

In the current buildroot configuration I added MESA, which is a software OpenGL driver but I did not get it running. To be honest I did not really invest a lot of money as QtQuick1 is enough for my purposes.

Using the QPainter Interface to draw your own "fancy" controls and implementing them in QML of QtQuick1 is a great way to build great UIs that render quite fast on Acqua A5. You can download the Atmel Qt5 for SAMA5D3 here: https://linuxlink.timesys.com/download (you will need to register before but it's free). Although this SDK is Qt4.8 you can port the provided controls very easily to Qt5 (there are a few easy to fix compilation errors). In fact I am using one of the provided widgets (LightControl) in my own project.

If only I had more time writing blog posts ;-).

pschuster commented 9 years ago

In order to port QtQuick Code to Qt5 you will need to replace all references to QtQuick (i.e. in qmake file) with QtQuick1.

QtQuick on Qt5 is QtQuick2 which relies on OpenGL. QtQuick1 is a port of the QPainters-Based (software rendering) to Qt5.

ezamp commented 9 years ago

In the documentation I saw that QtQuick2 is based on OpenGL, as you wrote. I tried to create a new project "Qt Quick Application" and set to Qt Quick 1.1, unfortunately in this case I have the same error running.

Sorry if I did not write in the previous message, the error appeared with both versions of QtQuick

Emanuele

pschuster commented 9 years ago

In QtCreator you can specify the command line to be used to run the application on the device. This setting is found unter "Projects" -> "Build & Run" -> [Tab of your Acqua A5] with "Run" activated.

See this picture from my Qt 4.8 tutorial what I mean: http://www.appfruits.com/wp-content/uploads/2015/01/Bildschirmfoto-2015-01-16-um-17.50.34.png (the last picture at the bottom of the page in my tutorial).

Instead of adding "-qws" as shown in the picture add "-platform linuxfb". This should activate the linux framebuffer as display/render device and not egl which seems to be the default one. Hope that helps.

pschuster commented 9 years ago

Please make sure your linux framebuffer is working correctely if it does not work. You should have a folder/file in /dev that is named fb0 or fb1. Setting "-platform linuxfb" will select fb0 by default. Use "-platform linuxfb:/dev/fb1" so select the fb1 framebuffer (which should not be necessary).

More info on platforms in Qt5 can be found here: http://doc.qt.io/qt-5/embedded-linux.html

ezamp commented 9 years ago

I added "-platform linuxfb" to the arguments and now everything works! if you want to use the touch you need to add "-plugin evdevtouch".

Thanks again for the help :) :) Emanuele

pschuster commented 9 years ago

Awesome. Have a good time developing for it. I think this is one of the most rewarding things I have been programming the last years as you can program on a very high level with fast, impressive results, but it runs on your own hardware.

Thank you very much for using my buildroot setup and for coming back to me all the time. This issue will help me writing a blog post with a little more infos than I provided in the README.

If you have any issues down the road don't hesitate and ask here. Perhaps I had the same issue before ;-).

Phillip

pschuster commented 9 years ago

I leave this issue open as I did not fix the AT91 bootstrap bug and it's a good, prominent resource for others until I have updated the documentation and fixed the bootstrap bug.

massixone commented 8 years ago

Hi, I'm still dealing with "Kernel panic at boot" with an output quite similar to the one of the 1st post above. More precisely, this is what I get at boot on the serial:

VFP support v0.3: implementor 41 architecture 2 part 30 variant 5 rev 1
at91_rtc fffffeb0.rtc: setting system clock to 2007-01-01 00:00:04 UTC (1167609604)
atmel_mci f0000000.mmc: version: 0x505
atmel_mci f0000000.mmc: using dma0chan5 for DMA transfers
atmel_mci f0000000.mmc: Atmel MCI controller at 0xf0000000 irq 17, 1 slots
ALSA device list:
  No soundcards found.
VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
1f00             256 mtdblock0  (driver?)
1f01             512 mtdblock1  (driver?)
1f02             768 mtdblock2  (driver?)
1f03             512 mtdblock3  (driver?)
1f04            6144 mtdblock4  (driver?)
1f05          253952 mtdblock5  (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
CPU: 0 PID: 1 Comm: swapper Not tainted 3.10.0 #1
[<c0012474>] (unwind_backtrace+0x0/0xec) from [<c00109c8>] (show_stack+0x10/0x14)
[<c00109c8>] (show_stack+0x10/0x14) from [<c041d438>] (panic+0x88/0x1d0)
[<c041d438>] (panic+0x88/0x1d0) from [<c0581cc8>] (mount_block_root+0x1d4/0x264)
[<c0581cc8>] (mount_block_root+0x1d4/0x264) from [<c0581f4c>] (mount_root+0x108/0x110)
[<c0581f4c>] (mount_root+0x108/0x110) from [<c05820e4>] (prepare_namespace+0x190/0x1d4)
[<c05820e4>] (prepare_namespace+0x190/0x1d4) from [<c0581950>] (kernel_init_freeable+0x1ac/0x1bc)
[<c0581950>] (kernel_init_freeable+0x1ac/0x1bc) from [<c041bc70>] (kernel_init+0x8/0x160)
[<c041bc70>] (kernel_init+0x8/0x160) from [<c000df58>] (ret_from_fork+0x14/0x3c)

I strictly followed the instructions provided here, in the tutorial http://www.acmesystems.it/microsd_format and in http://www.acmesystems.it/compile_at91bootstrap. Although I'm still stuck with my Acqua 256E N256. It looks like the kernel looks for its root on block 0 (Unable to mount root fs on unknown-block(0,0)), so I think I'm still doing something wrong, but I don't undertand exactly what. Thanx in advance for you help

pschuster commented 8 years ago

I am sorry. Besides what we had before like using the AT91Bootstrap provided from Acmesystems (and not that is created from my buildroot config) and making sure you do not remove the SD card too early after ejecting it in Ubuntu (see above https://github.com/appfruits/buildroot-boards/issues/2#issuecomment-89633180) I actually don't know what to do to fix the error.

This time (in contrast to the first time you posted that issue) a list of partitions is posted. That looks like some progress to me.

Did you try posting in Acmesystems support forums (https://groups.google.com/forum/#!forum/acmesystems)?

massixone commented 8 years ago

Thank you for you reply Phillip, Still doing some progress here, but tot as expected. Once I've identified a good solution I will certainly post here on behalf of anyone interested. ... at leas, I hope so ;)