error compiling embox for stm32f746-disco

48 views
Skip to first unread message

felix34

unread,
Feb 27, 2018, 11:36:52 AM2/27/18
to embox-devel
Hello ,


I'm trying to build embox with the stm32f746-disco template and I encounter an error:

/home/felix/embox/mk/extbld/arch-embox-gcc -include /home/felix/embox/src/include/sys/cdefs.h -D__ELF__  -fno-gnu89-inline -fno-builtin -O3 -fPIC  -std=c99 -Wall -I/home/felix/embox/build/extbld/third_party/lib/OpenLibm/openlibm-2252cbd02c176a31f74fa10f8fcdf926c3124987 -I/home/felix/embox/build/extbld/third_party/lib/OpenLibm/openlibm-2252cbd02c176a31f74fa10f8fcdf926c3124987/include -I/home/felix/embox/build/extbld/third_party/lib/OpenLibm/openlibm-2252cbd02c176a31f74fa10f8fcdf926c3124987/ -I/home/felix/embox/build/extbld/third_party/lib/OpenLibm/openlibm-2252cbd02c176a31f74fa10f8fcdf926c3124987/src -DASSEMBLER -D__BSD_VISIBLE -Wno-implicit-function-declaration -c src/s_fma.c -o src/s_fma.c.o
/tmp/cc8kRPif.s: Assembler messages:
/tmp/cc8kRPif.s:41: Error: selected processor does not support `vmrs r3,fpscr' in Thumb mode
/tmp/cc8kRPif.s:63: Error: selected processor does not support `vmsr fpscr,r3' in Thumb mode
Make.inc:144 : la recette pour la cible « src/s_fma.c.o » a échouée
make[6]: *** [src/s_fma.c.o] Erreur 1

It seems that I have a problem with my toolchain but I don't really understand why?


arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-none-eabi/4.9.3/lto-wrapper
Target: arm-none-eabi
Configured with: ../src/configure --build=x86_64-linux-gnu --prefix=/usr --includedir='/usr/lib/include' --mandir='/usr/lib/share/man' --infodir='/usr/lib/share/info' --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir='/usr/lib/lib/x86_64-linux-gnu' --libexecdir='/usr/lib/lib/x86_64-linux-gnu' --disable-maintainer-mode --disable-dependency-tracking --mandir=/usr/share/man --enable-languages=c,c++,lto --enable-multilib --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --build=x86_64-linux-gnu --target=arm-none-eabi --with-system-zlib --with-gnu-as --with-gnu-ld --with-pkgversion=15:4.9.3+svn231177-1 --without-included-gettext --prefix=/usr/lib --infodir=/usr/share/doc/gcc-arm-none-eabi/info --htmldir=/usr/share/doc/gcc-arm-none-eabi/html --pdfdir=/usr/share/doc/gcc-arm-none-eabi/pdf --bindir=/usr/bin --libexecdir=/usr/lib --libdir=/usr/lib --disable-libstdc++-v3 --host=x86_64-linux-gnu --with-headers=no --without-newlib --with-multilib-list=armv6-m,armv7-m,armv7e-m,armv7-r CFLAGS='-g -O2 -fstack-protector-strong' CPPFLAGS=-D_FORTIFY_SOURCE=2 CXXFLAGS='-g -O2 -fstack-protector-strong' FCFLAGS='-g -O2 -fstack-protector-strong' FFLAGS='-g -O2 -fstack-protector-strong' GCJFLAGS='-g -O2 -fstack-protector-strong' LDFLAGS='-Wl,-Bsymbolic-functions -Wl,-z,relro' OBJCFLAGS='-g -O2 -fstack-protector-strong' OBJCXXFLAGS='-g -O2 -fstack-protector-strong' INHIBIT_LIBC_CFLAGS=-DUSE_TM_CLONE_REGISTRY=0 AR_FOR_TARGET=arm-none-eabi-ar AS_FOR_TARGET=arm-none-eabi-as LD_FOR_TARGET=arm-none-eabi-ld NM_FOR_TARGET=arm-none-eabi-nm OBJDUMP_FOR_TARGET=arm-none-eabi-objdump RANLIB_FOR_TARGET=arm-none-eabi-ranlib READELF_FOR_TARGET=arm-none-eabi-readelf STRIP_FOR_TARGET=arm-none-eabi-strip
Thread model: single
gcc version 4.9.3 20150529 (prerelease) (15:4.9.3+svn231177-1)


