Skip to content

is SPI library interrupt safe ? #2630

@jcmg92

Description

@jcmg92

Please fill the info fields, it helps to get you faster support ;)

if you have a stack dump decode it:
https://github.com/esp8266/Arduino/blob/master/doc/Troubleshooting/stack_dump.md

for better debug messages:
https://github.com/esp8266/Arduino/blob/master/doc/Troubleshooting/debugging.md

----------------------------- Remove above -----------------------------

Basic Infos

Hardware

Hardware: ESP-12
Core Version: 2.3.0

Description

I am working arount SPI based LoRa modules with the Radiohead library. I have met many exceptions and after tracking those down, after having reworked Radiohead libraries to make their interrupt routine safe, I had to do the same inside the arduino/esp8266 SPI library.
Am I wrong when I considered the library not interrupt safe?

I have now modified the SPI library and seem to have a stable design.
Anyway, I have joined the modified files for advice.

SPI_cpp.txt
SPI_h.txt

The last and most delicate issue I had was with inline function "setDataBits". I could not find any way to make this one safe without removing its "inline" attribute?

Any feedback on this?

Settings in IDE

Module: NodeMCU 1.0
Flash Size: 4MB/SPIFS 1MB
CPU Frequency: 160MHz
Flash Mode:
Flash Frequency: 40Mhz
Upload Using: SERIAL
Reset Method: nodemcu

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting for feedbackWaiting on additional info. If it's not received, the issue may be closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions