Problem with linking my Nuttx application with touchgfx
Hi!
I am trying to build an application for STM32F429 written under Nuttx OS with touchgfx. I made stubs for oswrappers and hal to check the build. I have my own makefile and ld-script. The project compiles, but errors occur at the linking stage:
arm-none-eabi-ld: ./obj/display_main.o: in function `touchgfx :: HAL & touchgfx :: touchgfx_generic_init <NuttxHAL> (touchgfx :: DMA_Interface &, touchgfx :: LCD &, touchgfx :: TouchController &, short, short, unsigned short *, unsigned int, unsigned int) ': ./lib/touchgfx/framework/include/common/TouchGFXInit.hpp:89: undefined reference to `touchgfx :: Bitmap :: registerBitmapDatabase (touchgfx :: Bitmap :: BitmapData const *, unsigned short, unsigned short *, unsigned int, unsigned int) '
arm-none-eabi-ld: ./obj/NuttxHAL.o:(.rodata._ZTV8NuttxHAL+0x3c): undefined reference to `touchgfx :: HAL :: blockCopy (void *, void const *, unsigned int) '
arm-none-eabi-ld: ./obj/NuttxHAL.o:(.rodata._ZTV8NuttxHAL+0x60): undefined reference to `touchgfx :: HAL :: copyFBRegionToMemory (touchgfx :: Rect, unsigned short *, unsigned int) '
arm-none-eabi-ld: ./obj/NuttxHAL.o:(.rodata._ZTV8NuttxHAL+0x9c): undefined reference to `touchgfx :: HAL :: touch (int, int) '
arm-none-eabi-ld: ./lib/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx-float-abi-hard.a(AbstractPartition.o): in function `touchgfx :: AbstractPartition :: indexOf (void const *) ':
(.text._ZN8touchgfx17AbstractPartition7indexOfEPKv + 0x30): undefined reference to `__assert_func '
arm-none-eabi-ld: ./lib/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx-float-abi-hard.a(AbstractPartition.o): in function `touchgfx :: AbstractPartition :: allocate (unsigned short ) ':
(.text._ZN8touchgfx17AbstractPartition8allocateEt + 0x18): undefined reference to `__assert_func '
arm-none-eabi-ld: ./lib/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx-float-abi-hard.a(AbstractPartition.o): in function `touchgfx :: AbstractPartition :: allocateAt (unsigned short , unsigned short) ':
(.text._ZN8touchgfx17AbstractPartition10allocateAtEtt + 0x1a): undefined reference to `__assert_func '
arm-none-eabi-ld: ./lib/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx-float-abi-hard.a(CircleProgress.o): in function `touchgfx :: CircleProgress :: setStartEndAngle (int, int) ':
(.text._ZN8touchgfx14CircleProgress16setStartEndAngleEii + 0xe): undefined reference to `__assert_func '
arm-none-eabi-ld: ./lib/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx-float-abi-hard.a(AbstractProgressIndicator.o): in function `touchgfx :: AbstractProgressIndicator :: setRange (short, short, unsigned short, unsigned short) ':
(.text._ZN8touchgfx25AbstractProgressIndicator8setRangeEsstt + 0x1c): undefined reference to `__assert_func '
arm-none-eabi-ld: ./lib/touchgfx/lib/core/cortex_m4f/gcc/libtouchgfx-float-abi-hard.a(Container.o):(.text._ZN8touchgfx9Container3addERNS_8DrawableE+0 references `__assert_func 'follow
In this case, the rest of the touchgfx library is normally linked.
I use ld for linking with the following flags:
LD_FLAGS = --entry = __ start
LD_FLAGS + = -nostartfiles -nodefaultlibs
LD_FLAGS + = -Map = "$ (MAP)" --cref
LD_FLAGS + = --gc-sections
LD_FLAGS + = -T $ (LIBDIR) /nuttx-export/build/ld.script
LD_FLAGS + = -L $ (LIBDIR) / touchgfx / lib / core / cortex_m4f / gcc
LD_FLAGS + = -L $ (LIBDIR) / nuttx-export / libs
LD_FLAGS + = --start-group
LD_FLAGS + = -ltouchgfx-float-abi-hard
LD_FLAGS + = -lnuttx -lapps "$ (GCCLIB) /thumb/v7e-m/fpv4-sp/hard/libgcc.a"
LD_FLAGS + = --end-group
$ (LD) $ (OBJS) $ (LD_FLAGS) -o "$ (ELF)"ld-script is as follows:
MEMORY
{
flash (rx) : ORIGIN = 0x08000000, LENGTH = 2048K
sram (rwx) : ORIGIN = 0x20000000, LENGTH = 112K
}
OUTPUT_ARCH(arm)
EXTERN(_vectors)
ENTRY(_stext)
SECTIONS
{
.text : {
_stext = ABSOLUTE(.);
*(.vectors)
*(.text .text.*)
*(.fixup)
*(.gnu.warning)
*(.rodata .rodata.*)
*(.gnu.linkonce.t.*)
*(.glue_7)
*(.glue_7t)
*(.got)
*(.gcc_except_table)
*(.gnu.linkonce.r.*)
KEEP (*(.init))
KEEP (*(.fini))
KEEP (*(.dtors))
. = ALIGN(4);
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array*))
PROVIDE_HIDDEN (__preinit_array_end = .);
_etext = ABSOLUTE(.);
} > flash
. = ALIGN(4);
.init_section : {
_sinit = ABSOLUTE(.);
*(.init_array .init_array.*)
_einit = ABSOLUTE(.);
} > flash
. = ALIGN(4);
.ARM.extab : {
*(.ARM.extab*)
} > flash
. = ALIGN(4);
.ARM.exidx : {
__exidx_start = ABSOLUTE(.);
*(.ARM.exidx*)
__exidx_end = ABSOLUTE(.);
} > flash
_eronly = ABSOLUTE(.);
/* The RAM vector table (if present) should lie at the beginning of SRAM */
.ram_vectors : {
*(.ram_vectors)
} > sram
. = ALIGN(4);
.data : AT( _eronly ) {
_sdata = ABSOLUTE(.);
*(.data .data.*)
*(.gnu.linkonce.d.*)
CONSTRUCTORS
_edata = ABSOLUTE(.);
} > sram
.bss : {
_sbss = ABSOLUTE(.);
*(.bss .bss.*)
*(.gnu.linkonce.b.*)
*(COMMON)
_ebss = ABSOLUTE(.);
} > sram
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_info 0 : { *(.debug_info) }
.debug_line 0 : { *(.debug_line) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_aranges 0 : { *(.debug_aranges) }
}I tried using g++ for linking, but the result is the same.
Have you any ideas why this happens? I'm sure I forget to add something, but can't understand what exactly it should be.
Thanks.
