Skip to main content
ALomb
Senior
Dec 10, 2020 11:40 AM UTC
Question

assert(state[nextSendingBlock] == DRAWN);

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.

9 replies

ALomb
ALombAuthor
Senior
Dec 14, 2020 12:09 PM UTC

Hi @Martin KJELDSEN​ ,

no support on this problem?

Best regards

/Antonello

Martin KJELDSEN
Principal III
Dec 14, 2020 2:07 PM UTC

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
Dec 14, 2020 2:33 PM UTC

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
Dec 14, 2020 3:08 PM UTC

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

Flemming Gram CHRISTENSEN
ST Employee
Dec 22, 2020 9:05 AM UTC

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
Jan 4, 2021 7:20 AM UTC

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
Jan 5, 2021 3:32 PM UTC

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
Jan 13, 2021 8:27 AM UTC

​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
Mar 21, 2024 3:46 PM UTC

Same problem with version 4.23.2

TouchGFX is configured in partial frame buffer 3x4000 bytes.

TouchGFX Task StackSize is 4096 bytes