Hi Nordic team,
I am trying to enable I2C driver in SAADC example which is located in examples\peripheral\saadc\pca10040\blank\arm5_no_packs
As you can see I am using Keil V5
This example is working perfectly. The issue is when I am trying to use TWI in this.
nrf_drv_twi.c, nrfx_twi.c and nrfx_twim.c are added to project.
sdk_config.h didn't have the option to enable TWI, so I added following to sdk_config.h
// <e> NRFX_TWIM_ENABLED - nrfx_twim - TWIM peripheral driver //========================================================== #ifndef NRFX_TWIM_ENABLED #define NRFX_TWIM_ENABLED 1 #endif // <q> NRFX_TWIM0_ENABLED - Enable TWIM0 instance #ifndef NRFX_TWIM0_ENABLED #define NRFX_TWIM0_ENABLED 1 #endif // <q> NRFX_TWIM1_ENABLED - Enable TWIM1 instance #ifndef NRFX_TWIM1_ENABLED #define NRFX_TWIM1_ENABLED 0 #endif // <o> NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY - Frequency // <26738688=> 100k // <67108864=> 250k // <104857600=> 400k #ifndef NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY #define NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY 26738688 #endif // <q> NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT - Enables bus holding after uninit #ifndef NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT #define NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0 #endif // <o> NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority // <0=> 0 (highest) // <1=> 1 // <2=> 2 // <3=> 3 // <4=> 4 // <5=> 5 // <6=> 6 // <7=> 7 #ifndef NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY #define NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY 6 #endif // </e>
Following is being included in the code
#include "nrf_drv_twi.h" #include "nrf_twi.h" #include "nrf_twim.h"
I have read through a lot of topics, everywhere above two solutions are suggested but I am still getting the following errors
linking... .\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrfx_twi_init (referred from nrf_drv_twi.o). .\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol idle_state_handle (referred from i2c_control.o). .\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrfx_twi_disable (referred from i2c_control.o). .\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrfx_twi_enable (referred from i2c_control.o). .\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrfx_twi_rx (referred from i2c_control.o). .\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrfx_twi_tx (referred from i2c_control.o). .\_build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol nrfx_twi_uninit (referred from i2c_control.o). Not enough information to list image symbols. Not enough information to list load addresses in the image map. Finished: 2 information, 0 warning and 7 error messages. ".\_build\nrf52832_xxaa.axf" - 7 Error(s), 3 Warning(s). Target not created. Build Time Elapsed: 00:00:51
Can someone please let me know where I am going wrong?