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

Hi , can anyone say how to convert the driver and library for mpu 6050 from sdk 11 to sdk 13..??

Am a beginner to this platform , i don't know how to made the conversion . can anyone help me

  • Hello

    Could you please copy and paste the entire error message you receive here?

  • In file included from ../../../main.c:44:0: ../../../app_mpu.h:26:6: error: #error "No MPU defined. Please define MPU in Target Options C/C++ Defines" #error "No MPU defined. Please define MPU in Target Options C/C++ Defines" ^~~~~ In file included from ../../../main.c:44:0: ../../../app_mpu.h:193:6: error: #error "No/unknown MPU defined" #error "No/unknown MPU defined" ^~~~~ ../../../main.c: In function 'timers_init': ../../../main.c:226:16: error: too few arguments to function 'app_timer_init' err_code = app_timer_init(); ^~~~~~~~~~~~~~ In file included from ../../../main.c:28:0: ../../../../../../components/libraries/timer/app_timer.h:189:10: note: declared here uint32_t app_timer_init(uint32_t prescaler, ^~~~~~~~~~~~~~ ../../../main.c: In function 'conn_params_init': ../../../main.c:323:46: error: macro "APP_TIMER_TICKS" requires 2 arguments, but only 1 given cp_init.first_conn_params_update_delay = FIRST_CONN_PARAMS_UPDATE_DELAY; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../main.c:65:41: error: 'APP_TIMER_TICKS' undeclared (first use in this function) #define FIRST_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(5000) /< Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (5 seconds). */ ^ ../../../main.c:323:46: note: in expansion of macro 'FIRST_CONN_PARAMS_UPDATE_DELAY' cp_init.first_conn_params_update_delay = FIRST_CONN_PARAMS_UPDATE_DELAY; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../main.c:65:41: note: each undeclared identifier is reported only once for each function it appears in #define FIRST_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(5000) /< Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (5 seconds). */ ^ ../../../main.c:323:46: note: in expansion of macro 'FIRST_CONN_PARAMS_UPDATE_DELAY' cp_init.first_conn_params_update_delay = FIRST_CONN_PARAMS_UPDATE_DELAY; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../main.c:324:46: error: macro "APP_TIMER_TICKS" requires 2 arguments, but only 1 given cp_init.next_conn_params_update_delay = NEXT_CONN_PARAMS_UPDATE_DELAY; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../main.c: In function 'on_ble_evt': ../../../main.c:415:59: error: macro "APP_TIMER_TICKS" requires 2 arguments, but only 1 given err_code = app_timer_start(m_timer_accel_update_id, TIMER_INTERVAL_ACCEL_UPDATE, NULL); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../main.c:91:41: error: 'APP_TIMER_TICKS' undeclared (first use in this function) #define TIMER_INTERVAL_ACCEL_UPDATE APP_TIMER_TICKS(1000) // 1000 ms intervals ^ ../../../main.c:415:59: note: in expansion of macro 'TIMER_INTERVAL_ACCEL_UPDATE' err_code = app_timer_start(m_timer_accel_update_id, TIMER_INTERVAL_ACCEL_UPDATE, NULL); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../main.c: In function 'ble_stack_init': ../../../main.c:533:16: error: implicit declaration of function 'softdevice_app_ram_start_get' [-Werror=implicit-function-declaration] err_code = softdevice_app_ram_start_get(&ram_start); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../main.c:537:5: error: unknown type name 'ble_cfg_t' ble_cfg_t ble_cfg; ^~~~~~~~~ ../../../main.c:540:12: error: request for member 'common_cfg' in something not a structure or union ble_cfg.common_cfg.vs_uuid_cfg.vs_uuid_count = 1; ^ ../../../main.c:541:16: error: implicit declaration of function 'sd_ble_cfg_set' [-Werror=implicit-function-declaration] err_code = sd_ble_cfg_set(BLE_COMMON_CFG_VS_UUID, &ble_cfg, ram_start); ^~~~~~~~~~~~~~ ../../../main.c:541:31: error: 'BLE_COMMON_CFG_VS_UUID' undeclared (first use in this function) err_code = sd_ble_cfg_set(BLE_COMMON_CFG_VS_UUID, &ble_cfg, ram_start); ^~~~~~~~~~~~~~~~~~~~~~ ../../../main.c:546:12: error: request for member 'gap_cfg' in something not a structure or union ble_cfg.gap_cfg.role_count_cfg.periph_role_count = BLE_GAP_ROLE_COUNT_PERIPH_DEFAULT; ^ ../../../main.c:546:57: error: 'BLE_GAP_ROLE_COUNT_PERIPH_DEFAULT' undeclared (first use in this function) ble_cfg.gap_cfg.role_count_cfg.periph_role_count = BLE_GAP_ROLE_COUNT_PERIPH_DEFAULT; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../main.c:547:12: error: request for member 'gap_cfg' in something not a structure or union ble_cfg.gap_cfg.role_count_cfg.central_role_count = 0; ^ ../../../main.c:548:12: error: request for member 'gap_cfg' in something not a structure or union ble_cfg.gap_cfg.role_count_cfg.central_sec_count = 0; ^ ../../../main.c:549:31: error: 'BLE_GAP_CFG_ROLE_COUNT' undeclared (first use in this function) err_code = sd_ble_cfg_set(BLE_GAP_CFG_ROLE_COUNT, &ble_cfg, ram_start); ^~~~~~~~~~~~~~~~~~~~~~ ../../../main.c:553:34: error: passing argument 1 of 'softdevice_enable' from incompatible pointer type [-Werror=incompatible-pointer-types] err_code = softdevice_enable(&ram_start); ^ In file included from ../../../main.c:27:0: ../../../../../../components/softdevice/common/softdevice_handler/softdevice_handler.h:220:10: note: expected 'ble_enable_params_t * {aka struct }' but argument is of type 'uint32_t * {aka long unsigned int }' uint32_t softdevice_enable(ble_enable_params_t * p_ble_enable_params); ^~~~~~~~~~~~~~~~~ ../../../main.c: In function 'buttons_leds_init': ../../../main.c:690:58: error: passing argument 2 of 'bsp_init' makes integer from pointer without a cast [-Werror=int-conversion] err_code = bsp_init(BSP_INIT_LED | BSP_INIT_BUTTONS, bsp_event_handler); ^~~~~~~~~~~~~~~~~ In file included from ../../../main.c:33:0: ../../../../../../components/libraries/bsp/bsp.h:188:10: note: expected 'uint32_t {aka long unsigned int}' but argument is of type 'void ()(bsp_event_t) {aka void ()(enum )}' uint32_t bsp_init(uint32_t type, uint32_t ticks_per_100ms, bsp_event_callback_t callback); ^~~~~~~~ ../../../main.c:690:16: error: too few arguments to function 'bsp_init' err_code = bsp_init(BSP_INIT_LED | BSP_INIT_BUTTONS, bsp_event_handler); ^~~~~~~~ In file included from ../../../main.c:33:0: ../../../../../../components/libraries/bsp/bsp.h:188:10: note: declared here uint32_t bsp_init(uint32_t type, uint32_t ticks_per_100ms, bsp_event_callback_t callback); ^~~~~~~~ ../../../main.c: In function 'mpu_setup': ../../../main.c:719:33: error: implicit declaration of function 'MPU_DEFAULT_CONFIG' [-Werror=implicit-function-declaration] mpu_config_t p_mpu_config = MPU_DEFAULT_CONFIG(); // Load default values ^~~~~~~~~~~~~~~~~~ ../../../main.c:719:33: error: invalid initializer cc1: all warnings being treated as errors ../../../../../../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

    These are the errors am gettting,

  • hi sir , can you give me the make file of armgcc ,then i can able to know , where i have did the mistake

  • I have added a makefile and a linker file. Please see if they work for you.

  • Hi sir , i have compiled , but i get the following errors, i have followed all the above mentioned steps you have mentioned.. Here am getting the following errors :

    Makefile:262: Cannot find source file: ../../../../../../components/libraries/strerror/nrf_strerror.c Makefile:262: Cannot find source file: ../../../../../../components/drivers_nrf/twi_master\nrf_drv_twi.c Makefile:262: Cannot find include folder: ../../../../../../components/libraries/strerror Compiling file: nrf_log_backend_serial.c In file included from ../../../../../../components/libraries/log/src/nrf_log_backend_serial.c:27:0: ../../../../../../components/drivers_nrf/uart/nrf_drv_uart.h: In function 'nrf_drv_uart_task_address_get': ../../../../../../components/drivers_nrf/uart/nrf_drv_uart.h:383:12: error: implicit declaration of function 'nrf_uarte_task_address_get' [-Werror=implicit-function-declaration] return nrf_uarte_task_address_get(p_instance->reg.p_uarte, (nrf_uarte_task_t)task); ^~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../../../../components/drivers_nrf/uart/nrf_drv_uart.h:383:54: error: 'const union ' has no member named 'p_uarte' return nrf_uarte_task_address_get(p_instance->reg.p_uarte, (nrf_uarte_task_t)task); ^ ../../../../../../components/drivers_nrf/uart/nrf_drv_uart.h:383:65: error: 'nrf_uarte_task_t' undeclared (first use in this function) return nrf_uarte_task_address_get(p_instance->reg.p_uarte, (nrf_uarte_task_t)task); ^~~~~~~~~~~~~~~~ ../../../../../../components/drivers_nrf/uart/nrf_drv_uart.h:383:65: note: each undeclared identifier is reported only once for each function it appears in ../../../../../../components/drivers_nrf/uart/nrf_drv_uart.h:383:82: error: expected ')' before 'task' return nrf_uarte_task_address_get(p_instance->reg.p_uarte, (nrf_uarte_task_t)task); ^~~~ ../../../../../../components/drivers_nrf/uart/nrf_drv_uart.h: In function 'nrf_drv_uart_event_address_get': ../../../../../../components/drivers_nrf/uart/nrf_drv_uart.h:393:12: error: implicit declaration of function 'nrf_uarte_event_address_get' [-Werror=implicit-function-declaration] return nrf_uarte_event_address_get(p_instance->reg.p_uarte, (nrf_uarte_event_t)event); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../../../../components/drivers_nrf/uart/nrf_drv_uart.h:393:55: error: 'const union ' has no member named 'p_uarte' return nrf_uarte_event_address_get(p_instance->reg.p_uarte, (nrf_uarte_event_t)event); ^ ../../../../../../components/drivers_nrf/uart/nrf_drv_uart.h:393:66: error: 'nrf_uarte_event_t' undeclared (first use in this function) return nrf_uarte_event_address_get(p_instance->reg.p_uarte, (nrf_uarte_event_t)event); ^~~~~~~~~~~~~~~~~ ../../../../../../components/drivers_nrf/uart/nrf_drv_uart.h:393:84: error: expected ')' before 'event' return nrf_uarte_event_address_get(p_instance->reg.p_uarte, (nrf_uarte_event_t)event); ^~~~~ In file included from ../../../../../../components/libraries/log/src/nrf_log_backend_serial.c:27:0: ../../../../../../components/libraries/log/src/nrf_log_backend_serial.c: At top level: ../../../../../../components/drivers_nrf/uart/nrf_drv_uart.h:59:42: error: excess elements in union initializer [-Werror] #define NRF_DRV_UART_PERIPHERAL(id) (void *)CONCAT_2(NRF_UART, id) ^ ../../../../../../components/drivers_nrf/uart/nrf_drv_uart.h:105:22: note: in expansion of macro 'NRF_DRV_UART_PERIPHERAL' .reg = {NRF_DRV_UART_PERIPHERAL(id)},
    ^~~~~~~~~~~~~~~~~~~~~~~ ../../../../../../components/libraries/log/src/nrf_log_backend_serial.c:32:32: note: in expansion of macro 'NRF_DRV_UART_INSTANCE' static nrf_drv_uart_t m_uart = NRF_DRV_UART_INSTANCE(NRF_LOG_BACKEND_UART_INSTANCE); ^~~~~~~~~~~~~~~~~~~~~ ../../../../../../components/drivers_nrf/uart/nrf_drv_uart.h:59:42: note: (near initialization for 'm_uart.reg') #define NRF_DRV_UART_PERIPHERAL(id) (void *)CONCAT_2(NRF_UART, id) ^ ../../../../../../components/drivers_nrf/uart/nrf_drv_uart.h:105:22: note: in expansion of macro 'NRF_DRV_UART_PERIPHERAL' .reg = {NRF_DRV_UART_PERIPHERAL(id)},
    ^~~~~~~~~~~~~~~~~~~~~~~ ../../../../../../components/libraries/log/src/nrf_log_backend_serial.c:32:32: note: in expansion of macro 'NRF_DRV_UART_INSTANCE' static nrf_drv_uart_t m_uart = NRF_DRV_UART_INSTANCE(NRF_LOG_BACKEND_UART_INSTANCE); ^~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors ../../../../../../components/toolchain/gcc/Makefile.common:134: recipe for target '_build/nrf52832_xxaa_nrf_log_backend_serial.c.o' failed make: *** [_build/nrf52832_xxaa_nrf_log_backend_serial.c.o] Error 1

Related