Comments (3)
I kept looking for the issue and found the root cause, but I'm not exactly sure why the problem started happening. I believe it could be due to an update in ESP-IDF or FreeRTOS, someone with more experience in embedded systems might know...
Basically, in the u8g2_esp32_spi_byte_cb() function when filling out the fields of the dev_config variable to send to the spi_bus_add_device() function, none of the documentation I found instructed to pass the dev_config.clock_source field, but from what I saw in the functions that are called from here, this information is needed.
So, the error above was caused because the dev_config.clock_source field is not being filled in the u8g2_esp32_spi_byte_cb function before passing the dev_config as a parameter in the line ESP_ERROR_CHECK(spi_bus_add_device(HSPI_HOST, &dev_config, &handle_spi));
This way the initialization for the dev_config parameter would look like this:
spi_device_interface_config_t dev_config;
dev_config.address_bits = 0;
dev_config.command_bits = 0;
dev_config.dummy_bits = 0;
dev_config.mode = 0;
dev_config.duty_cycle_pos = 0;
dev_config.cs_ena_posttrans = 0;
dev_config.cs_ena_pretrans = 0;
dev_config.clock_speed_hz = 10000;
dev_config.clock_source = SPI_CLK_SRC_DEFAULT; //SOC_MOD_CLK_APB;
dev_config.spics_io_num = u8g2_esp32_hal.cs;
dev_config.flags = 0;
dev_config.queue_size = 200;
dev_config.pre_cb = NULL;
dev_config.post_cb = NULL;
//ESP_LOGI(TAG, "... Adding device bus.");
ESP_ERROR_CHECK(spi_bus_add_device(HSPI_HOST, &dev_config, &handle_spi));
That's it. Looking at the current ESP-IDF code, I can't understand how my previous code worked without this field, as browsing through previous versions of ESP-IDF on GitHub, this information was always mandatory.
I won't mark this thread as resolved since, as I mentioned, I don't understand why it worked before. Therefore, my solution might not be the correct one, or everything I said may not make sense, but as I'm behind schedule with my project, I won't delve further into this investigation.
Cheers!
from esp32-snippets.
I added the clock source and it built with logging set to none.
Was still flaky telling me the argument was invalid, so I put a 2 second delay before my call to "u8g2_Setup_st7920_128x64_f();" and now it seems to run perfectly.
I am wondering if it has to do with how fast the device is booting now, and thinking maybe its trying to set that clock source before the chip can initialize it?
Either way its interesting.
Thanks for the initial post, helped me a lot.
from esp32-snippets.
I have noticed this issue as well.
Using Kolban's HAL I get the same crash after updating from 4.2 to 5.1, but only when I have logging set to INFO or higher.
Otherwise I get the same crash.
Going to try the your solution now.
from esp32-snippets.
Related Issues (20)
- How to configure the number of packets per every BLE connection interval
- problèmes de compilation de la bibliothèque BleDevice HOT 1
- 677777j77ü-gt
- 'class BLEClient' has no member named 'setMTU' in version 1.0.6 HOT 2
- Notification frequency capability
- How to prevent remote-control from disconnecting after 2 minutes
- Bluetooth devices pinging
- Is it possible to get static MAC of BLE client ?
- Pairing an ESP32 with a health device from the client (master) HOT 2
- ESP32 BLE Characteristics increase the maximum HOT 1
- How to check if server currently advertising or not?
- Is it possible to scan and detect smartphones? HOT 7
- How a ESP-32 got mouse and keyboard input?
- Standard BLE on ESP32 can only support 4 notifications on 4 characteristics
- Wi Fi is not able to connect
- ESP32 is not able to connect with the wi fi
- [Feature Request] Please make BLECharacteristic::notify() return an error message
- How to manually connect BLE Client to BLE Server
- ESP32-C6, issues with Bluetooth HOT 1
- ESP32 C3 Mini using Bluetooth LE
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.
from esp32-snippets.