Where is the bootloader used by the serial example progect.

Hi Nordic,

I want to use this example to learn bluetooth mesh, but I cannot find the bootloader source code used in this example.

I used vim to view this "serial_nrf52832_xxAA_s132_7_2_0.emProject", but I couldn’t find the bootloader source code.

Can you tell me the bootloader source code of this example?

vim serial_nrf52832_xxAA_s132_7_2_0.emProject

### File content

<!DOCTYPE CrossStudio_Project_File>
<solution Name="serial_nrf52832_xxAA_s132_7.2.0" target="8" version="2">
  <project Name="serial_nrf52832_xxAA_s132_7.2.0">
    <configuration
      Name="Common"
      arm_architecture="v7EM"
      arm_core_type="Cortex-M4"
      arm_endian="Little"
      arm_fp_abi="Hard"
      arm_fpu_type="FPv4-SP-D16"
      arm_linker_heap_size="1024"
      arm_linker_process_stack_size="0"
      arm_linker_stack_size="2048"
      arm_linker_treat_warnings_as_errors="No"
      arm_simulator_memory_simulation_parameter="RWX 00000000,00100000,FFFFFFFF;RWX 20000000,00010000,CDCDCDCD"
      arm_target_device_name="nrf52832_xxAA"
      arm_target_interface_type="SWD"
      c_user_include_directories="include;..;../common/include;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/ble/common;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/softdevice/common;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/libraries/strerror;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/libraries/atomic;../../models/foundation/config/include;../../models/foundation/health/include;../../mesh/stack/api;../../mesh/core/api;../../mesh/core/include;../../mesh/access/api;../../mesh/access/include;../../mesh/dfu/api;../../mesh/dfu/include;../../mesh/prov/api;../../mesh/prov/include;../../mesh/bearer/api;../../mesh/bearer/include;../../mesh/gatt/api;../../mesh/gatt/include;../../mesh/friend/api;../../mesh/friend/include;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/softdevice/s132/headers/;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/softdevice/s132/headers/nrf52/;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/modules/nrfx;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/modules/nrfx/mdk;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/modules/nrfx/hal;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/toolchain/cmsis/include;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/toolchain/gcc;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/toolchain/cmsis/dsp/GCC;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/boards;../../mesh/serial/api;../../mesh/serial/include;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/integration/nrfx;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/libraries/util;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/libraries/timer;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/libraries/log;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/libraries/log/src;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/libraries/experimental_section_vars;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/libraries/delay;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/modules/nrfx/drivers/include;$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/modules/nrfx/drivers;../../external/micro-ecc;../../mesh/core/include;../../external/rtt/include;"
      c_preprocessor_definitions="NO_VTOR_CONFIG;PERSISTENT_STORAGE=0;USE_APP_CONFIG;CONFIG_APP_IN_CORE;NRF52_SERIES;NRF52832;NRF52832_XXAA;S132;SOFTDEVICE_PRESENT;NRF_SD_BLE_API_VERSION=7;BOARD_PCA10040;CONFIG_GPIO_AS_PINRESET"
      debug_target_connection="J-Link"
      
      debug_additional_load_file="$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/softdevice/s132/hex/s132_nrf52_7.2.0_softdevice.hex"
      
      debug_start_from_entry_point_symbol="No"
      linker_output_format="hex"
      linker_printf_width_precision_supported="Yes"
      linker_section_placement_file="$(ProjectDir)/flash_placement.xml"
      linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_PH_SIZE=0x78000;RAM_PH_START=0x20000000;RAM_PH_SIZE=0xf000;FLASH_START=0x26000;RAM_START=0x20002df0"
      linker_section_placements_segments="FLASH RX 0x0 0x78000;RAM1 RWX 0x20000000 0xf000"
      project_directory=""
      macros="CMSIS_CONFIG_TOOL=$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar"
      project_type="Executable" />

    <folder Name="Application">
      <file file_name="src/main.c" />
      <file file_name="../common/src/simple_hal.c" />
      <file file_name="../common/src/mesh_app_utils.c" />
      <file file_name="../common/src/mesh_adv.c" />
      <file file_name="../common/src/ble_softdevice_support.c" />
      <file file_name="../common/src/nrf_mesh_weak.c" />
      <file file_name="../common/src/app_error_weak.c" />
      <file file_name="../common/src/assertion_handler_weak.c" />
      <file file_name="include/sdk_config.h" />
    </folder>
    <folder Name="Core">
      <file file_name="../../mesh/core/src/internal_event.c" />
      <file file_name="../../mesh/core/src/nrf_mesh_configure.c" />
      <file file_name="../../mesh/core/src/aes.c" />
      <file file_name="../../mesh/core/src/msg_cache.c" />
      <file file_name="../../mesh/core/src/transport.c" />
      <file file_name="../../mesh/core/src/event.c" />
      <file file_name="../../mesh/core/src/packet_buffer.c" />
      <file file_name="../../mesh/core/src/flash_manager_defrag.c" />
      <file file_name="../../mesh/core/src/fifo.c" />
      <file file_name="../../mesh/core/src/nrf_flash.c" />
      <file file_name="../../mesh/core/src/net_state.c" />
      <file file_name="../../mesh/core/src/mesh_flash.c" />
      <file file_name="../../mesh/core/src/nrf_mesh_utils.c" />
      <file file_name="../../mesh/core/src/nrf_mesh.c" />
      <file file_name="../../mesh/core/src/queue.c" />
      <file file_name="../../mesh/core/src/hal.c" />
      <file file_name="../../mesh/core/src/aes_cmac.c" />
      <file file_name="../../mesh/core/src/timer_scheduler.c" />
      <file file_name="../../mesh/core/src/timer.c" />
      <file file_name="../../mesh/core/src/long_timer.c" />
      <file file_name="../../mesh/core/src/rand.c" />
      <file file_name="../../mesh/core/src/nrf_mesh_opt.c" />
      <file file_name="../../mesh/core/src/mesh_opt.c" />
      <file file_name="../../mesh/core/src/timeslot.c" />
      <file file_name="../../mesh/core/src/timeslot_timer.c" />
      <file file_name="../../mesh/core/src/bearer_event.c" />
      <file file_name="../../mesh/core/src/enc.c" />
      <file file_name="../../mesh/core/src/network.c" />
      <file file_name="../../mesh/core/src/net_packet.c" />
      <file file_name="../../mesh/core/src/msqueue.c" />
      <file file_name="../../mesh/core/src/nrf_mesh_keygen.c" />
      <file file_name="../../mesh/core/src/cache.c" />
      <file file_name="../../mesh/core/src/list.c" />
      <file file_name="../../mesh/core/src/log.c" />
      <file file_name="../../mesh/core/src/flash_manager.c" />
      <file file_name="../../mesh/core/src/ccm_soft.c" />
      <file file_name="../../mesh/core/src/toolchain.c" />
      <file file_name="../../mesh/core/src/replay_cache.c" />
      <file file_name="../../mesh/core/src/beacon.c" />
      <file file_name="../../mesh/core/src/flash_manager_internal.c" />
      <file file_name="../../mesh/core/src/core_tx.c" />
      <file file_name="../../mesh/core/src/heartbeat.c" />
      <file file_name="../../mesh/core/src/net_beacon.c" />
      <file file_name="../../mesh/core/src/mesh_config.c" />
      <file file_name="../../mesh/core/src/fsm.c" />
      <file file_name="../../mesh/core/src/mesh_config_backend.c" />
      <file file_name="../../mesh/core/src/mesh_config_flashman_glue.c" />
      <file file_name="../../mesh/core/src/lpn.c" />
      <file file_name="../../mesh/core/src/core_tx_lpn.c" />
      <file file_name="../../mesh/core/src/mesh_lpn_subman.c" />
      <file file_name="../../mesh/core/src/core_tx_local.c" />
      <file file_name="../../mesh/core/src/emergency_cache.c" />
      <file file_name="../../mesh/core/src/core_tx_adv.c" />
      <file file_name="../../mesh/core/src/mesh_mem_stdlib.c" />
    </folder>
    <folder Name="Serial">
      <file file_name="../../mesh/serial/src/serial_uart.c" />
      <file file_name="../../mesh/serial/src/serial_bearer.c" />
      <file file_name="../../mesh/serial/src/serial_handler_common.c" />
      <file file_name="../../mesh/serial/src/serial_handler_access.c" />
      <file file_name="../../mesh/serial/src/serial_handler_config.c" />
      <file file_name="../../mesh/serial/src/serial_handler_openmesh.c" />
      <file file_name="../../mesh/serial/src/serial.c" />
      <file file_name="../../mesh/serial/src/serial_handler_prov.c" />
      <file file_name="../../mesh/serial/src/serial_handler_dfu.c" />
      <file file_name="../../mesh/serial/src/serial_handler_mesh.c" />
      <file file_name="../../mesh/serial/src/serial_handler_models.c" />
      <file file_name="../../mesh/serial/src/serial_handler_device.c" />
      <file file_name="../../mesh/serial/src/nrf_mesh_serial.c" />
      <file file_name="../../mesh/serial/src/serial_handler_app.c" />
    </folder>
    <folder Name="DFU">
      <file file_name="../../mesh/dfu/src/nrf_mesh_dfu.c" />
    </folder>
    <folder Name="Mesh stack">
      <file file_name="../../mesh/stack/src/mesh_stack.c" />
    </folder>
    <folder Name="Toolchain">
      <file file_name="$(StudioDir)/source/thumb_crt0.s" />
    </folder>
    <folder Name="Access">
      <file file_name="../../mesh/access/src/access_publish.c" />
      <file file_name="../../mesh/access/src/access_publish_retransmission.c" />
      <file file_name="../../mesh/access/src/access.c" />
      <file file_name="../../mesh/access/src/access_reliable.c" />
      <file file_name="../../mesh/access/src/device_state_manager.c" />
    </folder>
    <folder Name="Bearer">
      <file file_name="../../mesh/bearer/src/ad_listener.c" />
      <file file_name="../../mesh/bearer/src/ad_type_filter.c" />
      <file file_name="../../mesh/bearer/src/adv_packet_filter.c" />
      <file file_name="../../mesh/bearer/src/advertiser.c" />
      <file file_name="../../mesh/bearer/src/bearer_handler.c" />
      <file file_name="../../mesh/bearer/src/broadcast.c" />
      <file file_name="../../mesh/bearer/src/filter_engine.c" />
      <file file_name="../../mesh/bearer/src/gap_address_filter.c" />
      <file file_name="../../mesh/bearer/src/radio_config.c" />
      <file file_name="../../mesh/bearer/src/rssi_filter.c" />
      <file file_name="../../mesh/bearer/src/scanner.c" />
      <file file_name="../../mesh/bearer/src/mesh_pa_lna.c" />
    </folder>
    <folder Name="SEGGER RTT">
      <file file_name="../../external/rtt/src/SEGGER_RTT.c" />
      <file file_name="../../external/rtt/src/SEGGER_RTT_printf.c" />
    </folder>
    <folder Name="uECC">
      <file file_name="../../external/micro-ecc/uECC.c" >
        <configuration
          Name="Common"
          c_preprocessor_definitions="uECC_OPTIMIZATION_LEVEL=2;uECC_SUPPORTS_secp160r1=0;uECC_SUPPORTS_secp192r1=0;uECC_SUPPORTS_secp224r1=0;uECC_SUPPORTS_secp256r1=1;uECC_SUPPORTS_secp256k1=0;uECC_SUPPORT_COMPRESSED_POINT=0"
          gcc_omit_frame_pointer="Yes" />
      </file>
    </folder>
    <folder Name="nRF5 SDK">
      <file file_name="$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/modules/nrfx/drivers/src/nrfx_gpiote.c" />
      <file file_name="$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/libraries/util/app_util_platform.c" />
      <file file_name="$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/ble/common/ble_advdata.c" />
      <file file_name="$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/libraries/experimental_section_vars/nrf_section_iter.c" />
      <file file_name="$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/softdevice/common/nrf_sdh_soc.c" />
      <file file_name="$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/softdevice/common/nrf_sdh_ble.c" />
      <file file_name="$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/softdevice/common/nrf_sdh.c" />
      <file file_name="$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/ble/common/ble_conn_params.c" />
      <file file_name="$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/libraries/atomic/nrf_atomic.c" />
      <file file_name="$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/ble/common/ble_srv_common.c" />
      <file file_name="$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/modules/nrfx/mdk/system_nrf52.c" />
      <file file_name="$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/libraries/util/app_error.c" />
      <file file_name="$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/components/libraries/util/app_error_handler_gcc.c" />
      <file file_name="$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/modules/nrfx/mdk/ses_startup_nrf52.s" />
      <file file_name="$(SDK_ROOT:../../../nRF5_SDK_17.0.2_d674dde)/modules/nrfx/mdk/ses_startup_nrf_common.s" />
    </folder>
    <folder Name="Provisioning">
      <file file_name="../../mesh/prov/src/prov_provisioner.c" />
      <file file_name="../../mesh/prov/src/prov_provisionee.c" />
      <file file_name="../../mesh/prov/src/nrf_mesh_prov.c" />
      <file file_name="../../mesh/prov/src/provisioning.c" />
      <file file_name="../../mesh/prov/src/prov_beacon.c" />
      <file file_name="../../mesh/prov/src/prov_utils.c" />
      <file file_name="../../mesh/prov/src/prov_bearer_adv.c" />
    </folder>
    <folder Name="Configuration Model">
      <file file_name="../../models/foundation/config/src/composition_data.c" />
      <file file_name="../../models/foundation/config/src/config_server.c" />
      <file file_name="../../models/foundation/config/src/packed_index_list.c" />
    </folder>
    <folder Name="Health Model">
      <file file_name="../../models/foundation/health/src/health_server.c" />
    </folder>
    <folder Name="Other">
      <file file_name="../../external/app_timer/app_timer_mesh.c" />
      <file file_name="../../external/app_timer/app_timer_workaround.c" />
    </folder>
    
  </project>
  <configuration Name="Debug"
                 arm_use_builtins="Yes"
                 gcc_debugging_level="Level 3"
                 gcc_omit_frame_pointer="No"
                 gcc_optimization_level="Debug"
                 gcc_entry_point="Reset_Handler"
                 build_intermediate_directory="build/$(ProjectName)_$(Configuration)/obj"
                 build_output_directory="build/$(ProjectName)_$(Configuration)">
  </configuration>
  <configuration Name="ReleaseWithDebugInformation"
                 arm_use_builtins="Yes"
                 gcc_debugging_level="Level 3"
                 gcc_omit_frame_pointer="Yes"
                 gcc_optimization_level="Optimize For Size"
                 gcc_entry_point="Reset_Handler"
                 build_intermediate_directory="build/$(ProjectName)_$(Configuration)/obj"
                 build_output_directory="build/$(ProjectName)_$(Configuration)">
  </configuration>
  <configuration Name="Release"
                 arm_use_builtins="Yes"
                 gcc_debugging_level="None"
                 gcc_omit_frame_pointer="Yes"
                 gcc_optimization_level="Optimize For Size"
                 gcc_entry_point="Reset_Handler"
                 build_intermediate_directory="build/$(ProjectName)_$(Configuration)/obj"
                 build_output_directory="build/$(ProjectName)_$(Configuration)">
  </configuration>
