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

Porting from nRF52832 to nRF52810

Hi Nordic Support

I have been working to port a blinky variant project and have found previous threads useful for guidance. I'm working with Segger Embedded Studio and have made the following modifications to the .emProject file....

Also deleted refs to NRF52 & NRF52XXAA in the pre-processor defs...

<!DOCTYPE CrossStudio_Project_File>
<solution Name="ble_app_blinky_pca10040_s132" target="8" version="2">
<project Name="ble_app_blinky_pca10040_s132">
<configuration
Name="Common"
arm_architecture="v7EM"
arm_core_type="Cortex-M4"
arm_endian="Little"
arm_fp_abi="Soft"
arm_fpu_type="FPv4-SP-D16"
arm_linker_heap_size="2048"
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="nRF52810_xxAA"
arm_target_interface_type="SWD"
c_preprocessor_definitions="BOARD_PCA10040;CONFIG_GPIO_AS_PINRESET;FLOAT_ABI_SOFT;INITIALIZE_USER_SECTIONS;NO_VTOR_CONFIG;NRF52810_XXAA;NRF52_PAN_74;NRF_SD_BLE_API_VERSION=6;S132;SOFTDEVICE_PRESENT;SWI_DISABLE0;"
c_user_include_directories="../../../config;../../../../../../components;../../../../../../components/ble/ble_advertising;../../../../../../components/ble/ble_dtm;../../../../../../components/ble/ble_racp;../../../../../../components/ble/ble_services/ble_ancs_c;../../../../../../components/ble/ble_services/ble_ans_c;../../../../../../components/ble/ble_services/ble_bas;../../../../../../components/ble/ble_services/ble_bas_c;../../../../../../components/ble/ble_services/ble_cscs;../../../../../../components/ble/ble_services/ble_cts_c;../../../../../../components/ble/ble_services/ble_dfu;../../../../../../components/ble/ble_services/ble_dis;../../../../../../components/ble/ble_services/ble_gls;../../../../../../components/ble/ble_services/ble_hids;../../../../../../components/ble/ble_services/ble_hrs;../../../../../../components/ble/ble_services/ble_hrs_c;../../../../../../components/ble/ble_services/ble_hts;../../../../../../components/ble/ble_services/ble_ias;../../../../../../components/ble/ble_services/ble_ias_c;../../../../../../components/ble/ble_services/ble_lbs;../../../../../../components/ble/ble_services/ble_lbs_c;../../../../../../components/ble/ble_services/ble_lls;../../../../../../components/ble/ble_services/ble_nus;../../../../../../components/ble/ble_services/ble_nus_c;../../../../../../components/ble/ble_services/ble_rscs;../../../../../../components/ble/ble_services/ble_rscs_c;../../../../../../components/ble/ble_services/ble_tps;../../../../../../components/ble/common;../../../../../../components/ble/nrf_ble_gatt;../../../../../../components/ble/nrf_ble_qwr;../../../../../../components/ble/peer_manager;../../../../../../components/boards;../../../../../../components/drivers_nrf/usbd;../../../../../../components/libraries/atomic;../../../../../../components/libraries/atomic_fifo;../../../../../../components/libraries/atomic_flags;../../../../../../components/libraries/balloc;../../../../../../components/libraries/bootloader/ble_dfu;../../../../../../components/libraries/button;../../../../../../components/libraries/cli;../../../../../../components/libraries/crc16;../../../../../../components/libraries/crc32;../../../../../../components/libraries/crypto;../../../../../../components/libraries/csense;../../../../../../components/libraries/csense_drv;../../../../../../components/libraries/delay;../../../../../../components/libraries/ecc;../../../../../../components/libraries/experimental_section_vars;../../../../../../components/libraries/experimental_task_manager;../../../../../../components/libraries/fds;../../../../../../components/libraries/fstorage;../../../../../../components/libraries/gfx;../../../../../../components/libraries/gpiote;../../../../../../components/libraries/hardfault;../../../../../../components/libraries/hci;../../../../../../components/libraries/led_softblink;../../../../../../components/libraries/log;../../../../../../components/libraries/log/src;../../../../../../components/libraries/low_power_pwm;../../../../../../components/libraries/mem_manager;../../../../../../components/libraries/memobj;../../../../../../components/libraries/mpu;../../../../../../components/libraries/mutex;../../../../../../components/libraries/pwm;../../../../../../components/libraries/pwr_mgmt;../../../../../../components/libraries/queue;../../../../../../components/libraries/ringbuf;../../../../../../components/libraries/scheduler;../../../../../../components/libraries/sdcard;../../../../../../components/libraries/slip;../../../../../../components/libraries/sortlist;../../../../../../components/libraries/spi_mngr;../../../../../../components/libraries/stack_guard;../../../../../../components/libraries/strerror;../../../../../../components/libraries/svc;../../../../../../components/libraries/timer;../../../../../../components/libraries/twi_mngr;../../../../../../components/libraries/twi_sensor;../../../../../../components/libraries/usbd;../../../../../../components/libraries/usbd/class/audio;../../../../../../components/libraries/usbd/class/cdc;../../../../../../components/libraries/usbd/class/cdc/acm;../../../../../../components/libraries/usbd/class/hid;../../../../../../components/libraries/usbd/class/hid/generic;../../../../../../components/libraries/usbd/class/hid/kbd;../../../../../../components/libraries/usbd/class/hid/mouse;../../../../../../components/libraries/usbd/class/msc;../../../../../../components/libraries/util;../../../../../../components/nfc/ndef/conn_hand_parser;../../../../../../components/nfc/ndef/conn_hand_parser/ac_rec_parser;../../../../../../components/nfc/ndef/conn_hand_parser/ble_oob_advdata_parser;../../../../../../components/nfc/ndef/conn_hand_parser/le_oob_rec_parser;../../../../../../components/nfc/ndef/connection_handover/ac_rec;../../../../../../components/nfc/ndef/connection_handover/ble_oob_advdata;../../../../../../components/nfc/ndef/connection_handover/ble_pair_lib;../../../../../../components/nfc/ndef/connection_handover/ble_pair_msg;../../../../../../components/nfc/ndef/connection_handover/common;../../../../../../components/nfc/ndef/connection_handover/ep_oob_rec;../../../../../../components/nfc/ndef/connection_handover/hs_rec;../../../../../../components/nfc/ndef/connection_handover/le_oob_rec;../../../../../../components/nfc/ndef/generic/message;../../../../../../components/nfc/ndef/generic/record;../../../../../../components/nfc/ndef/launchapp;../../../../../../components/nfc/ndef/parser/message;../../../../../../components/nfc/ndef/parser/record;../../../../../../components/nfc/ndef/text;../../../../../../components/nfc/ndef/uri;../../../../../../components/nfc/t2t_lib;../../../../../../components/nfc/t2t_lib/hal_t2t;../../../../../../components/nfc/t2t_parser;../../../../../../components/nfc/t4t_lib;../../../../../../components/nfc/t4t_lib/hal_t4t;../../../../../../components/nfc/t4t_parser/apdu;../../../../../../components/nfc/t4t_parser/cc_file;../../../../../../components/nfc/t4t_parser/hl_detection_procedure;../../../../../../components/nfc/t4t_parser/tlv;../../../../../../components/softdevice/common;../../../../../../components/softdevice/s132/headers;../../../../../../components/softdevice/s132/headers/nrf52;../../../../../../components/toolchain/cmsis/include;../../../../../../external/fprintf;../../../../../../external/segger_rtt;../../../../../../external/utf_converter;../../../../../../integration/nrfx;../../../../../../integration/nrfx/legacy;../../../../../../modules/nrfx;../../../../../../modules/nrfx/drivers/include;../../../../../../modules/nrfx/hal;../../../../../../modules/nrfx/mdk;../config;"
debug_additional_load_file="../../../../../../components/softdevice/s132/hex/s132_nrf52_6.1.0_softdevice.hex"
debug_register_definition_file="../../../../../../modules/nrfx/mdk/nrf52.svd"
debug_start_from_entry_point_symbol="No"
debug_target_connection="J-Link"
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=0x2FFFF;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x5FFF;FLASH_START=0x26000;FLASH_SIZE=0xa410;RAM_START=0x200022b8;RAM_SIZE=0x3e80"
linker_section_placements_segments="FLASH RX 0x0 0x80000;RAM RWX 0x20000000 0x10000"
macros="CMSIS_CONFIG_TOOL=../../../../../../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="../../../../../../components/libraries/log/src/nrf_log_backend_rtt.c" />
<file file_name="../../../../../../components/libraries/log/src/nrf_log_backend_serial.c" />
<file file_name="../../../../../../components/libraries/log/src/nrf_log_backend_uart.c" />
<file file_name="../../../../../../components/libraries/log/src/nrf_log_default_backends.c" />
<file file_name="../../../../../../components/libraries/log/src/nrf_log_frontend.c" />
<file file_name="../../../../../../components/libraries/log/src/nrf_log_str_formatter.c" />
</folder>
<folder Name="nRF_Libraries">
<file file_name="../../../../../../components/libraries/button/app_button.c" />
<file file_name="../../../../../../components/libraries/util/app_error.c" />
<file file_name="../../../../../../components/libraries/util/app_error_handler_gcc.c" />
<file file_name="../../../../../../components/libraries/util/app_error_weak.c" />
<file file_name="../../../../../../components/libraries/scheduler/app_scheduler.c" />
<file file_name="../../../../../../components/libraries/timer/app_timer.c" />
<file file_name="../../../../../../components/libraries/util/app_util_platform.c" />
<file file_name="../../../../../../components/libraries/hardfault/hardfault_implementation.c" />
<file file_name="../../../../../../components/libraries/util/nrf_assert.c" />
<file file_name="../../../../../../components/libraries/atomic_fifo/nrf_atfifo.c" />
<file file_name="../../../../../../components/libraries/atomic_flags/nrf_atflags.c" />
<file file_name="../../../../../../components/libraries/atomic/nrf_atomic.c" />
<file file_name="../../../../../../components/libraries/balloc/nrf_balloc.c" />
<file file_name="../../../../../../external/fprintf/nrf_fprintf.c" />
<file file_name="../../../../../../external/fprintf/nrf_fprintf_format.c" />
<file file_name="../../../../../../components/libraries/pwr_mgmt/nrf_pwr_mgmt.c" />
<file file_name="../../../../../../components/libraries/ringbuf/nrf_ringbuf.c" />
<file file_name="../../../../../../components/libraries/experimental_section_vars/nrf_section_iter.c" />
<file file_name="../../../../../../components/libraries/strerror/nrf_strerror.c" />
<file file_name="../../../../../../components/libraries/memobj/nrf_memobj.c" />
</folder>
<folder Name="None">
<file file_name="../../../../../../modules/nrfx/mdk/ses_startup_nrf52810.s" />
<file file_name="../../../../../../modules/nrfx/mdk/ses_startup_nrf_common.s" />
<file file_name="../../../../../../modules/nrfx/mdk/system_nrf52810.c" />
</folder>
<folder Name="Board Definition">
<file file_name="../../../../../../components/boards/boards.c" />
</folder>
<folder Name="nRF_Drivers">
<file file_name="nrf_drv_clock.c" />
<file file_name="nrf_drv_uart.c" />
<file file_name="nrfx_clock.c" />
<file file_name="nrfx_gpiote.c" />
<file file_name="nrfx_power_clock.c" />
<file file_name="nrfx_prs.c" />
<file file_name="nrfx_uart.c" />
<file file_name="nrfx_uarte.c" />
<file file_name="nrfx_ppi.c" />
<file file_name="nrfx_saadc.c" />
<file file_name="nrfx_prs.h" />
</folder>
<folder Name="Application">
<file file_name="../../../main.c" />
<file file_name="../config/sdk_config.h" />
</folder>
<folder Name="nRF_Segger_RTT">
<file file_name="../../../../../../external/segger_rtt/SEGGER_RTT.c" />
<file file_name="../../../../../../external/segger_rtt/SEGGER_RTT_Syscalls_SES.c" />
<file file_name="../../../../../../external/segger_rtt/SEGGER_RTT_printf.c" />
</folder>
<folder Name="nRF_BLE">
<file file_name="../../../../../../components/ble/common/ble_advdata.c" />
<file file_name="../../../../../../components/ble/common/ble_conn_params.c" />
<file file_name="../../../../../../components/ble/common/ble_conn_state.c" />
<file file_name="../../../../../../components/ble/common/ble_srv_common.c" />
<file file_name="../../../../../../components/ble/nrf_ble_gatt/nrf_ble_gatt.c" />
<file file_name="../../../../../../components/ble/nrf_ble_qwr/nrf_ble_qwr.c" />
</folder>
<folder Name="UTF8/UTF16 converter">
<file file_name="../../../../../../external/utf_converter/utf.c" />
</folder>
<folder Name="nRF_BLE_Services">
<file file_name="../../../../../../components/ble/ble_services/ble_lbs/ble_lbs.c" />
</folder>
<folder Name="nRF_SoftDevice">
<file file_name="../../../../../../components/softdevice/common/nrf_sdh.c" />
<file file_name="../../../../../../components/softdevice/common/nrf_sdh_ble.c" />
<file file_name="../../../../../../components/softdevice/common/nrf_sdh_soc.c" />
</folder>
<configuration
Name="Release"
arm_architecture="v7EM"
arm_core_type="Cortex-M4"
arm_endian="Little"
arm_fp_abi="Soft"
arm_fpu_type="FPv4-SP-D16"
arm_simulator_memory_simulation_parameter="RX 00000000,00030000,FFFFFFFF;RWX 20000000,00006000,CDCDCDCD"
arm_target_device_name="nRF52810_xxAA"
arm_target_interface_type="SWD"
c_preprocessor_definitions=""
debug_target_connection="J-Link"
linker_section_placement_file="flash_placement.xml"
linker_section_placement_macros="&quot;FLASH_PH_START=0x0\;FLASH_PH_SIZE=0x2FFFF\;RAM_PH_START=0x20000000\;RAM_PH_SIZE=0x5FFF\;FLASH_START=0x26000\;FLASH_SIZE=0xa410\;RAM_START=0x200022b8\;RAM_SIZE=0x3e80&quot; from project in Common configuration"
linker_section_placements_segments="FLASH RX 0x00000000 0x00030000;SRAM RWX 0x20000000 0x00006000"
speed="4000" />
</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" />
</solution>

