NRF528540 with MPU9255 Problem

Hello guys, i currently applying the example about MPU9255 following this:GitHub - Martinsbl/nrf5-mpu-examples

i'm using the app_mpu.c, app_mpu.h, mpu9255_register_map.h, nrf_drv_mpu.h, nrf_drv_mpu_twi.c to create new project with the main.c and sdk config in nrf5-mpu-simple. 

when i build and log showing this error. Could anyone help me with this, many thank,

Kyle. 

Parents
  • Hello,

    Line 35 in main.c in the nrf5-mpu-simple application is just a comment, so obviously you did some modifications, at least removed the comments on the top. 

    What function returned the error 13 that was passed into your APP_ERROR_CHECK(err_code) in main.c on line 35?

    Are you using Keil? Did you add the preprocessor definitions MPU9255 and MPU_USES_TWI to your project settings, according to the readme file in the github repository that you linked to?

    Best regards,

    Edvin

  • Hello Edvin, 

    The line 35 in my main.c is ret_code = app_mpu_config(&p_mpu_config); // Configure the MPU with above values

    The function that return error 13 is the mpu_init function.

    I'm using segger embedded studio but i'm already add the preprocessor definitions MPU9255 and MPU_USES_TWI.

    Best regards,

    Kyle

  • Hello,

    Can you please send me the main.c file (your latest version) with the corresponding error log. The log would not say what it says if your line 35 is ret_code_t = app_mpu_config(...).

    mpu_init() doesn't return any parameters (at least not in the unmodified nrf5-mpu-init\main.c file). 

    But I guess it is app_mpu_config() that returns 13, then. If that is the case, it looks like the nrf_drv_mpu_write_registers() returns NRF_ERROR_TIMEOUT, meaning that nrf_drv_twi_xfer() doesn't receive a callback. Is the MPU powered? Have you tried to analyze the TWI pins using a logic analyzer? Is the TWI data sent from the nRF? And does the MPU reply over TWI?

    Best regards,

    Edvin

Reply
  • Hello,

    Can you please send me the main.c file (your latest version) with the corresponding error log. The log would not say what it says if your line 35 is ret_code_t = app_mpu_config(...).

    mpu_init() doesn't return any parameters (at least not in the unmodified nrf5-mpu-init\main.c file). 

    But I guess it is app_mpu_config() that returns 13, then. If that is the case, it looks like the nrf_drv_mpu_write_registers() returns NRF_ERROR_TIMEOUT, meaning that nrf_drv_twi_xfer() doesn't receive a callback. Is the MPU powered? Have you tried to analyze the TWI pins using a logic analyzer? Is the TWI data sent from the nRF? And does the MPU reply over TWI?

    Best regards,

    Edvin

Children
No Data
Related