[prev in list] [next in list] [prev in thread] [next in thread] 

List:       uclinux-dev
Subject:    Re: [uClinux-dev] Cortex-M7: Enable FPU and Cache Support (STM32F7xx)
From:       "A. Brand" <tecnologic86 () gmail ! com>
Date:       2017-01-03 14:50:01
Message-ID: CAO1Gq2Ktww7mPT11Pi4LyLxZZ_e5yq7tWBv=ymYr6=B764H_Cw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Waldemar,

thanks for ur reply.

Waldemar Brodkorb <wbx@openadk.org> schrieb am Mo., 2. Jan. 2017 um
18:43 Uhr:

> Hi Alex,
> A. Brand wrote,
> 
> > Hi together,
> > 
> > normally i work bare metal on Cortex-M devices. But with devices such as
> the
> > Cortex-M7 with more than 200MHz, i think of using uclinux for my coming
> IoT
> > applications.
> > 
> > How is the actual status of the Cortex-M7 Support? My first Target will
> be the
> > STM32F769 Discovery board.
> 
> I can not speak for the uClinux distribution, I can only tell from
> my point of view. Buildroot does have sample defconfigs and tested
> support for Cortex-M4 (stm32f429_disco_defconfig /
> stm32f469_disco_defconfig). They use uClibc-ng and simple C
> applications incuding Linuxthreads should work fine.
> As binary format, FLAT is used.
> 
I actually build this configuration already, with stock buildroot
configuration. Due to the similarities
between the stm32 lines i should try to boot this on my hardware.

> As i read the discussions according FPU support for arm v7m devices, i
> can not
> > use the gnu arm gcc toolchain by arm hosted at:
> https://launchpad.net/
> > gcc-arm-embedded
> > because this toolchain was linked against newlib, am i right? I need a
> least
> > one linked against uClib?
> 
> Not sure, may be this depends on the functions you want to use from
> the C library. I have read newlib has some kind of FPU support.
> 

My question was not concerning the libs support. I think of building the
kernel with hard float support, cause i plan to make heavy use of floating
point in a device driver.

> 
> > So to get a toolchain supporting a arm v7m with fpv5-sp-d16 i need to
> add a
> > configuration for the cortex-m7 to buildroot. According to this thread:
> > http://buildroot-busybox.2317881.n4.nabble.com/
> > PATCH-00-16-ARM-Cortex-M-support-td129310.html i have to adapt the
> dropped
> > patch for the FPU support of the M4 to the M7 FPU.
> > 
> > Ok then i have a toolchain, but as i read through the thread why the FPU
> patch
> > was dropped, it seems i have another problem.
> > 
> > The V7M port of linux mainline has no support for the CONFIG_VFP option.
> It
> > seems fpu register stack save for task switches is not implemented yet.
> Is that
> > right? Were in the source tree can i look at the
> > hardware dependent code for the task switch? So i can try to add lazy fpu
> > register save an test it.
> > 
> > In search of a maintainer of the stm32 port i found Alexandre Torgues
> branch at
> > kernel.org as the one with the latest commits. But i found no recent
> commits on
> > fpu handling.
> 
> May be Maxime Coquelin knows more about it, as he seems to be
> involved in STM32 bootloader afboot-stm32, kernel and openocd for this
> targets.
> But why do you think there is some hardware dependent code involved?
> 
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/kernel/signal.c?id=refs/tags/v4.10-rc2
> 

To my shame i have not looked at the code. So i will resurrect the patches
from the linked thread, port them to my needs and give it a try.


> 
> > Thanks for reading this novel.
> > 
> > Does anybody have any suggestions where i can start my development?
> > Which toolchain to use? Buildroot, something manually built?
> > On which branch of the kernel should i clone?
> > 
> > Thanks in advance.
> 
> You can try looking at http://www.emcraft.com to see if they support
> FPU's in their ARM Cortex-M products.
> https://github.com/EmcraftSystems

I have my problems with using a toolchain from 2010 with a cpu from 2017. I
dont see that emcraft is using an other toolchain than stated here:
https://www.emcraft.com/som/stm32f7-212/installing-activating-cde furthermore
this doc was updated in sep. 2016.

> 
> 
> There is an evaluation to use FDPIC as binary format, it involves
> toolchain and kernel modifications:
> https://github.com/mickael-guene/fdpic_manifest
> The toolchain is built as soft-float.
> 
> Rob Landley and Rich Felker started porting musl to ARM
> noMMU devices. There requirement is FDPIC support in gcc and kernel, as
> Musl
> does not support FLAT binaries.
> http://www.openwall.com/lists/musl/2016/12/07/2
> Do not read the complete thread, as Rob and I diverged to discuss
> other topics ;)
> And _that_ is a novel ;)
> 
This is totally weird stuff. I will definitely have a eye on FDPIC, but for
me its in a too early stage and i have to little experience in this area.

> 
> <selfpromotion>
> If you want to try an underdog project with fresh Cortex-M7 toolchain
> support, try http://www.openadk.org/
> </selfpromotion>
> 
I will give it a try. Maybe i contribute a configuration for the F769.


> 
> Or if this is all too confusing, keep going using bare-metal ;)
> 
> http://www.st.com/content/ccc/resource/technical/document/application_note/10/6b/dc/ \
> ea/5b/6e/47/46/DM00047230.pdf/files/DM00047230.pdf/jcr:content/translations/en.DM00047230.pdf
> 

No this is boring, its my every day work, nothing for a hobby :).

regrads,

Alex


[Attachment #5 (text/html)]

<div dir="ltr">Hi Waldemar,<div><br></div><div>thanks for ur reply.<br><br><div \
class="gmail_quote"><div dir="ltr">Waldemar Brodkorb &lt;<a \
href="mailto:wbx@openadk.org">wbx@openadk.org</a>&gt; schrieb am Mo., 2. Jan. 2017 um \
18:43  Uhr:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Alex,<br class="gmail_msg"> A. \
Brand wrote,<br class="gmail_msg"> <br class="gmail_msg">
&gt; Hi together,<br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; normally i work bare metal on Cortex-M devices. But with devices such as the<br \
class="gmail_msg"> &gt; Cortex-M7 with more than 200MHz, i think of using uclinux for \
my coming IoT<br class="gmail_msg"> &gt; applications.  <br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; How is the actual status of the Cortex-M7 Support? My first Target will be \
the<br class="gmail_msg"> &gt; STM32F769 Discovery board.  <br class="gmail_msg">
<br class="gmail_msg">
I can not speak for the uClinux distribution, I can only tell from<br \
class="gmail_msg"> my point of view. Buildroot does have sample defconfigs and \
tested<br class="gmail_msg"> support for Cortex-M4 (stm32f429_disco_defconfig /<br \
class="gmail_msg"> stm32f469_disco_defconfig). They use uClibc-ng and simple C<br \
class="gmail_msg"> applications incuding Linuxthreads should work fine.<br \
class="gmail_msg"> As binary format, FLAT is used.<br \
class="gmail_msg"></blockquote><div>I actually build this configuration already, with \
stock buildroot configuration. Due to the similarities</div><div>between the stm32 \
lines i should try to boot this on my hardware.</div><div><br></div><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> &gt; As i read the discussions according FPU support for arm \
v7m devices, i can not<br class="gmail_msg"> &gt; use the gnu arm gcc toolchain by \
arm hosted at:      <a href="https://launchpad.net/" rel="noreferrer" \
class="gmail_msg" target="_blank">https://launchpad.net/</a><br class="gmail_msg"> \
&gt; gcc-arm-embedded<br class="gmail_msg"> &gt; because this toolchain was linked \
against newlib, am i right? I need a least<br class="gmail_msg"> &gt; one linked \
against uClib?<br class="gmail_msg"> <br class="gmail_msg">
Not sure, may be this depends on the functions you want to use from<br \
class="gmail_msg"> the C library. I have read newlib has some kind of FPU support.<br \
class="gmail_msg"></blockquote><div>  </div><div>My question was not concerning the \
libs support. I think of building the kernel with hard float support, cause i plan to \
make heavy use of floating point in a device driver.  </div><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> <br class="gmail_msg">
&gt; So to get a toolchain supporting a arm v7m with  fpv5-sp-d16 i need to add a<br \
class="gmail_msg"> &gt; configuration for the cortex-m7 to buildroot. According to \
this thread:<br class="gmail_msg"> &gt; <a \
href="http://buildroot-busybox.2317881.n4.nabble.com/" rel="noreferrer" \
class="gmail_msg" target="_blank">http://buildroot-busybox.2317881.n4.nabble.com/</a><br \
class="gmail_msg"> &gt; PATCH-00-16-ARM-Cortex-M-support-td129310.html i have to \
adapt the dropped<br class="gmail_msg"> &gt; patch for the FPU support of the M4 to \
the M7 FPU.<br class="gmail_msg"> &gt;<br class="gmail_msg">
&gt; Ok then i have a toolchain, but as i read through the thread why the FPU \
patch<br class="gmail_msg"> &gt; was dropped, it seems i have another problem.<br \
class="gmail_msg"> &gt;<br class="gmail_msg">
&gt; The V7M port of linux mainline has no support for the CONFIG_VFP option. It<br \
class="gmail_msg"> &gt; seems fpu register stack save for task switches is not \
implemented yet. Is that<br class="gmail_msg"> &gt; right? Were in the source tree \
can i look at the<br class="gmail_msg"> &gt; hardware dependent code for the task \
switch? So i can try to add lazy fpu<br class="gmail_msg"> &gt; register save an test \
it.<br class="gmail_msg"> &gt;<br class="gmail_msg">
&gt; In search of a maintainer of the stm32 port i found Alexandre Torgues branch \
at<br class="gmail_msg"> &gt; <a href="http://kernel.org" rel="noreferrer" \
class="gmail_msg" target="_blank">kernel.org</a> as the one with the latest commits. \
But i found no recent commits on<br class="gmail_msg"> &gt; fpu handling.<br \
class="gmail_msg"> <br class="gmail_msg">
May be Maxime Coquelin knows more about it, as he seems to be<br class="gmail_msg">
involved in STM32 bootloader afboot-stm32, kernel and openocd for this<br \
class="gmail_msg"> targets.<br class="gmail_msg">
But why do you think there is some hardware dependent code involved?<br \
class="gmail_msg"> <a \
href="https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/kernel/signal.c?id=refs/tags/v4.10-rc2" \
rel="noreferrer" class="gmail_msg" \
target="_blank">https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/kernel/signal.c?id=refs/tags/v4.10-rc2</a></blockquote><div>To \
my shame i have not looked at the code. So i will resurrect the patches from the \
linked thread, port them to my needs and give it a \
try.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="gmail_msg"> <br \
class="gmail_msg"> &gt; Thanks for reading this novel.  <br class="gmail_msg">
&gt;<br class="gmail_msg">
&gt; Does anybody have any suggestions where i can start my development?<br \
class="gmail_msg"> &gt; Which toolchain to use? Buildroot, something manually \
built?<br class="gmail_msg"> &gt; On which branch of the kernel should i clone?<br \
class="gmail_msg"> &gt;<br class="gmail_msg">
&gt; Thanks in advance.<br class="gmail_msg">
<br class="gmail_msg">
You can try looking at <a href="http://www.emcraft.com" rel="noreferrer" \
class="gmail_msg" target="_blank">http://www.emcraft.com</a> to see if they \
support<br class="gmail_msg"> FPU&#39;s in their ARM Cortex-M products.<br \
class="gmail_msg"> <a href="https://github.com/EmcraftSystems" rel="noreferrer" \
class="gmail_msg" target="_blank">https://github.com/EmcraftSystems</a></blockquote><div>I \
have my problems with using a toolchain from 2010 with a cpu from 2017. I dont see \
that emcraft is using an other toolchain than stated here: <a \
href="https://www.emcraft.com/som/stm32f7-212/installing-activating-cde">https://www.emcraft.com/som/stm32f7-212/installing-activating-cde</a> \
furthermore this doc was updated in sep. 2016.   </div><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><br class="gmail_msg"> <br class="gmail_msg">
There is an evaluation to use FDPIC as binary format, it involves<br \
class="gmail_msg"> toolchain and kernel modifications:<br class="gmail_msg">
<a href="https://github.com/mickael-guene/fdpic_manifest" rel="noreferrer" \
class="gmail_msg" target="_blank">https://github.com/mickael-guene/fdpic_manifest</a><br \
class="gmail_msg"> The toolchain is built as soft-float.<br class="gmail_msg">
<br class="gmail_msg">
Rob Landley and Rich Felker started porting musl to ARM<br class="gmail_msg">
noMMU devices. There requirement is FDPIC support in gcc and kernel, as Musl<br \
class="gmail_msg"> does not support FLAT binaries.<br class="gmail_msg">
<a href="http://www.openwall.com/lists/musl/2016/12/07/2" rel="noreferrer" \
class="gmail_msg" target="_blank">http://www.openwall.com/lists/musl/2016/12/07/2</a><br \
class="gmail_msg"> Do not read the complete thread, as Rob and I diverged to \
discuss<br class="gmail_msg"> other topics ;)<br class="gmail_msg">
And _that_ is a novel ;)<br class="gmail_msg"></blockquote><div>This is totally weird \
stuff. I will definitely have a eye on FDPIC, but for me its in a too early stage and \
i have to little experience in this area.</div><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br \
class="gmail_msg"> &lt;selfpromotion&gt;<br class="gmail_msg">
If you want to try an underdog project with fresh Cortex-M7 toolchain<br \
class="gmail_msg"> support, try <a href="http://www.openadk.org/" rel="noreferrer" \
class="gmail_msg" target="_blank">http://www.openadk.org/</a><br class="gmail_msg"> \
&lt;/selfpromotion&gt;<br class="gmail_msg"></blockquote><div>I will give it a try. \
Maybe i contribute a configuration for the F769.</div><div>  </div><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> <br class="gmail_msg">
Or if this is all too confusing, keep going using bare-metal ;)<br class="gmail_msg">
<a href="http://www.st.com/content/ccc/resource/technical/document/application_note/10 \
/6b/dc/ea/5b/6e/47/46/DM00047230.pdf/files/DM00047230.pdf/jcr:content/translations/en.DM00047230.pdf" \
rel="noreferrer" class="gmail_msg" \
target="_blank">http://www.st.com/content/ccc/resource/technical/document/application_ \
note/10/6b/dc/ea/5b/6e/47/46/DM00047230.pdf/files/DM00047230.pdf/jcr:content/translations/en.DM00047230.pdf</a></blockquote><div>No \
this is boring, its my every day work, nothing for a hobby :).</div><div>  \
</div><div>regrads,</div><div><br></div><div>Alex</div></div></div></div>



_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic