Comments (8)
Dma should be ok now, thanks to #70 and #76
You might want to test this.
from esp-idf-hal.
The implementation currently used polling transactions even with DMA. Am I correct in that this prevents other tasks from being executed while the transfer is executing?
As a side question, is it possible to use esp-hal's SPI/DMA implementation in an esp-idf-hal (std) environment or is this recommended against?
from esp-idf-hal.
Am I correct in that this prevents other tasks from being executed while the transfer is executing?
What do you mean? You are on top of ESP IDF / FreeRTOS. When the driver polls for transactions, it does not busy loop, but sleeps the current task. You can execute as many other tasks during that time as you want.
As a side question, is it possible to use esp-hal's SPI/DMA implementation in an esp-idf-hal (std) environment or is this recommended against?
Haven't heard of anybody else doing that, and your mileage might vary. Not sure why you want to do that in the first place.
from esp-idf-hal.
When the driver polls for transactions, it does not busy loop, but sleeps the current task.
I asked this because the esp-idf documentation says the following:
Polling transactions save time otherwise spent on queue handling and context switching, which results in smaller transaction duration. The disadvantage is that the CPU is busy while these transactions are in progress.
It wasn’t clear to me before if this meant the task busy loops or if it just blocks each time the task is activated.
from esp-idf-hal.
Good point, let me check again actually...
from esp-idf-hal.
@madwizard-thomas Argh you are right that it is actually busy looping: https://github.com/espressif/esp-idf/blob/release/v4.4/components/driver/spi_master.c#L983
Yet, I don't see any disabling of the FreeRTOS task scheduler, or holding a critical section. Which means that though the task is busy looping, it can be interrupted by the scheduler by another task with a higher priority (or same prio task due to time-slicing).
So it should still work IMO. A bit not so efficient in terms of CPU power consumption though.
Once we have the async SPI driver merged, as a side effect we'll get interrupt transactions as well though.
from esp-idf-hal.
dont forget you are on an FreeRTOS with preemptive scheduling, if the task here has lower prio than some other task you run concurrently this should be preempted on the while loop right?
from esp-idf-hal.
Changing the title to reflect that DMA support is in place since quite some time. Mainline also now supports async, as well as blocking+non-polling mode.
from esp-idf-hal.
Related Issues (20)
- Never return type for `reset::restart`
- Simple blink example for RGB Led on Esp32 C6
- Shared I2C bus example HOT 1
- Support async in i2c Driver by using new ESP-IDF V5.2 driver impl
- rmt_neopixel no longer works (on esp32c6) HOT 3
- Mutating struct in ISR HOT 1
- Error: dangerous relocation: call8: call target out of range:(xtensa-esp32s3-espidf) HOT 3
- Transport(Failed to load system certs: No valid certificate found) (xtensa-esp32s3-espidf/STD) HOT 4
- need uart dtr, for rs485 control HOT 1
- SpiBusDriver is not Send HOT 1
- I2C default baudrate too high, is 1M, using this parameter is likely to be wrong HOT 2
- Problem with CHANGELOG.md in v0.43.0 release: Unable to find valid link for esp-ulp-riscv-hal crate. HOT 2
- Spi has some problems. or clk needs to pull up resistors、or other...(esp32c2 rust-std) HOT 3
- spi async need some config in the Cargo.toml and sdkconfig.defaults?
- Example uart_loopback does not compile. TX buffer managment in Uart is broken sending garbage characters. HOT 1
- Pin Direction Change compiles but does not seem to be working and produces weird Info Log messages that I can not supress: HOT 6
- I2C timeout calculated wrong for MCU !esp32 HOT 2
- AsyncCanDriver is not Sync HOT 7
- ESP32C6 analog read working wonky HOT 4
- Potential wrong core type conversion in cpu.rs
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 esp-idf-hal.