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

Building Mesh Bootloader via makefile

I'm attempting to pull the mesh bootloader out of the sdk and put it in its own makefile project, so it can be built separately.

I'm building with `gcc-arm-none-eabi-7-2017-q4-major` for an nRF52832.

The bootloader builds successfully, however when I flash and run I get an error in the application code (a modified mesh lightswitch).

<t:         87>, mesh_softdevice_init.c,  117, Initializing SoftDevice...

<t:          0>, mesh_softdevice_init.c,   75, Enabling BLE...

<t:        549>, app_error_weak.c,   87, Application memory access: 493818:0

If i use the pre-built bootloader hex, it works successfully.

Any suggestions on what I might be missing?


Here is the build output for my project:

make VERBOSE=1 all 
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -f Makefile -C ./ -e mesh-bootloader
echo Makefile
Makefile
mkdir _build
Compiling file: bootloader.c
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o _build/bootloader.o -c /../mesh-bootloader/src/bootloader.c
Compiling file: bootloader_app_bridge.c
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o _build/bootloader_app_bridge.o -c /../mesh-bootloader/src/bootloader_app_bridge.c
Compiling file: bootloader_info.c
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o _build/bootloader_info.o -c /../mesh-bootloader/src/bootloader_info.c
Compiling file: bootloader_rtc.c
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o _build/bootloader_rtc.o -c /../mesh-bootloader/src/bootloader_rtc.c
Compiling file: bootloader_util.c
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o _build/bootloader_util.o -c /../mesh-bootloader/src/bootloader_util.c
Compiling file: dfu_bank.c
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o _build/dfu_bank.o -c /../mesh-bootloader/src/dfu_bank.c
Compiling file: dfu_mesh.c
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o _build/dfu_mesh.o -c /../mesh-bootloader/src/dfu_mesh.c
Compiling file: dfu_transfer_mesh.c
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o _build/dfu_transfer_mesh.o -c /../mesh-bootloader/src/dfu_transfer_mesh.c
Compiling file: dfu_util.c
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o _build/dfu_util.o -c /../mesh-bootloader/src/dfu_util.c
Compiling file: fifo.c
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o _build/fifo.o -c /../mesh-bootloader/src/fifo.c
Compiling file: main.c
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o _build/main.o -c /../mesh-bootloader/src/main.c
Compiling file: mesh_packet.c
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o _build/mesh_packet.o -c /../mesh-bootloader/src/mesh_packet.c
Compiling file: nrf_flash.c
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o _build/nrf_flash.o -c /../mesh-bootloader/src/nrf_flash.c
Compiling file: radio_control.c
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o _build/radio_control.o -c /../mesh-bootloader/src/radio_control.c
Compiling file: rand.c
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o _build/rand.o -c /../mesh-bootloader/src/rand.c
Compiling file: transport.c
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o _build/transport.o -c /../mesh-bootloader/src/transport.c
Compiling file: uECC.c
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o _build/uECC.o -c /../mesh-bootloader/src/uECC.c
Compiling file: sha256.c
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o _build/sha256.o -c /../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256/sha256.c
Compiling file: system_nrf52.c
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o _build/system_nrf52.o -c /../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk/system_nrf52.c
Assembly file: gcc_startup_nrf52.S
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' -Os -DNDEBUG -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm -I/../mesh-bootloader/include -I/../mesh-bootloader/sdk/nRF5_SDK/integration/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/util -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/timer -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/experimental_section_vars -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/delay -I/../mesh-bootloader/sdk/nRF5_SDK/components/libraries/sha256 -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers -I/../mesh-bootloader/sdk/nRF5_SDK/components/softdevice/s132/headers/nrf52 -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -I/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/hal -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/include -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/gcc -I/../mesh-bootloader/sdk/nRF5_SDK/components/toolchain/cmsis/dsp/GCC -I/../mesh-bootloader/sdk/nRF5_SDK/components/boards -o _build/gcc_startup_nrf52.o -c /../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk/gcc_startup_nrf52.S
Linking target: mesh-bootloader.out
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc' --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections --specs=nano.specs -L/../mesh-bootloader/sdk/nRF5_SDK/modules/nrfx/mdk -L/../mesh-bootloader/linker -T/../mesh-bootloader/linker/bootloader_nrf52832_xxAA.ld -Xlinker -Map=_build/mesh-bootloader.map _build/bootloader.o _build/bootloader_app_bridge.o _build/bootloader_info.o _build/bootloader_rtc.o _build/bootloader_util.o _build/dfu_bank.o _build/dfu_mesh.o _build/dfu_transfer_mesh.o _build/dfu_util.o _build/fifo.o _build/main.o _build/mesh_packet.o _build/nrf_flash.o _build/radio_control.o _build/rand.o _build/transport.o _build/uECC.o _build/sha256.o _build/system_nrf52.o _build/gcc_startup_nrf52.o -o _build/mesh-bootloader.out
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -f Makefile -C ./ -e finalize
Preparing: mesh-bootloader.bin
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-objcopy' -O binary _build/mesh-bootloader.out _build/mesh-bootloader.bin
Preparing: mesh-bootloader.hex
'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-objcopy' -O ihex _build/mesh-bootloader.out _build/mesh-bootloader.hex

