Hello, I'm trying to use ugfx with chibios on mikromedia stm32 board. I can't compile a simple program with chibistudio. Can somebody help me? I setup a new project based on the rt-stm32f407-discovery. I copy the last ugfx code source on c:\chibistudio\ugfx I use the workspace3. I modified my Makefile like that : ############################################################################## # Build global options # NOTE: Can be overridden externally. # # Compiler options here. ifeq ($(USE_OPT),) # Replace -O0 with -O2 for a production build. -O2 just messes with the debugger. USE_OPT = -O0 -g -fomit-frame-pointer -falign-functions=16 endif # C specific options here (added to USE_OPT). ifeq ($(USE_COPT),) USE_COPT = endif # C++ specific options here (added to USE_OPT). ifeq ($(USE_CPPOPT),) USE_CPPOPT = -fno-rtti endif # Enable this if you want the linker to remove unused code and data ifeq ($(USE_LINK_GC),) USE_LINK_GC = yes endif # Linker extra options here. ifeq ($(USE_LDOPT),) USE_LDOPT = endif # Enable this if you want link time optimizations (LTO) ifeq ($(USE_LTO),) ### disable as can cause segfault USE_LTO = no endif # If enabled, this option allows to compile the application in THUMB mode. ifeq ($(USE_THUMB),) USE_THUMB = yes endif # Enable this if you want to see the full log while compiling. ifeq ($(USE_VERBOSE_COMPILE),) USE_VERBOSE_COMPILE = no endif # # Build global options ############################################################################## ############################################################################### # Architecture or project specific options # # Stack size to be allocated to the Cortex-M process stack. This stack is # the stack used by the main() thread. ifeq ($(USE_PROCESS_STACKSIZE),) USE_PROCESS_STACKSIZE = 0x400 endif # Stack size to the allocated to the Cortex-M main/exceptions stack. This # stack is used for processing interrupts and exceptions. ifeq ($(USE_EXCEPTIONS_STACKSIZE),) USE_EXCEPTIONS_STACKSIZE = 0x400 endif # Enables the use of FPU on Cortex-M4 (no, softfp, hard). ifeq ($(USE_FPU),) USE_FPU = no endif # # Architecture or project specific options ############################################################################## ############################################################################## # Project, sources and paths # SW = .. # Define project name here PROJECT = ch # Imported source files and paths CHIBIOS = ../../chibios3 GFXLIB = ../../ugfx #include $(CHIBIOS)/boards/MIKROMEDIA_STM32_M4/board.mk include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk # Not a standard ChibiOS supported board include $(CHIBIOS)/os/hal/hal.mk include $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/platform.mk include $(GFXLIB)/boards/base/Mikromedia-STM32-M4-ILI9341/board.mk include $(CHIBIOS)/os/hal/osal/rt/osal.mk include $(CHIBIOS)/os/rt/rt.mk include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk include $(CHIBIOS)/test/rt/test.mk LDSCRIPT= $(PORTLD)/STM32F407xG.ld # Imported source files and paths for uGFX include $(GFXLIB)/boards/base/Mikromedia-STM32-M4-ILI9341/board.mk include $(GFXLIB)/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/board.mk # The replacement ChibiOS board files include $(GFXLIB)/gfx.mk # Where is our source code - alter these for your project. # Either just include the demo makefile or add your own definitions include $(GFXLIB)/demos/modules/gdisp/basics/demo.mk #MYFILES = my-project-directory #MYCSRC = $(MYFILES)/main.c #MYDEFS = # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. CSRC = $(STARTUPSRC) \ $(KERNSRC) \ $(PORTSRC) \ $(OSALSRC) \ $(HALSRC) \ $(PLATFORMSRC) \ $(BOARDSRC) \ $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. CPPSRC = # C sources to be compiled in ARM mode regardless of the global setting. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler # option that results in lower performance and larger code size. ACSRC = # C++ sources to be compiled in ARM mode regardless of the global setting. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler # option that results in lower performance and larger code size. ACPPSRC = # C sources to be compiled in THUMB mode regardless of the global setting. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler # option that results in lower performance and larger code size. TCSRC = # C sources to be compiled in THUMB mode regardless of the global setting. # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler # option that results in lower performance and larger code size. TCPPSRC = # List ASM source files here ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ $(CHIBIOS)/os/various # # Project, sources and paths ############################################################################## ############################################################################## # Compiler settings # MCU = cortex-m4 #TRGT = arm-elf- TRGT = arm-none-eabi- CC = $(TRGT)gcc CPPC = $(TRGT)g++ # Enable loading with g++ only if you need C++ runtime support. # NOTE: You can use C++ even without C++ support if you are careful. C++ # runtime support makes code size explode. LD = $(TRGT)gcc #LD = $(TRGT)g++ CP = $(TRGT)objcopy AS = $(TRGT)gcc -x assembler-with-cpp OD = $(TRGT)objdump SZ = $(TRGT)size HEX = $(CP) -O ihex BIN = $(CP) -O binary # ARM-specific options here AOPT = # THUMB-specific options here TOPT = -mthumb -DTHUMB # Define C warning options here CWARN = -Wall -Wextra -Wstrict-prototypes # Define C++ warning options here CPPWARN = -Wall -Wextra # # Compiler settings ############################################################################## ############################################################################## # Start of default section # # List all default C defines here, like -D_DEBUG=1 DDEFS = $(GFXDEFS) # List all default ASM defines here, like -D_DEBUG=1 DADEFS = # List all default directories to look for include files here DINCDIR = # List the default directory to look for the libraries here DLIBDIR = # List all default libraries here DLIBS = # # End of default section ############################################################################## ############################################################################## # Start of user section # # List all user C define here, like -D_DEBUG=1 UDEFS = # Define ASM defines here UADEFS = # List all user directories here UINCDIR = # List the user directory to look for the libraries here ULIBDIR = # List all user libraries here ULIBS = # # End of user defines ############################################################################## RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC include $(RULESPATH)/rules.mk please find the error I have : ------------------------------------------------------------------------ In file included from ../../chibios3/os/hal/include/hal.h:32:0, from ../../chibios3/os/hal/src/hal.c:25: ../../chibios3/os/hal/ports/STM32/STM32F4xx/hal_lld.h:1087:2: error: #error "STM32_PLLVCO outside acceptable range (STM32_PLLVCO_MIN...STM32_PLLVCO_MAX)" ../../chibios3/os/hal/ports/STM32/STM32F4xx/hal_lld.h:1099:2: error: #error "STM32_PLLCLKOUT outside acceptable range (STM32_PLLOUT_MIN...STM32_PLLOUT_MAX)" ../../chibios3/os/hal/ports/STM32/STM32F4xx/hal_lld.h:1119:2: error: #error "STM32_SYSCLK above maximum rated frequency (STM32_SYSCLK_MAX)" ../../chibios3/os/hal/ports/STM32/STM32F4xx/hal_lld.h:1198:2: error: #error "STM32_HCLK exceeding maximum frequency (STM32_SYSCLK_MAX)" ../../chibios3/os/hal/ports/STM32/STM32F4xx/hal_lld.h:1222:2: error: #error "STM32_PCLK1 exceeding maximum frequency (STM32_PCLK1_MAX)" ../../chibios3/os/hal/ports/STM32/STM32F4xx/hal_lld.h:1246:2: error: #error "STM32_PCLK2 exceeding maximum frequency (STM32_PCLK2_MAX)" In file included from ../../chibios3/os/hal/include/usb.h:362:0, from ../../chibios3/os/hal/include/hal.h:62, from ../../chibios3/os/hal/src/hal.c:25: ../../chibios3/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h:188:2: error: #error "the USB OTG driver requires a 48MHz clock" make: *** [build/obj/hal.o] Error 1 make: *** Waiting for unfinished jobs.... Compiling hal_queues.c In file included from ../../chibios3/os/hal/include/hal.h:32:0, from ../../chibios3/os/hal/src/hal_queues.c:38: ../../chibios3/os/hal/ports/STM32/STM32F4xx/hal_lld.h:1087:2: error: #error "STM32_PLLVCO outside acceptable range (STM32_PLLVCO_MIN...STM32_PLLVCO_MAX)" ../../chibios3/os/hal/ports/STM32/STM32F4xx/hal_lld.h:1099:2: error: #error "STM32_PLLCLKOUT outside acceptable range (STM32_PLLOUT_MIN...STM32_PLLOUT_MAX)" ../../chibios3/os/hal/ports/STM32/STM32F4xx/hal_lld.h:1119:2: error: #error "STM32_SYSCLK above maximum rated frequency (STM32_SYSCLK_MAX)" ../../chibios3/os/hal/ports/STM32/STM32F4xx/hal_lld.h:1198:2: error: #error "STM32_HCLK exceeding maximum frequency (STM32_SYSCLK_MAX)" ../../chibios3/os/hal/ports/STM32/STM32F4xx/hal_lld.h:1222:2: error: #error "STM32_PCLK1 exceeding maximum frequency (STM32_PCLK1_MAX)" ../../chibios3/os/hal/ports/STM32/STM32F4xx/hal_lld.h:1246:2: error: #error "STM32_PCLK2 exceeding maximum frequency (STM32_PCLK2_MAX)" In file included from ../../chibios3/os/hal/include/usb.h:362:0, from ../../chibios3/os/hal/include/hal.h:62, from ../../chibios3/os/hal/src/hal_queues.c:38: ../../chibios3/os/hal/ports/STM32/LLD/OTGv1/usb_lld.h:188:2: error: #error "the USB OTG driver requires a 48MHz clock" make: *** [build/obj/hal_queues.o] Error 1 -------------------------------------------------------------------------------------------------------------------------------------------------------- If I modify the board file provided form : #if !defined(STM32_HSECLK) #define STM32_HSECLK 16000000 #endif to : #if !defined(STM32_HSECLK) #define STM32_HSECLK 8000000U #endif but now I have this : ------------------------------------------------------------------------------------------------------------------------------------------------------------- Compiling flash_memory.c ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:14:1: error: unknown type name 'SPIConfig' ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:16:3: warning: excess elements in scalar initializer [enabled by default] ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:16:3: warning: (near initialization for 'flash_spicfg') [enabled by default] ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:17:3: warning: excess elements in scalar initializer [enabled by default] ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:17:3: warning: (near initialization for 'flash_spicfg') [enabled by default] ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:19:1: warning: excess elements in scalar initializer [enabled by default] ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:19:1: warning: (near initialization for 'flash_spicfg') [enabled by default] ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c: In function 'flash_is_write_busy': ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:27:3: warning: implicit declaration of function 'spiAcquireBus' [-Wimplicit-function-declaration] ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:27:18: error: 'SPID3' undeclared (first use in this function) ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:27:18: note: each undeclared identifier is reported only once for each function it appears in ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:28:3: warning: implicit declaration of function 'spiStart' [-Wimplicit-function-declaration] ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:29:3: warning: implicit declaration of function 'spiSelect' [-Wimplicit-function-declaration] ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:30:3: warning: implicit declaration of function 'spiSend' [-Wimplicit-function-declaration] ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:31:3: warning: implicit declaration of function 'spiReceive' [-Wimplicit-function-declaration] ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:32:3: warning: implicit declaration of function 'spiUnselect' [-Wimplicit-function-declaration] ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:33:3: warning: implicit declaration of function 'spiReleaseBus' [-Wimplicit-function-declaration] ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c: In function 'flash_write_enable': ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:39:18: error: 'SPID3' undeclared (first use in this function) ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c: In function 'flash_sector_erase': ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:56:18: error: 'SPID3' undeclared (first use in this function) ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c: In function 'flash_read': ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:74:18: error: 'SPID3' undeclared (first use in this function) ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c: In function 'flash_write': ../../ugfx/boards/base/Mikromedia-STM32-M4-ILI9341/ChibiOS_Board/flash_memory.c:93:18: error: 'SPID3' undeclared (first use in this function) make: *** [build/obj/flash_memory.o] Error 1 make: *** Waiting for unfinished jobs.... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Can someone help me configuring chibios/ugfx woth mikromedia stm32 board ? Is there anyone successfully compile ugfx on this board? Regards, Julien