I'm in the process of trying to port my SDK 14 project to SDK 15.2. I've made a pretty good amount of progress, but I have two issues that I can't seem to figure out.
The first is somewhat minor but very annoying. For some reason since I replaced the SDK 14 files with SDK 15.2 in my repo, the uint32_t type is no longer recognized by Eclipse even though other integers (uint16_t etc) are. APP_ERROR_CHECK is also marked as unrecognized. The compiler doesn't have issues with these though, so it seems to be something with Eclipse. If I go back to my SDK 14 branch (which just changes the code since my Eclipse settings are not tracked in my repo), uint32_t and APP_ERROR_CHECK are recognized by Eclipse without issue. This is annoying but not a blocker.
However, an issue I'm having with IRQ handlers is keeping me from progressing. Here's the output of my compiler (ARM GCC):
Compiling test_mode.c In file included from /Users/user/Documents/source/firmware/nRF5_SDK_15.2.0_9412b96/modules/nrfx/soc/nrfx_irqs.h:49:0, from /Users/user/Documents/source/firmware/nRF5_SDK_15.2.0_9412b96/integration/nrfx/nrfx_glue.h:59, from /Users/user/Documents/source/firmware/nRF5_SDK_15.2.0_9412b96/modules/nrfx/nrfx.h:46, from /Users/user/Documents/source/firmware/nRF5_SDK_15.2.0_9412b96/components/libraries/delay/nrf_delay.h:44, from /Users/user/Documents/source/firmware/system/app/inc/log_print.h:15, from /Users/user/Documents/source/firmware/system/app/src/test_mode.c:9: /Users/user/Documents/source/firmware/nRF5_SDK_15.2.0_9412b96/modules/nrfx/soc/nrfx_irqs_nrf52832.h:71:37: error: redundant redeclaration of 'SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler' [-Werror=redundant-decls] #define nrfx_twi_0_irq_handler SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler ^ /Users/user/Documents/source/firmware/nRF5_SDK_15.2.0_9412b96/modules/nrfx/soc/nrfx_irqs_nrf52832.h:71:37: note: in definition of macro 'nrfx_twi_0_irq_handler' #define nrfx_twi_0_irq_handler SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/Documents/source/firmware/nRF5_SDK_15.2.0_9412b96/modules/nrfx/soc/nrfx_irqs_nrf52832.h:66:37: note: previous declaration of 'SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler' was here #define nrfx_spim_0_irq_handler SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler ^ /Users/user/Documents/source/firmware/nRF5_SDK_15.2.0_9412b96/modules/nrfx/soc/nrfx_irqs_nrf52832.h:66:37: note: in definition of macro 'nrfx_spim_0_irq_handler' #define nrfx_spim_0_irq_handler SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/Documents/source/firmware/nRF5_SDK_15.2.0_9412b96/modules/nrfx/soc/nrfx_irqs_nrf52832.h:83:37: error: redundant redeclaration of 'SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler' [-Werror=redundant-decls] #define nrfx_twi_1_irq_handler SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler ^ /Users/user/Documents/source/firmware/nRF5_SDK_15.2.0_9412b96/modules/nrfx/soc/nrfx_irqs_nrf52832.h:83:37: note: in definition of macro 'nrfx_twi_1_irq_handler' #define nrfx_twi_1_irq_handler SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/user/Documents/source/firmware/nRF5_SDK_15.2.0_9412b96/modules/nrfx/soc/nrfx_irqs_nrf52832.h:78:37: note: previous declaration of 'SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler' was here #define nrfx_spim_1_irq_handler SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler ^ /Users/user/Documents/source/firmware/nRF5_SDK_15.2.0_9412b96/modules/nrfx/soc/nrfx_irqs_nrf52832.h:78:37: note: in definition of macro 'nrfx_spim_1_irq_handler' #define nrfx_spim_1_irq_handler SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make: *** [/Users/user/Documents/source/firmware/build/obj/test_mode.o] Error 1
I'm not completely sure what's going on, but it seems like the compiler thinks I'm trying to define the SPIM/TWI IRQ handler twice each for modules 0 and 1. But I'm not- at least not intentionally. My project intends to use TWI0, SPIM1, and SPIM2. My nrfx_config.h sets TWI/TWIS/TWIM/SPI/SPIS/SPIM enable flags as follows:
NRFX_TWI0_ENABLED 1
NRFX_TWI1_ENABLED 0
NRFX_SPIM0_ENABLED 0
NRFX_SPIM1_ENABLED 1
NRFX_SPIM2_ENABLED 1
All TWIM, TWIS, SPIS, and SPI are disabled.
If I search my entire working directory for NRFX_SPIM0_ENABLED, I find it defined in several places (excluding example directories).
- sdk/config/nrf52832/config/sdk_config.h
- sdk/integration/apply_old_config.h
- sdk/modules/nrfx/templates/nRF52832/nrfx_config.h
- <my application directory>/nrfx_config.h
So it was confusing to figure out which enable flag the compiler was actually using. But I added .orig extensions to numbers 1-3 so they won't be included and commented out the inclusion of apply_old_config.h in nrfx_glue.h. And I still get the same problem.
Other possible points of interest- I originally intended to use the legacy files provided to minimize the amount of changes I'd need to make to my application code up front. But I wondered if something in that legacy layer was causing issues, so I excluded it and made the necessary code changes (mostly nrf_drv_x to nrfx_x) and modified linker and sdk_config.h (and nrfx_config.h) files from the SDK instead of trying to modify the corresponding files I carried over from SDK 14. But none of those steps helped this SPI/TWI IRQ issue.
Any thoughts?