What kind of practical projects can I do to learn Yocto [closed] - embedded-linux

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 11 months ago.
Improve this question
I have started learning Yocto through Chris Simond’s book, and reached a level at which I don’t know what can I do with this knowledge in practice.
Any advice on real projects where I can exercise and apply what I learn?

Yocto is for creating custom embedded Linux distributions.
And custom Linux distributions are dedicated for embedded boards (RPI, iMX, BBB, etc) (You can also build for x86)
With Yocto you can work on two sides: Software and BSP
Software:
Develop recipes for new projects to integrate them into your image.
Create custom classes to manage the project recipes
Create custom DISTRO for the project
Create custom images and packagegroups
etc
BSP:
You work on Linux kernel recipe to add drivers, DTS, etc
Create an out-of-tree driver recipe
Create an in-tree driver patch
Work with defconfig and fragments
etc
You work on U-boot recipe to add drivers, DTS, etc
If you have new board, you add a complete board support
etc
It is basically related to hardware.
If you manage to have an embedded board then you can set a project idea and start the practice.
For example:
Hardware: RaspberryPi (All the integrated HW components are supported)
Add-Ons:
Externel I²C/SPI sensor
USB CAN/Network peripheral
etc
Idea:
Work on the Linux recipe to add a config fragment for the new components
Learn about the Linux subsystems to develop drivers for them (This is the core of Embedded Linux job)
Develop a simple QT5 application for the sensors data
Work with meta-qt5 and qt5 images, recipes and classes.
Develop your own recipe for the QT5 application
Develop your own Yocto distro
Since you added new HW components, you can add your new MACHINE based on RPI
Finally, you will find your self did a lot about Yocto (Classes, images, DISTRO, MACHINE, packagegroups, patches, bbappends, new layers, recipes, etc)
If you don't have an embedded board, you can work on the Software part with QEMU with x86 or any supported architecture in QEMU. Then, you create images, new recipes, and try to create a full image and dirstro according to your needs.
NOTE
You can work with SDKs for the drivers/qt5 cross compilation
Use repo or kas for your project's layers collection or for pipelines auto generation

Related

.Any suggestions on the things to be considered to boot Linux Kernel for RISCV?

We are developing RISC-V soft-processor in Verilog.So far we have implemented 12 stage pipeline, Data and Instruction cache and M-extension.We are going to add F extension susequently.What are the feature we have to improve for boot Linux Kernel?
Linux distributions all currently target RV64GC, so if you want to be able to run software out of the box you'll want to support RV64GC. It's possible to run Linux on other systems, with various caveats:
Systems without the A extension aren't currently supported, but adding support for single-hart systems without the A extension wouldn't be too much work. This would require recompiling all of userspace.
Systems without the M and C extensions aren't currently supported, but it should be possible to just recompile userspace and get a working system.
Systems without the F and D extensions are currently supported, but Linux distributions aren't targeting these as their first target. We test these regularly, but not to the extent that porting a full Linux distribution would so you might find bugs.
RV32I-based Linux systems are currently known to be broken, but there is nothing fundamentally wrong with them. Expect to run into a pile of bugs if you try to run Linux on an RV32I-based system today, but we'll eventually fix this.

Is GCC being replaced by LLVM? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I wonder whether LLVM by virtue of its newer design is to replace GCC in the open-source world?
LLVM should feature several techniques of inspecting code, so that IDE's are easier to program etc. However, GCC should still be good in terms of performance.
Short answer: No. They're both widely used depending on the context.
Long answer:
Depends, it's a matter of adoption as well as other factors.
For example, Apple uses LLVM (and Clang) for pretty much everything including building the kernel (previously built using GCC), bootloader and the userspace. As well as that, LLVM is used in the graphics drivers for compiling shaders to SGX USSE bytestreams, though here it's largely a case of eating your own dogfood.
As well as that, LLVM is also used in open source projects, for example in Mesa and in the Dolphin Emulator for JIT compilation.
Aside from that, GCC still has predominant usage, for example, Linux is built using GCC and while there have been attempts to build Linux using Clang+LLVM, they were more of an experiement than anything. As well as that, in the embedded world, a lot of embedded applications (for example, UBoot and Little Kernel) rely on features provided by GCC extensions and outright won't build with Clang+LLVM failing either at compilation to objects or linking stages.
For userspace applications however, it's largely a matter of personal (or your company's preference) since both of them offer roughly the same feature set including stuff like SIMD support and full support for C++14 and C11 (though GCC has some annoying unresolved bugs when it comes to C++ support, for example, Bug 61636).
The code inspection techniques are largely provided by Clang and in my personal experience provided a substantial amount of overhead (for example in Qt Creator and less so in XCode).

