‎2020-01-19 11:02 AM
hi everyone,
i wanted to create a project with touchGFX but there are errors, i just create the graphic interface, i didn't add any code!
even though when i tried to upload to my card an example it said error too!
how can i resolve this?
Solved! Go to Solution.
‎2020-01-26 03:02 AM
Yes @Martin KJELDSEN​ this is it! The touch won’t work if this file is empty even though the driver (ts) is here! But when I copy paste the code generated by TouchGFX Designer, the touch work so if this file is empty the touch won’t work! I want to know how it’s possible to make this file not empty with CubeIDE without “copy paste�??
or?
‎2020-01-26 04:13 AM
It's working as intended =) You're getting the right ideas now.
As i said, CubeMX does not know anything about touch controllers. This is BSP! It only does MCU configuration.
The application template comes with a working project. What we did is start from cubemx/generator (like you) and then manually made the touch controller work, manually configured SDRAM and QSPI, because that's how you would bring up a custom board. The touch controller is display/board specific! CubeMX has no clue, so you need to write the code yourself. And that's what we did for you, in all the application templates.
/Martin
‎2020-01-26 04:15 AM
You could then go on to say that you should NEVER create a new TouchGFX HAL for a well known stm32 board that is supported by the designer, unless you're just eager to learn. Otherwise we already did the work.
/Martin
‎2020-01-26 04:39 AM
Thank you @Martin KJELDSEN​ this is very cool! I have one more question please :smiling_face_with_smiling_eyes: in TouchGFX in interaction I used slide to change screen but when I debug and run the code there’s no slide it changes the screen without slide, what’s the problem?
‎2020-01-27 12:20 AM
Hi,
I think you'll have to be more specific. But my guess is that you do not have an "animation storage" buffer allocated. You allocate this when you configure the TouchGFX HAL.
/Martin
‎2020-01-27 03:51 AM
hi @Martin KJELDSEN​ ,
so i have to add the code as I did for SDRAM, QSPI & FMC?
‎2020-01-27 03:55 AM
Well, in this case you just need to configure your TouchGFX HAL differently. Here's the doc for HAL::setFrameBufferStartAddress()
/**
* @fn virtual void HAL::setFrameBufferStartAddress(void* adr, uint16_t depth = 16, bool useDoubleBuffering = true, bool useAnimationStorage = true)
*
* @brief Sets the address used for frame buffers, usually located in external memory.
*
* Sets the address used for frame buffers, usually located in external memory. Will
* reserve memory for one or two frame buffers based on display size. Will optionally
* also reserve memory for a third frame buffer used for animationStorage.
*
* @param [in] adr Starting address to use for frame buffers.
* @param depth (Optional) Depth of each pixel in bits, default is 16.
* @param useDoubleBuffering (Optional) If true, reserve memory for an extra frame buffer.
* @param useAnimationStorage (Optional) If true, reserve memory for animation storage.
*
* @deprecated Use the setFramaBufferStartAddress with 'format' parameter instead of 'depth'
*/
virtual void setFrameBufferStartAddress(void* adr, uint16_t depth = 16, bool useDoubleBuffering = true, bool useAnimationStorage = true)
The key here is to tell HAL to use an additional buffer (same size as framebuffer) for snapshots when doing screen animations.
‎2020-01-27 06:02 AM
Okay @Martin KJELDSEN​ ! But in which file I have to add this? TouchGFXGeneratedHAL.cpp or TouchGFXHAL.cpp because when I open these 2 files I already found setFrameBufferStartAddresss(void* framebuffer,void* doubleBuffer, void * aniamationStorage)
‎2020-01-27 06:25 AM
TouchGFXHAL.cpp, you cannot modify GeneratedHAL. You have your HAL::initialize() function there you can use to call the base class init (TouchGFXGeneratedHAL) and reconfigure what you want.
void TouchGFXHAL::initialize()
{
// Calling parent implementation of initialize().
//
// To overwrite the generated implementation, omit call to parent function
// and implemented needed functionality here.
// Please note, HAL::initialize() must be called to initialize the framework.
TouchGFXGeneratedHAL::initialize();
}
Reconfigure framebuffer addresses here. Use:;
* setFrameBufferStartAddress, with arguments (bitdepth, use animation storage, ...), if you want touchgfx to decide where to place the buffers
* setFrameBufferStartAddresses, if you want to supply the exact location of each buffer
‎2020-01-27 07:04 AM
I'm sorry @Martin KJELDSEN​ if I ask lots of question but I really want to learn
Is this correct?
I add :
TouchGFXGeneratedHAL::setFrameBufferStartAddresses(frameBuffer0, 0, (void*)USE_ANIMATION_STORAGE);