My attempt to hack the bbcmicrobit_V2.json you are referring to by the brute force and deleting the “-DNRF52833_XXAA” from "“extra_flags”:‘’ line, resulted in the compilation error:
C:\Users\eugene.platformio\packages\framework-arduinonordicnrf5\cores\nRF5\SDK\components\device/nrf.h:182:6:
error: #error “Device must be defined. See nrf.h.”
#error “Device must be defined. See nrf.h.”
My next step was to follow the idea of Martin Williams (thanks, Martin, a lot - appreciate it!) that the core of the problem is the “NRF52832_XXAA” macro definition in
“….platformio\packages\framework-arduinonordicnrf5\cores\nRF5\SDK\components\device\nrf.h”.
After I changed the lines ##92-98 in this file (….platformio\packages\framework-arduinonordicnrf5\cores\nRF5\SDK\components\device\nrf.h) to the following:
/* Redefine “old” too-generic name NRF52 to NRF52832_XXAA to keep backwards compatibility. */
#if defined (NRF52)
#define NRF52_SERIES
// #ifndef NRF52832_XXAA
// #define NRF52832_XXAA
// #endif
#endif
The result was positive - I got my testing program, which manipulates the LED Matrix directly through the pins corresponding to the rows and columns of the LED Matrix, was working fine - the program was able to light all columns of the LED Matrix including the 4th one.
After I added a few #ifdef statements to the program
#if defined (NRF52)
#warning “NRF52 DEFINED!”
#endif
#if defined (NRF52_SERIES)
#warning “NRF52_SERIES DEFINED!”
#endif
#if defined (NRF52832_XXAA)
#warning “NRF52832_XXAA DEFINED!”
#endif
The compilation gave me the following:
src\main.cpp:11:4: warning: #warning “NRF52 DEFINED!” [-Wcpp]
#warning “NRF52 DEFINED!”
^~~~~~~
src\main.cpp:15:4: warning: #warning “NRF52_SERIES DEFINED!” [-Wcpp]
#warning “NRF52_SERIES DEFINED!”
Compiling a small testing program for “Adafruit_Microbit” Library also gave positive results: it was able to display various symbols on LED Matrix including the leds in the 4th column which have not been working correctly, However, the scrolling functionality was not working correctly - the characters were scrolling randomly or even not scrolling at all…
I am not sure how to investigate this problem further in a more robust way than hacking the “nrf.h” file.
Unless there are other ideas, as you suggested, the problem probably should be addressed through the PIO development team.
Thank you very much for your analysis and feedback.
Eugene.