</solution>

Thanks in advance.

Leo.

Parents
  • Hey Leo!

    You don't have to use a bootloader to use this example, though for the DFU reasons the mesh bootloader can be found in MeshSDK/examples/dfu/. For more info see here.

    Best regards,

    Elfving

  • Hi Elfving

    Thank you for your reply!

    Q1- Do you mean that this example does not have a bootloader FW? Only softdevice FW and application FW are needed?

     

    Q2- So I used the "Interactive PyACI script" to send the "Direct Firmware Upgrade Jump To Bootloader" command. The device only reboots, but does not jump to bootloader mode, because this example does not have a bootloader FW? Right?

    Like the instructions on the file

    =========================================================================================== 

    The following is the actual practice of my Q2 question.

     

    Here I used this example and changed some things.

    First I added "nrf_mesh_dfu.c" to the project.

    Below is the content of "serial_nrf52832_xxAA_s132_7_2_0.emProject"

    And the function nrf_mesh_dfu_jump_to_bootloader has been changed so that when I give instructions, the code that jumps to bootloader mode will be executed.

    Because I think that to use the nrfutil tool to update the FW through the serial interface, the nrf52832 module must be in DFU mode. So I tried to let nrf52832 enter the DFU mode.

    I entered the command, but the device only reboots, but does not enter the bootloader mode.

    Thanks in advance.

    Leo.

Reply
  • Hi Elfving

    Thank you for your reply!

    Q1- Do you mean that this example does not have a bootloader FW? Only softdevice FW and application FW are needed?

     

    Q2- So I used the "Interactive PyACI script" to send the "Direct Firmware Upgrade Jump To Bootloader" command. The device only reboots, but does not jump to bootloader mode, because this example does not have a bootloader FW? Right?

    Like the instructions on the file

    =========================================================================================== 

    The following is the actual practice of my Q2 question.

     

    Here I used this example and changed some things.

    First I added "nrf_mesh_dfu.c" to the project.

    Below is the content of "serial_nrf52832_xxAA_s132_7_2_0.emProject"

    And the function nrf_mesh_dfu_jump_to_bootloader has been changed so that when I give instructions, the code that jumps to bootloader mode will be executed.

    Because I think that to use the nrfutil tool to update the FW through the serial interface, the nrf52832 module must be in DFU mode. So I tried to let nrf52832 enter the DFU mode.

    I entered the command, but the device only reboots, but does not enter the bootloader mode.

    Thanks in advance.

    Leo.

Children
No Data
Related