Hi,
My project uses the "sd_jpeg" SDK example on imxrt1176. It's working. But I want to port it to FreeRTOS and I have tried it as attached. It's not working like this.
Can anyone help me figure out where it's going wrong?
There are no compilation errors but the code doesn't work. It gets stuck in the do-while loop (freeFb == NULL each time) as below:
do
{
oldIntStat = DisableGlobalIRQ();
freeFb = APP_GetFrameBuffer();
EnableGlobalIRQ(oldIntStat);
} while (NULL == freeFb);
Solved! Go to Solution.
Hi @Devaharsha ,
This is because each layer has max size. You changed offset, but didn't changed size.
g_dc.ops->getLayerDefaultConfig(&g_dc, 0, &fbInfo);
fbInfo.pixelFormat = APP_FB_FORMAT;
fbInfo.width = APP_FB_WIDTH-200;
fbInfo.height = APP_FB_HEIGHT-100;
fbInfo.startX = 200;
fbInfo.startY = 100;
fbInfo.strideBytes = APP_FB_STRIDE_BYTE;
if (kStatus_Success != g_dc.ops->setLayerConfig(&g_dc, 0, &fbInfo))
...
Regards,
Jing
Hi @smartpavan333 ,
The jpeg decoder in SDK doesn't support gif. You have to find a decoder elsewhere.
Regard,
Jing
Using infinite for loop "for(;;)" instead of "while(True)", frame buffer is getting updated and the entire is code is working fine when ported to FreeRTOS.
If I want to rotate the jpg file in sd card, It's not getting rotated on the display. Can anyone help me in where the modification is required in the above sdk code?
Hi @Devaharsha ,
You can use PXP to rotate the picture. Otherwise you have to use your own code.
Regards,
Jing
ok, thanks.I will try.
Can you help how sd_jpeg sdk example can be added with pxp_flip sdk code? I want to integrate both example code so that I can rotate the image.
I am confused as what to put the value for ".bufferAddr=" in the below structure (which I assume would be same for output buffer structure to):
/* PS configure. */
const pxp_ps_buffer_config_t psBufferConfig = {
.pixelFormat = APP_PXP_PS_FORMAT,
.swapByte = false,
.bufferAddr = (uint32_t)s_psBufferPxp,
.bufferAddrU = 0U,
.bufferAddrV = 0U,
.pitchBytes = APP_PS_SIZE * APP_BPP,
};
Hi @Devaharsha ,
If the picture is RGB format, bufferAddr point to picture start address. If the picture format is YUV one plane, bufferAddr point to Y. If the picture format is YUV two/three plane, bufferAddr point to Y start address and bufferAddrU/bufferAddrV point to the other plane.
Regards,
Jing
Hi @Devaharsha ,
That means it can't get frame buffer. Can you trace in and see why it can't?
Regards,
Jing
In the normal sd_jpeg SDK example code, I want to move the image. I have tried changing
"fbinfo->startx" & "fbinfo->starty"
but the image is not shifting. I think that the wrong way to do.
Can you please help me in were to modify in the code? (Im not using PXP driver, used image: 720x720 px)
Hi @Devaharsha ,
This is because each layer has max size. You changed offset, but didn't changed size.
g_dc.ops->getLayerDefaultConfig(&g_dc, 0, &fbInfo);
fbInfo.pixelFormat = APP_FB_FORMAT;
fbInfo.width = APP_FB_WIDTH-200;
fbInfo.height = APP_FB_HEIGHT-100;
fbInfo.startX = 200;
fbInfo.startY = 100;
fbInfo.strideBytes = APP_FB_STRIDE_BYTE;
if (kStatus_Success != g_dc.ops->setLayerConfig(&g_dc, 0, &fbInfo))
...
Regards,
Jing
Ok thanks, I will try it.
Another thing, as you mentioned like if you want to rotate image, manually you can or use PXP driver. But PXP driver is taking more time than expected. So, we are going with manual way.
Manually if I rotate image in Paint, its still displaying correctly. So, can you tell how to do it manually?
Hi @Devaharsha ,
PXP is much more faster than manually.
There isn't image rotate software or library in SDK driver. You can search in LVGL library but I'm not sure.
Here is some doc about how to rotate a image.
https://www.sciencedirect.com/topics/computer-science/image-rotation
https://homepages.inf.ed.ac.uk/rbf/HIPR2/rotate.htm
Regards,
Jing
The image is getting rotated manually i.e. if I rotate it in paint, save it and store it in SDcard. It's working.
Thanks, @jingpan for the shifting part. I have tried it and it's working. But it's shifting from the center of the panel.
Shifting is also working by changing the ratio below:
buffer += row_stride * ((APP_FB_HEIGHT - cinfo.output_height) / 2);
buffer += APP_FB_BPP * ((APP_FB_WIDTH - cinfo.output_width) / 2);