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

Importing SDK12.3.0 with Segger Embedded Studio does not work.

Motivation: I would like to use SEGGER Embedded Studio V4.10 to use sample projects whose size is not available in keil(no license).

Problem: I can't check the operation of the program (nothing is displayed in TeraTerm), even though the writing seems to be successful. When I write the exact same program from keil, I can see it with TeraTerm.

failure: used segger

success: used keil

I am using SDK12.3.0 and nRF51822.

The evaluation board is EBSGCNZWY by TAIYOYUDEN, and system_nrf51.c is modified according to the specification.

#define __SYSTEM_CLOCK      (32000000UL)     /*!< nRF51 devices use a fixed System Clock Frequency of 16MHz */

static bool is_manual_peripheral_setup_needed(void);
static bool is_disabled_in_debug_needed(void);
static bool is_peripheral_domain_setup_needed(void);


#if defined ( __CC_ARM )
    uint32_t SystemCoreClock __attribute__((used)) = __SYSTEM_CLOCK;
#elif defined ( __ICCARM__ )
    __root uint32_t SystemCoreClock = __SYSTEM_CLOCK;
#elif defined   ( __GNUC__ )
    uint32_t SystemCoreClock __attribute__((used)) = __SYSTEM_CLOCK;
#endif

void SystemCoreClockUpdate(void)
{
    SystemCoreClock = __SYSTEM_CLOCK;
}

void SystemInit(void)
{
if (*(uint32_t *)0x10001008 == 0xFFFFFFFF)
{
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen<<NVMC_CONFIG_WEN_Pos;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
*(uint32_t *)0x10001008 = 0xFFFFFF00;
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren<<NVMC_CONFIG_WEN_Pos;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
NVIC_SystemReset();
while (true){}
}
    /* If desired, switch off the unused RAM to lower consumption by the use of RAMON register.
       It can also be done in the application main() function. */

    /* Prepare the peripherals for use as indicated by the PAN 26 "System: Manual setup is required
       to enable the use of peripherals" found at Product Anomaly document for your device found at
       https://www.nordicsemi.com/. The side effect of executing these instructions in the devices
       that do not need it is that the new peripherals in the second generation devices (LPCOMP for
       example) will not be available. */
    if (is_manual_peripheral_setup_needed())
    //The following are unchanged
    

I changed the settings of segger by referring to the following link.

https://devzone.nordicsemi.com/f/nordic-q-a/48639/segger-embedded-studio-support-for-nrf5_sdk_12_3_0_d7732ad-this-is-not-a-question/238391

The only differences from the settings are the following.

And "Target Device" is nRF51822xxAC .

The write operation was probably successful.

Connecting ‘J-Link’ using ‘USB’
Connecting to target using SWD
Loaded C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.10/bin/JLink_x64.dll
Firmware Version: J-Link Lite-Cortex-M V9 compiled Feb  2 2021 16:33:27
DLL Version: 6.34h
Hardware Version: V9.00
Target Voltage: 3.386
Device "NRF51822_XXAC" selected.
Found SW-DP with ID 0x0BB11477
Scanning AP map to find all available APs
AP[1]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x04770021)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xF0000000
CPUID register: 0x410CC200. Implementer code: 0x41 (ARM)
Found Cortex-M0 r0p0, Little endian.
FPUnit: 4 code (BP) slots and 0 literal slots
CoreSight components:
ROMTbl[0] @ F0000000
ROMTbl[0][0]: E00FF000, CID: B105100D, PID: 000BB471 ROM Table
ROMTbl[1] @ E00FF000
ROMTbl[1][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
ROMTbl[1][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
ROMTbl[1][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
ROMTbl[0][1]: F0002000, CID: B105900D, PID: 000BB9A3 ???
Preparing target for download
Executing script TargetInterface.resetAndStop()
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Downloading ‘s130_nrf51_2.0.1_softdevice.hex’ to J-Link
Programming 1.9 KB of addresses 00000000 — 000007bf
Programming 103.9 KB of addresses 00001000 — 0001afdf
J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
Download successful
Downloading ‘ble_app_uart_c_pca10028_s130.elf’ to J-Link
Programming 30.8 KB of addresses 0001b000 — 00022b87
Programming 0.0 KB of addresses 00022b88 — 00022b9f
J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
Download successful
Executing disconnect script
Executing script TargetInterface.resetAndStop()
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.

The output is shown above.

I checked the programmer of nRF connect and it is as follows.

Please give me suggestions for improvement.

Parents Reply Children
  • Hello,

    Unfortunately, I wasn't able to build your project without errors (some missing includes). But I did find a SES project I had made for this exact SDK example a while back. Could you try mine and see if that runs OK on your board as well? I already changed the clock source to the internal RC oscillator. Though you may still have to change the pin assignments for UART RX and TX, as I'm not sure if they are different on your board.

    8244.nRF5_SDK12.3.0_SeggerSamples.zip

    Note, before building my project you must run the nRF_MDK_8_34_1_SES_BSDLicense.emPackage installer included in the zip. This will add the device startup files to your Segger installation.

  • Import "custom_board" (project>>options>>Preprocessor>>User Include Directories to "custom_bo") to run your project using the evaluation board from TAIYOYUDEN. board.h" in project>>options>>Preprocessor>>User Include Directories), but I get a message "fatal error: custom_board.h: No such file or directory".

    There is an error in "#include custom_board.h" of "boards.h", but if I use "Go to definition", I can go to "custom_board.h" in ses.

    I know this is not the main question, but I would like to know the solution for verification.

  • Hi,

    The original Nordic SDK does not include the custom_board.h header file fro the Taiyo Yuden module, hence the build error.

    To make it compile you can copy custom_board.h file from your other SDK to \sdk\nRF5_SDK_12.3.0_d7731ad\components\boards\

  • Thank you.

    I was able to compile the project you gave me.

    I tried "ble_peripheral>>ble_app_uart".

    I scanned the UART using the smartphone app "nRF Toolbox", but did not find "nordic_uart".

    I'll go into detail about what I've set up in SES v4.10.

    1) Select "File >> Import Project >> Import Keil MDK Project" and select my uvprojx file(ble_app_uart). And then, select "Internal Toolchain".

    2)Navigate to "Project >> Options >> Linker >> Linker" and set "SEGGER" to "GNU".

    3)Delete "Internal Files" folder's element and add "flash_placement.xml", "ses_nrf51_startup.s" and "thumb_crt0.s" and "system_nrf51.c". 

    4)

    Navigate to "Project >> Options >> Preprocessor >> User Include Directories" and add following lines.

          - ../../../../../../components/device

          - ../../../../../../components/toolchain/cmsis/include

    5)Navigate to "Project >> Options >> Linker >> Section Placement Macros" and add following lines.

    FLASH_START=0x1B000

    SRAM_START = 0x20001FE8

    6)"Project >> Options >> Preprocessor >> Preprocessor Definitions" and change "NRF51422" to "NRF51822".

    7)NRF51822 is used, navigate to "Project >> Options >> Debugger >> Target Device" and select "NRF51822_xxAC".

    8)"Project >> Options >> Preprocessor >> Preprocessor Definitions" and add "NO_VTOR_CONFIG".

    9)navigate to "Project >> Options >> Loader >> Additional Load File[0]" and select S130 v2.0.1 hex file.

    10)Navigate to "Project >> Options >> Target Scripts >> Disconnect Script" and add "TargetInterface.resetAndStop()" line.

    11)Navigate to "Project >> Options >> Debugger >> Register Definition File" and select nrf51.svd file.

  • Hi,

    I only provided the NUS Central example (Nordic UART Service Client) located in \nRF5_SDK12.3.0_SeggerSamples\app folder, and to test this example you will need to have another board that runs the peripheral UART/Serial Port Emulation over BLE example.

Related