Jump to content

Eclipse + GNU ARM + nucleoF401 + ili9341 hundreds of errors at compile time


Recommended Posts

Posted

Hello!

I'm trying since a while to integrate this lib into a project and begin to play with my screen (the 2.8" w/touchscreen ILI9341, similar to those who sell Adafruit). My setup is Linux mint KDE 17.3, Eclipse Neon + GNU ARM Eclipse, NucleoF401RE board, the project was created with CubeMX and imported according with the method of Carmine Noviello (I successfully draw some things in a SSD1306 OLED screen with the U8GLib trough I2C and DMA).

Since the Makefile is generated with some automake I make a makefile.init with this content:

GFXLIB = /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx
include $(GFXLIB)/gfx.mk

In project properties->C/C++Build->Settings->ToolSettings added the include path "../ugfx" for the sections "Cross ARM GNU Assembler", "Cross ARM C Compiler" and "Cross ARM C++ Compiler", in "Cross ARM C++ Linker"->Miscellaneous->Other objects I added: $(GFXSRC)

The methods in board_ILI9341.h seems to have nothing to do with the errors I have, I can comment everything and nothing new happens.

This are some of the results of the compilation in the console:

Building target: ili9341-ugfx-uno.elf
Invoking: Cross ARM C++ Linker
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -Wall -Wextra  -g3 -T mem.ld -T libs.ld -T sections.ld -nostartfiles -Xlinker --gc-sections -L"../ldscripts" -Wl,-Map,"ili9341-ugfx-uno.map" --specs=nano.specs -u _printf_float -o "ili9341-ugfx-uno.elf"  ./system/src/stm32f4xx/stm32f4xx_hal.o ./system/src/stm32f4xx/stm32f4xx_hal_cortex.o ./system/src/stm32f4xx/stm32f4xx_hal_dma.o ./system/src/stm32f4xx/stm32f4xx_hal_dma_ex.o ./system/src/stm32f4xx/stm32f4xx_hal_flash.o ./system/src/stm32f4xx/stm32f4xx_hal_flash_ex.o ./system/src/stm32f4xx/stm32f4xx_hal_flash_ramfunc.o ./system/src/stm32f4xx/stm32f4xx_hal_gpio.o ./system/src/stm32f4xx/stm32f4xx_hal_pwr.o ./system/src/stm32f4xx/stm32f4xx_hal_pwr_ex.o ./system/src/stm32f4xx/stm32f4xx_hal_rcc.o ./system/src/stm32f4xx/stm32f4xx_hal_rcc_ex.o ./system/src/stm32f4xx/stm32f4xx_hal_spi.o ./system/src/stm32f4xx/stm32f4xx_hal_tim.o ./system/src/stm32f4xx/stm32f4xx_hal_tim_ex.o  ./system/src/newlib/_cxx.o ./system/src/newlib/_exit.o ./system/src/newlib/_sbrk.o ./system/src/newlib/_startup.o ./system/src/newlib/_syscalls.o ./system/src/newlib/assert.o  ./system/src/diag/Trace.o ./system/src/diag/trace_impl.o  ./system/src/cortexm/_initialize_hardware.o ./system/src/cortexm/_reset_hardware.o ./system/src/cortexm/exception_handlers.o  ./system/src/cmsis/startup_stm32f401xe.o ./system/src/cmsis/system_stm32f4xx.o ./system/src/cmsis/vectors_stm32f4xx.o  ./src/main.o ./src/stm32f4xx_hal_msp.o ./src/stm32f4xx_it.o  /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gfx.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_chibios.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_freertos.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_win32.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_linux.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_osx.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_raw32.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_ecos.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_rawrtos.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_arduino.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_cmsis.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_nios.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_x_threads.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_x_heap.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gdriver/gdriver.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gqueue/gqueue.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gdisp/gdisp.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gdisp/gdisp_fonts.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gdisp/gdisp_pixmap.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gdisp/gdisp_image.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gdisp/gdisp_image_native.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gdisp/gdisp_image_gif.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gdisp/gdisp_image_bmp.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gdisp/gdisp_image_jpg.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gdisp/gdisp_image_png.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gdisp/mcufont/mf_encoding.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gdisp/mcufont/mf_font.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gdisp/mcufont/mf_justify.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gdisp/mcufont/mf_kerning.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gdisp/mcufont/mf_rlefont.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gdisp/mcufont/mf_bwfont.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gdisp/mcufont/mf_scaledfont.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gdisp/mcufont/mf_wordwrap.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gevent/gevent.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gtimer/gtimer.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin_widget.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin_wm.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin_console.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin_graph.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin_button.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin_slider.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin_checkbox.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin_image.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin_label.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin_radio.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin_list.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin_progressbar.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin_container.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin_frame.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin_tabset.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin_gl3d.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin_keyboard.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin_keyboard_layout.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gwin/gwin_textedit.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/ginput/ginput.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/ginput/ginput_mouse.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/ginput/ginput_keyboard.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/ginput/ginput_keyboard_microcode.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/ginput/ginput_toggle.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/ginput/ginput_dial.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gadc/gadc.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gaudio/gaudio.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gmisc/gmisc.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gmisc/gmisc_arrayops.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gmisc/gmisc_matrix2d.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gmisc/gmisc_trig.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gfile/gfile.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gfile/gfile_fs_native.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gfile/gfile_fs_ram.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gfile/gfile_fs_rom.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gfile/gfile_fs_fatfs.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gfile/gfile_fs_petitfs.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gfile/gfile_fs_mem.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gfile/gfile_fs_chibios.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gfile/gfile_fs_strings.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gfile/gfile_printg.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gfile/gfile_scang.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gfile/gfile_stdio.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gfile/gfile_fatfs_wrapper.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gfile/gfile_fatfs_diskio_chibios.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gfile/gfile_petitfs_wrapper.c /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gfile/gfile_petitfs_diskio_chibios.c  /home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gtrans/gtrans.c
/home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_raw32.c:29:4: warning: #warning "GOS: Raw32 - Make sure you initialize your hardware and the C runtime before calling gfxInit() in your application!" [-Wcpp]
   #warning "GOS: Raw32 - Make sure you initialize your hardware and the C runtime before calling gfxInit() in your application!"
    ^
