Page 1 of 2

build Chibios Under Atollic

Posted: Fri Mar 02, 2018 12:39 pm
by Tabulous
Just wondered if anyone had done this ?

I.e. the New Atollic for STM32 and Chibios 16.1 ?

Re: build Chibios Under Atollic

Posted: Fri Mar 02, 2018 1:18 pm
by Tabulous
it builds but it gets linkers errors, note this project builds fine in chibistudio.

Linking build/debug/t7_app.elf
c:/program files (x86)/atollic/truestudio for stm32 9.0.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: section .test VMA [2001fffc,2001ffff] overlaps section .heap VMA [2001df1c,2001ffff]
c:/program files (x86)/atollic/truestudio for stm32 9.0.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/lib/armv7e-m\libc.a(lib_a-mallocr.o): In function `_malloc_r':
mallocr.c:(.text._malloc_r+0x408): undefined reference to `malloc_getpagesize_P'
mallocr.c:(.text._malloc_r+0x410): undefined reference to `malloc_getpagesize_P'
c:/program files (x86)/atollic/truestudio for stm32 9.0.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/lib/armv7e-m\libc.a(lib_a-freer.o): In function `_malloc_trim_r':
mallocr.c:(.text._malloc_trim_r+0xa8): undefined reference to `malloc_getpagesize_P'
collect2.exe: error: ld returned 1 exit status
make: *** [build/debug/t7_app.elf] Error 1

Re: build Chibios Under Atollic

Posted: Fri Mar 02, 2018 1:42 pm
by Giovanni
It looks like a customized compiler and library.

Giovanni

Re: build Chibios Under Atollic

Posted: Fri Mar 02, 2018 4:56 pm
by Tabulous
Yeah looks like it is. I copy over the files from Chibistudio and got it to compile ok.

Re: build Chibios Under Atollic

Posted: Fri Mar 02, 2018 5:44 pm
by Giovanni
If you can use the GCC provided by ARM then the rest of the environment should be OK, Eclipse basically.

Personally I prefer to avoid being bound by specific environments, ChibiStudio is an assembly of "standard" parts.

Giovanni

Re: build Chibios

Posted: Wed Sep 05, 2018 4:57 pm
by crispus
I have a similar issue while trying to compile for STM32H743ZIT6

Code: Select all

/usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/bin/ld: section .rodata VMA [0000000008008e90,0000000008009e77] overlaps section .text VMA [00000000080002c0,0000000008008eab]

I am using command line (Debian testing) with the Makefile from ChibiOS example (nucleo board). The difference is that I have some c++ files.
I use same Makefile (with the appropriate linker/headers/etc changes) to compile it for STM32F767ZIT6 and it works.

Code: Select all

$ .vfp11_veneer   0x0000000008008eac        0x0 load address 0x0000000008008e90
.v4_bx          0x0000000008008eac        0x0 load address 0x0000000008008e90
.iplt           0x0000000008008eac        0x0 load address 0x0000000008008e90
.rodata         0x0000000008008e90      0xfe8
                0x0000000008008e90                __rodata_base__ = .
 .rodata        0x0000000008008e90        0x4 /usr/lib/gcc/arm-none-eabi/6.3.1/../../../arm-none-eabi/lib/thumb/v7e-m/libg.a(lib_a-impure.o)
                0x0000000008008e90                _global_impure_ptr

Code: Select all

.text           0x00000000080002c0     0x8bec load address 0x00000000080002a4
                0x00000000080002c0                __text_base = .
 .text          0x00000000080002c0       0xd8 build_STM32H743ZIT6/obj/crt0_v7m.o
                0x00000000080002c0                _crt0_entry

I used two version of compilers: 6.3.1 and 7.3.1

L.E: I checked, same flags are used in both variations, same flags on nucleo H7 board example.

Code: Select all

 -mcpu=cortex-m7 -mthumb -O0 -ggdb -fomit-frame-pointer -falign-functions=16 -Werror  -ffunction-sections -fdata-sections -fno-common -flto -nostartfiles  -Wl,-Map=build_STM32H743ZIT6/xxx.map,--cref,--no-warn-mismatch,--library-path=./os/common/startup/ARMCMx/compilers/GCC/ld,--script=./os/common/startup/ARMCMx/compilers/GCC/ld/STM32H743xI.ld,--gc-sections,--defsym=__process_stack_size__=0x400,--defsym=__main_stack_size__=0x400 

Re: build Chibios Under Atollic

Posted: Wed Sep 05, 2018 6:20 pm
by Giovanni
What compiler are you using?

Those in distro repositories are known to NOT work.

Giovanni

Re: build Chibios Under Atollic

Posted: Wed Sep 05, 2018 6:45 pm
by crispus
Latest version from dev.arm.com: GNU Arm Embedded Toolchain Version 7-2018-q2-update (7.3.1) and 6.3.1 from debian repo.

Since STM32H7 is M7 I didn't expected to have an compiler/linker problem...

Re: build Chibios Under Atollic

Posted: Wed Sep 05, 2018 7:17 pm
by Giovanni
Same, I doubt that the problem is the device, there is something in the project. You may try excluding parts.

Giovanni

Re: build Chibios Under Atollic

Posted: Wed Sep 05, 2018 8:04 pm
by crispus
It seems that is coming from C++ stuff (commenting cpp out it will compile). I have nothing fancy/complex, just 2 classes.
On same configuration STM32F767 compiles just fine.

Code: Select all

include $(CHIBIOS)/os/various/cpp_wrappers/chcpp.mk