Hi Jared,

I am trying to interface MPU 6050 with a feather. I have gone through the external programming process but I am still confused.

Like if I want to flash the new code written by me in c then what I have to use west or visual studio code or both. I am appreciating your effort to do all documentation for debugging and programming. But for beginners like me, it is still not easy. Like we are not aware of every parameter.

Please try to help me out.

With Regards,
Rahul Kidecha

    RKidecha you should use one of the pre-existing samples to start with. Ideally you should copy the whole directory to a renamed directory. Make your modifications as necessary and then, yes, use west to build and newtmgr to flash.

    Hi Jared,

    As I am interfacing the MPU 6050 with a feather so need to debug the code in visual code studio. I saw your documentation for it and as per my understanding, I can flash the code using visual code studio also. (if wrong corrects me).

    To understand the debugger process I started to run sample code blinky. I did all the settings which you have shown in the documentation. after the click on start debugging, I got the below error.

    Error when debugging

    Check the below image of launch.Jason setting

    can you help me out with what to do to resolve the above issue?

    With Regards,
    Rahul Kidecha

      I gave the proper path and it worked but got a different error.

      Is there anything else that needs to change in the JSON file?

        11 days later

        Hi Jared,

        I have done some changes to the Launch. Jason file. just added the one line

        “serverpath”: “C:/Program Files (x86)/SEGGER/JLink/JLinkGDBServerCL.exe”,

        after that when I tried to debug it got below error.

        Please check OUTPUT tab (Adapter Output) for output from C:/Program Files (x86)/SEGGER/JLink/JLinkGDBServerCL.exe
        Launching server: “C:/Program Files (x86)/SEGGER/JLink/JLinkGDBServerCL.exe” “-if” “swd” “-port” “50000” “-swoport” “50001” “-telnetport” “50002” “-device” “nrf9160_xxAA”
        Launching GDB: “C:\Program Files (x86)\GNU Tools Arm Embedded\9 2019-q4-major\bin\arm-none-eabi-gdb.exe” “-q” “–interpreter=mi2”
        undefinedC:\Program Files (x86)\GNU Tools Arm Embedded\9 2019-q4-major\bin\arm-none-eabi-gdb.exe: warning: Couldn’t determine a path for the index cache directory.
        Reading symbols from C:/Users/rahul/ncs/v1.3.1/zephyr/samples/basic/blinky/build/zephyr/zephyr.elf…
        0xfffffffe in ?? ()
        Not implemented stop reason (assuming exception): undefined
        Resetting target
        Resetting target
        Something went wrong due zephyr.elf file.

        Can you guide me what to do next?

        With Regards,
        Rahul Kidecha

          I had many very similar issues. I’m using Windows 10 and had to addresses the forward vs backward path slashes issue between windows and linux. You can Google this topic to learn more. Below is exactly what I have in my launch.json to successfully debug blinky running the nRF9160 connected to the nRF5340-PDK with a Tag Connect (TC2030-CTX-NL) cable. Also, I followed Jared’s Debugging Visual Code from the https://docs.jaredwolff.com/nrf9160-programming-and-debugging.html#requirements-for-external-programming instructions.

           {
               // Use IntelliSense to learn about possible attributes.
               // Hover to view descriptions of existing attributes.
               // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
               "version": "0.2.0",
               "configurations": [
                  {
                      "name": "Cortex Debug",
                      "cwd": "${workspaceRoot}",
                      "executable": "${workspaceRoot}\\build\\zephyr\\zephyr.elf",
                      "request": "launch",
                      "type": "cortex-debug",
                      "servertype": "jlink",
                      "device": "nrf9160_xxAA",
                      "interface": "swd",
                      "armToolchainPath": "C:\\Program Files (x86)\\GNU Tools Arm Embedded\\9 2019-q4-major\\bin"
                  }
               ]
             }

          I hope this helps. I didn’t include the {} because when I copied this from my launch.json in VSC to this community website the second slash along the path is deleted. I presume this community site is running on a linux box. 🙂


            6 days later

            Also @SteveD0 not sure if you noticed but when installing Nordic’s Command Line Tools jlink.exe doesn’t get added to the $PATH. I had to do it manually. Not sure if that was your experience.

            I updated the documentation here.

            Also in launch.json is relative to the root that you open VSCode in. So executable may have to look like

            "executable": "${workspaceRoot}\\nrf9160-feather\\samples\\blinky\\build\\zephyr\\zephyr.elf",

            Where you replace nrf9160-feather\\samples\\blinky\\ with the path to your project subfolder. For example if you open VSCode in the nfed directory you’ll have to add \\nrf9160-feather\\samples\\blinky\\ to debug the blinky specific project. I think this will help with @RKidecha or anyone else who may be debugging on Windows.

            Terms and Conditions | Privacy Policy