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

Help getting the PCA20041 Gaming Mouse demo programmed and working

Hi,

I've got the gaming mouse dev kit and I'm stuck trying to get it programmed using my nRF52840-DK. See my hardware connection image below. 

If I leave the mouse power switch off, then it seems to just program the dev kit's onboard processor and not my mouse. If I turn on the mouse power switch I get a "no idcode detected" popup. I tried flipping the debug adapter thing that plugs into the mouse over and I got the same behavior. Any ideas?

I may also have a problem with my project as this is the first time I've used Zephyr - but at the very least I think I should be getting to the point of erasing the mouse so that it doesn't work anymore - but it's still got its factory programming on it (I attempted to customize the project in a recognizable way by changing CONFIG_BT_DEVICE_NAME in autoconf.h... hopefully that's the right way to do that)

Thanks,

Glen

 

Parents
  • More info: I also have the PCA20045 nRF52810 based desktop mouse and this morning I was able to program that one successfully using the same nRF52840-DK, cable, and debug adapter board.

    So - it looks like my programming hardware and my basic use of the software tools is OK. It seems to be something about this gaming mouse. Are there special instructions to get it into a programmable state, like powering it through USB or not, or having the power switch in a certain position? I feel like I've tried all the combinations of that, but maybe not?

    Thanks,

    Glen

Reply
  • More info: I also have the PCA20045 nRF52810 based desktop mouse and this morning I was able to program that one successfully using the same nRF52840-DK, cable, and debug adapter board.

    So - it looks like my programming hardware and my basic use of the software tools is OK. It seems to be something about this gaming mouse. Are there special instructions to get it into a programmable state, like powering it through USB or not, or having the power switch in a certain position? I feel like I've tried all the combinations of that, but maybe not?

    Thanks,

    Glen

