cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F401RE Hangs working with 1BPP

CFern.1724
Associate II

Hi, TouchGFX community

I'm trying to get TouchGFX working on a STM32F401RE device with a 200x200 screen.

I've created a simple project with one screen and text as 1bit color depth (Idither_algorithm := 2, opaque_image_format := BW, non_opaque_image_format := BW on app.mk) and I use these configuration on BoardConfiguration.cpp:

uint8_t frameBuffer[5000]; //200 * 200 / 8

uint32_t frameBuf0 = (uint32_t)& frameBuffer[0];

namespace touchgfx

{

NoDMA dma;

NoTouchController tc;

LCD1bpp display;

void touchgfx_init()

{

  HAL& hal = touchgfx_generic_init<MyFakeHAL>(dma, display, tc, 200, 200, 0, 0);

  hal.setFrameBufferStartAddress((uint8_t*)frameBuf0, 1, false, false);

  hal.registerTaskDelayFunction(&OSWrappers::taskDelay);

   // Enable strategy.

   hal.setFrameRefreshStrategy(HAL::REFRESH_STRATEGY_OPTIM_SINGLE_BUFFER_TFT_CTRL);

  hal.setFrameRateCompensation(false);

  hal.lockDMAToFrontPorch(false);

}

I think that framebuffer big is enough for a 1 bit per pixel ( 200 * 200 / 8 bytes). Everything compiles OK but at debug system crashes always when trying to draw at touchgfx::LCD1bpp::drawGlyph()

I've seen other examples and they always use uint16 [width *height] arrays for creating the frame buffer, but this should only be needed in case of 16BPP. Its also needed for working with 1BPP? If not, what's happening?

Thanks,

11 REPLIES 11

Thanks a lot for your help. It help me to look at things more carefully. Thanks!

You're welcome. I'm glad you are able to find these things on your own - That makes things a lot easier :)