compile errors on opentx firmware for taranis

Post Reply
zatalian
Posts: 4
Joined: Mon Aug 11, 2014 6:29 pm
Country: -

compile errors on opentx firmware for taranis

Post by zatalian »

Hi,

I hope this is the right place to ask...

I'm trying to build the latest opentx firmware for my taranis transmitter.
I'm using a (gentoo) linux box and i'm trying to follow the OpenTX Linux Build Instructions

I have arm-none-eabi-gcc installed

Code: Select all

arm-none-eabi-gcc --version

arm-none-eabi-gcc (Gentoo 4.8.3 p1.1, pie-0.5.9) 4.8.3
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I have checked out the master source:

Code: Select all

git clone https://github.com/opentx/opentx
cd opentx
git checkout master
after that I have some problems to follow the documentation... It says to use make... but in the opentx directory, make does not find any targets. I moved to "opentx/radio/src". Here make does work... but i'm not sure if i should make things in the src dir?

Code: Select all

cd radio/src
make PCB=TARANIS
make is going into the "targets/taranis" directory and builds fine. After that it moves to the "bootloader" directory where the errors start...

Code: Select all

-------- begin --------
arm-none-eabi-gcc (Gentoo 4.8.3 p1.1, pie-0.5.9) 4.8.3
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Building bootloader...
make -C bootloader PCB=TARANIS PCBREV=
make[1]: Entering directory `/tmp/opentx/radio/src/bootloader'
arm-none-eabi-gcc -c -mcpu=cortex-m3 -Os -gdwarf-2 -mthumb -fomit-frame-pointer -Wall -fverbose-asm   -DRUN_FROM_FLASH=0 -DHSE_VALUE=12000000 -DPCBTARANIS  -DREV4 -DCPUARM -DBOOT -MD -MP -MF .dep/boot.o.d -I../targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc -I../targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Include -I../targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc -I../targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc -I../targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc -I../targets/taranis -I../fonts/std -fno-exceptions -I . -I./inc boot.cpp -o boot.o
arm-none-eabi-gcc ./startup_stm32f2xx.o ./system_stm32f2xx.o ./i2c.o ./delays.o ./stm32f2xx_rcc.o ./stm32f2xx_gpio.o ./stm32f2xx_spi.o ./misc.o ./ff.o ./ccsbcs.o ./usb_core.o ./usb_dcd.o ./usb_dcd_int.o ./usbd_core.o ./usbd_ioreq.o ./usbd_req.o ./usbd_msc_data.o ./usbd_msc_scsi.o ./usbd_msc_bot.o ./usbd_msc_core.o ./usbd_desc.o ./aspi.o ./usb_bsp.o ./usb_driver.o ./pwr_driver.o ./lcd_driver.o ./configure_pins.o ./keys_driver.o ./flash_driver.o ./diskio.o ./usbd_usr.o ./usbd_storage_msd.o ./lcd_common.o ./lcd_taranis.o ./keys.o ./fonts.o ./strhelpers.o ./boot.o -mcpu=cortex-m3 -mthumb -nostartfiles -T../targets/taranis/stm32_ramBoot.ld -Wl,-Map=bootloader_ramBoot.map,--cref,--no-warn-mismatch    -o bootloader_ramBoot.elf
./boot.o: In function `openBinaryFile(unsigned long)':
/tmp/opentx/radio/src/bootloader/boot.cpp:379: undefined reference to `__stack_chk_fail'
/tmp/opentx/radio/src/bootloader/boot.cpp:379: undefined reference to `__stack_chk_guard'
./ff.o: In function `gen_numname':
/tmp/opentx/radio/src/bootloader/../FatFs/ff.c:1414: undefined reference to `__stack_chk_fail'
/tmp/opentx/radio/src/bootloader/../FatFs/ff.c:1414: undefined reference to `__stack_chk_guard'
./ff.o: In function `f_open':
/tmp/opentx/radio/src/bootloader/../FatFs/ff.c:2431: undefined reference to `__stack_chk_fail'
/tmp/opentx/radio/src/bootloader/../FatFs/ff.c:2431: undefined reference to `__stack_chk_guard'
./ff.o: In function `f_chdir':
/tmp/opentx/radio/src/bootloader/../FatFs/ff.c:2795: undefined reference to `__stack_chk_fail'
/tmp/opentx/radio/src/bootloader/../FatFs/ff.c:2795: undefined reference to `__stack_chk_guard'
./ff.o: In function `f_getcwd':
/tmp/opentx/radio/src/bootloader/../FatFs/ff.c:2866: undefined reference to `__stack_chk_fail'
/tmp/opentx/radio/src/bootloader/../FatFs/ff.c:2866: undefined reference to `__stack_chk_guard'
./ff.o: In function `f_opendir':
/tmp/opentx/radio/src/bootloader/../FatFs/ff.c:3073: undefined reference to `__stack_chk_fail'
/tmp/opentx/radio/src/bootloader/../FatFs/ff.c:3073: undefined reference to `__stack_chk_guard'
./ff.o: In function `f_readdir':
/tmp/opentx/radio/src/bootloader/../FatFs/ff.c:3115: undefined reference to `__stack_chk_fail'
/tmp/opentx/radio/src/bootloader/../FatFs/ff.c:3115: undefined reference to `__stack_chk_guard'
./diskio.o: In function `disk_initialize':
/tmp/opentx/radio/src/bootloader/../targets/taranis/diskio.cpp:647: undefined reference to `__stack_chk_fail'
/tmp/opentx/radio/src/bootloader/../targets/taranis/diskio.cpp:647: undefined reference to `__stack_chk_guard'
./diskio.o: In function `disk_ioctl':
/tmp/opentx/radio/src/bootloader/../targets/taranis/diskio.cpp:903: undefined reference to `__stack_chk_fail'
/tmp/opentx/radio/src/bootloader/../targets/taranis/diskio.cpp:903: undefined reference to `__stack_chk_guard'
./lcd_common.o: In function `lcdPutPattern(unsigned short, unsigned char, unsigned char const*, unsigned char, unsigned char, unsigned long)':
/tmp/opentx/radio/src/bootloader/../lcd_common.cpp:133: undefined reference to `__stack_chk_fail'
/tmp/opentx/radio/src/bootloader/../lcd_common.cpp:133: undefined reference to `__stack_chk_guard'
collect2: error: ld returned 1 exit status
make[1]: *** [bootloader_ramBoot.elf] Error 1
make[1]: Leaving directory `/tmp/opentx/radio/src/bootloader'
make: *** [bootloader/bootloader_ramBoot.bin] Error 2
* Am i starting make in the right directory?
* How can i solve those undefined reference errors?