Children
  • Hi,

    1) In SES, are using the nrf_desktop application project, and have selected the nrf52840gmouse_nrf52840 board ?

    2) What NCS version are you using? v1.5.0 ?

    3) Is nrfjprog able to connect/communicate with the board? Are you able to run the command "nrfjprog --readregs" ?

  • Yes I am using the nrf_desktop project and I selected the nrf52840gmouse_nrf52840 board.

    I am using NCS v1.5.1

    I got this error with nrfjprog when I connect if the mouse is powered up:

    Could not fetch memory size of target devkit: Error: Error occured when get library info. Errorcode: CouldNotOpenDevice (0x4) Lowlevel error: JLINKARM_DLL_ERROR (ffffff9a)

    If the mouse is not powered up I get a connection but I'm 99% sure it's just connecting to the nRF52840 on the devkit since it doesn't detect anything connected to the P19 connector.

    I'm not sure how to enter command line switches like readregs - is that something you can do from the GUI? If not, what folder is the executable located in on the computer so I can try it command line? 

  • Glen M said:
    I'm not sure how to enter command line switches like readregs - is that something you can do from the GUI? If not, what folder is the executable located in on the computer so I can try it command line? 

     Install nRF Command Line Tools from here: https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Command-Line-Tools/Download

    Then just use cmd from anywhere on the computer:

  • Ok here's what I got from nrfjprog --readregs

    ERROR: JLinkARM DLL reported an error. Try again. If error condition
    ERROR: persists, run the same command again with argument --log, contact Nordic
    ERROR: Semiconductor and provide the generated log.log file to them.

    I ran it again with --log added on and here's the content of the log.log file:

    [2021-May-12 14:02:57] [ info] --------------------------------------------------------------------------------
    [2021-May-12 14:02:57] [ info] nrfjprog --readregs --log
    [2021-May-12 14:02:57] [ info] nrfjprog version 10.12.1
    [2021-May-12 14:02:57] [ info] --------------------------------------------------------------------------------
    [2021-May-12 14:02:57] [debug] [ nRF0x0] - open_dll
    [2021-May-12 14:02:57] [ info] [ nRF0x0] - Load library at C:\Program Files (x86)\Nordic Semiconductor\nrf-command-line-tools\bin\JLINKARM_UNKNOWN_NRFJPROG.dll.
    [2021-May-12 14:02:57] [ info] [ nRF0x0] - Library loaded, loading member functions.
    [2021-May-12 14:02:57] [ info] [ nRF0x0] - Member functions succesfully loaded.
    [2021-May-12 14:02:57] [ info] [Backend] - Logger callback at 0xd82020 registered in Segger backend logger.
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] Logger callback at 0xd82020 registered in JLink logger.
    [2021-May-12 14:02:57] [debug] [nRFUnknown] - Just_open_dll_tagged_callback
    [2021-May-12 14:02:57] [debug] [Backend] - open_dll
    [2021-May-12 14:02:57] [ info] [Backend] - No J-Link DLL path was provided. Attempting to auto detect.
    [2021-May-12 14:02:57] [ info] [Backend] - Load library at C:\Program Files (x86)\SEGGER\JLink\JLinkARM.dll.
    [2021-May-12 14:02:57] [ info] [Backend] - Library loaded, loading member functions.
    [2021-May-12 14:02:57] [ info] [Backend] - Member functions succesfully loaded.
    [2021-May-12 14:02:57] [debug] [Backend] - dll_version
    [2021-May-12 14:02:57] [ info] [Backend] - Segger dll version 6.98.e loaded.
    [2021-May-12 14:02:57] [debug] [Backend] - set_core_data
    [2021-May-12 14:02:57] [debug] [ nRF0x0] - enum_emu_snr
    [2021-May-12 14:02:57] [debug] [nRFUnknown] - Just_enum_emu_snr
    [2021-May-12 14:02:57] [debug] [Backend] - enum_emu_snr
    [2021-May-12 14:02:57] [debug] [Backend] - ---just_enum_emu_snr
    [2021-May-12 14:02:57] [debug] [Backend] - ---just_get_num_emus
    [2021-May-12 14:02:57] [debug] [ nRF0x0] - connect_to_emu_with_snr
    [2021-May-12 14:02:57] [debug] [nRFUnknown] - Just_connect_to_emu_with_snr
    [2021-May-12 14:02:57] [debug] [Backend] - connect_to_emu_with_snr
    [2021-May-12 14:02:57] [debug] [Backend] - is_connected_to_emu
    [2021-May-12 14:02:57] [debug] [Backend] - ---just_enum_emu_snr
    [2021-May-12 14:02:57] [debug] [Backend] - ---just_get_num_emus
    [2021-May-12 14:02:57] [debug] [Backend] - ---just_connect_to_emu_with_snr
    [2021-May-12 14:02:57] [debug] [Backend] - ---just_connect_to_emu_without_snr
    [2021-May-12 14:02:57] [ info] [Backend] - Segger logging enabled.
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Feb 2 2021 16:47:20
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Feb 2 2021 16:47:20
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] Hardware: V1.00
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] S/N: 683971486
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] OEM: SEGGER
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] TELNET listener socket opened on port 19021
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] WEBSRV Starting webserver
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] WEBSRV Webserver running on local port 19080
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 6.561ms returns "O.K."
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_GetHWStatus(...)
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 0.220ms returns 0
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand("SetRestartOnClose = 0", ...).
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 0.006ms returns 0x01
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand("DisableFlashDL", ...).
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 0.004ms returns 0x00
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand("ExcludeFlashCacheRange 0x0-0xFFFFFFFF", ...).
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 0.004ms returns 0x00
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_SetHookUnsecureDialog
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_SetHookUnsecureDialog(...)
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 0.019ms returns 0
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_TIF_Select(JLINKARM_TIF_SWD)
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 0.803ms returns 0x00
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_SetSpeed(2000)
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 0.111ms
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_GetSN()
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 0.007ms returns 683971486
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [debug] [Backend] - ---just_load_core_data
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand("CORESIGHT_SetIndexAHBAPToUse = 0", ...).
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 0.003ms returns 0x00
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_ExecCommand("device = Cortex-M4", ...).
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] XML file found at: C:\Program Files (x86)\SEGGER\JLink\JLinkDevices.xml
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] C:\Program Files (x86)\SEGGER\JLink\JLinkDevices.xml evaluated successfully.
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] Device "CORTEX-M4" selected.
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] Device "CORTEX-M4" selected.
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 34.627ms returns 0x00
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [debug] [ nRF0x0] - read_connected_emu_snr
    [2021-May-12 14:02:57] [debug] [nRFUnknown] - Just_read_connected_emu_snr
    [2021-May-12 14:02:57] [debug] [Backend] - read_connected_emu_snr
    [2021-May-12 14:02:57] [debug] [Backend] - is_connected_to_emu
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_IsOpen()
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 0.010ms returns 0x01
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [debug] [ nRF0x0] - read_device_family
    [2021-May-12 14:02:57] [debug] [nRFUnknown] - Just_read_device_family
    [2021-May-12 14:02:57] [debug] [Backend] - is_connected_to_emu
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_IsOpen()
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 0.007ms returns 0x01
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_Lock()
    [2021-May-12 14:02:57] [debug] [Backend] - read_debug_port_idr
    [2021-May-12 14:02:57] [debug] [Backend] - read_debug_port_register
    [2021-May-12 14:02:57] [debug] [Backend] - ---just_read_debug_port_register
    [2021-May-12 14:02:57] [debug] [Backend] - coresight_configure
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_CORESIGHT_Configure()
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 101.256ms returns 0
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [debug] [Backend] - ---just_select_debug_port_register
    [2021-May-12 14:02:57] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 1.462ms returns -1
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [ info] [Backend] - JLinkARM.dll reported "-1", an unknown error.
    [2021-May-12 14:02:57] [debug] [Backend] - ---just_abort_debug_action
    [2021-May-12 14:02:57] [ info] [Backend] - Attempting to clear any configuration errors in debug port before closing connection.
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 1.251ms returns -1
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [ info] [Backend] - JLinkARM.dll reported "-1", an unknown error.
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 0.062ms
    [2021-May-12 14:02:57] [debug] [ nRF0x0] - close_dll
    [2021-May-12 14:02:57] [debug] [nRFUnknown] - Just_close_dll
    [2021-May-12 14:02:57] [debug] [Backend] - close
    [2021-May-12 14:02:57] [debug] [Backend] - disconnect_from_emu
    [2021-May-12 14:02:57] [debug] [Backend] - is_connected_to_emu
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_IsOpen()
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 0.024ms returns 0x01
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [debug] [Backend] - ---just_disconnect_from_emu
    [2021-May-12 14:02:57] [debug] [Backend] - is_connected_to_device
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_IsConnected()
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 0.025ms returns FALSE
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [debug] [Backend] - ---just_is_debug_region_powered
    [2021-May-12 14:02:57] [debug] [Backend] - ---just_read_debug_port_register
    [2021-May-12 14:02:57] [debug] [Backend] - is_connected_to_emu
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_IsOpen()
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 0.022ms returns 0x01
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_Lock()
    [2021-May-12 14:02:57] [debug] [Backend] - ---just_select_debug_port_register
    [2021-May-12 14:02:57] [debug] [Backend] - Select AP 255, DP Bank 0, AP Bank 255
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x02, 0x00000000)
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 1.394ms returns -1
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [ info] [Backend] - JLinkARM.dll reported "-1", an unknown error.
    [2021-May-12 14:02:57] [debug] [Backend] - ---just_abort_debug_action
    [2021-May-12 14:02:57] [ info] [Backend] - Attempting to clear any configuration errors in debug port before closing connection.
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_CORESIGHT_WriteAPDPReg(DP reg 0x00, 0x0000001F)
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 1.536ms returns -1
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_HasError()
    [2021-May-12 14:02:57] [ info] [Backend] - JLinkARM.dll reported "-1", an unknown error.
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] - 0.067ms
    [2021-May-12 14:02:57] [ info] [ JLink] - [Info ] [JLink ] JLINK_Close()
    [2021-May-12 14:02:57] [debug] [Backend] - Segger Backend closed.

  • Hi,

    Looks like the debugger is not able to connect to the nRF52840.

    Are you sure that the debug adapter is properly inserted ? You are not able to push it further in?

Related