'/usr/local/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-size' _build/mesh-bootloader.out
text data bss dec hex filename
19116 128 2464 21708 54cc _build/mesh-bootloader.out

Parents
  • Hi Jay, 

    Could you send your make file of the bootloader project ? 

    We had an issue with our spam filter. It's fixed now , now you can edit your question. 

  • i attempted to attach the makefile to the original post, but it didn't seem to work, so here it is:

    PROJECT_NAME := mesh-bootloader
    
    export OUTPUT_FILENAME
    MAKEFILE_NAME := $(MAKEFILE_LIST)
    MAKEFILE_DIR := $(dir $(MAKEFILE_NAME) )
    
    TEMPLATE_PATH = ./sdk/nRF5_SDK/components/toolchain/gcc
    
    include $(TEMPLATE_PATH)/Makefile.common
    
    ifeq ($(OS),Windows_NT)
    include $(TEMPLATE_PATH)/Makefile.windows
    else
    include $(TEMPLATE_PATH)/Makefile.posix
    endif
    
    SDK_ROOT := $(abspath ./sdk/nRF5_SDK)
    PROJ_DIR := $(abspath ./)
    MESH_ROOT := $(abspath ./sdk/MESH_SDK)
    
    #echo suspend
    ifeq ("$(VERBOSE)","1")
    NO_ECHO :=
    else
    NO_ECHO := @
    endif
    
    #function for removing duplicates in a list
    remduplicates = $(strip $(if $1,$(firstword $1) $(call remduplicates,$(filter-out $(firstword $1),$1))))
    
    C_SOURCE_FILES += \
    $(PROJ_DIR)/src/bootloader.c \
    $(PROJ_DIR)/src/bootloader_app_bridge.c \
    $(PROJ_DIR)/src/bootloader_info.c \
    $(PROJ_DIR)/src/bootloader_rtc.c \
    $(PROJ_DIR)/src/bootloader_util.c \
    $(PROJ_DIR)/src/dfu_bank.c \
    $(PROJ_DIR)/src/dfu_mesh.c \
    $(PROJ_DIR)/src/dfu_transfer_mesh.c \
    $(PROJ_DIR)/src/dfu_util.c \
    $(PROJ_DIR)/src/fifo.c \
    $(PROJ_DIR)/src/main.c \
    $(PROJ_DIR)/src/mesh_packet.c \
    $(PROJ_DIR)/src/nrf_flash.c \
    $(PROJ_DIR)/src/radio_control.c \
    $(PROJ_DIR)/src/rand.c \
    $(PROJ_DIR)/src/transport.c \
    $(PROJ_DIR)/src/uECC.c \
    $(SDK_ROOT)/components/libraries/sha256/sha256.c \
    $(SDK_ROOT)/modules/nrfx/mdk/system_nrf52.c
    
    ASM_SOURCE_FILES  = $(SDK_ROOT)/modules/nrfx/mdk/gcc_startup_nrf52.S
    
    INC_PATHS += -I$(PROJ_DIR)/include
    INC_PATHS += -I$(SDK_ROOT)/integration/nrfx
    INC_PATHS += -I$(SDK_ROOT)/components/libraries/util
    INC_PATHS += -I$(SDK_ROOT)/components/libraries/timer
    INC_PATHS += -I$(SDK_ROOT)/components/libraries/experimental_section_vars
    INC_PATHS += -I$(SDK_ROOT)/components/libraries/delay
    INC_PATHS += -I$(SDK_ROOT)/components/libraries/sha256
    INC_PATHS += -I$(SDK_ROOT)/components/softdevice/s132/headers
    INC_PATHS += -I$(SDK_ROOT)/components/softdevice/s132/headers/nrf52
    INC_PATHS += -I$(SDK_ROOT)/modules/nrfx
    INC_PATHS += -I$(SDK_ROOT)/modules/nrfx/mdk
    INC_PATHS += -I$(SDK_ROOT)/modules/nrfx/hal
    INC_PATHS += -I$(SDK_ROOT)/components/toolchain/cmsis/include
    INC_PATHS += -I$(SDK_ROOT)/components/toolchain/gcc
    INC_PATHS += -I$(SDK_ROOT)/components/toolchain/cmsis/dsp/GCC
    INC_PATHS += -I$(SDK_ROOT)/components/boards
    
    OBJECT_DIRECTORY = _build
    LISTING_DIRECTORY = $(OBJECT_DIRECTORY)
    OUTPUT_BINARY_DIRECTORY = $(OBJECT_DIRECTORY)
    
    # Sorting removes duplicates
    BUILD_DIRECTORIES := $(sort $(OBJECT_DIRECTORY) $(OUTPUT_BINARY_DIRECTORY) $(LISTING_DIRECTORY) )
    OUTPUT_DIRECTORY = $(BUILD_DIRECTORIES)
    
    #flags common to all targets
    #CDEFINES = -DBOARD_PCA10040
    CDEFINES = -DBOARD_CUSTOM
    CDEFINES += -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm
    #CDEFINES += -DCONFIG_GPIO_AS_PINRESET
    
    COMFLAGS = --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g
    COMFLAGS += -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16
    
    CFLAGS  = $(COMFLAGS)
    CCFLAGS = $(COMFLAGS)
    
    LD_COMMON_PATH = $(SDK_ROOT)/modules/nrfx/mdk
    LDFLAGS = --std=gnu99 -Wall -Wno-attributes -Wno-format -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -Os -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections --specs=nano.specs
    
    # Assembler flags
    ASMFLAGS = -Os -DNDEBUG -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DBOARD_CUSTOM -DBOOTLOADER -DNORDIC_SDK_VERSION=15 -DNRF52832 -DNRF52832_XXAA -DNRF52_SERIES -DRBC_MESH_PACKET_POOL_SIZE=32 -DuECC_CURVE=uECC_secp256r1 -DuECC_PLATFORM=uECC_arm
    
    
    default: clean mesh-bootloader
    
    all:
    	$(NO_ECHO)"$(MAKE)" -f $(MAKEFILE_NAME) -C $(MAKEFILE_DIR) -e mesh-bootloader
    
    help:
    	@echo following targets are available:
    	@echo 	mesh-bootloader
    
    C_SOURCE_FILE_NAMES = $(notdir $(C_SOURCE_FILES))
    C_PATHS = $(call remduplicates, $(dir $(C_SOURCE_FILES) ) )
    C_OBJECTS = $(addprefix $(OBJECT_DIRECTORY)/, $(C_SOURCE_FILE_NAMES:.c=.o) )
    
    ASM_SOURCE_FILE_NAMES = $(notdir $(ASM_SOURCE_FILES))
    ASM_PATHS = $(call remduplicates, $(dir $(ASM_SOURCE_FILES) ))
    ASM_OBJECTS = $(addprefix $(OBJECT_DIRECTORY)/, $(ASM_SOURCE_FILE_NAMES:.S=.o) )
    
    vpath %.c $(C_PATHS)
    vpath %.S $(ASM_PATHS)
    
    OBJECTS = $(C_OBJECTS) $(ASM_OBJECTS)
    
    LINKER_PATH = $(PROJ_DIR)/linker
    
    mesh-bootloader: OUTPUT_FILENAME := mesh-bootloader
    mesh-bootloader: LINKER_SCRIPT=$(LINKER_PATH)/bootloader_nrf52832_xxAA.ld
    LDFLAGS += -L$(LD_COMMON_PATH) -L$(LINKER_PATH) -T$(LINKER_SCRIPT)
    LDFLAGS += -Xlinker -Map=$(LISTING_DIRECTORY)/$(OUTPUT_FILENAME).map
    
    mesh-bootloader: $(MENU_INCLUDE) $(BUILD_DIRECTORIES) $(OBJECTS)
    	@echo Linking target: $(OUTPUT_FILENAME).out
    	$(NO_ECHO)$(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out
    	$(NO_ECHO)"$(MAKE)" -f $(MAKEFILE_NAME) -C $(MAKEFILE_DIR) -e finalize
    
    ## Create build directories
    $(BUILD_DIRECTORIES):
    	echo $(MAKEFILE_NAME)
    	$(MK) $@
    
    # Create objects from C SRC files
    $(OBJECT_DIRECTORY)/%.o: %.c
    	@echo Compiling file: $(notdir $<)
    	$(NO_ECHO)$(CC) $(CDEFINES) $(INC_PATHS) $(CFLAGS) -o $@ -c $<
    
    # Assemble files
    $(OBJECT_DIRECTORY)/%.o: %.S
    	@echo Assembly file: $(notdir $<)
    	$(NO_ECHO)$(CC) $(ASMFLAGS) $(INC_PATHS) -o $@ -c $<
    # Link
    $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out: $(BUILD_DIRECTORIES) $(OBJECTS)
    	@echo Linking target: $(OUTPUT_FILENAME).out
    	$(NO_ECHO)$(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) -lm -o $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out
    ## Create binary .bin file from the .out file
    $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).bin: $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out
    	@echo Preparing: $(OUTPUT_FILENAME).bin
    	$(NO_ECHO)$(OBJCOPY) -O binary $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).bin
    
    ## Create binary .hex file from the .out file
    $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).hex: $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out
    	@echo Preparing: $(OUTPUT_FILENAME).hex
    	$(NO_ECHO)$(OBJCOPY) -O ihex $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).hex
    
    finalize: genbin genhex echosize
    
    genbin:
    	@echo Preparing: $(OUTPUT_FILENAME).bin
    	$(NO_ECHO)$(OBJCOPY) -O binary $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).bin
    
    ## Create binary .hex file from the .out file
    genhex:
    	@echo Preparing: $(OUTPUT_FILENAME).hex
    	$(NO_ECHO)$(OBJCOPY) -O ihex $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).hex
    echosize:
    	-@echo ''
    	$(NO_ECHO)$(SIZE) $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out
    	-@echo ''
    
    cleanobj:
    	$(RM) $(BUILD_DIRECTORIES)/*.o
    

  • Hi Jay, 

    Thanks for the file. We would be interested to know what you have in your .ld file. 

    There is one thing special about the bootloader is that it requires a dedicated "core ram" section. 

    If you have a look at the .ld files here: 

    https://github.com/NordicPlayground/nRF51-ble-bcast-mesh/tree/develop/DFU/nRF51/bootloader/gcc

    You can find in gcc_bl_nrf52832_xxAA.ld the CORE_BL_RAM section is defined and then used in gcc_bl_nrf52_common.ld . 

    This bootloader was for our old mesh stack (broadcast mesh) but it's almost identical to the bootloader in our newer mesh SDK. 

  • i am using an unmodified linker file from the mesh SDK:

    nrf5_SDK_for_Mesh_v2.1.1_src/mesh/bootloader/linker/bootloader_nrf52832_xxAA.ld

    /* nRF5 SDK for Mesh Bootloader linker script. */
    
    SEARCH_DIR(.)
    GROUP(-lgcc -lc -lnosys)
    MEMORY
    {
        FLASH (rx) :           ORIGIN = 0x78000, LENGTH = 0x6000
        RAM (rw) :             ORIGIN = 0x20000004, LENGTH = 0xfcfc
        CORE_BL_RAM (rw) :     ORIGIN = 0x2000fd00, LENGTH = 0x300
        UICR_BOOTADDR (r) :    ORIGIN = 0x10001014, LENGTH = 0x04
        UICR_MBRPARAMADDR (r): ORIGIN = 0x10001018, LENGTH = 0x04
    }
    
    SECTIONS
    {
        .core_data (NOLOAD) :
        {
            __core_ram_start__ = .;
            . = ALIGN(4);
            *sha256.c.obj (.data*)
            *bootloader_app_bridge.c.obj (.data*)
            *bootloader_info.c.obj (.data*)
            *uECC.c.obj (.data*)
            *dfu_mesh.c.obj (.data*)
            *dfu_transfer_mesh.c.obj (.data*)
            *dfu_bank.c.obj (.data*)
            *dfu_util.c.obj (.data*)
            . = ALIGN(4);
            __core_ram_end__ = .;
        } > CORE_BL_RAM
        .core_bss (NOLOAD) :
        {
            __core_ram_start__ = .;
            . = ALIGN(4);
            *sha256.c.obj (.bss*)
            *bootloader_app_bridge.c.obj (.bss*)
            *bootloader_info.c.obj (.bss*)
            *uECC.c.obj (.bss*)
            *dfu_mesh.c.obj (.bss*)
            *dfu_transfer_mesh.c.obj (.bss*)
            *dfu_bank.c.obj (.bss*)
            *dfu_util.c.obj (.bss*)
            . = ALIGN(4);
            __core_ram_end__ = .;
        } > CORE_BL_RAM
    
        /* Ensures the Bootloader start address in flash is written to UICR when flashing the image. */
        .uicrBootStartAddress :
        {
          KEEP(*(.uicrBootStartAddress))
        } > UICR_BOOTADDR
    
        /* The MBR used for the supported nRF52 SoftDevices expects a pointer to an empty
         * flash page written in the UICR.NRFFW[1] register.
         */
        .uicrBootMBRParamAddress :
        {
          KEEP(*(.uicrBootMBRParamAddress))
        } > UICR_MBRPARAMADDR
    }
    
    INCLUDE "nrf_common.ld"

