AlexMiron31 Posted November 7, 2017 Report Posted November 7, 2017 Hi everyone. I'm trying to implement the uGFX library on STM32F429I-DISCO board. My IDE is Keil uVision 5. So far the GDisplay module was attached with setting of back color in LCD and showing the uGFX logo during setup time. I was trying to atach the GInput module, too, but there is some issue I can't resolve. Ater adding this module to the project in configuration file the program begins to run the thread-related sub-routines and never rich the infinite loop inside the main(). I reduced the code there to two strings (toggling on-board LED and delay through gfxSleepMilliseconds()), but it has no influence. However, with GInput switched off the code inside the loop executes pretty fine. Maybe someone would be so kind to explain my mistake? I'll attach the archived project. Many thanks to all who will consider it possible to help me. 15.0.TFT_on_F429.rar
Joel Bodenmann Posted November 7, 2017 Report Posted November 7, 2017 Did you properly set GFX_CPU, GFX_OS_HEAP_SIZE and GFX_COMPILER? The latter is very important when using Keil. When using the Raw32 (baremetal) port with Keil you want to make sure taht GFX_OS_HEAP_SIZE is a non-zero value. It's the heap size that µGFX will use in bytes. Give it something like 20k or 40k to get started.
AlexMiron31 Posted November 8, 2017 Author Report Posted November 8, 2017 13 hours ago, Joel Bodenmann said: Did you properly set GFX_CPU, GFX_OS_HEAP_SIZE and GFX_COMPILER? The latter is very important when using Keil. Hi, Joel, thank you for the answer! I set CPU and compiler as shown below: #define GFX_COMPILER GFX_COMPILER_KEIL #define GFX_CPU GFX_CPU_CORTEX_M4 Unfortunately, I forgot to set heap size (my bad), but when I've set it to #define GFX_OS_HEAP_SIZE 37632 after your answer, nothing changed. The larger values leads to many errors during compiling. Is there something else that could be a problem?
AlexMiron31 Posted November 8, 2017 Author Report Posted November 8, 2017 And one more thing - I can see the data polling on I2C bus using oscilloscope, and the breakpoint on the start of read_xyz() shows that this function is being executed, but it never detects touch. Even if I hold my finger on the screen and run debugging, this function always get into if clause with empty FIFO buffer and never reach the point where the reading of x and y starts.
inmarket Posted November 8, 2017 Report Posted November 8, 2017 That sounds like an io pin may not have been initialized correctly and you therefore are not reading correct data.
AlexMiron31 Posted November 8, 2017 Author Report Posted November 8, 2017 9 minutes ago, inmarket said: That sounds like an io pin may not have been initialized correctly and you therefore are not reading correct data. That's quite right, I've just found the problem. It was in my implementation of write_reg() function - it transmitted the address of device and register to access correct, but the transmission of register's value was incorrect so the touch controller wasn't initialized properly. After fixing that the calibration dialog work properly. Joel, inmarket, thanks for your quick and helpful replies!
Joel Bodenmann Posted November 8, 2017 Report Posted November 8, 2017 Glad to hear that you got it working! I was somehow under the impression that you don't get anything on the display - this definitely makes sense. 4 hours ago, AlexMiron31 said: Unfortunately, I forgot to set heap size (my bad), but when I've set it to #define GFX_OS_HEAP_SIZE 37632 after your answer, nothing changed. The larger values leads to many errors during compiling. I assume the errors you're getting are due to the fact that there's not enough RAM to fit the uGFX heap during linking time.
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