sandeepmistry / arduino-nRF5

Arduino Core for Nordic Semiconductor nRF5 based boards
Other
872 stars 278 forks source link

nRF52833 to use NRF_P1 problem #480

Open mrespin opened 2 years ago

mrespin commented 2 years ago

Hi, I am using nRF52833, but when the family is set to NRF52, header file nrf.h sets to NRF52832 in line 93 and I cannot use GPIO over 32 (P1.x):

if defined (NRF52)

#ifndef NRF52832_XXAA
    #define NRF52832_XXAA  // commenting this line fix
#endif

endif

After commenting on this line (93) all works fine. PS I did not find #define NRF52 Thank you

carlosperate commented 2 years ago

~~Are you using the latest release? It should have this block instead: https://github.com/sandeepmistry/arduino-nRF5/blob/master/cores/nRF5/SDK/components/device/nrf.h#L92-L97~~

Edit: I just noticed it's the same code you've shared, sorry.

carlosperate commented 2 years ago

It looks like variants like the micro:bit V2 simply use the integer value (P1.0 -> 32): https://github.com/sandeepmistry/arduino-nRF5/blob/75baa76b21ec28cf7c6ece57ba444cf2306b584b/variants/BBCmicrobitV2/variant.cpp#L35

mrespin commented 1 year ago

Unfortunately, P1.00 is not activated when set to #define NRF52832_XXAA, as NRF52832_XXAA do not have it. Moreover, I started to use NRF52805, part of the NRF52 family and it lacks FPU and caching mechanism, thus default #define NRF52832_XXAA breaks it even more. Fix:

if !defined(NRF52832_XXAA) && !defined(NRF52805_XXAA) && !defined(NRF52833_XXAA) and so on.