Getting started with Intel Processor Trace (Intel PT) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 months ago.
Improve this question
I have gone through Chapter 36 of "Intel® 64 and IA-32 Architectures
Software Developer’s Manual, Volume 3 (3A, 3B & 3C): System Programming Guide" and could understand the capabilities/features of Intel PT. However, I could not get information on how to use it. If I want to start capturing a trace, how should I proceed and where can I configure options that I am interested in? Any pointer to such information will be of great help. Once I have this information, I can follow above mentioned chapter 36 to perform analysis over the captured trace.
You can do it with Linux kernel 4.3, and these are the patch that goes in:
https://lkml.org/lkml/2013/12/11/233
https://lkml.org/lkml/2015/9/24/181
https://lkml.org/lkml/2015/9/27/45
This is on the interaction of PT with other Intel features like LBT:
https://lkml.org/lkml/2014/7/31/572
Read up the documentation at tools/perf/Documentation/intel-pt.txt on usage how to.
Andi Kleen from Intel is the originator of the patch for Skylakes/Broadwell (only these two processor support Intel PT), and he has the userspace tool for demonstrating its use for debugging:
https://github.com/andikleen/simple-pt
For example, the following are two different usage based on the tools above:
"sptcmd -c tcall taskset -c 0 ./tcall"
"sptdecode --sideband ptout.sideband --pt ptout.0".
The solution to your question consists of two distinct parts: First, you need to configure the processor of your system to start collecting the Processor Trace information and then dump that data into a file that can be processed later. Second, you need the tool that can make sense of the contents of that file.
The first question that has to be answered is: what OS are you running? The code that performs the processor configuration and data collection is going to need to run at the system/kernel level, so you will have to either be comfortable writing drivers for that space, or be able to find something that already does the job.
As mentioned above, the Linux kernel has built-in support for Processor Trace starting with the 4.1 kernel, incorporated into the perf facility. A few well worded searches should be all you need to take advantage of that.
For earlier versions of Linux, there is the simple-pt kernel module described above and found at: https://github.com/andikleen/simple-pt
This module can be made to work back to at least there 3.0 kernel, and is fairly straightforward to add. It also represents a good starting point if you want to port to a different operating system altogether, as it gives you an example of how to get the processor to do the right tricks to gather the data.
The library also has user-space utilities that are used to configure and control the simple-pt kernel module, as we as tools to decode the output of the module. Again, these can serve as starting points for your own projects if you need to move to a different OS. Note that these utilities require the Intel trace decoder library (libipt): https://github.com/01org/processor-trace.
Also note that the versions of simple-pt and libipt are not in sync. The latest simple-pt depends on an in-between releases version of libipt in order to build correctly.
For Linux there is also the kernel perf wiki https://perf.wiki.kernel.org and in particular for Intel PT there is page https://perf.wiki.kernel.org/index.php/Perf_tools_support_for_Intel%C2%AE_Processor_Trace

