2018-06-13 05:33 AM
Hi,
I found two bugs when trying to read more than two bytes using HAL_DSI_Read().
Bug 1: HAL_DSI_Read() will always return HAL_ERROR when reading more than two bytes.
The root cause is simple:
HAL_DSI_Read will first take the HAL lock. Then it will check if datasize > 2 and then try to write the DSI_MAX_RETURN_PKT_SIZE using HAL_DSI_ShortWrite(). This function will try to take the same lock, but it will obviously fail and always return HAL_BUSY and HAL_DSI_Read() will then return HAL_ERROR.
Bug 2: assert_param in HAL_DSI_ShortWrite will fail when writing DSI_MAX_RETURN_PKT_SIZE.
If bug 1 is fixed, HAL_DSI_ShortWrite() is called with third parameter (Mode) DSI_MAX_RETURN_PKT_SIZE. The assert_param() check in HAL_DSI_ShortWrite() (assert_param(IS_DSI_SHORT_WRITE_PACKET_TYPE(Mode));) will fail because IS_DSI_SHORT_WRITE_PACKET_TYPE() does not contain DSI_MAX_RETURN_PKT_SIZE:
&sharpdefine IS_DSI_SHORT_WRITE_PACKET_TYPE(MODE) (((MODE) == DSI_DCS_SHORT_PKT_WRITE_P0) || \
((MODE) == DSI_DCS_SHORT_PKT_WRITE_P1) || \ ((MODE) == DSI_GEN_SHORT_PKT_WRITE_P0) || \ ((MODE) == DSI_GEN_SHORT_PKT_WRITE_P1) || \ ((MODE) == DSI_GEN_SHORT_PKT_WRITE_P2))These two bugs must be fixed in order to be able to read more than two bytes (which I want to do to read out the display ID).
BR,
Johan
#dsi2018-06-13 06:15 AM
Hello
johan.olsson@se.bosch.com
,I raised these issues internally for check and come back to you.
Thank you for your contribution.
With Regards,
Imen.
2018-12-26 07:25 AM
Hello,
This issue is fixed internally and will be available on next release of STM32CubeF4.
Thank you for your contribution.
Kind Regards,
Imen