/home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_x_threads.c: In function 'threadreturn_t gfxThreadWait(gfxThreadHandle)':
/home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_x_threads.c:646:4: error: invalid conversion from 'gfxThreadHandle {aka void*}' to 'thread*' [-fpermissive]
  t = th;
    ^
/home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_x_heap.c: In function 'void* gfxAlloc(size_t)':
/home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_x_heap.c:76:32: error: expected unqualified-id before 'new'
   register memslot *prev, *p, *new;
                                ^
/home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_x_heap.c:76:32: error: expected initializer before 'new'
/home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_x_heap.c:86:9: error: expected type-specifier before '=' token
     new = (memslot *)((char *)p + sz);
         ^
/home/jano/STM32Toolchain/workspace/ili9341-ugfx-uno/ugfx/src/gos/gos_x_heap.c:87:8: error: expected type-specifier before '->' token
     new->next = p->next;
        ^

and more like this, attached is the complete error log, main.c and board_ILI9341.h

do I missing to include something? or should tell something more to the compiler? any ideas? Thanks for reading.

err.txt

main.c

board_ILI9341.h

Posted

Hi!

Thank you for the tip, but unfortunately I have no idea how to do that!

I should delete the entry in "Cross ARM C++ Linker"->Miscellaneous->Other objects I added: $(GFXSRC), then should instruct to the makefile to use arm-none-eabi-gcc instead arm-none-eabi-g++, but how?

Posted

It is something to do with the automatic build associations. Somehow in your build .c files have been associated with the g++ compiler instead of the gcc compiler. Check your toolchain settings.

Posted

