Assert_param problem in the 270-degree rotate state


Hello, have a good time
in my code, I rotate my display from 270 degrees (LV_DISP_ROT_270) to none rotation( LV_DISP_ROT_NONE) or vise_versa
when my LCD is in 270 degrees rotation state, sometimes I have assert_param problem in data length of dma_buffer_size
I use DMA for draw buffer(flush_cb)
I took effort for debugging that I think that problem occurs in draw_buf_rotate function in lv_refr.c because max_row parameter is negative that leads to area->x1 parameter is bigger than area->x2 parameter

I send a screenshot from my debug, which you can see at the bottom.
in the picture, parameters shown
have anybody suggestions?

What MCU/Processor/Board and compiler are you using?


What LVGL version are you using?


What do you want to achieve?

fixed problem

What have you tried so far?

Code to reproduce

/*You code here*/

Screenshot and/or video

This smells like stack/memory corruption. Perhaps try increasing your stack size?

Based on your screenshot, max_row would equal 128,000 divided by 2 or 4, divided by area_w (which is 1). I don’t see how that can be a negative number.

thanks for the reply, I will try it
yes, I think the max_row parameter must equal 110 or 128000 divided by 2 or 4 but I don’t know why the result of LV_MIN is negative (in line 904(screenshot))

Hello, I increase the stack size but it’s not working, in addition, I checked, the stack size used is 70 percent
I think I found the problem, in rot_270_deg I had created an object (this object is the parent of the chart that the data of chart is changing in runtime) that size was bigger than its parent, in other words, I created 3 objects lets named them parent, object and chart that object is a child of the parent and chart is the child of the object that size of the object is bigger than the parent
when the display is in rot_270_deg at first all thing is working correctly but after a time, the problem happens. I changed the size of the object (smaller than the parent ), the assert_param problem does not happen again until now
do you think the problem is related to the size of the object?

It may be. If you can narrow it down to a small code snippet I can try it in a simulator where it’s easier to debug.