cancel
Showing results for 
Search instead for 
Did you mean: 

assert(state[nextSendingBlock] == DRAWN);

ALomb
Senior

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.

9 REPLIES 9
ALomb
Senior

Hi @Martin KJELDSEN​ ,

no support on this problem?

Best regards

/Antonello

Martin KJELDSEN
Chief III

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
Senior

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

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

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
Senior

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
Chief III

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
Chief III

​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

Panchev68
Senior

Same problem with version 4.23.2

TouchGFX is configured in partial frame buffer 3x4000 bytes.

TouchGFX Task StackSize is 4096 bytes