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

NO MPU Defined error

Hello,

I am trying to use nrf-mpu-examples in eclipse from this link github.com/.../nrf5-mpu-examples. I have provided all required libraries and header files but I am not getting how I can remove this error "No MPU defined. Please define MPU in Target Options C/C++ Defines" In the post they mentioned "Define your MPU in Keil's "Target Options -> C/C++". Use define "MPU9255", "MPU9150", or "MPU60x0"." but i am using eclipse. What should be done ?

Parents
  • Try adding it to your makefile as an C and assembler flag.

    CFLAGS += -DMPU9255
    ASMFLAGS += -DMPU9255
    
  • HI,

    I am using same github library. instead of keil i want to work in segger. but there is no SES file for the MPU library is there any SES file available..?

    and also i am trying to alternate  " ble_app_uart_pca10040_s132 "   segger solution to work in this MPU library which is SDK 15.2.

    for that i also got the error  #error "No MPU defined. Please define MPU in Target Options C/C++ Defines"

    and more error like

    Rebuilding ‘ble_app_uart_pca10040_s132 - MPU’ from solution ‘ble_app_uart_pca10040_s132 - MPU’ in configuration ‘Release’
      Assembling ‘thumb_crt0.s’
      Compiling ‘nrf_log_backend_rtt.c’
      Compiling ‘nrf_log_backend_serial.c’
      Compiling ‘nrf_log_default_backends.c’
      Compiling ‘nrf_log_frontend.c’
      Compiling ‘nrf_log_str_formatter.c’
      Compiling ‘app_button.c’
      Compiling ‘app_error.c’
      Compiling ‘app_error_handler_gcc.c’
      Compiling ‘app_error_weak.c’
      Compiling ‘app_fifo.c’
      Compiling ‘app_scheduler.c’
      Compiling ‘app_timer.c’
      Compiling ‘app_uart_fifo.c’
      Compiling ‘app_util_platform.c’
      Compiling ‘hardfault_implementation.c’
      Compiling ‘nrf_assert.c’
      Compiling ‘nrf_atfifo.c’
      Compiling ‘nrf_atflags.c’
      Compiling ‘nrf_atomic.c’
      Compiling ‘nrf_balloc.c’
      Compiling ‘nrf_fprintf.c’
      Compiling ‘nrf_fprintf_format.c’
      Compiling ‘nrf_memobj.c’
      Compiling ‘nrf_pwr_mgmt.c’
      Compiling ‘nrf_ringbuf.c’
      Compiling ‘nrf_section_iter.c’
      Compiling ‘nrf_strerror.c’
      Compiling ‘retarget.c’
      Assembling ‘ses_startup_nrf52.s’
      Assembling ‘ses_startup_nrf_common.s’
      Compiling ‘system_nrf52.c’
      Compiling ‘boards.c’
      Compiling ‘nrf_drv_clock.c’
      Compiling ‘nrf_drv_uart.c’
      Compiling ‘nrfx_clock.c’
      Compiling ‘nrfx_gpiote.c’
      Compiling ‘nrfx_power_clock.c’
      Compiling ‘nrfx_prs.c’
      Compiling ‘nrfx_uart.c’
      Compiling ‘nrfx_uarte.c’
      Compiling ‘bsp.c’
      Compiling ‘bsp_btn_ble.c’
      Compiling ‘nrf_drv_mpu_spi.c’
      Compiling ‘nrf_drv_mpu_twi.c’
      Compiling ‘main.c’
        app_mpu.h: No such file or directory
      Compiling ‘app_mpu.c’
        app_mpu.c
        #error "No MPU defined. Please define MPU in Target Options C/C++ Defines"
        app_mpu.c
        #error "No/unknown MPU defined"
        app_mpu.c
        #elif with no expression
        'MPU_REG_SMPLRT_DIV' undeclared (first use in this function)
        each undeclared identifier is reported only once for each function it appears in
        'MPU_REG_INT_PIN_CFG' undeclared (first use in this function)
        'MPU_REG_INT_ENABLE' undeclared (first use in this function)
        'MPU_REG_SIGNAL_PATH_RESET' undeclared (first use in this function)
        'MPU_REG_PWR_MGMT_1' undeclared (first use in this function)
        'MPU_REG_ACCEL_XOUT_H' undeclared (first use in this function)
        'MPU_REG_GYRO_XOUT_H' undeclared (first use in this function)
        'MPU_REG_TEMP_OUT_H' undeclared (first use in this function)
        'MPU_REG_INT_STATUS' undeclared (first use in this function)
      Compiling ‘ble_mpu.c’
        ble_mpu.h
        ble_mpu.c
        #error "No MPU defined. Please define MPU in Target Options C/C++ Defines"
        ble_mpu.h
        ble_mpu.c
        #error "No/unknown MPU defined"
      Compiling ‘SEGGER_RTT.c’
    Build failed

    the respective screen shot

