SPIM 2 Not Compiling on NCS 2.1.0 on nRF52840 - SOLVED

Hi there,

I'm using SPIM2 for an external accelerator, and I wanted to set it up.

I insert all as requested, but compiling it says me:

In file included from C:\ncs\v2.1.0-rc2\modules\hal\nordic\nrfx\nrfx.h:38,
                 from c:\ncs\v2.1.0-rc2\zephyr\soc\arm\nordic_nrf\common\soc_nrf_common.h:14,
                 from C:\ncs\v2.1.0-rc2\zephyr\soc\arm\nordic_nrf\nrf52\soc.h:14,
                 from C:\ncs\v2.1.0-rc2\zephyr\include\zephyr\arch\arm\aarch32\cortex_m\cmsis.h:17,
                 from C:\ncs\v2.1.0-rc2\zephyr\include\zephyr\arch\arm\aarch32\mpu\arm_mpu_v7m.h:11,
                 from C:\ncs\v2.1.0-rc2\zephyr\include\zephyr\arch\arm\aarch32\mpu\arm_mpu.h:14,
                 from C:\ncs\v2.1.0-rc2\zephyr\include\zephyr\arch\arm\aarch32\arch.h:210,
                 from C:\ncs\v2.1.0-rc2\zephyr\include\zephyr\arch\cpu.h:19,
                 from C:\ncs\v2.1.0-rc2\zephyr\include\zephyr\kernel_includes.h:33,
                 from C:\ncs\v2.1.0-rc2\zephyr\include\zephyr\kernel.h:17,
                 from C:\ncs\v2.1.0-rc2\zephyr\include\zephyr\init.h:11,
                 from C:\ncs\v2.1.0-rc2\zephyr\include\zephyr\device.h:29,
                 from c:\..\..\..\myprojectsrc\app\AppTools.h:26,
                 from c:\..\..\..\myproject\src\BSP\Spi3.h:21,
                 from c:\..\..\..\myproject\src\BSP\Spi3.c:15:
C:\ncs\v2.1.0-rc2\modules\hal\nordic\nrfx\drivers\include\nrfx_spim.h:84:35: error: 'NRFX_SPIM2_INST_IDX' undeclared here (not in a function); did you mean 'NRFX_SPIM_INSTANCE'?
   84 |     .drv_inst_idx = NRFX_CONCAT_3(NRFX_SPIM, id, _INST_IDX), \
      |                                   ^~~~~~~~~
C:\ncs\v2.1.0-rc2\modules\hal\nordic\nrfx\drivers\nrfx_common.h:140:37: note: in definition of macro 'NRFX_CONCAT_3_'
  140 | #define NRFX_CONCAT_3_(p1, p2, p3)  p1 ## p2 ## p3
      |                                     ^~
C:\ncs\v2.1.0-rc2\modules\hal\nordic\nrfx\drivers\include\nrfx_spim.h:84:21: note: in expansion of macro 'NRFX_CONCAT_3'
   84 |     .drv_inst_idx = NRFX_CONCAT_3(NRFX_SPIM, id, _INST_IDX), \
      |                     ^~~~~~~~~~~~~
c:\2BiTS\progetti\ShockTest\iotnode\src\BSP\Spi3.c:42:33: note: in expansion of macro 'NRFX_SPIM_INSTANCE'
   42 | static nrfx_spim_t m_spimDev  = NRFX_SPIM_INSTANCE(2);
      |                                 ^~~~~~~~~~~~~~~~~~

This seems to be an error coming from the define 

#ifdef CONFIG_NRFX_SPIM2
#define NRFX_SPIM2_ENABLED 1
#endif

As the CONFIG_NRFX_SPIM2 is not defined, it's not included into the enumerator oh nrdx_spim.h and so it causes an error.

The problem is that I activate the SPIM2 using KCONFIG define but it seems it doesn't work...

Do you know how to go out of this trouble?
I don't want to add the define manually.

on manuals, SPIM2 is present into nRF52840

Related