Thank you for your help.

Best regards.

Felix.



Alex Kalmuk

unread,
Feb 27, 2018, 2:17:08 PM2/27/18
to embox...@googlegroups.com
Hello,

/tmp/cc8kRPif.s:41: Error: selected processor does not support `vmrs r3,fpscr' in Thumb mode
/tmp/cc8kRPif.s:63: Error: selected processor does not support `vmsr fpscr,r3' in Thumb mode
You got this error messages because the new version of OpenLibm generates an invalid code for Thumb instructions.
In my opinion, the most suitable way to solve the problem is to update your compiler. For instance, >= 5.4.1 works fine.


Now a few words about the reason why it happens (that's just my opinion)
OpenLibm has the following code:
#elif defined(__ARM_FP) && (__ARM_FP & 0x0C) != 0
#define __rfs(__fpsr)   __asm __volatile("vmrs %0,fpscr" : "=&r" (*(__fpsr)))
#define __wfs(__fpsr)   __asm __volatile("vmsr fpscr,%0" : : "r" (__fpsr))
#else
Yes, you can see here these invalid Thumb instructions. That is, if gcc has a predefined macro __ARM_FP (./arm-none-eabi-gcc -dM -E - < /dev/null),
than this code will be used, which doesn't seem to be a correct code in case of Thumb mode.
Now, your compiler defines __ARM_FP, while gcc 5.4.1 doesn't.

Best regards,
Alex

--
You received this message because you are subscribed to the Google Groups "embox-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to embox-devel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

felix34

unread,
Feb 27, 2018, 5:37:55 PM2/27/18
to embox-devel
Thank you Alex,

Eventually I changed the tool chain following your advice and the problem has been resolved.
I have used the last toolchain from ARM site:
  gcc-arm-none-eabi-7-2017-q4-major

But now I have an another error and he seems to be linked with a problem of toolchain:

EMBOX_GCC_LINK=full ./mk/extbld/arch-embox-gcc ./mk/extbld/toolchain_test.c -o ./build/base/obj/toolchain_test
./build/base/obj/embox.o: In function `run_cmd':
src/cmds/shell/tish.c:171: undefined reference to `task_self_module_ptr_set'
collect2: error: ld returned 1 exit status
mk/extbld/toolchain.mk:76 : la recette pour la cible « build/base/obj/toolchain_test » a échouée

I don't understand very well how to set the toolchain.
I have installed the toolchain like advised by ARM in /home/opt and set an environment variable using  export to bind the location of my toolchain bin folder  to arm-none-eabi-
and it works.But how  I set the toolchain  lib paths?.


I don't want to waist your time.Feel free to help me or not.

Felix.

Alex Kalmuk

unread,
Feb 28, 2018, 2:41:47 AM2/28/18
to embox...@googlegroups.com
./build/base/obj/embox.o: In function `run_cmd':
src/cmds/shell/tish.c:171: undefined reference to `task_self_module_ptr_set'
I think the problem is in the selected template.
I checked default template for stm32f7, it built successfully ("make confload-arm/stm32f7cube"). You сould try to use this one.
I guess you're trying "platform/stm32f7/stm32f7_discovery", which is less supported than "arm/stm32f7cube".
And I see it is broken, we will fix it soon.

I have installed the toolchain like advised by ARM in /home/opt and set an environment variable using  export to bind the location of my toolchain bin folder  to arm-none-eabi-
and it works.But how  I set the toolchain  lib paths?.
 Exporting PATH variable is enough (alternatively, you can set it in your ~/.profile). So there is no problem with your toolchain.
 
Feel free to discuss your problems here, we will try to help as soon as we can.

Best regards,
Alex


felix34

unread,
Feb 28, 2018, 11:19:38 AM2/28/18
to embox-devel

Hello Alex,

I have build with sucess ( no errors ) the arm/stm32f7cube template.
But after I load the binary to the target ( stm32f746g disco board) the board doesn't run.
No debug messages or init messages on the two UART, no IP...etc..
Could you give me a config file that would works for this board?
I have attached the config files.
On this board, I use uart6 ( connector CN4 ) and there is also the stlink virtual com (should be usart1 )...
Thank you.

Felix.
To unsubscribe from this group and stop receiving emails from it, send an email to embox-devel...@googlegroups.com.
start_script.inc
lds.conf
build.conf
mods.config

Alex Kalmuk

unread,
Feb 28, 2018, 12:29:42 PM2/28/18
to embox...@googlegroups.com
We do not configure uart6 on the board, so you could try to use virtual com (CN14) through the usual micro-usb cable.

If you haven't changed the config it should be ok.

There is a description on how to launch Embox on this board - https://github.com/embox/embox/wiki/Running-Embox-on-STM32xxDiscovery
Please, read it first in case if you have not yet done so, probably it can help you.

Best regards,
Alex

To unsubscribe from this group and stop receiving emails from it, send an email to embox-devel+unsubscribe@googlegroups.com.

felix34

unread,
Feb 28, 2018, 6:38:28 PM2/28/18
to embox-devel
Hi Alex,

I have found that my problem was the too recent toolchain ( I used arm-none-eabi- v7 and then v6...compilation is done without error but the board  is not working.. ).
I have installed the 5.4.1 and the arm/stm32f7 template is running on my board.
All is working ( telnetd httpd ping etc.. ).

Thank you for your help.

Felix.  

Alex Kalmuk

unread,
Mar 1, 2018, 2:23:43 AM3/1/18
to embox...@googlegroups.com
Hi Felix,

Great. Feel free to ask us further if you face any problems with Embox.
Thank you! We will test recent versions of the toolchain.

Best regards,
Alex

To unsubscribe from this group and stop receiving emails from it, send an email to embox-devel+unsubscribe@googlegroups.com.

Alex Kalmuk

unread,
Mar 1, 2018, 4:35:35 AM3/1/18
to embox...@googlegroups.com
Felix,

 I used arm-none-eabi- v7 and then v6...compilation is done without error but the board  is not working..
I installed gcc-arm-none-eabi-7-2017-q4-major too, and Embox seems to be running well (I see the output in minicom).

Could you retry compiling with gcc v7? Just to make sure you're doing the same steps for both v5 and v7.
In case if gcc v7 results in "a bad binary" yet, provide please your build/base/bin/embox.

Best regards,
Alex

Alex Kalmuk

unread,
Mar 1, 2018, 4:38:27 AM3/1/18
to embox...@googlegroups.com
Before compiling, don't forget to execute
make distclean

Then
make confload-arm/stm32f7cube
...

Best regards,
Alex

felix34

unread,
Mar 1, 2018, 10:44:31 AM3/1/18
to embox-devel
Hello Alex,

You are rght...using the last arm-none-ebi-xxx v7 toolchain works fine.
I was flashing the binary with a wrong method.


      route - Manipilate routing table
       ping - Send ICMP ECHO_REQUEST to network hosts
    telnetd - Start telnetd server
      httpd - Start HTTP server
http_admin_backend -
       help - Shows all available commands
    version - Displays info associated with compilation
       exit - exit from shell
     logout - logout current user
embox>version

.------.          _
|  ____|         | |
| |____ _ __ ___ | |_    _____  __
|  ____| '_ ` _ \|  _ \ / _ \ \/ /
| |____| | | | | | |_) | (_) >  < 
|______|_| |_| |_|____/ \___/_/\_\

Date:  Mar  1 2018
Time:  16:12:16
Compiler: 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204]
embox>

Thank you.


Felix.

Alex Kalmuk

unread,
Mar 1, 2018, 11:25:47 AM3/1/18
to embox...@googlegroups.com
Hi Felix,

Well done :)

Best regards,
Alex

To unsubscribe from this group and stop receiving emails from it, send an email to embox-devel+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages