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

Error JLINKARM_DLL_ERROR when using Power Profiler

I am getting an error in the Power Profiler ppk.py when it is starting. The error occurs on the first call to nrfjprog.rtt_read. The error is JLINKARM_DLL_ERROR, which is -102.

(Updated) I wrote a similar small Python program to test pynrfprog and I find that the rtt_is_control_block_found() is always returning False.

I am using the software versions specified in the PPK User Guide:

  • Python 2.7.12 (32 bit)
  • nRF5x Command Line Tools (which installs Segger JLink 5.12g)
  • Python packages as installed by 'python_packages.bat', specifically pynrfjprog 9.0.0

I have programmed the DK with PPK_v1_0_0.hex using flash_pkk.py

Here is the cutdown program that fails to find the rtt control block:

import libs.rtt as rtt
import time
from pynrfjprog import API
JLINK_PRO_V8    = 4000

# Always try to have highest speed
JLINK_SPEED_KHZ = JLINK_PRO_V8

nrfjprog = API.API('NRF52')
nrfjprog.open()

nrfjprog.connect_to_emu_without_snr(jlink_speed_khz=JLINK_SPEED_KHZ)
nrfjprog.sys_reset()
nrfjprog.go()
nrfjprog.rtt_start()
time.sleep(1)
print nrfjprog.dll_version()

# It never exits this while() - just prints 'waiting' continuously
while (not nrfjprog.rtt_is_control_block_found()):
  print 'waiting for control block'
  time.sleep(1)

# This fails with JLINKARM_DLL_ERROR if we let it get here
nrfjprog.rtt_read(0,10000, encoding=None)
  • Try adding a import time at the top, and time.sleep(1) after nrfjprog.rtt_start(). I don't remember why but, but it usually fixes this issue (unless it was the -2, INVALID_OPERATION it fixed).

    You can also try to spool on rtt_is_control_block_found before proceeding

  • This block has always worked for me

        self.nrfjprog.sys_reset()
        self.nrfjprog.go()
        self.nrfjprog.rtt_start()
        time.sleep(1)
    
        data = self.nrfjprog.rtt_read(0, 100, encoding=None)
    

    But quite a few people have the ppk software and haven't stumbled into this issue, so it makes me wonder if you have an outdated or failing Segger Jlink installation(?).

  • On a clean machine, I started over and made sure I used the versions specified in the PPK user guide:

    • Python 2.7.12 (32 bit Windows)
    • nRF5x Command Line Tools 9.0.0 (which installs Segger JLink 5.12g)

    The Segger JLinkconfig.exe connects to the DK board OK.

    I will try your suggestion above of spinning on rtt_is_control_block_found.

  • Updated my question above. I tried spinning until rtt_is_control_block_found() is True and it is always False.

  • After trying 2 things, it appears more like the PPK firmware is not executing on the DK:

    • I cleared the Flash on the DK, and the above Python snipped behaves the same (is willing to rtt_start, but never finds a control block). So with no program on the DK, rtt_start() succeeds but no control block is ever found.
    • I added a simple SEGGER_RTT_printf() to Blinky, and the above Python program runs OK with that. I can print the result of the rtt_read to see my message

    So, now, why would the PPK firmware not run on my DK? My DK is marked "BMD-300 Series Evaluation Board 320-00050 vB" My PPK board is "PCA63511 Rev 1.0.0 2016.27".

    For the PPK firmware, I have tried loading it with "flash_ppy.py" and also loading ppk_v1_0_0.hex using nRFgo Studio.

Related