leozhang Posted June 3, 2017 Report Share Posted June 3, 2017 Hardware : NUCLEO-F302R8 library: STM32-CUBEMX, uGFX 2.7 compiler:KEIL MDK 5.2 I try to interated to my board,it can pass compile, when I use oled own dirver,it can work, but the ugfx do not work, i think i have something wrong in the configuration.any boby help? thx uGFX_OLED.zip Link to comment Share on other sites More sharing options...
leozhang Posted June 6, 2017 Author Report Share Posted June 6, 2017 It seems be stuck at the _gdispInit(); function. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted June 6, 2017 Report Share Posted June 6, 2017 Hello @leozhang First of all: You shouldn't copy the driver out of the µGFX library to your project directory. The driver itself should remain in the µGFX library directory. You only have to put the board file in your project directory (that is unless you want to modify the driver). If your driver doesn't pass the initialization then please use the debugger to set a breakpoint in the board_init() function and step through the code line by line to figure out where it hangs and why. Keil has a great debugger. I haven't looked at the 3rd party OLED functions that you're calling but the board file itself seems fine on first glance. But you might want to consider adding the implementation for the setpin_reset() function in the board file as well. Link to comment Share on other sites More sharing options...
leozhang Posted June 8, 2017 Author Report Share Posted June 8, 2017 it seems i have problem in “ RAM(g)[xyaddr(x, y)] &= ~xybit(y) ; ” because when I use keil bebug and running at this code,the mcu will goto“ void HardFault_Handler(void)” but I think the really problem is “ g->priv = gfxAlloc() ” yes that function. my configuration are : //#define GFX_USE_OS_WIN32 FALSE //#define GFX_USE_OS_LINUX FALSE //#define GFX_USE_OS_OSX FALSE //#define GFX_USE_OS_ECOS FALSE //#define GFX_USE_OS_RAWRTOS FALSE //#define GFX_USE_OS_ARDUINO FALSE //#define GFX_USE_OS_KEIL FALSE //#define GFX_USE_OS_CMSIS FALSE #define GFX_USE_OS_RAW32 TRUE //#define GFX_USE_OS_NIOS FALSE //#define GFX_USE_OS_QT FALSE // #define INTERRUPTS_OFF() optional_co // #define INTERRUPTS_ON() optional_co // Options that (should where relevant) apply to all operating sys // #define GFX_NO_INLINE FALSE #define GFX_COMPILER GFX_COMPILER // #define GFX_SHOW_COMPILER FALSE // #define GFX_CPU GFX_CPU_UNK // #define GFX_CPU_NO_ALIGNMENT_FAULTS FALSE // #define GFX_CPU_ENDIAN GFX_CPU_END // #define GFX_OS_HEAP_SIZE 0 // #define GFX_OS_NO_INIT FALSE // #define GFX_OS_INIT_NO_WARNING FALSE // #define GFX_OS_PRE_INIT_FUNCTION myHardwareI // #define GFX_OS_EXTRA_INIT_FUNCTION myOSInitRou // #define GFX_OS_EXTRA_DEINIT_FUNCTION myOSDeInitR // #define GFX_EMULATE_MALLOC TRUE so i dont know how to usb the gfxAlloc() Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted June 8, 2017 Report Share Posted June 8, 2017 Please set GFX_COMPILER to GFX_COMPILER_KEIL and set GFX_CPU to GFX_CPU_CORTEX_M4 (or the floating point equivalent if you're using the FPU). Don't forget to recompile from scratch after making those changes (clean build). Link to comment Share on other sites More sharing options...
inmarket Posted June 9, 2017 Report Share Posted June 9, 2017 Also you need to set GFX_OS_HEAP_SIZE to something other than zero. This is the heap size when using Raw32 so it is not surprising your memory allocations using gfxAlloc are failing. Try setting it to say 10240 as a starting point (10K heap size). Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted June 9, 2017 Report Share Posted June 9, 2017 Yep, that too. I missed that one - sorry. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now