Reply
  • HI,

    I am using same github library. instead of keil i want to work in segger. but there is no SES file for the MPU library is there any SES file available..?

    and also i am trying to alternate  " ble_app_uart_pca10040_s132 "   segger solution to work in this MPU library which is SDK 15.2.

    for that i also got the error  #error "No MPU defined. Please define MPU in Target Options C/C++ Defines"

    and more error like

    Rebuilding ‘ble_app_uart_pca10040_s132 - MPU’ from solution ‘ble_app_uart_pca10040_s132 - MPU’ in configuration ‘Release’
      Assembling ‘thumb_crt0.s’
      Compiling ‘nrf_log_backend_rtt.c’
      Compiling ‘nrf_log_backend_serial.c’
      Compiling ‘nrf_log_default_backends.c’
      Compiling ‘nrf_log_frontend.c’
      Compiling ‘nrf_log_str_formatter.c’
      Compiling ‘app_button.c’
      Compiling ‘app_error.c’
      Compiling ‘app_error_handler_gcc.c’
      Compiling ‘app_error_weak.c’
      Compiling ‘app_fifo.c’
      Compiling ‘app_scheduler.c’
      Compiling ‘app_timer.c’
      Compiling ‘app_uart_fifo.c’
      Compiling ‘app_util_platform.c’
      Compiling ‘hardfault_implementation.c’
      Compiling ‘nrf_assert.c’
      Compiling ‘nrf_atfifo.c’
      Compiling ‘nrf_atflags.c’
      Compiling ‘nrf_atomic.c’
      Compiling ‘nrf_balloc.c’
      Compiling ‘nrf_fprintf.c’
      Compiling ‘nrf_fprintf_format.c’
      Compiling ‘nrf_memobj.c’
      Compiling ‘nrf_pwr_mgmt.c’
      Compiling ‘nrf_ringbuf.c’
      Compiling ‘nrf_section_iter.c’
      Compiling ‘nrf_strerror.c’
      Compiling ‘retarget.c’
      Assembling ‘ses_startup_nrf52.s’
      Assembling ‘ses_startup_nrf_common.s’
      Compiling ‘system_nrf52.c’
      Compiling ‘boards.c’
      Compiling ‘nrf_drv_clock.c’
      Compiling ‘nrf_drv_uart.c’
      Compiling ‘nrfx_clock.c’
      Compiling ‘nrfx_gpiote.c’
      Compiling ‘nrfx_power_clock.c’
      Compiling ‘nrfx_prs.c’
      Compiling ‘nrfx_uart.c’
      Compiling ‘nrfx_uarte.c’
      Compiling ‘bsp.c’
      Compiling ‘bsp_btn_ble.c’
      Compiling ‘nrf_drv_mpu_spi.c’
      Compiling ‘nrf_drv_mpu_twi.c’
      Compiling ‘main.c’
        app_mpu.h: No such file or directory
      Compiling ‘app_mpu.c’
        app_mpu.c
        #error "No MPU defined. Please define MPU in Target Options C/C++ Defines"
        app_mpu.c
        #error "No/unknown MPU defined"
        app_mpu.c
        #elif with no expression
        'MPU_REG_SMPLRT_DIV' undeclared (first use in this function)
        each undeclared identifier is reported only once for each function it appears in
        'MPU_REG_INT_PIN_CFG' undeclared (first use in this function)
        'MPU_REG_INT_ENABLE' undeclared (first use in this function)
        'MPU_REG_SIGNAL_PATH_RESET' undeclared (first use in this function)
        'MPU_REG_PWR_MGMT_1' undeclared (first use in this function)
        'MPU_REG_ACCEL_XOUT_H' undeclared (first use in this function)
        'MPU_REG_GYRO_XOUT_H' undeclared (first use in this function)
        'MPU_REG_TEMP_OUT_H' undeclared (first use in this function)
        'MPU_REG_INT_STATUS' undeclared (first use in this function)
      Compiling ‘ble_mpu.c’
        ble_mpu.h
        ble_mpu.c
        #error "No MPU defined. Please define MPU in Target Options C/C++ Defines"
        ble_mpu.h
        ble_mpu.c
        #error "No/unknown MPU defined"
      Compiling ‘SEGGER_RTT.c’
    Build failed

    the respective screen shot

Children
Related