Skip to main content
ALomb
Senior
December 10, 2020
Question

assert(state[nextSendingBlock] == DRAWN);

  • December 10, 2020
  • 8 replies
  • 2608 views

My HW is NUCLEO-F446RE and X-NUCLEO-GFX01M1.

TouchGFX is configured in partial frame buffer (3x1920 bytes)

In the project I use FreeRTOS API CMSIS V2.

The assert in question occurs randomly:

assertion "state[nextSendingBlock] == DRAWN" failed:
file "../Middlewares/ST/touchgfx/framework/include/touchgfx/hal/FrameBufferAllocator.hpp", 
line 241,
function: const touchgfx::Rect& touchgfx::ManyBlockAllocator<block_size, blocks, bytes_pr_pixel>::peekBlockForTransfer()
[with long unsigned int block_size = 1920; long unsigned int blocks = 3; long unsigned int bytes_pr_pixel = 2]

When the assert occurs, the state fields are all EMPTY.

This topic has been closed for replies.

8 replies

ALomb
ALombAuthor
Senior
December 14, 2020

Hi @Martin KJELDSEN​ ,

no support on this problem?

Best regards

/Antonello

Martin KJELDSEN
Principal III
December 14, 2020

Hey. Busy busy with 4.16.0 release.

Let me take a look at that. When does that happen? has the application been running for a while? I'll need some more information to help you.

/Martin

ALomb
ALombAuthor
Senior
December 14, 2020

Hi Martin,

thanks for the support and I am sorry to take your precious time for 4.16.0 release which, of course, I am anxious to use ;)

The project is based on FreeRTOS (CubeIDE) and there are other tasks, in particular one dedicated to the transmission of messages via CAN BUS.

The problem occurs 90% of the time at startup and at the end of the animation. Consider that the animation is the same as the online demo for the NUCLEO-G071RB where I changed the images.

While waiting for the support I created the following workaround in Middlewares/ST/touchgfx/framework/include/touchgfx/hal/FrameBufferAllocator.hpp:

 virtual const Rect& peekBlockForTransfer()
 {
 int nextSendingBlock = sendingBlock + 1;
 int foo = 0;
 if (nextSendingBlock == blocks)
 {
 nextSendingBlock = 0;
 }
 if (state[nextSendingBlock] != DRAWN)
 {
 	foo++;
 	state[nextSendingBlock] = DRAWN;
 }
 assert(state[nextSendingBlock] == DRAWN);
 return blockRect[nextSendingBlock];
 }

With this and with a breakpoint in "foo++" the execution with the debugger continues, but only if I break for a least three cycles. If I remove the breakpoint it crashes.

I am available for any clarification/detail you need.

/Antonello

Martin KJELDSEN
Principal III
December 14, 2020

Don't be sorry! Thanks for the info :) I'll look at it tomorrow.

Flemming Gram CHRISTENSEN
ST Employee
December 22, 2020

Hi.

I think Martin Kjeldsen is out of the office at moment for Christmas vacation.

Can you provide a stack trace when you hit the assert? This is to know if we are coming from the interrupt context.

Thanks

ALomb
ALombAuthor
Senior
January 4, 2021

Hi and happy New Year !

@Flemming Gram CHRISTENSEN​  I have attached the image with the stack and the contents of the state vector.

Thanks

0693W000006HMQiQAO.png

Martin KJELDSEN
Principal III
January 5, 2021

Thanks. We're trying to reproduce is here - This is not the first time we've heard about someone having issues with PFB and RTOS.

Martin KJELDSEN
Principal III
January 13, 2021

​Update:

We found a logic bug that would cause this issue. We have a fix ready for 4.16.1 which should be out end of January.

/Martin

Senior
March 21, 2024

Same problem with version 4.23.2

TouchGFX is configured in partial frame buffer 3x4000 bytes.

TouchGFX Task StackSize is 4096 bytes