Jump to content

enrico.dallavia

Members
  • Posts

    34
  • Joined

  • Last visited

Everything posted by enrico.dallavia

  1. Beside chibios if I want to use ugfx with bare metal, with stm32f429-discovery, after the implementation of the 3 functions for delay. Is it possible to use the simple example from ugfx demo? like clear the screen and draw some text? Because I haven't succeeded to port some st function into chibios and I have to give up using it I had to modify some files of ugfx in order to compile the project without error (some definition was missing,like SDRAM_BANK_ADDR and I had to include manually a file from /board that are only included if I use chibios to find the symbols)
  2. I have succeeded to put chibios with ugfx (half a day) 1) download chibios 3.01 and switch to demos/RT-STM32F429-DISCOVERY example folder, do make and check if the compilation complete 2) download and copy ugfx folder 3) you have to modify a little few .mk files, since the path iside them is missing a folder sometimes 4) in the makefile of chibios, you have to add CHIBIOS_CPUCLASS = ARMCMx CHIBIOS_PORT = v7m #uGFX path GFXLIB = $(CHIBIOS)/ugfx GFXBOARD = STM32F429i-Discovery # General settings OPT_OS = chibios OPT_THUMB = yes OPT_LINK_OPTIMIZE = yes OPT_CPU = stm32m4 # ChibiOS settings ifeq ($(OPT_OS),chibios) # See $(GFXLIB)/tools/gmake_scripts/os_chibios.mk for the list of variables CHIBIOS_BOARD = ST_STM32F429I_DISCOVERY CHIBIOS_PLATFORM = STM32F4xx CHIBIOS_PORT = GCC/ARMCMx/STM32F4xx CHIBIOS_LDSCRIPT = STM32F429xI.ld endif include $(GFXLIB)/gfx.mk CSRC = $(STARTUPSRC) \ $(KERNSRC) \ $(PORTSRC) \ $(OSALSRC) \ $(HALSRC) \ $(PLATFORMSRC) \ $(BOARDSRC) \ $(TESTSRC) \ $(CHIBIOS)/os/various/shell.c \ $(CHIBIOS)/os/hal/lib/streams/memstreams.c \ $(CHIBIOS)/os/hal/lib/streams/chprintf.c \ --> $(GFXSRC) \ $(SNSR_SRC) \ main.c INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ $(CHIBIOS)/os/hal/lib/streams $(CHIBIOS)/os/various \ ---> $(GFXINC) be aware to remove the test.h from the main.c and remove all related code that belong to test (since with me I got error when it is enabled) then you can try some example from ugfx be aware that gfxInit(); will call the initialization of chibios so, you have to avoid call them twice, removing halInit(); chSysInit(); from main.c
  3. Thanks, it works fine!! ./mcufont import_ttf Quicksand-Regular.ttf 12, -> the command's output is the Quicksand-Regular12.dat file ./mcufont rlefont_export Quicksand-Regular12.dat myfont.c -> gave as output myfont.c file, rename it in userfonts.h to be able to use it inside ugfx
  4. Thanks for the answer, it will be very helpful to have a dedicated application instead of relying on web only. Is there any specification I can look into to try to do it myself? because within a month I think I will need the custom fonts.
  5. Hello, I've tried to generate file for custom fonts from uGfx online convert, but I got always "could not import font". I have a ttf font (whom I can preview from linux or windows). I tried also with other font from linux system but without success. Any suggestion? Thanks!
  6. Yes your answers were very clear. Thanks a lot for the clarification!
  7. after other test I can conclude that the USE_LTO = no and USE_OPT = -O0 are a requirement. otherwise 9 times over 10 the flash with st-flash is not working and the program is not reliable!
  8. Good morning. After the suggestion made by Tectu (switch to -O0, disable link optimization, disable usb and so on..), I was able to have my lcd show something! Then I tried to figure out restoring the initial condition one by one to see what was the source of the problem. Strangely now I am able to have everything working, what I noticed is that sometimes using st-link to flash the program, even if the message was successful, the program is not really loaded into the board (I had to launch st-link two times in a row to have it working) so I suppose this is the main source of my problem yesterday.. I have another question, I looked inside the gfx.mk and it seems to load automatically other mk if I have defined some variable, like ifneq ($(GFXBOARD),) include $(GFXLIB)/boards/base/$(GFXBOARD)/board.mk endif ifneq ($(GFXDRIVERS),) include $(patsubst %,$(GFXLIB)/drivers/%/driver.mk,$(GFXDRIVERS)) endif ifneq ($(GFXDEMO),) include $(GFXLIB)/demos/$(GFXDEMO)/demo.mk endif But Tectu wrote about it is not necessary to So just in case of the supported board I have to leave only GFXBOARD = STM32F429i-Discovery inside my Makefile? What is the purpose of ifneq ($(GFXDRIVERS),) include $(patsubst %,$(GFXLIB)/drivers/%/driver.mk,$(GFXDRIVERS)) endif Is it possible to use graphics capability of uGSX by only having the display drivers, or it needs always also the board? besides I'd like to point out that from http://wiki.ugfx.org/index.php?title=ChibiOS/RT the example of makefile (I know it is only an example, so I have copied only the enlightened part) there are those rows include $(GFXLIB)/gfx.mk include $(GFXLIB)/boards/base/Embest-STM32-DMSTF4BB/board.mk # board include $(GFXLIB)/drivers/gaudio/vs1053/driver.mk # additional driver but from Tectu it seems not to be right? I must include only include $(GFXLIB)/gfx.mk include $(GFXLIB)/boards/base/Embest-STM32-DMSTF4BB/board.mk # board or if I define in the makefile GFXBOARD = STM32F429i-Discovery then I only have to include include $(GFXLIB)/gfx.mk Thanks a lot for the support! in the following days I'm looking forward to work with uGFX and hope it will lighten the burden to deal with the graphics, facilitating my job!
  9. Hi, I'm using chibios 3.0.1, and the blincking led demo program for STM32F429-discovery works fine at first try. Now I'm trying to insert uGFX, so I've downloaded the latest version and put it inside chibios root dir: so I have /home/user/chibios/ugfx (with ugfx at the same level of the other main dir of chibios) I've modified the makefile following the instruction from uGFX website for chibios integration ############################################################################## # Build global options # NOTE: Can be overridden externally. # # Compiler options here. ifeq ($(USE_OPT),) USE_OPT = -O2 -ggdb -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),) USE_LTO = yes 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 # If enabled, this option makes the build process faster by not compiling # modules not used in the current configuration. ifeq ($(USE_SMART_BUILD),) USE_SMART_BUILD = yes 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 # # Define project name here PROJECT = ch # Imported source files and paths CHIBIOS = ../../.. CHIBIOS_VERSION = 3 CHIBIOS_CPUCLASS = ARMCMx CHIBIOS_PORT = v7m #uGFX path GFXLIB = $(CHIBIOS)/ugfx GFXBOARD = STM32F429i-Discovery #GFXDEMO = modules/gdisp/basics # General settings # See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables OPT_OS = chibios OPT_THUMB = yes OPT_LINK_OPTIMIZE = yes OPT_CPU = stm32m4 # ChibiOS settings ifeq ($(OPT_OS),chibios) # See $(GFXLIB)/tools/gmake_scripts/os_chibios.mk for the list of variables CHIBIOS_BOARD = ST_STM32F429I_DISCOVERY CHIBIOS_PLATFORM = STM32F4xx CHIBIOS_PORT = GCC/ARMCMx/STM32F4xx CHIBIOS_LDSCRIPT = STM32F429xI.ld endif # Startup files. include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk # HAL-OSAL files (optional). include $(CHIBIOS)/os/hal/hal.mk include $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/platform.mk include $(CHIBIOS)/os/hal/boards/ST_STM32F429I_DISCOVERY/board.mk include $(CHIBIOS)/os/hal/osal/rt/osal.mk # RTOS files (optional). include $(CHIBIOS)/os/rt/rt.mk include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk # Other files (optional). se compilo test mi crasha il compilatore quando compila!!!! #include $(CHIBIOS)/test/rt/test.mk # per usare framework grafico include $(GFXLIB)/gfx.mk #include $(GFXLIB)/boards/base/STM32F429i-Discovery/board.mk # board #include $(GFXLIB)/drivers/gdisp/STM32F429iDiscovery/driver.mk # additional driver #include $(GFXLIB)/drivers/gdisp/ILI9341/driver.mk # Define linker script file here LDSCRIPT= $(STARTUPLD)/STM32F429xI.ld # 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) \ $(CHIBIOS)/os/various/shell.c \ $(CHIBIOS)/os/hal/lib/streams/memstreams.c \ $(CHIBIOS)/os/hal/lib/streams/chprintf.c \ $(GFXSRC) \ usbcfg.c 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/hal/lib/streams $(CHIBIOS)/os/various \ $(GFXINC) #\ #$(GFXINC)/$(GFXINC)/boards/base/STM32F429i-Discovery \ #include # # 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 AR = $(TRGT)ar 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 -Wundef -Wstrict-prototypes #CWARN = # Define C++ warning options here CPPWARN = -Wall -Wextra -Wundef #CPPWARN = # # Compiler settings ############################################################################## #CFLAGS +=-DGFX_USE_OS_CHIBIOS=TRUE -DCORTEX_USE_FPU=FALSE #CPPFLAGS += -DGFX_USE_OS_CHIBIOS=TRUE -DCORTEX_USE_FPU=FALSE #CXXFLAGS += -DGFX_USE_OS_CHIBIOS=TRUE -DCORTEX_USE_FPU=FALSE ############################################################################## # 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 # *** EOF *** And copied gfxconf.h inside the folder where I have the makefile and the main.c (inside demos/STM32/RT-STM32F429-DISCOVERY) where I have the following defines #define GFX_USE_OS_CHIBIOS TRUE //#define GFX_USE_OS_WIN32 FALSE //#define GFX_USE_OS_LINUX FALSE //#define GFX_USE_OS_OSX FALSE /* GFX sub-systems to turn on */ #define GFX_USE_GDISP TRUE /* Features for the GDISP sub-system. */ #define GDISP_NEED_VALIDATION TRUE #define GDISP_NEED_CLIP TRUE #define GDISP_TOTAL_DISPLAYS 1 #define GDISP_NEED_STARTUP_LOGO FALSE #define GDISP_STARTUP_LOGO_TIMEOUT 0 and add the instruction I found in the example of uGFX ugfx/demos/modules/gdisp/basics coord_t width, height; coord_t i, j; // Initialize and clear the display gfxInit(); //start thread for blinking 2 leds /* * Activates the USB driver and then the USB bus pull-up on D+. * Note, a delay is inserted in order to not have to disconnect the cable * after a reset. */ usbDisconnectBus(serusbcfg.usbp); chThdSleepMilliseconds(1000); usbStart(serusbcfg.usbp, &usbcfg); usbConnectBus(serusbcfg.usbp); /* * Creating the blinker threads. */ chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO + 10, Thread1, NULL); chThdCreateStatic(waThread2, sizeof(waThread2), NORMALPRIO + 10, Thread2, NULL); // Get the screen size width = gdispGetWidth(); height = gdispGetHeight(); // Code Here gdispDrawBox(10, 10, width/2, height/2, Yellow); gdispFillArea(width/2, height/2, width/2-10, height/2-10, Blue); gdispDrawLine(5, 30, width-50, height-40, Red); for(i = 5, j = 0; i < width && j < height; i += 7, j += i/20) gdispDrawPixel(i, j, White); while(TRUE) { gfxSleepMilliseconds(500); } The make would complete without errors, but when I flash it the led stop blinking so I assume the system is stuck on the gfxInit(); Any ideas where I made it wrong? (I have enabled the SPI bus with SPI5 inside the chibios config file, just in case anyone have a doubt about it) Thanks to all.
×
×
  • Create New...