Thanks

User avatar
dinamich
Posts: 288
Joined: Mon Apr 01, 2013 1:21 pm
Country: Slovenia
Location: Ljubljana

Re: compile errors on opentx firmware for taranis

Post by dinamich »

Build instructions are missing a step to enter radio/src dir. I will correct that shortly.

About your error, it looks related to your ARM gcc compiler, the libraries in that package should provide functions like __stack_chk_guard. Try to use gcc that is described on wiki page.
projectkk2glider@github
zatalian
Posts: 4
Joined: Mon Aug 11, 2014 6:29 pm
Country: -

Re: compile errors on opentx firmware for taranis

Post by zatalian »

Ok, I managed to get a correct toolchain in gentoo. I had to disable the openmp option in crossdev

Code: Select all

USE="-openmp" crossdev -v -s4 -t arm-none-eabi
Deleting the opentx source and restarting from a fresh download also helps after a few hours of experimenting...
Now i have a opentx.bin file on my computer, build from the master branch. What can go wrong if i flash this to my taranis?

* Can I brick my taranis with this file?
* If I only flash the firmware and leave the bootloader, will I always be able to flash an older, working version?
User avatar
dinamich
Posts: 288
Joined: Mon Apr 01, 2013 1:21 pm
Country: Slovenia
Location: Ljubljana

Re: compile errors on opentx firmware for taranis

Post by dinamich »

You can't brick Taranis! The stm32 boot loader is factory installed and can't be erased. So in worst case the DFU programming ( taranis off) is always possible.
projectkk2glider@github

Post Reply

Return to “openTx for FrSky radios”