Jump to content

STM32 Sytem Workbench, ILI9341, SPI


chrisjn52

Recommended Posts

Hi, I am trying to compile my first uGFX project from within STM32 System Workbench IDE, (eclipse), for a STM32F103 chip using a SPI driver for the ILI9341 lcd controller. I have setup the IDE in a similar fashion to that shown in the Wiki for the Keil IDE.......

http://wiki.ugfx.org/index.php/Using_Keil_µVision_5_MDK-ARM

and I have the following compile error(s). I am unable to find a type definition for 'SPIConfig' in order to make any further progress.

I have attached the board_ILI9341.h file.

Many thanks.

 

10:11:14 **** Incremental Build of configuration Debug for project uGFX_STM32F103 ****
make -j2 all 
'Building file: ../ugfx/gdisp_lld_ILI9341.c'
'Building file: ../ugfx/gfx_mk.c'
'Invoking: MCU GCC Compiler'
'Invoking: MCU GCC Compiler'
C:\Users\Chris\workspace\uGFX_STM32F103\Debug
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -DSTM32F1 -DNUCLEO_F103RB -DSTM32F103RBTx -DSTM32 -DDEBUG -DUSE_STDPERIPH_DRIVER -DSTM32F10X_MD -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib" -I"C:/Users/Chris/workspace/uGFX_STM32F103/inc" -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib/CMSIS/core" -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib/CMSIS/device" -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib/StdPeriph_Driver/inc" -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib/Utilities/STM32F1xx-Nucleo" -I"C:/Users/Chris/workspace/uGFX_STM32F103/ugfx" -I"C:/Users/Chris/workspace/ugfx_2.5" -I"C:/Users/Chris/workspace/ugfx_2.5/drivers/gdisp/ILI9341" -I"C:/Users/Chris/workspace/uGFX_STM32F103/src" -O0 -g3 -Wall -fmessage-length=0 -ffunction-sections -c -MMD -MP -MF"ugfx/gdisp_lld_ILI9341.d" -MT"ugfx/gdisp_lld_ILI9341.o" -o "ugfx/gdisp_lld_ILI9341.o" "../ugfx/gdisp_lld_ILI9341.c"
C:\Users\Chris\workspace\uGFX_STM32F103\Debug
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -DSTM32F1 -DNUCLEO_F103RB -DSTM32F103RBTx -DSTM32 -DDEBUG -DUSE_STDPERIPH_DRIVER -DSTM32F10X_MD -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib" -I"C:/Users/Chris/workspace/uGFX_STM32F103/inc" -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib/CMSIS/core" -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib/CMSIS/device" -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib/StdPeriph_Driver/inc" -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib/Utilities/STM32F1xx-Nucleo" -I"C:/Users/Chris/workspace/uGFX_STM32F103/ugfx" -I"C:/Users/Chris/workspace/ugfx_2.5" -I"C:/Users/Chris/workspace/ugfx_2.5/drivers/gdisp/ILI9341" -I"C:/Users/Chris/workspace/uGFX_STM32F103/src" -O0 -g3 -Wall -fmessage-length=0 -ffunction-sections -c -MMD -MP -MF"ugfx/gfx_mk.d" -MT"ugfx/gfx_mk.o" -o "ugfx/gfx_mk.o" "../ugfx/gfx_mk.c"
In file included from ../ugfx/gdisp_lld_ILI9341.c:25:0:
C:/Users/Chris/workspace/ugfx_2.5/drivers/gdisp/ILI9341/board_ILI9341.h:30:8: error: unknown type name 'SPIConfig'
 static SPIConfig spi_cfg = {
        ^
C:/Users/Chris/workspace/ugfx_2.5/drivers/gdisp/ILI9341/board_ILI9341.h:31:3: warning: initialization makes integer from pointer without a cast [-Wint-conversion]

 

board_ILI9341.h

Link to comment
Share on other sites

The SPIConfig is a struct from ChibiOS/HAL. It has nothing to do with µGFX itself. This means that you are trying to use a board file that was written to be used with ChibiOS/HAL which you are not using.

The solution is to not use that board file but copy the template that you can find in /drivers/gdisp/ILI9341/board_ILI9341_template.h and implement those empty functions using what ever HAL that you are using (eg. STM32CubeF1).

Link to comment
Share on other sites

I now have compile issues with mcufont etc. and would really appreciate a further pointer!

The issue seems to be one of relative/absolute paths since  #include MF_FONT_FILE_NAME in mf_font.c resolves to  src/gdisp/fonts/fonts.h: No such file or directory.

If I change this to "#include ../fonts/font.h" I can progress to more errors of the same with other files. Simply adding the folders to the include path in Eclipse did not fix the issue.

Am I doing something wrong or will I need to change these paths?

 

make -j2 all 
'Building file: C:/Users/Chris/workspace/ugfx_2.5/src/gdisp/mcufont/mf_font.c'
'Building file: C:/Users/Chris/workspace/ugfx_2.5/src/gdisp/mcufont/mf_wordwrap.c'
'Invoking: MCU GCC Compiler'
'Invoking: MCU GCC Compiler'
C:\Users\Chris\workspace\uGFX_STM32F103\Debug
arm-none-eabi-gcc -mthumb -mfloat-abi=soft -DSTM32F1 -DNUCLEO_F103RB -DSTM32F103RBTx -DSTM32 -DDEBUG -DUSE_STDPERIPH_DRIVER -DSTM32F10X_MD -I"C:/Users/Chris/workspace/uGFX_STM32F103/src" -I"C:/Users/Chris/workspace/ugfx_2.5/drivers/gdisp/ILI9341" -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib" -I"C:/Users/Chris/workspace/uGFX_STM32F103/inc" -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib/CMSIS/core" -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib/CMSIS/device" -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib/StdPeriph_Driver/inc" -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib/Utilities/STM32F1xx-Nucleo" -O0 -g3 -Wall -fmessage-length=0 -ffunction-sections -c -MMD -MP -MF"ugfx_2.5/src/gdisp/mcufont/mf_font.d" -MT"ugfx_2.5/src/gdisp/mcufont/mf_font.o" -o "ugfx_2.5/src/gdisp/mcufont/mf_font.o" "C:/Users/Chris/workspace/ugfx_2.5/src/gdisp/mcufont/mf_font.c"
C:\Users\Chris\workspace\uGFX_STM32F103\Debug
arm-none-eabi-gcc -mthumb -mfloat-abi=soft -DSTM32F1 -DNUCLEO_F103RB -DSTM32F103RBTx -DSTM32 -DDEBUG -DUSE_STDPERIPH_DRIVER -DSTM32F10X_MD -I"C:/Users/Chris/workspace/uGFX_STM32F103/src" -I"C:/Users/Chris/workspace/ugfx_2.5/drivers/gdisp/ILI9341" -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib" -I"C:/Users/Chris/workspace/uGFX_STM32F103/inc" -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib/CMSIS/core" -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib/CMSIS/device" -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib/StdPeriph_Driver/inc" -I"C:/Users/Chris/workspace/nucleo-f103rb_stdperiph_lib/Utilities/STM32F1xx-Nucleo" -O0 -g3 -Wall -fmessage-length=0 -ffunction-sections -c -MMD -MP -MF"ugfx_2.5/src/gdisp/mcufont/mf_wordwrap.d" -MT"ugfx_2.5/src/gdisp/mcufont/mf_wordwrap.o" -o "ugfx_2.5/src/gdisp/mcufont/mf_wordwrap.o" "C:/Users/Chris/workspace/ugfx_2.5/src/gdisp/mcufont/mf_wordwrap.c"
C:/Users/Chris/workspace/ugfx_2.5/src/gdisp/mcufont/mf_font.c:26:27: fatal error: src/gdisp/fonts/fonts.h: No such file or directory
compilation terminated.
make: *** [ugfx_2.5/src/gdisp/mcufont/mf_font.o] Error 1

 

Edited by Joel Bodenmann
Please use code tags for pastes
Link to comment
Share on other sites

Do never ever modify anything inside the uGFX library unless you know what you are doing (eg. custom modifications). Our build system is very complex and adapts itself to each configuration in order to provide the most efficient code possible. There are many things that are evaluated during compile time and change how stuff gets glued together.

If you are working with eclipse we strongly recommend adding the µGFX library using the built-in makefile system. This is the most reliable and easiest way to add µGFX to an existing project. This way you don't have to worry about making sure that every source file is included and that all inclusion paths are set correctly which can be a very cumbersome and error prone work. Guide: http://wiki.ugfx.org/index.php/Getting_Started#Makefiles

In your current situation it seems like the root path to the µGFX library directory has not been added to the search/include path.

Link to comment
Share on other sites

Doh! thanks for the pointer Joel. I had this correctly setup from the start but deleted the include path in my efforts to understand what was going on. I then added it back it sometime later BUT in the assembler section instead of the C compiler section of Eclipse.

I completely understand your recommendation but once I had started I was determined to fix the problem, particularly as it prompted much head-scratching and forum research into how things work and as a result I have now sorted the include paths and the project now compiles perfectly ok under STM32 System Workbench.

Many thanks.

 

 

Link to comment
Share on other sites

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...