backport 3cd66af889b42b036d6c9d88e067fc3b8abbdb2a and pr 258
Applies to STM32F4 and STM32F7
STM32, STM32 F7, and STM32 L4: Clone Freddie Chopin's I2C change to similar STM32 I2C drivers.
Save elapsed time before handling I2C in stm32_i2c_sem_waitstop()
This patch follows the same logic as in previous fix to
stm32_i2c_sem_waitdone().
It is possible that a context switch occurs after I2C registers are read
but before elapsed time is saved in stm32_i2c_sem_waitstop(). It is then
possible that the registers were read only once with "elapsed time"
equal 0. When scheduler resumes this thread it is quite possible that
now "elapsed time" will be well above timeout threshold. In that case
the function returns and reports a timeout, even though the registers
were not read "recently".
Fix this by inverting the order of operations in the loop - save elapsed
time before reading registers. This way a context switch anywhere in the
loop will not cause an erroneous "timeout" error.
5a6d95dd9f051be548a8d2378aaef75f0a1ba5e1 and ee5ae3a57dbbe835584f164c956e0374da1ed2eb
Applies to STM32F4 and STM32F7
Save elapsed time before handling I2C in stm32_i2c_sem_waitdone()
It is possible that a context switch occurs after stm32_i2c_isr() call
but before elapsed time is saved in stm32_i2c_sem_waitdone(). It is then
possible that the handling code was executed only once with "elapsed
time" equal 0. When scheduler resumes this thread it is quite possible
that now "elapsed time" will be well above timeout threshold. In that
case the function returns and reports a timeout, even though the
handling code was not executed "recently".
Fix this by inverting the order of operations in the loop - save elapsed
time before handling I2C. This way a context switch anywhere in the loop
will not cause an erroneous "timeout" error.
This is an intrim nuttx patch that fixes the missing CONFIG_
prefix on RAMTRON_WRITEWAIT. PR submitted upstream. This will
be in affect until the next uptake of upstream NuttX
STM32F4 does not require the HSI to erase or program FLASH
The HSI needs to be left on until a new clock source is chosen.
(we leave it on all the time)
NuttX had the CRTSCTS define incorrectly set for only output flow control, which broke our flow control logic. This commit patches NuttX and puts in addition a guard in place to prevent any future issue with the non-POSIX define being incorrect.
This has been debugged and identified by @ecmnet, which was the main contribution for this patch.
This hot fix essentialy revert commit 265af481209d60033f7cd4c4216048b1ce3eb435
in NuttX/nuttx. The commit STM32 serial: Make input hardware flow-control work with RX DMA.
From Jussi Kivilinna has broken the DMA on an STM32F4 in a yet TBD way.
The symptoms are lost data on RX, the DMA count decrements but
the data ia not written to memory. This looks to be introduced but the
non circular DMA settings.
1) Ensure if CONFIG_SERIAL_DMA is set that cdcacm uart_ops is initalized
with correct functions in correct slots.
This was detected only with PX4 build flags
2) C&P error from F7 would prevent CONFIG_STM32_SERIALBRK_BSDCOMPAT ifdefed
code from being included.