<font size=2 face="sans-serif">Thanks so far!</font>
<br>
<br><font size=2 face="sans-serif">I have 3 questions for my understanding:</font>
<br>
<br><font size=2 face="sans-serif">1.) How to define extra Include Paths
if the module needs some extra Includes?</font>
<br><font size=2 face="sans-serif"> Like
the "mach/gpio.h", which should be under "<Kernel-Dir>/arch/arm/mach-at91/include"
and is needed for the PIN definitions.</font>
<br><font size=2 face="sans-serif"> Should
it be done at the Makefile like:</font>
<br><font size=2 face="sans-serif">
CFLAGS_hello.o += -I${COMPILER_INCLUDE}
-I${KERNEL_DIR}/arch/arm/mach-at91/include</font>
<br><font size=2 face="sans-serif"> 1.1)
What are the equivalents to ${COMPILER_INCLUDE} and ${KERNEL_DIR} in Yocto?</font>
<br><font size=2 face="sans-serif"> 1.2)
Should it be done in the Makefile or at the bb-File?</font>
<br><font size=2 face="sans-serif">2.) How to activate/deactivate the Driver
in the "local.conf"?</font>
<br><font size=2 face="sans-serif">3.) How does the process works with
cmake?</font>
<br><font size=2 face="sans-serif"> 3.1)
Is it enough to inherit after modul cmake?</font>
<br><font size=2 face="sans-serif"> like
@ hello-mod_0.1.bb -> "inherit module cmake"</font>
<br>
<br>
<br><font size=2 face="sans-serif">With kind regards!<br>
<br>
Stefan Jaritz<br>
Entwickler<br>
<br>
------------------------------------------------------------<br>
ESA Elektroschaltanlagen Grimma GmbH<br>
Broner Ring 30<br>
04668 Grimma<br>
Telefon: +49 3437 9211 176<br>
Telefax: +49 3437 9211 26<br>
E-Mail: s.jaritz@esa-grimma.de<br>
Internet: </font><a href="www.esa-grimma.de"><font size=2 face="sans-serif">www.esa-grimma.de</font></a><font size=2 face="sans-serif"><br>
<br>
<br>
Geschäftsführer:<br>
Dipl.-Ing. Jörg Gaitzsch<br>
Jörg Reinker<br>
<br>
Sitz der Gesellschaft: Grimma<br>
Ust.-ID: DE 141784437<br>
Amtsgericht: Leipzig, HRB 5159<br>
Steuernummer: 238/108/00755<br>
<br>
<br>
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
<br>
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich
erhalten <br>
haben, informieren Sie bitte sofort den Absender und löschen Sie diese
<br>
Nachricht. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser
Mail <br>
ist nicht gestattet.<br>
<br>
This e-mail may contain confidential and/or privileged information. If
you are <br>
not the intended recipient (or have received this e-mail in error) please
<br>
notify the sender immediately and destroy this e-mail. Any unauthorized
<br>
copying, disclosure or distribution of the material in this e-mail is strictly
<br>
forbidden.</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">Von:
</font><font size=1 face="sans-serif">"Esponde, Joel"
<Joel.Esponde@Honeywell.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">An:
</font><font size=1 face="sans-serif">"petter@technux.se"
<petter@technux.se>, "yocto@yoctoproject.org" <yocto@yoctoproject.org></font>
<br><font size=1 color=#5f5f5f face="sans-serif">Datum:
</font><font size=1 face="sans-serif">10.05.2016 12:30</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Betreff:
</font><font size=1 face="sans-serif">Re: [yocto]
How to build a simple kernel modul</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Gesendet von:
</font><font size=1 face="sans-serif">yocto-bounces@yoctoproject.org</font>
<br>
<hr noshade>
<br>
<br>
<br><font size=3 color=#400000 face="Calibri">Hi,</font>
<br><font size=3 color=#400000 face="Calibri"> </font>
<br><font size=3 color=#400000 face="Calibri">And here is a hello world
module example:</font>
<br><a href="http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta-skeleton/recipes-kernel/hello-mod"><font size=3 color=blue face="Calibri"><u>http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta-skeleton/recipes-kernel/hello-mod</u></font></a>
<br><font size=3 color=#400000 face="Calibri"> </font>
<br><font size=3 color=#808080 face="Arial"><b>Joël Esponde</b></font>
<br><font size=3 color=#808080 face="Arial"><b>Honeywell </b>| Sensing
and Productivity Solutions</font>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=3 face="Calibri"><b>De :</b> yocto-bounces@yoctoproject.org
[</font><a href="mailto:yocto-bounces@yoctoproject.org"><font size=3 face="Calibri">mailto:yocto-bounces@yoctoproject.org</font></a><font size=3 face="Calibri">]
<b>De la part de</b> Petter Mabäcker<b><br>
Envoyé :</b> mardi 10 mai 2016 06:51<b><br>
À :</b> yocto@yoctoproject.org<b><br>
Objet :</b> Re: [yocto] How to build a simple kernel modul</font>
<br><font size=3 face="Times New Roman"> </font>
<p><font size=3 face="sans-serif">2016-05-09 17:06 skrev </font><a href="mailto:S.Jaritz@esa-grimma.de"><font size=3 color=blue face="sans-serif"><u>S.Jaritz@esa-grimma.de</u></font></a><font size=3 face="sans-serif">:</font>
<br><font size=3 face="Arial">Hej,</font><font size=3 face="sans-serif">
<br>
</font><font size=3 face="Arial"><br>
I want to build a recipe for a simple GPIO Module. I found no tutorial
at the documentation. What is the comon way to build a simple kernel module?</font><font size=3 face="sans-serif">
<br>
</font><font size=3 face="Arial"><br>
The Makefile looks like:</font><font size=3 face="sans-serif"> </font><font size=3 face="Arial"><br>
#########</font><font size=3 face="sans-serif"> </font><font size=3 face="Arial"><br>
obj-m += ledmodule.o</font><font size=3 face="sans-serif"> <br>
</font><font size=3 face="Arial"><br>
SRC := $(shell pwd)</font><font size=3 face="sans-serif"> <br>
</font><font size=3 face="Arial"><br>
all: modules</font><font size=3 face="sans-serif"> <br>
</font><font size=3 face="Arial"><br>
modules:</font><font size=3 face="sans-serif"> </font><font size=3 face="Arial"><br>
$(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules</font><font size=3 face="sans-serif">
<br>
</font><font size=3 face="Arial"><br>
modules_install:</font><font size=3 face="sans-serif"> </font><font size=3 face="Arial"><br>
$(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install</font><font size=3 face="sans-serif">
<br>
</font><font size=3 face="Arial"><br>
clean:</font><font size=3 face="sans-serif"> </font><font size=3 face="Arial"><br>
rm -rf *.o *.ko *.mod.c</font><font size=3 face="sans-serif">
</font><font size=3 face="Arial"><br>
#########</font><font size=3 face="sans-serif"> </font><font size=3 face="Arial"><br>
The recipe contains:</font><font size=3 face="sans-serif"> </font><font size=3 face="Arial"><br>
#########</font><font size=3 face="sans-serif"> </font><font size=3 face="Arial"><br>
SUMMARY = "ledmodule"</font><font size=3 face="sans-serif"> </font><font size=3 face="Arial"><br>
SECTION = ""</font><font size=3 face="sans-serif"> </font><font size=3 face="Arial"><br>
LICENSE = "CLOSED"</font><font size=3 face="sans-serif"> <br>
</font><font size=3 face="Arial"><br>
inherit module</font><font size=3 face="sans-serif"> <br>
</font><font size=3 face="Arial"><br>
SRC_URI = "</font><a href=file://sek4_ledmodule.c/><font size=3 color=blue face="Arial"><u>file://ledmodule.c</u></font></a><font size=3 face="Arial">
\</font><font size=3 face="sans-serif"> </font><font size=3 face="Arial"><br>
</font><a href=file://Makefile/><font size=3 color=blue face="Arial"><u>file://Makefile</u></font></a><font size=3 face="Arial">
\</font><font size=3 face="sans-serif"> </font><font size=3 face="Arial"><br>
"</font><font size=3 face="sans-serif">
</font><font size=3 face="Arial"><br>
S = "${WORKDIR}/ledmodule-0.1"</font><font size=3 face="sans-serif">
</font><font size=3 face="Arial"><br>
#########</font><font size=3 face="sans-serif"> <br>
</font><font size=3 face="Arial"><br>
Regards<br>
<br>
Stefan Jaritz<br>
Entwickler<br>
<br>
------------------------------------------------------------<br>
ESA Elektroschaltanlagen Grimma GmbH<br>
Broner Ring 30<br>
04668 Grimma<br>
Telefon: +49 3437 9211 176<br>
Telefax: +49 3437 9211 26<br>
E-Mail: </font><a href="mailto:s.jaritz@esa-grimma.de"><font size=3 color=blue face="Arial"><u>s.jaritz@esa-grimma.de</u></font></a><font size=3 face="Arial"><br>
Internet: </font><a href="http://www.esa-grimma.de/"><font size=3 color=blue face="Arial"><u>www.esa-grimma.de</u></font></a><font size=3 face="Arial"><br>
<br>
<br>
Geschäftsführer:<br>
Dipl.-Ing. Jörg Gaitzsch<br>
Jörg Reinker<br>
<br>
Sitz der Gesellschaft: Grimma<br>
Ust.-ID: DE 141784437<br>
Amtsgericht: Leipzig, HRB 5159<br>
Steuernummer: 238/108/00755<br>
<br>
<br>
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
<br>
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich
erhalten <br>
haben, informieren Sie bitte sofort den Absender und löschen Sie diese
<br>
Nachricht. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser
Mail <br>
ist nicht gestattet.<br>
<br>
This e-mail may contain confidential and/or privileged information. If
you are <br>
not the intended recipient (or have received this e-mail in error) please
<br>
notify the sender immediately and destroy this e-mail. Any unauthorized
<br>
copying, disclosure or distribution of the material in this e-mail is strictly
<br>
forbidden.</font>
<p><font size=3 face="sans-serif">Hi,</font>
<p><font size=3 face="sans-serif"><br>
There are actually some guides for this, see lab4 in:</font><font size=3 color=blue face="sans-serif"><u><br>
</u></font><a href="https://www.yoctoproject.org/sites/default/files/kernel-lab-2.1_0.pdf"><font size=3 color=blue face="sans-serif"><u>https://www.yoctoproject.org/sites/default/files/kernel-lab-2.1_0.pdf</u></font></a>
<p><font size=3 face="sans-serif">But to simply build a module using bitbake,
you can just do:</font>
<p><font size=3 face="sans-serif">$ bitbake ledmodule</font>
<p><font size=3 face="sans-serif">then you will find your recipe and the
module in the ./tmp/work/ structure (assuming you are not inheriting 'rm_work'
in local.conf...).</font>
<p><font size=3 face="sans-serif"> </font>
<p><font size=3 face="sans-serif">if you just want to compile it, you can
run:</font>
<p><font size=3 face="sans-serif">$ bitbake ledmodule -c compile</font>
<p><font size=3 face="sans-serif"> </font>
<p><font size=3 face="sans-serif">BR Petter</font>
<br><font size=3 face="Courier New">Petter Mabäcker</font>
<br><font size=3 face="Courier New"> </font>
<br><font size=3 face="Courier New">Technux <</font><a href=mailto:petter@technux.se><font size=3 color=blue face="Courier New"><u>petter@technux.se</u></font></a><font size=3 face="Courier New">></font>
<br><a href=http://www.technux.se/><font size=3 color=blue face="Courier New"><u>www.technux.se</u></font></a><tt><font size=2>--
<br>
_______________________________________________<br>
yocto mailing list<br>
yocto@yoctoproject.org<br>
</font></tt><a href=https://lists.yoctoproject.org/listinfo/yocto><tt><font size=2>https://lists.yoctoproject.org/listinfo/yocto</font></tt></a><tt><font size=2><br>
</font></tt>
<br>