Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document board limitations for MY_RX_MESSAGE_BUFFER_FEATURE #1128

Closed
mfalkvidd opened this issue May 11, 2018 · 7 comments

Comments

@mfalkvidd
Copy link
Contributor

commented May 11, 2018

According to a note on

// Note: ESP8266 & SoftSPI currently do not support interrupt usage for SPI,
MY_RX_MESSAGE_BUFFER_FEATURE is "unsafe to use" on ESP8266. This should probably be included in the Doxygen documentation.

Not sure if any other notes are needed. By reading the code, my impression is that MY_RX_MESSAGE_BUFFER_FEATURE will work on Linux. There is no note about SAMD.

@mfalkvidd

This comment has been minimized.

Copy link
Contributor Author

commented May 11, 2018

Maybe also add a compilation error or warning

@Yveaux

This comment has been minimized.

Copy link
Member

commented May 20, 2018

The limitation for ESP is caused by incomplete support of SPI transactions in Arduino ESP port at the time of writing that comment line. We need to check for ESP (and SAMD, Linux,...) if SPI transactions are completely supported.

@Yveaux

This comment has been minimized.

Copy link
Member

commented Aug 1, 2018

The Arduino AVR core SPI library contains following remark: SPI_HAS_TRANSACTION means SPI has beginTransaction(), endTransaction(), usingInterrupt(), and SPISetting(clock, bitOrder, dataMode)
So checking for this define should be sufficient to detect if a certain architecture supports safe SPI access from interrupts.

However, studying the implementations of SPI libraries for various architectures reveals the following:

Summing up

  • AVR, SAMD and probably Linux work out of the box.
  • STM32, nRF52, ESP8266 and SoftSPI need explicit protection in the MySensors stack until complete SPI transactions are implemented correctly.

Simply disabling all interrupts could be a workaround for now.

At the time of writing only AVR is known to work with MY_RX_MESSAGE_BUFFER_FEATURE. More testing is required.

@Yveaux

This comment has been minimized.

Copy link
Member

commented Aug 1, 2018

Regarding the compiler error remark, a compile error will be generated on ESP8266, https://github.com/mysensors/MySensors/blob/2.3.0/drivers/RF24/RF24.h#L130

@Yveaux

This comment has been minimized.

Copy link
Member

commented Aug 1, 2018

Arduino SPI access from interrupts on ESP8266 might become troublesome, see esp8266/Arduino#3917

@mfalkvidd

This comment has been minimized.

Copy link
Contributor Author

commented Aug 4, 2018

I suggest we add a note in doxygen and link to this issue, as a start. I'll create a PR in the next few days.

@mfalkvidd

This comment has been minimized.

Copy link
Contributor Author

commented Jun 3, 2019

Reopening based on Yveaux's comment in #1296
I don't see a realistic way to handle that the information is outdated, but we should amend the documentation to something like "STM32, nRF52, ESP8266 and SoftSPI do not work."

@mfalkvidd mfalkvidd reopened this Jun 3, 2019
mfalkvidd added a commit to mfalkvidd/MySensors that referenced this issue Jun 3, 2019
mfalkvidd added a commit to mfalkvidd/MySensors that referenced this issue Jul 13, 2019
mfalkvidd added a commit to mfalkvidd/MySensors that referenced this issue Jul 13, 2019
@tekka007 tekka007 closed this in 8dd893c Jul 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.