This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Linking MPU6050 sensor with BLE UART

Hi, I am trying to interface MPU^)%) sensor with NRF52832. with help of BLE UART. i will get the resultant data on BLE APP. but here i got some error is this the linking error or ?

Parents
  • Hi Sunil.

    Have you enabled NRFX_TWI_ENABLED in sdk_config.h?

    Like this:

    // <e> NRFX_TWI_ENABLED - nrfx_twi - TWI peripheral driver
    //==========================================================
    #ifndef NRFX_TWI_ENABLED
    #define NRFX_TWI_ENABLED 1
    #endif

    - Andreas

  • Hi Andreas

    I have enabled that one

    / <e> NRFX_TWI_ENABLED - nrfx_twi - TWI peripheral driver
    //==========================================================
    #ifndef NRFX_TWI_ENABLED
    #define NRFX_TWI_ENABLED 1
    #endif
    // <q> NRFX_TWI0_ENABLED  - Enable TWI0 instance
     

    #ifndef NRFX_TWI0_ENABLED
    #define NRFX_TWI0_ENABLED 0
    #endif

    // <q> NRFX_TWI1_ENABLED  - Enable TWI1 instance
     

    #ifndef NRFX_TWI1_ENABLED
    #define NRFX_TWI1_ENABLED 0
    #endif

    // <e> TWI_ENABLED - nrf_drv_twi - TWI/TWIM peripheral driver - legacy layer
    //==========================================================
    #ifndef TWI_ENABLED
    #define TWI_ENABLED 1
    #endif
    // <o> TWI_DEFAULT_CONFIG_FREQUENCY  - Frequency
     
    // <26738688=> 100k
    // <67108864=> 250k
    // <104857600=> 400k

Reply
  • Hi Andreas

    I have enabled that one

    / <e> NRFX_TWI_ENABLED - nrfx_twi - TWI peripheral driver
    //==========================================================
    #ifndef NRFX_TWI_ENABLED
    #define NRFX_TWI_ENABLED 1
    #endif
    // <q> NRFX_TWI0_ENABLED  - Enable TWI0 instance
     

    #ifndef NRFX_TWI0_ENABLED
    #define NRFX_TWI0_ENABLED 0
    #endif

    // <q> NRFX_TWI1_ENABLED  - Enable TWI1 instance
     

    #ifndef NRFX_TWI1_ENABLED
    #define NRFX_TWI1_ENABLED 0
    #endif

    // <e> TWI_ENABLED - nrf_drv_twi - TWI/TWIM peripheral driver - legacy layer
    //==========================================================
    #ifndef TWI_ENABLED
    #define TWI_ENABLED 1
    #endif
    // <o> TWI_DEFAULT_CONFIG_FREQUENCY  - Frequency
     
    // <26738688=> 100k
    // <67108864=> 250k
    // <104857600=> 400k

Children
  • Hi.

    Try to also enable NRFX_TWI0_ENABLED

    Like this:

    #ifndef NRFX_TWI0_ENABLED
    #define NRFX_TWI0_ENABLED 1
    #endif

    - Andreas

  • how to properly post source code:

    How to properly insert source code

    then it will look as in 's posts

  • Hi,

    even though that I enabled the NRFX_TWI0_ENABLED as 1, errors are coming.

  • Hi.

    There appears to be an overwrite of the config in sdk_config.h by the file apply_old_config.h.

    If you have the following config, it should work:

    // <e> NRFX_TWI_ENABLED - nrfx_twi - TWI peripheral driver
    //==========================================================
    #ifndef NRFX_TWI_ENABLED
    #define NRFX_TWI_ENABLED 1
    #endif
    
    
    // <q> NRFX_TWI0_ENABLED  - Enable TWI0 instance
    
    #ifndef NRFX_TWI0_ENABLED
    #define NRFX_TWI0_ENABLED 1
    #endif
    
    
    // <e> TWI_ENABLED - nrf_drv_twi - TWI/TWIM peripheral driver - legacy layer
    //==========================================================
    #ifndef TWI_ENABLED
    #define TWI_ENABLED 1
    
    
    // <e> TWI0_ENABLED - Enable TWI0 instance
    //==========================================================
    #ifndef TWI0_ENABLED
    #define TWI0_ENABLED 1

    apply_old_config.h overwrites the NRFX_TWI_... defines, but it will still use the new nrfx drivers.

    Hope this helps.

    - Andreas

  • As you said

    in apply_old_config.h

    // TWI
    #define TWI_ONLY      ( defined(TWI_PRESENT) && !defined(TWIM_PRESENT))
    #define TWIM_ONLY     (!defined(TWI_PRESENT) &&  defined(TWIM_PRESENT))
    #define TWI_AND_TWIM  ( defined(TWI_PRESENT) &&  defined(TWIM_PRESENT))
    
    #if defined(TWI_ENABLED)
    
    #undef NRFX_TWI_ENABLED
    #define NRFX_TWI_ENABLED   (TWI_ENABLED && (NRFX_TWI0_ENABLED  || NRFX_TWI1_ENABLED))
    #undef NRFX_TWIM_ENABLED
    #define NRFX_TWIM_ENABLED  (TWI_ENABLED && (NRFX_TWIM0_ENABLED || NRFX_TWIM1_ENABLED))
    
    #if defined(TWI_PRESENT) && !defined(TWIM_PRESENT)
    
    #undef NRFX_TWI0_ENABLED
    #define NRFX_TWI0_ENABLED   TWI0_ENABLED
    #undef NRFX_TWIM0_ENABLED
    #define NRFX_TWIM0_ENABLED  0
    
    #undef NRFX_TWI1_ENABLED
    #define NRFX_TWI1_ENABLED   TWI1_ENABLED
    #undef NRFX_TWIM1_ENABLED
    #define NRFX_TWIM1_ENABLED  0
    
    #elif !defined(TWI_PRESENT) && defined(TWIM_PRESENT)
    
    #undef NRFX_TWI0_ENABLED
    #define NRFX_TWI0_ENABLED   0
    #undef NRFX_TWIM0_ENABLED
    #define NRFX_TWIM0_ENABLED  TWI0_ENABLED
    
    #undef NRFX_TWI1_ENABLED
    #define NRFX_TWI1_ENABLED   0
    #undef NRFX_TWIM1_ENABLED
    #define NRFX_TWIM1_ENABLED  TWI1_ENABLED
    

Related