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

Fix nRF52810 build with Arduino and SPI/I2C #54

Merged
merged 4 commits into from
Jul 5, 2024
Merged

Conversation

h2zero
Copy link
Owner

@h2zero h2zero commented Jul 4, 2024

Fixes #50, #52

@jackb60

@jackb60
Copy link

jackb60 commented Jul 4, 2024

This appears to break I2C compatibility with the NRF52832. When attempting to compile for NRF52832, I get

[My sketch location.ino]: undefined reference to `Wire'
collect2.exe: error: ld returned 1 exit status

It isn't an issue with my sketch, as it compiles fine for NRF52832 with the previous Wire_nRF52.cpp

Works for NRF52810 though.

I'll see if I can figure out the problem. Thank you for this library and the fixes.

@jackb60
Copy link

jackb60 commented Jul 4, 2024

For whatever reason, changing line 402 in Wire_nRF52.cpp from
#if defined(SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn) to
#if defined(NRF_TWIM1)
fixed the issue. Now it works for both NRF52810 and NRF52832.

@h2zero
Copy link
Owner Author

h2zero commented Jul 4, 2024

Thanks! I'll make some adjustments.

@h2zero h2zero force-pushed the nrf52810-fixes branch 3 times, most recently from 47d75b5 to a98daaf Compare July 5, 2024 00:29
@jackb60
Copy link

jackb60 commented Jul 5, 2024

Looks good. I wonder if you also want to change line 411 in Wire_nRF52.cpp from
#if defined(SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn) to
#if defined(NRF_TWIM1) given the previous issue with SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn

@h2zero
Copy link
Owner Author

h2zero commented Jul 5, 2024

Done, this should work now.

@h2zero
Copy link
Owner Author

h2zero commented Jul 5, 2024

Looks good. I wonder if you also want to change line 411 in Wire_nRF52.cpp from #if defined(SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn) to #if defined(NRF_TWIM1) given the previous issue with SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQn

Sorry I missed this comment, yes that seems better for sure at this moment as that doesn't look to actually be #defined anywhere but is instead an enum value. For now I will use your suggestion but look to change it in the future if it no longer discriminates accurately enough.

Thanks for all the help!!!

@h2zero h2zero changed the title Nrf52810 fixes Fix nRF52810 build with Arduino and SPI/I2C Jul 5, 2024
@h2zero
Copy link
Owner Author

h2zero commented Jul 5, 2024

@jackb60 Have you tested this with any devices connected to SPI/I2C? Would be great to know that its working as well as compiling 😄

@jackb60
Copy link

jackb60 commented Jul 5, 2024

Yes I have devices attached to both SPI and I2C and they are working (tested with NRF52810).

@h2zero
Copy link
Owner Author

h2zero commented Jul 5, 2024

Perfect, I will merge this then. Thanks again!

@h2zero h2zero merged commit 8f25513 into master Jul 5, 2024
62 checks passed
@h2zero h2zero deleted the nrf52810-fixes branch July 5, 2024 02:58
@h2zero h2zero mentioned this pull request Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nrf52810 Compilation Error Resulting From Typo in boards.txt
2 participants