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 ?

  • 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:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    // <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
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    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

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    // 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
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi.

    I don't understand your reply, did you add this to apply_old_config.h?

    You should have added the configurations I wrote in my previous reply to sdk_config.h.

    - Andreas

  • Hi,

    no, i just open and saw the value

    I don't understand your reply, did you add this to apply_old_config.h?

    as like you said sdk_config.h i did the same

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    // <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 0
    #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
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

1 2