2024-03-05 09:24 PM
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
V1.9.0
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:
I wonder is this a bug or not? If this is a bug, could you please fix this in next version?
2024-03-05 11:04 PM
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