SPISlave.onData never get triggered
- Dominant language
- C++
- Stars
- 16.7k
- Forks
- 13.1k
- PR merge metrics
- No merged PRs in 30d
Description
### Basic Infos
- [x] This issue complies with the [issue POLICY doc](https://github.com/esp8266/Arduino/blob/master/POLICY.md).
- [x] I have read the documentation at [readthedocs](https://arduino-esp8266.readthedocs.io/en/latest) and the issue is not addressed there.
- [x] I have tested that the issue is present in current master branch (aka latest git).
- [x] I have searched the issue tracker for a similar issue.
- [ ] If there is a stack dump, I have decoded it.
- [x] I have filled out all fields below.
#### Platform
- Hardware: [ESP-12]
- Core Version: [latest git hash or date]
- Development Env: [Arduino IDE]
- Operating System: [Windows]
### Settings in IDE
- Module: [Nodemcu]
- Flash Mode: [qio|dio|other]
- Flash Size: [4MB]
- lwip Variant: [v1.4|v2 Lower Memory]
- Reset Method: [nodemcu]
- Flash Frequency: [40Mhz]
- CPU Frequency: [80Mhz]
- Upload Using: [SERIAL]
- Upload Speed: [115200]
### Problem Description
Detailed problem description goes here.
### [MCVE](https://stackoverflow.com/help/mcve) Sketch
```cpp
#include
#include "SPISlave.h"
volatile uint8_t interruptCounter = 0;
uint8_t data_to_send[4] = {110,24,30,40};
void ReceiveData(uint8_t * pdata, size_t len)
{
interruptCounter++;
}
void setup() {
Serial.begin(74880);
Serial.setDebugOutput(true);
SPISlave.onData(ReceiveData);
SPISlave.onDataSent([]() {
Serial.println("Answer Sent");
});
// Setup SPI Slave registers and pins
SPISlave.begin();
SPISlave.setData(data_to_send, 4);
}
void loop()
{
Serial.print("interrupt counter : ");
Serial.println(interruptCounter);
delay(1000);
}
```
Hi,
I'm using an ARM board as a Spi master and i'm trying to communicate with a NodeMcu board configured as a slave. With a logic analyser I was able to see the communication working (the master produced a correct clock and the correct data was sent). From the ESP side, on the serial I'm able to see an "Answer sent" and check the data on the Logic Analyser but ``` interruptCounter``` always stays at 0 and I can't understand why. I've checked the wiring 10 times and as I said, the slave can correctly send data but ReceiveData never get called.
Thanks,
Anthony
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.