cancel
Showing results for 
Search instead for 
Did you mean: 

Bug Report STM32CubeF4 v 1.21.0 - HAL_DSI_Read() can't read more than two parameters

Johan Olsson
Associate
Posted on June 13, 2018 at 14:33

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

#dsi
2 REPLIES 2
Imen.D
ST Employee
Posted on June 13, 2018 at 15:15

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.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Imen.D
ST Employee

Hello,

This issue is fixed internally and will be available on next release of STM32CubeF4.

 Thank you for your contribution.

Kind Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen