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" />
Parents
  • The flash_placement file you attached above doesn't reserve space for the Softdevice (.reserved_flash) It also doesn't place many of the sections defined in nrf5_SDK_for_Mesh_v1.0.0_src/examples/light_switch/server/linker/nrf52832_xxAA_s132_5.0.0.ld Don't these name spaces need to match? (e.g. .cli_sorted_cmd_ptrs and .sdh_stack_observers)

    Finally when using the file you sent, it isn't clear to me where usage of .text2 and .data2 is defined. I do see the thumb_crt0.s file can initialize these secondary sections.

    I also took my queue from the Getting Started->Coexistance with other SDK documentation that suggests moving mesh stuff into SDK (14.2) example directory, rather than the reverse.

    In general, in the SDK 14.2, each example has a dedicated flash_placement.xml file that is co-located in same directory as the .emProject file. The Mesh SDK appears to be missing all this configuration-related info apart from looking inside the .ld file. Or am I missing something major about how the different parts hang together when Mesh stack is used?

    I get the same "invalid ASCII.." error when click Target->Download light_switch.

Reply
  • The flash_placement file you attached above doesn't reserve space for the Softdevice (.reserved_flash) It also doesn't place many of the sections defined in nrf5_SDK_for_Mesh_v1.0.0_src/examples/light_switch/server/linker/nrf52832_xxAA_s132_5.0.0.ld Don't these name spaces need to match? (e.g. .cli_sorted_cmd_ptrs and .sdh_stack_observers)

    Finally when using the file you sent, it isn't clear to me where usage of .text2 and .data2 is defined. I do see the thumb_crt0.s file can initialize these secondary sections.

    I also took my queue from the Getting Started->Coexistance with other SDK documentation that suggests moving mesh stuff into SDK (14.2) example directory, rather than the reverse.

    In general, in the SDK 14.2, each example has a dedicated flash_placement.xml file that is co-located in same directory as the .emProject file. The Mesh SDK appears to be missing all this configuration-related info apart from looking inside the .ld file. Or am I missing something major about how the different parts hang together when Mesh stack is used?

    I get the same "invalid ASCII.." error when click Target->Download light_switch.

Children
No Data
Related