cancel
Showing results for 
Search instead for 
Did you mean: 

Found issue in "GPIO_ResetBits" and "GPIO_WriteBit" function

GhostLee
Associate

Hi,

I found issue in STM32F4xx_DSP_StdPeriph_Lib_V1.9.0 when I test serial port communication. "\r\n" simple missed when get received data. I try STM32F4xx_DSP_StdPeriph_Lib_V1.4.0 run same code works fine, so I do some research about what's changes between these versions.

After research I found code logic difference in "GPIO_ResetBits" and "GPIO_WriteBit" function between two versions. Please look follow image:

V1.4.0

屏幕截图 2024-03-06 131606.png

V1.9.0

屏幕截图 2024-03-06 131700.png

I understand that you use 32bits parameter to replace old version two 16bits parameter, but in current code only saved high or low BSRR value, not both of them.

I change your code like follow image, then serial port works fine in V.1.9.0, please take a look green rectangle part:

屏幕截图 2024-03-06 132224.png

I wonder is this a bug or not? If this is a bug, could you please fix this in next version?

1 REPLY 1

BSRR register is write-only (and most probably reads always as zero), so changing the operation from = to |= does not change the write itself. In other words, the original v1.9 version is OK.

However, the real change you've made is in timing. I don't know how exactly do you use this function in testing serial communication, so without seeing the context it's impossible to judge, what is really the problem.

Post relevant portion of code which fails with the original v1.9.

JW