The latest TWI example I can find is from 4 SDK revisions ago and uses old libraries. Is there a sample using the nrf_drv_twi library that is recommended for current development?
The latest TWI example I can find is from 4 SDK revisions ago and uses old libraries. Is there a sample using the nrf_drv_twi library that is recommended for current development?
Hi! I am struggling to build this code. I'm getting errors like:
....\main.c(55): warning: #223-D: function "CONCAT_2" declared implicitly const nrf_drv_twi_t p_twi_instance = RF_DRV_TWI_INSTANCE(1); // Set up TWI instance 1 with default values ....\main.c(55): error: #20: identifier "NRF_TWI" is undefined const nrf_drv_twi_t p_twi_instance =
These appear to be basic TWI macros used by the libraries but definitions for variables like NRF_TWI cannot be found.
I am wondering if there is a file path issue that needs to be resolved. Or if this code does not apply to my scenario. I'm using SDK 9.0, nRF51422, Keil_V5, and soft device s110.
Any suggestions?
Sounds like a path issue. Did you extract the example so that the file path looks exactly like the one in my first comment?
Hi Martin. I believe so.
C:\Keil_v5\ARM\Device\Nordic\examples\peripheral\twi_simple_SDK9.0.0_v2\pca10028\arm5_no_packs\twi_simple_SDK9.0.0_v2.uvprojx
*I'm using Dynastream's N5 Starter kit
My includes are:
I tried to run the example myself now and ran into the same problems as you. It looks like there has been an update to the MDK or Keil packs that has messed with what files are included. You need to make sure that it is only the drivers found in "your_SDK9_folder\components" that is used. Open managed run-time environment in Keil and deselect the TWI drivers there. I attached an updated example, v3, that works on my system at least. I need to investigate further to find out exactly what caused this.
Thanks Martin. Let me know when it has been resolved.
Using the method you provided, it appears that I need to add a lot of include paths to make this code work. Still working on it.