Appears to build and load the target ok which is the Fanstel BT832A (on the Fanstel EV board) and programmed via the nRF52 DK.

The application was working fine on the same Nordic DK.

However, when I try and run in Debug Mode I keep hitting a "Vector Catch" and so I think my porting process is not completed accurately. This initially stops at a low address in the memory, 0x8C8. Perhaps you can take a look and advise on any errors and or supplementary things to do please.

Best Regards Martin

Parents
  • Ok, I have moved on a little and adjusted the memory placement macros as follows....

     linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_PH_SIZE=0x2FFFF;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x5FFF;FLASH_START=0x26000;FLASH_SIZE=0x29fff;RAM_START=0x200022b8;RAM_SIZE=0x3d47"

    I also did not need the UART in the nRF52810 application so I disabled in the UARTS in the sdkconfig file and removed the nrfx_uart.c file from the build. Before doing this I got a compile error relating to NRF_UART_Type not being found.

    The status now is I get the error 0x0001001 returned from the function 

    err_code = nrf_sdh_enable_request();
    APP_ERROR_CHECK(err_code);

    which appears to be #define NRF_ERROR_SVC_HANDLER_MISSING         (NRF_ERROR_BASE_NUM + 1)  ///< SVC handler is missing

    Now I'm wondering what has caused this issue while I have been porting from a working nRF52832 application. ANy advice would be appreciated.

    Regards Martin

Reply
  • Ok, I have moved on a little and adjusted the memory placement macros as follows....

     linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_PH_SIZE=0x2FFFF;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x5FFF;FLASH_START=0x26000;FLASH_SIZE=0x29fff;RAM_START=0x200022b8;RAM_SIZE=0x3d47"

    I also did not need the UART in the nRF52810 application so I disabled in the UARTS in the sdkconfig file and removed the nrfx_uart.c file from the build. Before doing this I got a compile error relating to NRF_UART_Type not being found.

    The status now is I get the error 0x0001001 returned from the function 

    err_code = nrf_sdh_enable_request();
    APP_ERROR_CHECK(err_code);

    which appears to be #define NRF_ERROR_SVC_HANDLER_MISSING         (NRF_ERROR_BASE_NUM + 1)  ///< SVC handler is missing

    Now I'm wondering what has caused this issue while I have been porting from a working nRF52832 application. ANy advice would be appreciated.

    Regards Martin

Children
  • Hello Martin,

     

    MPH said:
    #define NRF_ERROR_SVC_HANDLER_MISSING         (NRF_ERROR_BASE_NUM + 1)  ///< SVC handler is missing

     that would be error 0x00000001, because NRF_ERROR_BASE_NUM = 0.

    Error 0x00001001 is 0x1000 + 0x0001, and NRF_ERROR_SDM_BASE_NUM is 0x1000, so I typically start to search the project for NRF_ERROR_SDM_BASE_NUM in cases of error codes starting with 0x00001000. If you look in nrf_error_sdm.h, you will see:

    #define NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION (NRF_ERROR_SDM_BASE_NUM + 1)  ///< Incorrect interrupt configuration (can be caused by using illegal priority levels, or having enabled SoftDevice interrupts).

    I assume it is sd_softdevice_enable() that returned this ret_code, inside nrf_sdh_enable_request().

    I am not completely sure what exactly is causing this issue, but perhaps you can try to port a pca10040e example to run on the nRF52810, as these are already set up to emulate an nRF52810 on an nRF52832. 

    There are a few steps you need to do to actually port this to the nRF52810. Please see my colleague Bjørn's reply starting with "Make sure that you have removed the DEVELOP_IN_NRF52832 define" in this ticket. The comment regarding the rc_ctiv parameter is only relevant if your PCB doesn't have an external LFXTAL.

    Best regards,

    Edvin

  • Thanks Edvin

    I ran the pca10040e blinky example ok with the nRF52810 in the latest version 17.0.0, so at least I have something to modify if needs be.

    However I have a fair amout of code added to the 15.2.0 blinky example so I will see if I can debug further. I checked the interrupt priorities in the config file which have not been modified and they appear to be at level 6. One other thing I changed was due to Timer3 being used on the nRF52832, so for porting to nRF52810 I used Timer0 intsead. Timer0 does not appear to be used in the blinky example. If you have further ideas to check let me know.

    Regards Martin

  • If you are using the softdevice, the application can't use Timer0. Timer0 is reserved for the softdevice. However, if you really need Timer0, you can look into the timeslot API. That means that you can request timeslots from the softdevice where the timer is not needed, and you can use TIMER0 as you like inside that timeslot. But these timeslots are short, only reaching between the connection events of your connection, or between the advertising events (advertising interval). The Softdevice will always have the first priority. 

    BR,
    Edvin

  • Thanks for the Softdevice resources reminder Edvin. I went back to my problem project and changed from T0 to T2 on the nRF52810 and now I have a result, it's working as expected. So the porting completed ok for now. 

    I made another observation in regards the Pca10040e_s112 blinky project. If I use Segger v5.10 the application (without any mods by me) does not progress passed ble_stack_init(); call in Debug Mode. If I use Segger v3.50 it works ok. I'll stick on v3.50 for now.

    BR Martin

  • MPH said:
    I made another observation in regards the Pca10040e_s112 blinky project. If I use Segger v5.10 the application (without any mods by me) does not progress passed ble_stack_init(); call in Debug Mode. If I use Segger v3.50 it works ok. I'll stick on v3.50 for now.

     You are testing this on an actual nRF52810, and not emulated on nRF52832, right? If you are using an nRF52810, did you remove the DEVELOP_IN_NRF52832 preprocessor definition? Did you remove it from all settings tabs (Release, Common, Debug)?

    Best regards,

    Edvin

Related