bsics-svr's People
bsics-svr's Issues
STM32 I2C lock-up when HAL_UART_Transmit() used in other task
At commit 4a7f4ec ,
- scpi server task uses iprintf() and consequently HAL_UART_Transmit() for debug output
- default task periodically issues HAL_I2C_Master_Transmit() and HAL_I2C_Mem_Write()
Even the UART messages
iprintf("***Connection closed\r\n");
printf("***Control Connection closed\r\n");
are sufficient to cause I2C1 and eventually I2C2 to lock up with clock (and occasionally SDA due to true slave device lock-up) stuck low:
The last bits exchanged are always part of a full byte + ACK and mostly observed during the long HAL_I2C_Mem_Write() to update SSD1306.
Overall, the periodic timing is much more stretched out as I2C1 and I2C2 comms are interleaved:
I2C_RequestMemoryWrite()
fails during start-up as devices are detected and their status is reported. Later (when opening and closing a TCP connection and causing the associated reporting via UART), I2C_WaitOnTXISFlagUntilTimeout()
fails when the above breakpoint is removed. Subsequent issues are encountered earlier when I2C_WaitOnFlagUntilTimeout()
fails.
The timeout value passed is equivalent to 25 ms. Extending timeouts to 250 ms does not fix the issue.
HAL I2C functions do not seem to fail gracefully, transmissions are not completed and I2C bus functionality is not recovered.
Ideal solution: interrupt or DMA-based handling of UART transfers (see https://stm32f4-discovery.net/2017/07/stm32-tutorial-efficiently-receive-uart-data-using-dma/). Currently no received characters are being processed, so UART does not need to block program execution at all.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.