Hi Nordic,
I did some further research and need your assistance in figuring out this Mystery ....
recap - I'm trying to implement twi support on freertos ble project (SDK15.0) the following way -
- My target project is a copy of ble_app_hrs_freertos folder
- My reference project is twi_sensor
- Added nrfx_twi.c & nrfx_twim.c to the nRF_Drivers group of the target project (imported from <SDK_folder>\modules\nrfx\drivers\src as in the reference project)
- Included the following at the beginning of main.c:
#include <nrfx.h>
#include "sdk_config.h"
#include "nrf_drv_twi.h"
- In sdk_config.h I've enabled NRFX_TWI_ENABLED & NRFX_TWIM_ENABLED and their immediate child NRFX_TWI0_ENABLED & ERFX_TWIM0_ENABLED
- in my main.c just before main() I've copied two lines from the reference project:
/* TWI instance ID. */
#define TWI_INSTANCE_ID 0
/* TWI instance. */
static const nrf_drv_twi_t m_twi = NRF_DRV_TWI_INSTANCE(TWI_INSTANCE_ID)
Mysteriously I keep getting "NRF_DRV_TWI_INSTANCE_0 undefined" error and noticed that although I've enabled TWI & TWIM in sdk_config.h they remained undef'd when looking in nrfx_twi.c & nrfx_twim.c (code grayed out). See screen capture
What make it even stranger is that in the reference project, again, both NRF_TWI_ENABLED & NRF_TWIM_ENABLED are set to 1 in sdk_config.h, but this time nrfx_twim.c become enabled while nerfx_twi.c remains grayed out...
I tried to follow the definition route and everything looks OK so I'm pretty lost here......
Thanks in advance for any support
Problem solved!
Hello, eyalasko, I had the same problem, and I did exactly what you did.
I followed the NRFX_TWI0_ENABLED of the line #if NRFX_CHECK(NRFX_TWI0_ENABLED)
and it got me to this kind of transition file name apply_old_config.h and at this file NRFX_TWI0_ENABLED and NRFX_TWI_ENABLED appear as a combination of TWI0_ENABLED and TWI_ENABLED and so on, as you can see in the image below.
So I basically did the same sdk_config.h as you and also enabled TWI0_ENABLED and TWI_ENABLED and it worked like that!
Hope it also solves your issue ;) !
Problem solved!
Hello, eyalasko, I had the same problem, and I did exactly what you did.
I followed the NRFX_TWI0_ENABLED of the line #if NRFX_CHECK(NRFX_TWI0_ENABLED)
and it got me to this kind of transition file name apply_old_config.h and at this file NRFX_TWI0_ENABLED and NRFX_TWI_ENABLED appear as a combination of TWI0_ENABLED and TWI_ENABLED and so on, as you can see in the image below.
So I basically did the same sdk_config.h as you and also enabled TWI0_ENABLED and TWI_ENABLED and it worked like that!
Hope it also solves your issue ;) !