It seems to me that ISR (Interrupt Service Routine aka interrupt handler) code which is intended to capture uart data is not all-that-it-can-be. Some people claiming to be "embedded developers" post code to these forums and even write blogs to demonstrate their expertise, but end up confusing the folks that need the help to get their projects running. The net result is more confusion and little transfer of knowledge. Code is posted with very few or questionable comments, structs or other code that have no business being there, code that does nothing, etc.
So, after spending hours debugging examples, I have decided to write this blurb just to clear up a few things about the Uart ISRs that I have looked at
For example:
1. The ISR intro should be checking the status register to determine what caused the interrupt. If a Parity Error (UART0/1/2.int_st.val = 4) caused the interrupt, there is no point to capturing the data because it would be invalid. The code should clear the register and move on.
2. Clearing only 1 or 2 bits of the Reset Register when there are at least 6 different interrupt-enable-bits set in the configuration register makes NO sense. If the the condition that caused the interrupt is not reset, the ISR will continually be re-entered as soon as the function completes. The code then finds itself in an endless loop and the user has no idea why his code is "not working" --> Back to the forum...
3. Newbie developers should understand that you don't need Freetos libraries to make the ISR function fulfill its task. One such piece of code floating around in this forum imports the libraries to create a task that just blinks an LED. This might lead a person to think that the libraries are required when they are not!!! I believe that the KISS principle should be followed when developing code.
There are more things that I could comment on, but, I think that some of the people reading this rant will understand my frustration with some "developers" that just copy code from somewhere else and pass it on as their own without explanation, either because they don't understand "their" code, or are too lazy to provide the comments that would help those of us that need the help!!!
ESP32 Uart ISRs and misinformation
Return to “General Discussion”
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- 全国大学生物联网设计竞赛乐鑫答疑专区
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- 中文文档讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: Majestic-12 [Bot] and 235 guests
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.