2016-07-22 06:44 AM
Hi,
Using CubeF7 with STM32F746G Discovery board.
Found a weird bug in
STM32Cube_FW_F7_V1.4.0\Drivers\BSP\STM32746G-Discovery\stm32746g_discovery_lcd.c
:
uint32_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos)
{
uint32_t ret = 0;
if
(hLtdcHandler.LayerCfg[ActiveLayer].PixelFormat == LTDC_PIXEL_FORMAT_ARGB8888)
{
/* Read data value from SDRAM memory */
ret = *(__IO uint32_t*) (hLtdcHandler.LayerCfg[ActiveLayer].FBStartAdress + (2*(Ypos*BSP_LCD_GetXSize() + Xpos)));
}
The highlighted multiplier of
2
must be replaced with4
, otherwise the code either returns data for the wrong pixel, or causes hardfault crash trying to access non-existing memory.Similar changes probably should be made in the code below (for RGB888 format).
#!bug2016-12-21 07:56 AM
Dear
‌,
Thanks for highlighting this issue.
I confirmed this bug and it will be fixed in the coming versions.
Best Regards
Imen