Solved with short but non-zero blocking timeout!
After further digging, the issue seems to be contention on accessing the mutex object by multiple readers at the same time. It is fixed by adding a very short but non-zero blocking timeout to aquire the ReadAccess lock. I used `std::shared_timed ...
Search found 115 matches
- Wed Sep 03, 2025 8:11 pm
- Forum: ESP-IDF
- Topic: Unexpected behavior of std::shared_lock<std::shared_mutex>
- Replies: 2
- Views: 633
- Fri Jun 20, 2025 6:52 pm
- Forum: ESP-IDF
- Topic: Unexpected behavior of std::shared_lock<std::shared_mutex>
- Replies: 2
- Views: 633
Unexpected behavior of std::shared_lock<std::shared_mutex>
My goal is to be able to write C++ code that uses scoped lock objects like this:
if (auto dbAccess = MyConfigDbManager::getInstance().getReadAccess()) // get scoped read lock
{
// Got a read lock. Do something with the protected object, i.e.
dbAccess->doSomething();
// when this block ends and ...
if (auto dbAccess = MyConfigDbManager::getInstance().getReadAccess()) // get scoped read lock
{
// Got a read lock. Do something with the protected object, i.e.
dbAccess->doSomething();
// when this block ends and ...
- Fri Apr 25, 2025 2:26 pm
- Forum: ESP-IDF
- Topic: Can "test" partition be used instead of "factory" in production?
- Replies: 2
- Views: 3729
Re: Can "test" partition be used instead of "factory" in production?
I did end up going with a partition of type "TEST" for a small recovery firmware. It is working quite well.
BTW, I just stumbled upon this component which allows for compressed OTA updates. It would have been very useful to know about it before:
https://components.espressif.com/components ...
BTW, I just stumbled upon this component which allows for compressed OTA updates. It would have been very useful to know about it before:
https://components.espressif.com/components ...
- Thu Feb 20, 2025 8:49 pm
- Forum: ESP-IDF
- Topic: Can "test" partition be used instead of "factory" in production?
- Replies: 2
- Views: 3729
Re: Can "test" partition be used instead of "factory" in production?
I was just asking myself a very similar question and found this post. It's a shame so many questions go unanswered for years on this forum. What did you end up doing?
Yes, the default behavior seems drastic and doesn't align with many devices on the market. The difference is this is a FACTORY ...
Yes, the default behavior seems drastic and doesn't align with many devices on the market. The difference is this is a FACTORY ...
- Wed Jan 29, 2025 10:04 pm
- Forum: ESP-IDF
- Topic: [Answered] Maximum number of open sockets supported
- Replies: 8
- Views: 25049
Re: [Answered] Maximum number of open sockets supported
Finally, this commit increases the limit of sockets. It was trivial to back-port to my old IDF 4.4.8
espressif/esp-idf@48295d3
https://github.com/espressif/esp-idf/commit/48295d31ca90d693356b632750630efd2f1b34eb
I increased LWIP_MAX_SOCKETS to 32, but my HTTP server still failed when I opened 6 ...
espressif/esp-idf@48295d3
https://github.com/espressif/esp-idf/commit/48295d31ca90d693356b632750630efd2f1b34eb
I increased LWIP_MAX_SOCKETS to 32, but my HTTP server still failed when I opened 6 ...
- Thu Jul 18, 2024 7:52 pm
- Forum: ESP-IDF
- Topic: Unit testing, on the host (gcc x86_64)
- Replies: 1
- Views: 3150
Re: Unit testing, on the host (gcc x86_64)
I am also interested in running unit tests on a host machine (via GitLab CI).
Ideally, it would automatically use the same unit tests that I have written for my components in /components/mycmp/test/test_mycmp.c, just
like the Unit Test App does .
And if some tests are not appropriate for running ...
Ideally, it would automatically use the same unit tests that I have written for my components in /components/mycmp/test/test_mycmp.c, just
like the Unit Test App does .
And if some tests are not appropriate for running ...
- Fri Mar 15, 2024 2:00 pm
- Forum: Hardware
- Topic: GPIO4 can't be used for UART when Ethernet is enabled
- Replies: 6
- Views: 6602
Re: GPIO4 can't be used for UART when Ethernet is enabled
Not sure if relevant or helpful, but I previously found that JTAG was unusable when the EMAC is enabled, even though they don't share any pins. I never figured out why, but configured my project with macros to disable EMAC when I need to debug with JTAG.
- Fri Mar 15, 2024 1:44 pm
- Forum: Hardware
- Topic: ESP32 - IO33 - levels - 2V
- Replies: 2
- Views: 3796
Re: ESP32 - IO33 - levels - 2V
My guess is that the pin is initialized to Hi-Z (floating) at power-on-reset. Then it takes some time for the CPU to start running your code and set the level high.
You could try adding an external pull-up resistor to 3.3V so it goes high when the pin is hi-Z / floating.
You could try adding an external pull-up resistor to 3.3V so it goes high when the pin is hi-Z / floating.
- Fri Mar 15, 2024 1:32 pm
- Forum: Hardware
- Topic: In-Package Quad SPI Flash
- Replies: 2
- Views: 1389
Re: In-Package Quad SPI Flash
Yep! And some ESP32 variants also have PSRAM / SPI RAM inside the same chip package.
- Fri Mar 15, 2024 1:25 pm
- Forum: Hardware
- Topic: Hardware Flash Corruption Issue
- Replies: 56
- Views: 68621
Re: Hardware Flash Corruption Issue
If you can recover after reflashing the code, then it is NOT the same issue as covered in this thread/topic.
You should start a new topic.
You should start a new topic.