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
  • Addendum: 2021/6/18, 15:32
    The "Preprocessor Difinitions" is also a little different.

  • Hello,

    Have you tried to debug the application to see if the program reaches the main() function?

     

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

     __SYSTEM_CLOCK shall still be 16 MHz (the 32MHz signal is divided by 2 internally)

  • 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.

  • I see.

    ...\examples\ble_central\ble_app_uart_c\pca10028\s130\arm5_no_packs\ble_app_uart

    I used this with segger and keil.

    As a result, keil was successful, while SES did not return any results.

  • The Segger project I created is placed in nRF5_SDK12.3.0_SeggerSamples\app\ble_app_uart_c\pca10028\s130\ses\

  • I see.

    Compilation was successful.

    However, TeraTerm did not show anything.

    The following is the "output".

    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 "NRF51422_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.0 KB of addresses 0001b000 — 0002285f
    Programming 0.0 KB of addresses 00022860 — 0002286b
    J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (31744 bytes)
    J-Link: Flash download: Total time needed: 0.975s (Prepare: 0.048s, Compare: 0.005s, Erase: 0.656s, Program: 0.240s, Verify: 0.002s, Restore: 0.022s)
    Download successful

  • Please make sure you're using the correct pin assigments for UART as I mentioned earlier.

Reply Children
Related