How do you intend to implement these settings in your project?
For example:

    OPT_OS                    = raw32
    OPT_CPU                    = stm32m7
    GFXBOARD                = STM32F746-Discovery
    GFXDEMO                    =
    GFXDRIVERS                =
STMHAL                        = ../STM32F7xx_HAL_Driver
CMSIS                        = ../CMSIS

ARCH     = arm-none-eabi-
SRCFLAGS = -ggdb -O1
CXXFLAGS = -fno-rtti
.......

 

Posted

hi Victor!

as far as I understand the getting started, I should use ugfx/gfxconf.h, my settings on this file are:

#define GFX_USE_OS_RAW32                             TRUE

    #define GFX_CPU                                  GFX_CPU_CORTEX_M4_FP
        #define CORTEX_USE_FPU     TRUE

    #define GFX_OS_HEAP_SIZE                         8192

#define GFX_USE_GDISP                                TRUE

#define GDISP_NEED_CIRCLE                            TRUE
#define GDISP_NEED_ELLIPSE                           TRUE
#define GDISP_NEED_ARC                               TRUE
#define GDISP_NEED_ARCSECTORS                        TRUE
#define GDISP_NEED_CONVEX_POLYGON                    TRUE

#define GDISP_NEED_TEXT                              TRUE

    #define GDISP_NEED_UTF8                          TRUE

    #define GDISP_INCLUDE_FONT_DEJAVUSANS10          TRUE

Don't know about the HAL and CMSIS settings, probably I should check that.
ARCH is defined in Properties->C/C++Build->Settings->Tolchains is set to ARM(AArch32) and prefix is arm-none-eabi-

I know nothing about these flags, should I worry?

Posted

The variables & definitions mentioned by @Victor are only required/recommended if you are working with our built-in Makefile system (eg. when using our own top-level Makefile). If you are using the Makefiles generated by Eclipse or if you are just adding µGFX to Eclipse there is no need to define those - you have to take care of them in your own build settings.
The only thing you have to do is to copy the configuration file template gfxconf.example.h to your own project directory and renaming it to gfxconfig.h as @jano mentioned.

We don't have a generic Eclipse guide because it depends heavily on many factors (eg. the "Eclipse Distribution") and how the Vendor/Supplier set up the build environment. If somebody would like to publish a step-by-step guide or tutorial, we'd appreciate a lot. So far we have a guide that explains how to use ChibiStudio which is also Eclipse based.

Please don't hesitate to ask if you have any other questions.

Posted

It seems to me, that jano try to use uGFX build system in eclipse ( using uGFX top-level Makefile ).  But He didn't specify driver, board and etc, which build system requires.

Eclipse Autotools makefile has some places where user can define anything. ( -include ../makefile.init, -include ../makefile.defs, -include ../makefile.targets).

For example in theory: Created  makefile.init  and described there somthing else for proper use uGFX build system. And then add GFXSRC /GFXINC to the sources/includes of Eclipse Autotools makefile. 

It is theoretical way to use ugfx build system with eclipse, but it is not work.

Now to implement uGFX to my eclipse neon project I do following steps:

1. Copy ugfx lib to project tree and exclude ugfx folder from build

2. Copy gfx_mk.c to src folder

3. Copy  gfxconf.h to inc folder

4. I use f7-discovery and i need folowing drivers: STM32LTDC, FT5336, STM32F746-Discovery. Find them in ugfx folder,copy them to project tree and inculude these folder to build

(click right  mouse button on folder and check "Resource Configurations")

5. Add to include paths:

"../ugfx"
"../STM32LTDC"
"../STM32F746-Discovery"
"../FT5336"

6. in main.c define #include "gfx.h"

Folder STM32F746-Discovery conteins some files for init hardware. You can use some of them and exclude from build those no need.

For example: I don't use linker script(.ld), startup.s, system init, hal drivers etc from this folder. You have to config everything separatly before uGFXInit().  

It is all, if I have nothing forgot.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...