Porting project from NRF52833 to NRF52832

Hi All,

I am trying to port my current SES project (s140) from nrf52833 to nrf52832. My nrf52832 is spec'd at 512kb flash and 64kb RAM. Any help would be much appreciated.

Thanks

Regards

  • Hi

    The nRF523832 does not support the S140 SoftDevice (see the compatibility matrix here), and it's recommended you switch to the S132, as the S140 takes a lot more space and includes some features the nRF52832 doesn't support. 

    We don't have a specific transfer guide from nRF52833 to nRF52833, but you can check out the Transferring a project to nRF52820 hardware and switch out the mentions of nRF52820 with nRF52832, and match the RAM and Flash memory sizes to match the nRF52832 specs.

    Best regards,

    Simon

  • and it's recommended you switch to the S132, as the S140 takes a lot more space and includes some features the nRF52832 doesn't support. 

    So I am not completely sure how to migrate from S140 to S132. I used the following process.

    1. Under solutions -> project -> right click -> options -> set configurations to common -> preprocessor ->user include directories -> changed from the following:

    ../nRF5_SDK_16/components/softdevice/s140/headers
    ../nRF5_SDK_16/components/softdevice/s140/headers/nrf52

    to the following:

    ../nRF5_SDK_16/components/softdevice/s132/headers
    ../nRF5_SDK_16/components/softdevice/s132/headers/nrf52

    will this help? if not what other steps I should be following?

    I did the following changes to make sure the RAM and flash size are correct. As I am moving from nrf52833 to nrf52832.

    Modified the following:

    Changed the following to s132

    Preprocessor definitions:

    I am still getting the following error:

    Here is the emProject file

    <!DOCTYPE CrossStudio_Project_File>
    <solution Name="ble_app_s140" target="8" version="2">
      <project Name="ble_app_s140">
        <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="8192"
          arm_linker_process_stack_size="0"
          arm_linker_stack_size="8192"
          arm_linker_treat_warnings_as_errors="No"
          arm_simulator_memory_simulation_parameter="RX 00000000,00080000,FFFFFFFF;RWX 20000000,00010000,CDCDCDCD"
          arm_target_device_name="nRF52832_xxAA"
          arm_target_interface_type="SWD"
          c_preprocessor_definitions="ARM_MATH_CM4;CONFIG_GPIO_AS_PINRESET;FLOAT_ABI_HARD;INITIALIZE_USER_SECTIONS;NO_VTOR_CONFIG;NRF52832_XXAA;SOFTDEVICE_PRESENT;NRF_SD_BLE_API_VERSION=7;S132;CONFIG_NFCT_PINS_AS_GPIOS;NRF52_PAN_74;APP_TIMER_V2;APP_TIMER_V2_RTC1_ENABLED;BOARD_PCA10100;DEVELOP_IN_NRF52832"
          c_user_include_directories="$(SolutionDir);../3rd_party/nRF5_SDK_16/components;../3rd_party/nRF5_SDK_16/components/ble/ble_advertising;../3rd_party/nRF5_SDK_16/components/ble/ble_dtm;../3rd_party/nRF5_SDK_16/components/ble/ble_link_ctx_manager;../3rd_party/nRF5_SDK_16/components/ble/ble_racp;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_ancs_c;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_ans_c;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_bas;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_bas_c;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_cscs;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_cts_c;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_dfu;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_dis;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_gls;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_hids;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_hrs;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_hrs_c;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_hts;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_ias;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_ias_c;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_lbs;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_lbs_c;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_lls;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_nus;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_nus_c;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_rscs;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_rscs_c;../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_tps;../3rd_party/nRF5_SDK_16/components/ble/common;../3rd_party/nRF5_SDK_16/components/ble/nrf_ble_gatt;../3rd_party/nRF5_SDK_16/components/ble/nrf_ble_qwr;../3rd_party/nRF5_SDK_16/components/ble/peer_manager;../3rd_party/nRF5_SDK_16/components/boards;../3rd_party/nRF5_SDK_16/components/libraries/atomic;../3rd_party/nRF5_SDK_16/components/libraries/atomic_fifo;../3rd_party/nRF5_SDK_16/components/libraries/atomic_flags;../3rd_party/nRF5_SDK_16/components/libraries/balloc;../3rd_party/nRF5_SDK_16/components/libraries/bootloader/ble_dfu;../3rd_party/nRF5_SDK_16/components/libraries/bsp;../3rd_party/nRF5_SDK_16/components/libraries/button;../3rd_party/nRF5_SDK_16/components/libraries/cli;../3rd_party/nRF5_SDK_16/components/libraries/crc16;../3rd_party/nRF5_SDK_16/components/libraries/crc32;../3rd_party/nRF5_SDK_16/components/libraries/crypto;../3rd_party/nRF5_SDK_16/components/libraries/csense;../3rd_party/nRF5_SDK_16/components/libraries/csense_drv;../3rd_party/nRF5_SDK_16/components/libraries/delay;../3rd_party/nRF5_SDK_16/components/libraries/ecc;../3rd_party/nRF5_SDK_16/components/libraries/experimental_section_vars;../3rd_party/nRF5_SDK_16/components/libraries/experimental_task_manager;../3rd_party/nRF5_SDK_16/components/libraries/fds;../3rd_party/nRF5_SDK_16/components/libraries/fifo;../3rd_party/nRF5_SDK_16/components/libraries/fstorage;../3rd_party/nRF5_SDK_16/components/libraries/gfx;../3rd_party/nRF5_SDK_16/components/libraries/gpiote;../3rd_party/nRF5_SDK_16/components/libraries/hardfault;../3rd_party/nRF5_SDK_16/components/libraries/hci;../3rd_party/nRF5_SDK_16/components/libraries/led_softblink;../3rd_party/nRF5_SDK_16/components/libraries/log;../3rd_party/nRF5_SDK_16/components/libraries/log/src;../3rd_party/nRF5_SDK_16/components/libraries/low_power_pwm;../3rd_party/nRF5_SDK_16/components/libraries/mem_manager;../3rd_party/nRF5_SDK_16/components/libraries/memobj;../3rd_party/nRF5_SDK_16/components/libraries/mpu;../3rd_party/nRF5_SDK_16/components/libraries/mutex;../3rd_party/nRF5_SDK_16/components/libraries/pwm;../3rd_party/nRF5_SDK_16/components/libraries/pwr_mgmt;../3rd_party/nRF5_SDK_16/components/libraries/queue;../3rd_party/nRF5_SDK_16/components/libraries/ringbuf;../3rd_party/nRF5_SDK_16/components/libraries/scheduler;../3rd_party/nRF5_SDK_16/components/libraries/sdcard;../3rd_party/nRF5_SDK_16/components/libraries/slip;../3rd_party/nRF5_SDK_16/components/libraries/sortlist;../3rd_party/nRF5_SDK_16/components/libraries/spi_mngr;../3rd_party/nRF5_SDK_16/components/libraries/stack_guard;../3rd_party/nRF5_SDK_16/components/libraries/strerror;../3rd_party/nRF5_SDK_16/components/libraries/svc;../3rd_party/nRF5_SDK_16/components/libraries/timer;../3rd_party/nRF5_SDK_16/components/libraries/twi_mngr;../3rd_party/nRF5_SDK_16/components/libraries/twi_sensor;../3rd_party/nRF5_SDK_16/components/libraries/uart;../3rd_party/nRF5_SDK_16/components/libraries/usbd;../3rd_party/nRF5_SDK_16/components/libraries/usbd/class/audio;../3rd_party/nRF5_SDK_16/components/libraries/usbd/class/cdc;../3rd_party/nRF5_SDK_16/components/libraries/usbd/class/cdc/acm;../3rd_party/nRF5_SDK_16/components/libraries/usbd/class/hid;../3rd_party/nRF5_SDK_16/components/libraries/usbd/class/hid/generic;../3rd_party/nRF5_SDK_16/components/libraries/usbd/class/hid/kbd;../3rd_party/nRF5_SDK_16/components/libraries/usbd/class/hid/mouse;../3rd_party/nRF5_SDK_16/components/libraries/usbd/class/msc;../3rd_party/nRF5_SDK_16/components/libraries/util;../3rd_party/nRF5_SDK_16/components/nfc/ndef/conn_hand_parser;../3rd_party/nRF5_SDK_16/components/nfc/ndef/conn_hand_parser/ac_rec_parser;../3rd_party/nRF5_SDK_16/components/nfc/ndef/conn_hand_parser/ble_oob_advdata_parser;../3rd_party/nRF5_SDK_16/components/nfc/ndef/conn_hand_parser/le_oob_rec_parser;../3rd_party/nRF5_SDK_16/components/nfc/ndef/connection_handover/ac_rec;../3rd_party/nRF5_SDK_16/components/nfc/ndef/connection_handover/ble_oob_advdata;../3rd_party/nRF5_SDK_16/components/nfc/ndef/connection_handover/ble_pair_lib;../3rd_party/nRF5_SDK_16/components/nfc/ndef/connection_handover/ble_pair_msg;../3rd_party/nRF5_SDK_16/components/nfc/ndef/connection_handover/common;../3rd_party/nRF5_SDK_16/components/nfc/ndef/connection_handover/ep_oob_rec;../3rd_party/nRF5_SDK_16/components/nfc/ndef/connection_handover/hs_rec;../3rd_party/nRF5_SDK_16/components/nfc/ndef/connection_handover/le_oob_rec;../3rd_party/nRF5_SDK_16/components/nfc/ndef/generic/message;../3rd_party/nRF5_SDK_16/components/nfc/ndef/generic/record;../3rd_party/nRF5_SDK_16/components/nfc/ndef/launchapp;../3rd_party/nRF5_SDK_16/components/nfc/ndef/parser/message;../3rd_party/nRF5_SDK_16/components/nfc/ndef/parser/record;../3rd_party/nRF5_SDK_16/components/nfc/ndef/text;../3rd_party/nRF5_SDK_16/components/nfc/ndef/uri;../3rd_party/nRF5_SDK_16/components/nfc/platform;../3rd_party/nRF5_SDK_16/components/nfc/t2t_lib;../3rd_party/nRF5_SDK_16/components/nfc/t2t_parser;../3rd_party/nRF5_SDK_16/components/nfc/t4t_lib;../3rd_party/nRF5_SDK_16/components/nfc/t4t_parser/apdu;../3rd_party/nRF5_SDK_16/components/nfc/t4t_parser/cc_file;../3rd_party/nRF5_SDK_16/components/nfc/t4t_parser/hl_detection_procedure;../3rd_party/nRF5_SDK_16/components/nfc/t4t_parser/tlv;../3rd_party/nRF5_SDK_16/components/softdevice/common;../3rd_party/nRF5_SDK_16/components/softdevice/s132/headers;../3rd_party/nRF5_SDK_16/components/softdevice/s132/headers/nrf52;../3rd_party/nRF5_SDK_16/components/toolchain/cmsis/include;../3rd_party/nRF5_SDK_16/external/fprintf;../3rd_party/nRF5_SDK_16/external/segger_rtt;../3rd_party/nRF5_SDK_16/external/utf_converter;../3rd_party/nRF5_SDK_16/integration/nrfx;../3rd_party/nRF5_SDK_16/integration/nrfx/legacy;../3rd_party/nRF5_SDK_16/modules/nrfx;../3rd_party/nRF5_SDK_16/modules/nrfx/drivers/include;../3rd_party/nRF5_SDK_16/modules/nrfx/hal;../3rd_party/nRF5_SDK_16/modules/nrfx/mdk;../sx1261"
          debug_additional_load_file="../3rd_party/nRF5_SDK_16/components/softdevice/s132/hex/s132_nrf52_7.0.1_softdevice.hex"
          debug_register_definition_file="../3rd_party/nRF5_SDK_16/modules/nrfx/mdk/nrf52.svd"
          debug_start_from_entry_point_symbol="No"
          debug_target_connection="J-Link"
          gcc_cplusplus_language_standard="c++11"
          gcc_debugging_level="Level 3"
          gcc_entry_point="Reset_Handler"
          linker_output_format="hex"
          linker_printf_fmt_level="long"
          linker_printf_width_precision_supported="Yes"
          linker_section_placement_file="flash_placement.xml"
          linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_PH_SIZE=0x80000;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x10000;FLASH_START=0x0;FLASH_SIZE=0x80000;RAM_START=0x20000000;RAM_SIZE=0x10000"
          linker_section_placements_segments="FLASH1 RX 0x00000000 0x00080000;RAM1 RWX 0x20000000 0x00010000"
          macros="CMSIS_CONFIG_TOOL=../3rd_party/nRF5_SDK_16/external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar"
          project_directory=""
          project_type="Executable" />
        <folder Name="Segger Startup Files">
          <file file_name="$(StudioDir)/source/thumb_crt0.s" />
        </folder>
        <folder Name="nRF_Log">
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/log/src/nrf_log_backend_rtt.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/log/src/nrf_log_backend_serial.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/log/src/nrf_log_default_backends.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/log/src/nrf_log_frontend.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/log/src/nrf_log_str_formatter.c" />
        </folder>
        <folder Name="nRF_Libraries">
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/button/app_button.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/util/app_error.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/util/app_error_handler_gcc.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/util/app_error_weak.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/fifo/app_fifo.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/scheduler/app_scheduler.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/timer/app_timer2.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/uart/app_uart_fifo.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/util/app_util_platform.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/timer/drv_rtc.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/hardfault/hardfault_implementation.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/util/nrf_assert.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/atomic_fifo/nrf_atfifo.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/atomic_flags/nrf_atflags.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/atomic/nrf_atomic.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/balloc/nrf_balloc.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/external/fprintf/nrf_fprintf.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/external/fprintf/nrf_fprintf_format.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/memobj/nrf_memobj.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/pwr_mgmt/nrf_pwr_mgmt.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/ringbuf/nrf_ringbuf.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/experimental_section_vars/nrf_section_iter.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/sortlist/nrf_sortlist.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/libraries/strerror/nrf_strerror.c" />
        </folder>
        <folder Name="None">
          <file file_name="../3rd_party/nRF5_SDK_16/modules/nrfx/mdk/ses_startup_nrf_common.s" />
          <file file_name="../3rd_party/nRF5_SDK_16/modules/nrfx/mdk/system_nrf52.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/modules/nrfx/mdk/ses_startup_nrf52.s" />
        </folder>
        <folder Name="Board Definition">
          <file file_name="../3rd_party/nRF5_SDK_16/components/boards/boards.c" />
        </folder>
        <folder Name="nRF_Drivers">
          <file file_name="../3rd_party/nRF5_SDK_16/integration/nrfx/legacy/nrf_drv_clock.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/integration/nrfx/legacy/nrf_drv_spi.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/integration/nrfx/legacy/nrf_drv_uart.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/modules/nrfx/soc/nrfx_atomic.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/modules/nrfx/drivers/src/nrfx_clock.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/modules/nrfx/drivers/src/nrfx_gpiote.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/modules/nrfx/drivers/src/prs/nrfx_prs.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/modules/nrfx/drivers/src/nrfx_spi.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/modules/nrfx/drivers/src/nrfx_spim.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/modules/nrfx/drivers/src/nrfx_uart.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/modules/nrfx/drivers/src/nrfx_uarte.c" />
        </folder>
        <folder Name="Application">
          <file file_name="main.cpp" />
        </folder>
        <folder Name="nRF_Segger_RTT">
          <file file_name="../3rd_party/nRF5_SDK_16/external/segger_rtt/SEGGER_RTT.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/external/segger_rtt/SEGGER_RTT_Syscalls_SES.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/external/segger_rtt/SEGGER_RTT_printf.c" />
        </folder>
        <folder Name="nRF_BLE">
          <file file_name="../3rd_party/nRF5_SDK_16/components/ble/common/ble_advdata.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/ble/ble_advertising/ble_advertising.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/ble/common/ble_conn_params.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/ble/common/ble_conn_state.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/ble/ble_link_ctx_manager/ble_link_ctx_manager.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/ble/common/ble_srv_common.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/ble/nrf_ble_gatt/nrf_ble_gatt.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/ble/nrf_ble_qwr/nrf_ble_qwr.c" />
        </folder>
        <folder Name="UTF8/UTF16 converter">
          <file file_name="../3rd_party/nRF5_SDK_16/external/utf_converter/utf.c" />
        </folder>
        <folder Name="nRF_BLE_Services">
          <file file_name="../3rd_party/nRF5_SDK_16/components/ble/ble_services/ble_nus/ble_nus.c" />
        </folder>
        <folder Name="nRF_SoftDevice">
          <file file_name="../3rd_party/nRF5_SDK_16/components/softdevice/common/nrf_sdh.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/softdevice/common/nrf_sdh_ble.c" />
          <file file_name="../3rd_party/nRF5_SDK_16/components/softdevice/common/nrf_sdh_soc.c" />
        </folder>
        <folder Name="Radio">
          <file file_name="../sx1261/RH_SX126x.cpp" />
        </folder>
      </project>
      <configuration
        Name="Release"
        c_preprocessor_definitions="NDEBUG"
        gcc_optimization_level="Optimize For Size" />
      <configuration
        Name="Debug"
        c_preprocessor_definitions="DEBUG; DEBUG_NRF"
        gcc_optimization_level="None" />
      <configuration
        Name="Common"
        build_intermediate_directory="Output/$(Configuration)/"
        build_output_directory="Output/$(Configuration)/" />
    </solution>
    

    Your help will be much appreciated.

    Thanks

  • Hi

    The section placement macros does not look correct I'm afraid. When building a project with a SoftDevice, the RAM and FLASH start addresses will need to be set to the end of the SoftDevice region, and the RAM/Flash size needs to be set to RAM/Flash PH size - RAM/Flash start. It should look like this for an nRF52832 project with the S132 SoftDevice.

    We also have a guide explaining this in detail that you might find helpful here.

    Best regards,

    Simon

  • Hi Simon,

    Thanks for the quick reply. I tried to use the mentioned RAM and FLASH size and I seem to get the same error. Is there something other I can do to solve the issue. 

    Regards

  • Hi

    Okay, by how much do the "UNPLACED_SECTIONS" overflow by after setting these settings now, the same number? Since the issue is seen in the compiler phase there must be something wrong in your projects flash_placement.xml file. Can you open it and check that the Flash and RAM sizes match the nRF52832, and check that the FLASH name matches what is set in your Memory segments. If not, make sure they are both called either FLASH or FLASH1.

    Best regards,
    Simon

Related