cancel
Showing results for 
Search instead for 
Did you mean: 

Slide screen transition problem

VKost.3
Associate II

I created two screens and did the actions to change the screen. But changing the screen does not work correctly.

Added an extra buffer for animation

uint16_t buf_ram [160*128];

using namespace touchgfx;

namespace {

  LOCATION_PRAGMA("TouchGFX_Framebuffer")

  uint32_t frameBuf[(160 * 128 * 2 + 3) / 4 * 2] LOCATION_ATTRIBUTE("TouchGFX_Framebuffer");

}

void TouchGFXGeneratedHAL::initialize()

{

  HAL::initialize();

  registerEventListener(*(Application::getInstance()));

  setFrameBufferStartAddresses((void*)frameBuf, (void*)(frameBuf + sizeof(frameBuf)/(sizeof(uint32_t)*2)), (void*)buf_ram);

}

11 REPLIES 11
Romain DIELEMAN
ST Employee

Hi,

Are you facing the issues shown in the pictures only when you go from a screen to another ? Does that mean that you face no issues when staying on one screen and rotating elements (i have in mind the same animation as the UI template "Texture mapper example"), or with any other "complex" animations ?

/Romain

VKost.3
Associate II

Yes, I only come across during transitions! Animating scrollWil Tutorial 4: Creating a Scroll Wheel with Custom Behavior works well! Transition block works good. Transition Slide, Cover and Wipe works bad.

How/why did you set the size and addresses of the framebuffers and animation storage to what you set ? I think you should enable more memory to the animation storage. I would do something more like this:

setFrameBufferStartAddresses((void*) addressFrambuffer1, (void*) addressFramebuffer1 + sizeFramebuffer, (void*) addressFramebuffer1 + 2 * (sizeFrameBuffer) );

where sizeFramebuffer = HEIGHT * WIDTH * bpp / 8, so in your case I guess just 160*128*16/8.

/Romain

#include <TouchGFXGeneratedHAL.hpp>

#include <touchgfx/hal/OSWrappers.hpp>

#include <gui/common/FrontendHeap.hpp>

#include "stm32f7xx.h"

#define SIZE_FRAME_BUFFER (uint32_t) (128 * 160 * 16 / 8)

#define ADDRESS_FRAME_BUFFER (uint32_t) 0x20010000

using namespace touchgfx;

void TouchGFXGeneratedHAL::initialize()

{

  HAL::initialize();

  registerEventListener(*(Application::getInstance()));

  setFrameBufferStartAddresses((void*)ADDRESS_FRAME_BUFFER, (void*)(ADDRESS_FRAME_BUFFER + SIZE_FRAME_BUFFER), (void*)(ADDRESS_FRAME_BUFFER + (2*SIZE_FRAME_BUFFER)));

}

Screen replacement does not work. The screen does not change.

After the first call to application (). GotoScreen2ScreenBlockTransition (), the transition to the second screen does not occur and the handleTickEvent event stops working.

Watch out as you are writing those changes in TouchGFXGeneratedHAL.cpp. This file will be overwritten whenever you will generate code from TouchGFX Designer (or run simulator/on target).

You should add it instead to the TouchGFXHAL.cpp file, in the TouchGFXHAL::initialize() function (after the TouchGFXGeneratedHAL::initialize() call).

/Romain

MM..1
Chief III

Maybe good is start from start. How method LCD you use? LTDC? FMC? SPI? ...

I use FMS+freertos, buffer is in RAM

Fuller info is better , project from where ? CubeMX IDE TouchGFX? You select Custom driver and Double buffer by allocation?

When you change this you need delete target folder before generate new usw.

I recommend try same config from start with TouchGFX 4.13 compare result ...

FMS??

It's also bad with version 4.13

Doesn't go to second screen, interrupt handleTickEvent() stops working. Interrupt timer for touchgfx_signalVSyncTimer () works!

My settings

#include <touchgfx/hal/OSWrappers.hpp>

#include "stm32f7xx.h"

#include "../../oled160128/Inc/oled160128.h"

#define SIZE_FRAME_BUFFER (uint32_t) (128 * 160 * 16 / 8)

#define ADDRESS_FRAME_BUFFER (uint32_t) 0x20020000

using namespace touchgfx;

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();

  setFrameBufferStartAddresses((void*)(ADDRESS_FRAME_BUFFER), (void*)(ADDRESS_FRAME_BUFFER + SIZE_FRAME_BUFFER), (void*)(ADDRESS_FRAME_BUFFER + 2*SIZE_FRAME_BUFFER));

}