0

TWI sensor over UART on nrf52832

asabuncuoglu13 gravatar image

asked 2017-06-19 16:44:16 +0200

joh2 gravatar image

updated 2017-06-20 09:20:31 +0200

Hello,

Now, I am merging my UART code with the TWI sensor example (I use SDK 13). Now my error after compiling the code is:

In file included from ../../../../../../components/libraries/util/app_error.h:57:0,
                 from ../../../../../../components/libraries/util/nrf_assert.h:49,
                 from ../../../../../../components/libraries/util/app_util_platform.h:59,
                 from ../../../../../../components/libraries/uart/app_uart.h:54,
                 from ../../../main.c:14:
../../../../../../components/drivers_nrf/twi_master/nrf_drv_twi.h:91:58: error: 'NRF_TWITWI_INSTANCE_ID' undeclared here (not in a function)
     #define NRF_DRV_TWI_PERIPHERAL(id)  (void *)CONCAT_2(NRF_TWI, id)
                                                          ^
../../../../../../components/libraries/util/nordic_common.h:114:31: note: in definition of macro 'CONCAT_2_'
 #define CONCAT_2_(p1, p2)     p1##p2
                               ^~
../../../../../../components/drivers_nrf/twi_master/nrf_drv_twi.h:91:49: note: in expansion of macro 'CONCAT_2'
     #define NRF_DRV_TWI_PERIPHERAL(id)  (void *)CONCAT_2(NRF_TWI, id)
                                                 ^~~~~~~~
../../../../../../components/drivers_nrf/twi_master/nrf_drv_twi.h:119:22: note: in expansion of macro 'NRF_DRV_TWI_PERIPHERAL'
     .reg          = {NRF_DRV_TWI_PERIPHERAL(id)},       \
                      ^~~~~~~~~~~~~~~~~~~~~~
../../../main.c:41:36: note: in expansion of macro 'NRF_DRV_TWI_INSTANCE'
 static const nrf_drv_twi_t m_twi = NRF_DRV_TWI_INSTANCE(TWI_INSTANCE_ID);
                                    ^~~~~~~~~~~~~~~~~~~~
../../../../../../components/drivers_nrf/twi_master/nrf_drv_twi.h:120:30: error: 'TWITWI_INSTANCE_ID_INSTANCE_INDEX' undeclared here (not in a function)
     .drv_inst_idx = CONCAT_3(TWI, id, _INSTANCE_INDEX), \
                              ^
../../../../../../components/libraries/util/nordic_common.h:133:31: note: in definition of macro 'CONCAT_3_'
 #define CONCAT_3_(p1, p2, p3) p1##p2##p3
                               ^~
../../../../../../components/drivers_nrf/twi_master/nrf_drv_twi.h:120:21: note: in expansion of macro 'CONCAT_3'
     .drv_inst_idx = CONCAT_3(TWI, id, _INSTANCE_INDEX), \
                     ^~~~~~~~
../../../main.c:41:36: note: in expansion of macro 'NRF_DRV_TWI_INSTANCE'
 static const nrf_drv_twi_t m_twi = NRF_DRV_TWI_INSTANCE(TWI_INSTANCE_ID);
                                    ^~~~~~~~~~~~~~~~~~~~
../../../../../../components/drivers_nrf/twi_master/nrf_drv_twi.h:121:30: error: 'TWITWI_INSTANCE_ID_USE_EASY_DMA' undeclared here (not in a function)
     .use_easy_dma = CONCAT_3(TWI, id, _USE_EASY_DMA)    \
                              ^
../../../../../../components/libraries/util/nordic_common.h:133:31: note: in definition of macro 'CONCAT_3_'
 #define CONCAT_3_(p1, p2, p3) p1##p2##p3
                               ^~
../../../../../../components/drivers_nrf/twi_master/nrf_drv_twi.h:121:21: note: in expansion of macro 'CONCAT_3'
     .use_easy_dma = CONCAT_3(TWI, id, _USE_EASY_DMA)    \
                     ^~~~~~~~
../../../main.c:41:36: note: in expansion of macro 'NRF_DRV_TWI_INSTANCE'
 static const nrf_drv_twi_t m_twi = NRF_DRV_TWI_INSTANCE(TWI_INSTANCE_ID);
                                    ^~~~~~~~~~~~~~~~~~~~
../../../../../../components/toolchain/gcc/Makefile.common:134: recipe for target '_build/nrf52832_xxaa_main.c.o' failed
make: *** [_build/nrf52832_xxaa_main.c.o] Error 1

You can see my main file from : https://www.dropbox.com/s/fjl80m7zhka...

and my makefile : https://www.dropbox.com/s/979by5nzvu7...

Thank you for your help !!!

edit retag flag offensive close delete report spam

1 answer

Sort by » oldest newest most voted
1
mattyice gravatar image

answered 2017-06-19 20:55:29 +0200

Do you have TWI_INSTANCE_ID defined anywhere? I ran into very similar errors when I failed to add #define TWI_INSTANCE_ID 0 to my code.

edit flag offensive delete publish link more

Comments

1

Yeah, this also solved my issue, thanks !

asabuncuoglu13 ( 2017-06-20 10:26:05 +0200 )editconvert to answer

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

Question Tools

1 follower

Stats

Asked: 2017-06-19 16:44:16 +0200

Seen: 40 times

Last updated: 2 days ago

Related questions