When starting off with Qt Framework, what to choose - Widgets or QT Quick? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I have a project in mind and want to take on it and have chosen QT as the preferred framework to begin with. I have been trying to figure out how to start and have Qt package (SDK and Qt Creator) installed. The problem is - I am not able to figure out the exact use-cases of Qt Quick and Qt Widgets. I plan to make the project for a long-term purpose with these properties:
It will be a desktop-only GUI application. If I ever want to make a mobile version, I would do that for the mobile platform in native or HTML5, and not Qt. So code-base compatibility with any mobile platform is not my concern.
Touch UI and animations are also not a part of the feature set. However, down the line support for creating graphs would be great (I can always use QtWebkit and JS to create some though)
Windows is the prime target. Linux and Mac would probably not be used by the target user(s).
It would need to be self-upgradable - now that is not much of a concern in making the choice but if there are problems with either, some knowledge would help me. I do not mind a full application installer download but updating modules independently would be a little better
It would need to talk to a web server for fetching and uploading data (I think HTTP would be Qt core's job but I do not know much about Qt yet).
The app would need tables with inline editing, a small picture gallery, menus, multi-part windows, drag-n-drop support etc. I could not find anything about menus relating to Qt Quick though.
Considering that use-case, what would be a better choice - Qt Widgets or Qt Quick?
A little about me and why I chose Qt - I have been out of touch from C++ since almost 2 years and have not made anything serious in Qt but Qt is a preferable choice over Java (which I do not like much). Again, I lack experience with Python. In addition to that Python UI sucks and if I have to install QT framework for a good UI, why not make the entire thing in Qt anyway (considering I am okay with C++). So Qt is the preferable choice for me. Since the project would need to be cross-platform compatible, Qt is even more attractive to my eyes.
QML will provide more support for customising widgets in a simple manner, Widgets gives you a set of tools ready to go that gives you platform styled controls in a very simple way. Both have their upsides, both have their downsides, I'd personally recommend getting started with Widgets first as there's a lot more historical documentation for them, so if you need to research something you'll have a bigger base to work with.
From your comment above, there's been little development on Widgets as the Qt development team feel that they don't need any additional work at this stage. They're stable, solid and reliable, there's not much that needs to be done to be improved, and when people need custom widgets they end up creating them themselves.

Hesitation between XCode and Qt [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm planning to develop a suite of application on various plateform using common module.
I'm still hesitating between XCode and Qt. Here is my development plan:
I need to develop a product A soon for MacOSX with simple user interface
I want to develop a similar product (B) on iOS using common modules with simple user interface
I want to develop a new product (C) cross plateform (Windows/MacOSX/Linux) using common modules with complex user interface
Here are the list of stuff to know:
Product A deals with graphics and video and needs strong performance (60fps not 58 or 59).
I'm worrying about developing product A on XCode because XCode is * but I'm wondering if there is some performance issue if I'm not doing native code.
I could eventually use Android for Product B but most of my client use iOS
Qt is perfect for product C.
My question is shall I start with XCode and then pass to Qt or start with Qt directly? I'm a start up so times matter but product B can be delayed. I need to take this decision right now so I would like to hear from you fellows :-)
Probably I will be beaten for such answer, but that based on around 15 years experience in Qt development (first version I started to work was 1.33.. OMG).
I am developing Qt cross platform application for most of my professional life (Win32/Linux/MacOS/embedded). Developing cross platform applications suppose to follow certain style of coding, libraries/3rd party tools you are going to use additional to Qt, but main issue is what should be you prime development platforms and others will be just targets.
And regarding development platform (although I am mainly MacOSX and Linux user) I think VS is the best one. Probably is a subject for another topic, but I believe that Visual Studio is fastest C++ development platform available. QtCreator (although it a very nice tool) never will be so good integrated in OS kernel for debugging purposes as native MS product. Same applied for Mac and Linux. Everything you debugging is at the end just front-end to GDB.. if you need to develop fast its about everything, how fast your editor, how fast you switch from Debug Command till first breakpoint reached.. And sadly for me, within Unix world there is nothing so integrated for development as Visual Studio for WinXX..
I am using Mac's last 10-12 years.. My current development machine is MacBook Pro (late 2011) + 16Gb.. and development within Parallels VM + Win7 + VS2012 is much much much faster and efficient then XCode or QtCreator.
I know that GDB shipped with Mac is older then my grad mom car, and updating it to latest stable make QtCreator 10 times more responsive..., but still then you make 1000+ lines of code daily overall speed is just not good enough.
That's not because XCode is bad, but XCode is an Objective-C platform and I dont think it's a right way to try fit Qt in..
Important note: everything said above not applied to VS2010 which is pure MS mistake. It's slow and buggy environment which shouldn't be considered as a production environment for anything. My path was (although I has all major MS VS releases) 6.0 -> 2008 -> 2012..
You can still use XCode for MacOSX applications, it's alot easier and quicker to use since all of the tools and preset graphics are there already.

Resources