Reply
  • i am using an unmodified linker file from the mesh SDK:

    nrf5_SDK_for_Mesh_v2.1.1_src/mesh/bootloader/linker/bootloader_nrf52832_xxAA.ld

    /* nRF5 SDK for Mesh Bootloader linker script. */
    
    SEARCH_DIR(.)
    GROUP(-lgcc -lc -lnosys)
    MEMORY
    {
        FLASH (rx) :           ORIGIN = 0x78000, LENGTH = 0x6000
        RAM (rw) :             ORIGIN = 0x20000004, LENGTH = 0xfcfc
        CORE_BL_RAM (rw) :     ORIGIN = 0x2000fd00, LENGTH = 0x300
        UICR_BOOTADDR (r) :    ORIGIN = 0x10001014, LENGTH = 0x04
        UICR_MBRPARAMADDR (r): ORIGIN = 0x10001018, LENGTH = 0x04
    }
    
    SECTIONS
    {
        .core_data (NOLOAD) :
        {
            __core_ram_start__ = .;
            . = ALIGN(4);
            *sha256.c.obj (.data*)
            *bootloader_app_bridge.c.obj (.data*)
            *bootloader_info.c.obj (.data*)
            *uECC.c.obj (.data*)
            *dfu_mesh.c.obj (.data*)
            *dfu_transfer_mesh.c.obj (.data*)
            *dfu_bank.c.obj (.data*)
            *dfu_util.c.obj (.data*)
            . = ALIGN(4);
            __core_ram_end__ = .;
        } > CORE_BL_RAM
        .core_bss (NOLOAD) :
        {
            __core_ram_start__ = .;
            . = ALIGN(4);
            *sha256.c.obj (.bss*)
            *bootloader_app_bridge.c.obj (.bss*)
            *bootloader_info.c.obj (.bss*)
            *uECC.c.obj (.bss*)
            *dfu_mesh.c.obj (.bss*)
            *dfu_transfer_mesh.c.obj (.bss*)
            *dfu_bank.c.obj (.bss*)
            *dfu_util.c.obj (.bss*)
            . = ALIGN(4);
            __core_ram_end__ = .;
        } > CORE_BL_RAM
    
        /* Ensures the Bootloader start address in flash is written to UICR when flashing the image. */
        .uicrBootStartAddress :
        {
          KEEP(*(.uicrBootStartAddress))
        } > UICR_BOOTADDR
    
        /* The MBR used for the supported nRF52 SoftDevices expects a pointer to an empty
         * flash page written in the UICR.NRFFW[1] register.
         */
        .uicrBootMBRParamAddress :
        {
          KEEP(*(.uicrBootMBRParamAddress))
        } > UICR_MBRPARAMADDR
    }
    
    INCLUDE "nrf_common.ld"

Children
Related