Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can't override bsp.h

I would like to add events for button release and button long push to my application. I also want to keep the SDK folder unmodified for easy upgrades.

To do this I copied bsp.h to my project directory and added BSP_EVENT_KEY_0_RELEASE to the enum. I also modified the Makefile so my modified bsp.h is at the top of the INC_FOLDERS array.

However, when I compile my modified bsp.h is being ignored in favor of the original bsp.h. The only way to get my bsp.h to compile is to move/delete the original bsp.h.

Is there a way to get my custom bsp.h to be used without modifiying the SDK?

Thanks

Parents Reply Children
  • Ok I see, thanks. I'm not sure what is wrong here. I tried doing the same here. Created a new folder where the main.c file is located. Copied the bsp.h file to this location. Made the modifications to the bsp_event_t enum, then I use this new enum value in main.

    If I add the path to INC_FOLDERS above the previous bsp path, it compiles just fine. If I add it after, the compilation fails.

    Can you try to run "make VERBOSE=1" to see if the include path is actually put in the right location?

  • Just tried that. No success placing the path before or after the bsp folder:

    Before:
    '/usr/bin/arm-none-eabi-gcc' -x assembler-with-cpp -MP -MD -c -o _build/nrf52840_xxaa/gcc_startup_nrf52840.S.o ../../../../../../modules/nrfx/mdk/gcc_startup_nrf52840.S -g3 -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DAPP_TIMER_V2 -DAPP_TIMER_V2_RTC1_ENABLED -DBOARD_PCA10056 -DCONFIG_GPIO_AS_PINRESET -DFLOAT_ABI_HARD -DNRF52840_XXAA -DNRF_SD_BLE_API_VERSION=7 -DS140 -DSOFTDEVICE_PRESENT -D__HEAP_SIZE=8192 -D__STACK_SIZE=8192 -I../../../../../../components/nfc/ndef/generic/message -I../../../../../../components/nfc/t2t_lib -I../../../../../../components/nfc/t4t_parser/hl_detection_procedure -I../../../../../../components/ble/ble_services/ble_ancs_c -I../../../../../../components/ble/ble_services/ble_ias_c -I../../../../../../components/libraries/pwm -I../../../../../../components/libraries/usbd/class/cdc/acm -I../../../../../../components/libraries/usbd/class/hid/generic -I../../../../../../components/libraries/usbd/class/msc -I../../../../../../components/libraries/usbd/class/hid -I../../../../../../modules/nrfx/hal -I../../../../../../components/nfc/ndef/conn_hand_parser/le_oob_rec_parser -I../../../../../../components/libraries/log -I../../../../../../components/ble/ble_services/ble_gls -I../../../../../../components/libraries/fstorage -I../../../../../../components/nfc/ndef/text -I../../../../../../components/libraries/mutex -I../../../../../../components/libraries/gfx -I../../../../../../components/libraries/bootloader/ble_dfu -I../../../../../../components/nfc/ndef/connection_handover/common -I../../../../../../components/libraries/fifo -I../../../../../../components/boards -I../../../../../../components/nfc/ndef/generic/record -I../../../../../../components/nfc/t4t_parser/cc_file -I../../../../../../components/ble/ble_advertising -I../../../../../../external/utf_converter -I../../../../../../components/ble/ble_services/ble_bas_c -I../../../../../../modules/nrfx/drivers/include -I../../../../../../components/libraries/experimental_task_manager -I../../../../../../components/ble/ble_services/ble_hrs_c -I../../../../../../components/softdevice/s140/headers/nrf52 -I../../../../../../components/nfc/ndef/connection_handover/le_oob_rec -I../../../../../../components/libraries/queue -I../../../../../../components/libraries/pwr_mgmt -I../../../../../../components/ble/ble_dtm -I../../../../../../components/toolchain/cmsis/include -I../../../../../../components/ble/ble_services/ble_rscs_c -I../../../../../../components/ble/common -I../../../../../../components/ble/ble_services/ble_lls -I../../../../../../components/nfc/platform -I../../.. -I../../../../../../components/libraries/bsp -I../../../../../../components/nfc/ndef/connection_handover/ac_rec -I../../../../../../components/ble/ble_services/ble_bas -I../../../../../../components/libraries/mpu -I../../../../../../components/libraries/experimental_section_vars -I../../../../../../components/ble/ble_services/ble_ans_c -I../../../../../../components/libraries/slip -I../../../../../../components/libraries/delay -I../../../../../../components/libraries/csense_drv -I../../../../../../components/libraries/memobj -I../../../../../../components/ble/ble_services/ble_nus_c -I../../../../../../components/softdevice/common -I../../../../../../components/ble/ble_services/ble_ias -I../../../../../../components/libraries/usbd/class/hid/mouse -I../../../../../../components/libraries/low_power_pwm -I../../../../../../components/nfc/ndef/conn_hand_parser/ble_oob_advdata_parser -I../../../../../../components/ble/ble_services/ble_dfu -I../../../../../../external/fprintf -I../../../../../../components/libraries/svc -I../../../../../../components/libraries/atomic -I../../../../../../components -I../../../../../../components/libraries/scheduler -I../../../../../../components/libraries/cli -I../../../../../../components/ble/ble_services/ble_lbs -I../../../../../../components/ble/ble_services/ble_hts -I../../../../../../components/ble/ble_services/ble_cts_c -I../../../../../../components/libraries/crc16 -I../../../../../../components/nfc/t4t_parser/apdu -I../../../../../../components/libraries/util -I../config -I../../../../../../components/libraries/usbd/class/cdc -I../../../../../../components/libraries/csense -I../../../../../../components/libraries/balloc -I../../../../../../components/libraries/ecc -I../../../../../../components/libraries/hardfault -I../../../../../../components/ble/ble_services/ble_cscs -I../../../../../../components/libraries/uart -I../../../../../../components/libraries/hci -I../../../../../../components/libraries/usbd/class/hid/kbd -I../../../../../../components/libraries/timer -I../../../../../../components/softdevice/s140/headers -I../../../../../../integration/nrfx -I../../../../../../components/nfc/t4t_parser/tlv -I../../../../../../components/libraries/sortlist -I../../../../../../components/libraries/spi_mngr -I../../../../../../components/libraries/led_softblink -I../../../../../../components/nfc/ndef/conn_hand_parser -I../../../../../../components/libraries/sdcard -I../../../../../../components/nfc/ndef/parser/record -I../../../../../../modules/nrfx/mdk -I../../../../../../components/ble/ble_link_ctx_manager -I../../../../../../components/ble/ble_services/ble_nus -I../../../../../../components/libraries/twi_mngr -I../../../../../../components/ble/ble_services/ble_hids -I../../../../../../components/libraries/strerror -I../../../../../../components/libraries/crc32 -I../../../../../../components/nfc/ndef/connection_handover/ble_oob_advdata -I../../../../../../components/nfc/t2t_parser -I../../../../../../components/nfc/ndef/connection_handover/ble_pair_msg -I../../../../../../components/libraries/usbd/class/audio -I../../../../../../components/nfc/t4t_lib -I../../../../../../components/ble/peer_manager -I../../../../../../components/libraries/mem_manager -I../../../../../../components/libraries/ringbuf -I../../../../../../components/ble/ble_services/ble_tps -I../../../../../../components/nfc/ndef/parser/message -I../../../../../../components/ble/ble_services/ble_dis -I../../../../../../components/nfc/ndef/uri -I../../../../../../components/ble/nrf_ble_gatt -I../../../../../../components/ble/nrf_ble_qwr -I../../../../../../components/libraries/gpiote -I../../../../../../components/libraries/button -I../../../../../../modules/nrfx -I../../../../../../components/libraries/twi_sensor -I../../../../../../integration/nrfx/legacy -I../../../../../../components/libraries/usbd -I../../../../../../components/nfc/ndef/connection_handover/ep_oob_rec -I../../../../../../external/segger_rtt -I../../../../../../components/libraries/atomic_fifo -I../../../../../../components/ble/ble_services/ble_lbs_c -I../../../../../../components/nfc/ndef/connection_handover/ble_pair_lib -I../../../../../../components/libraries/crypto -I../../../../../../components/ble/ble_racp -I../../../../../../components/libraries/fds -I../../../../../../components/nfc/ndef/launchapp -I../../../../../../components/libraries/atomic_flags -I../../../../../../components/ble/ble_services/ble_hrs -I../../../../../../components/ble/ble_services/ble_rscs -I../../../../../../components/nfc/ndef/connection_handover/hs_rec -I../../../../../../components/nfc/ndef/conn_hand_parser/ac_rec_parser -I../../../../../../components/libraries/stack_guard -I../../../../../../components/libraries/log/src
    
    After:
    '/usr/bin/arm-none-eabi-gcc' -x assembler-with-cpp -MP -MD -c -o _build/nrf52840_xxaa/gcc_startup_nrf52840.S.o ../../../../../../modules/nrfx/mdk/gcc_startup_nrf52840.S -g3 -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DAPP_TIMER_V2 -DAPP_TIMER_V2_RTC1_ENABLED -DBOARD_PCA10056 -DCONFIG_GPIO_AS_PINRESET -DFLOAT_ABI_HARD -DNRF52840_XXAA -DNRF_SD_BLE_API_VERSION=7 -DS140 -DSOFTDEVICE_PRESENT -D__HEAP_SIZE=8192 -D__STACK_SIZE=8192 -I../../../../../../components/nfc/ndef/generic/message -I../../../../../../components/nfc/t2t_lib -I../../../../../../components/nfc/t4t_parser/hl_detection_procedure -I../../../../../../components/ble/ble_services/ble_ancs_c -I../../../../../../components/ble/ble_services/ble_ias_c -I../../../../../../components/libraries/pwm -I../../../../../../components/libraries/usbd/class/cdc/acm -I../../../../../../components/libraries/usbd/class/hid/generic -I../../../../../../components/libraries/usbd/class/msc -I../../../../../../components/libraries/usbd/class/hid -I../../../../../../modules/nrfx/hal -I../../../../../../components/nfc/ndef/conn_hand_parser/le_oob_rec_parser -I../../../../../../components/libraries/log -I../../../../../../components/ble/ble_services/ble_gls -I../../../../../../components/libraries/fstorage -I../../../../../../components/nfc/ndef/text -I../../../../../../components/libraries/mutex -I../../../../../../components/libraries/gfx -I../../../../../../components/libraries/bootloader/ble_dfu -I../../../../../../components/nfc/ndef/connection_handover/common -I../../../../../../components/libraries/fifo -I../../../../../../components/boards -I../../../../../../components/nfc/ndef/generic/record -I../../../../../../components/nfc/t4t_parser/cc_file -I../../../../../../components/ble/ble_advertising -I../../../../../../external/utf_converter -I../../../../../../components/ble/ble_services/ble_bas_c -I../../../../../../modules/nrfx/drivers/include -I../../../../../../components/libraries/experimental_task_manager -I../../../../../../components/ble/ble_services/ble_hrs_c -I../../../../../../components/softdevice/s140/headers/nrf52 -I../../../../../../components/nfc/ndef/connection_handover/le_oob_rec -I../../../../../../components/libraries/queue -I../../../../../../components/libraries/pwr_mgmt -I../../../../../../components/ble/ble_dtm -I../../../../../../components/toolchain/cmsis/include -I../../../../../../components/ble/ble_services/ble_rscs_c -I../../../../../../components/ble/common -I../../../../../../components/ble/ble_services/ble_lls -I../../../../../../components/nfc/platform -I../../../../../../components/libraries/bsp -I../../.. -I../../../../../../components/nfc/ndef/connection_handover/ac_rec -I../../../../../../components/ble/ble_services/ble_bas -I../../../../../../components/libraries/mpu -I../../../../../../components/libraries/experimental_section_vars -I../../../../../../components/ble/ble_services/ble_ans_c -I../../../../../../components/libraries/slip -I../../../../../../components/libraries/delay -I../../../../../../components/libraries/csense_drv -I../../../../../../components/libraries/memobj -I../../../../../../components/ble/ble_services/ble_nus_c -I../../../../../../components/softdevice/common -I../../../../../../components/ble/ble_services/ble_ias -I../../../../../../components/libraries/usbd/class/hid/mouse -I../../../../../../components/libraries/low_power_pwm -I../../../../../../components/nfc/ndef/conn_hand_parser/ble_oob_advdata_parser -I../../../../../../components/ble/ble_services/ble_dfu -I../../../../../../external/fprintf -I../../../../../../components/libraries/svc -I../../../../../../components/libraries/atomic -I../../../../../../components -I../../../../../../components/libraries/scheduler -I../../../../../../components/libraries/cli -I../../../../../../components/ble/ble_services/ble_lbs -I../../../../../../components/ble/ble_services/ble_hts -I../../../../../../components/ble/ble_services/ble_cts_c -I../../../../../../components/libraries/crc16 -I../../../../../../components/nfc/t4t_parser/apdu -I../../../../../../components/libraries/util -I../config -I../../../../../../components/libraries/usbd/class/cdc -I../../../../../../components/libraries/csense -I../../../../../../components/libraries/balloc -I../../../../../../components/libraries/ecc -I../../../../../../components/libraries/hardfault -I../../../../../../components/ble/ble_services/ble_cscs -I../../../../../../components/libraries/uart -I../../../../../../components/libraries/hci -I../../../../../../components/libraries/usbd/class/hid/kbd -I../../../../../../components/libraries/timer -I../../../../../../components/softdevice/s140/headers -I../../../../../../integration/nrfx -I../../../../../../components/nfc/t4t_parser/tlv -I../../../../../../components/libraries/sortlist -I../../../../../../components/libraries/spi_mngr -I../../../../../../components/libraries/led_softblink -I../../../../../../components/nfc/ndef/conn_hand_parser -I../../../../../../components/libraries/sdcard -I../../../../../../components/nfc/ndef/parser/record -I../../../../../../modules/nrfx/mdk -I../../../../../../components/ble/ble_link_ctx_manager -I../../../../../../components/ble/ble_services/ble_nus -I../../../../../../components/libraries/twi_mngr -I../../../../../../components/ble/ble_services/ble_hids -I../../../../../../components/libraries/strerror -I../../../../../../components/libraries/crc32 -I../../../../../../components/nfc/ndef/connection_handover/ble_oob_advdata -I../../../../../../components/nfc/t2t_parser -I../../../../../../components/nfc/ndef/connection_handover/ble_pair_msg -I../../../../../../components/libraries/usbd/class/audio -I../../../../../../components/nfc/t4t_lib -I../../../../../../components/ble/peer_manager -I../../../../../../components/libraries/mem_manager -I../../../../../../components/libraries/ringbuf -I../../../../../../components/ble/ble_services/ble_tps -I../../../../../../components/nfc/ndef/parser/message -I../../../../../../components/ble/ble_services/ble_dis -I../../../../../../components/nfc/ndef/uri -I../../../../../../components/ble/nrf_ble_gatt -I../../../../../../components/ble/nrf_ble_qwr -I../../../../../../components/libraries/gpiote -I../../../../../../components/libraries/button -I../../../../../../modules/nrfx -I../../../../../../components/libraries/twi_sensor -I../../../../../../integration/nrfx/legacy -I../../../../../../components/libraries/usbd -I../../../../../../components/nfc/ndef/connection_handover/ep_oob_rec -I../../../../../../external/segger_rtt -I../../../../../../components/libraries/atomic_fifo -I../../../../../../components/ble/ble_services/ble_lbs_c -I../../../../../../components/nfc/ndef/connection_handover/ble_pair_lib -I../../../../../../components/libraries/crypto -I../../../../../../components/ble/ble_racp -I../../../../../../components/libraries/fds -I../../../../../../components/nfc/ndef/launchapp -I../../../../../../components/libraries/atomic_flags -I../../../../../../components/ble/ble_services/ble_hrs -I../../../../../../components/ble/ble_services/ble_rscs -I../../../../../../components/nfc/ndef/connection_handover/hs_rec -I../../../../../../components/nfc/ndef/conn_hand_parser/ac_rec_parser -I../../../../../../components/libraries/stack_guard -I../../../../../../components/libraries/log/src

  • I am using SDK 17 with linux. I just tested in SDK 16 and in windows and got the same unfortunate result.

  • Can you please post the whole project in a zip, or at least a simplified project which reproduce the issue?

Related