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

SDK for Mesh v1.0.0 with SES "invalid ASCII encoded byte:line 1"

I am trying to build and debug the Mesh v1.0.0 light-switch server example and getting a cryptic error when launching the debug.

My environment is Segger v3.30 on macOS. I picked up the SES .emProject and flash_placement.xml files from the examples/light_switch/server directory, but had to make several changes to the .emProject file.

When building I get a warning "cannot find entry symbol Reset_handler: defaulting to ..." but the build completes. When I thereafter initiate Debug>Go, the Output view shows "Preparing target for download" is completed and then there is a Segger GUI popup "invalid ASCII encoded byte:line 1"

Any suggestions on how to proceed would be welcome.

The top of my .emProject file shows the value of the 'linker_section_placement_macros', where the values were picked up from the .ld file in ..examples/light_switch/server/linker/nrf52832_xxAA_s132_5.0.0.ld

<!DOCTYPE CrossStudio_Project_File> <solution   Name="light_switch_server_nrf52832_xxAA_s132_5.0.0" target="8"   version="2">   <project Name="light_switch_server_nrf52832_xxAA_s132_5.0.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_preprocessor_definitions="NO_VTOR_CONFIG;NRF52;NRF52_SERIES;NRF52832;NRF52832_XXAA;S132;SOFTDEVICE_PRESENT;SD_BLE_API_VERSION=5;NRF_SD_BLE_API_VERSION=5;BOARD_PCA10040;CONFIG_GPIO_AS_PINRESET"
      c_user_include_directories="include;../include;../..;../../common/include;../../../external/nRF5_SDK_14.2.0_17b948a/components/drivers_nrf/delay;../../../models/simple_on_off/include;../../../models/config/include;../../../models/health/include;../../../mesh/access/api;../../../mesh/access/include;../../../mesh/prov/api;../../../mesh/prov/include;../../../external/nRF5_SDK_14.2.0_17b948a/components/boards;../../../external/nRF5_SDK_14.2.0_17b948a/components/drivers_nrf/hal;../../../external/nRF5_SDK_14.2.0_17b948a/components/libraries/util;../../../external/softdevice/s132_5.0.0/s132_nrf52_5.0.0_API/include;../../../external/softdevice/s132_5.0.0/s132_nrf52_5.0.0_API/include/nrf52;../../../mesh/core/api;../../../external/nRF5_SDK_14.2.0_17b948a/components/device;../../../external/nRF5_SDK_14.2.0_17b948a/components/toolchain;../../../external/nRF5_SDK_14.2.0_17b948a/components/toolchain/cmsis/include;../../../external/nRF5_SDK_14.2.0_17b948a/components/toolchain/gcc;../../../external/nRF5_SDK_14.2.0_17b948a/components/toolchain/dsp/GCC;../../../external/rtt/include;../../../mesh/core/include;../../../mesh/dfu/api;../../../mesh/dfu/include;../../../mesh/prov/api;../../../mesh/prov/include;../../../mesh/bearer/api;../../../mesh/bearer/include;../../../external/micro-ecc;../../../mesh/core/include;"
      debug_additional_load_file="$(ProjectDir)/../../../external/softdevice/s132_5.0.0/s132_nrf52_5.0.0_softdevice.hex"
      debug_start_from_entry_point_symbol="No"
      debug_target_connection="J-Link"
      linker_output_format="hex"
      linker_printf_width_precision_supported="No"
      linker_section_placement_file=""
      linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_START=0x23000;FLASH_SIZE=0x55000;FLASH_PH_SIZE=0x80000;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x10000;RAM_START=0x200031b0;RAM_SIZE=0xcb50"
      linker_section_placements_segments="FLASH RX 0x00000000 0x78000;RAM RWX 0x20000000 0xf000"
      project_directory=""
      project_type="Executable" />
    <folder Name="Application">
      <file file_name="src/main.c" />
      <file file_name="../../nrf_mesh_sdk.c" />
  • Thanks for help. I was able to build/debug the project using the .emProject file shipped with Mesh SDK. For benefit of others: My .emProject file had incorrect values for the FLASH_SIZE and RAM_SIZE defines in the linker_section_placement_macros variable. The flash_placement.xml linked above is identical to the one shipped with Segger 3.30. (I was able to use the one from SDK14.2 as well - the gnu linker ld won't create sections in the output file unless there is at least one matching section in an input file.) Segger docs explain it generates its own .ld files based on session placement files/directives, so this explains why the .ld files shipped with SDK aren't used when building with Segger. When looking at Segger Memory view, will see hole in Flash before 0x23000, ie no .reserved_flash as with SDK14.2 examples. On debug, if Softdevice is missing, Segger downloads it in the front.

Related