nRF Connect SDK Intermediate Lesson 1 Exercise 1 Debugging Issues

Hi

This is my first time using nRF connect and Visual studio but I have been following through first the Fundamentals course on the Dev Academy using the nRF52840 DK with no issues.

However in exercise 1 of lesson 1 of the Intermediate course, when attempting to debug i do not end up in "main" function but in the file ".../zephyr/arch/arm/core/cortex_m/reset.S". I also do not have any of the functions showing in the call stack or any threads in the thread view of the NRF Debug terminal.

The code appears to run correctly if i stop debugging and i get the LEDs toggling and the terminal outputs as expected and i get the same behavior using the solution code so i assume it is something to do with my setup rather than the code itself.

I am connected to the nRF52840 DK directly via USB.

I would be grateful for an suggestions on how to go about resolving this.

Parents
  • Hello,

    Does it start in reset.S? Have you tried setting a breakpoint somewhere near the start of your main() function, and then hit the "play" button near the top of the VS Code window?

    Does it jump into main() then?

    Best regards,

    Edvin

  • Hi Edvin,

    Thanks for getting back to me.

    Yes it starts in reset.S, if i set a break point in main() and then continue it stops at the break point in main() but I don't get anything in the Thread Viewer and the call stack only contains main().  If i add a break point at the end of main() and continue to it then the tread viewer is populated but greyed out (cannot interact with anything unlike the description in exercise 1) and the call stack still only contains main(). Is this how it is supposed to function?

    Best regards,

    Tom

  • Hello Tom,

    I don't know all the quirks with VS Code, but perhaps you can try some of the hints here:

    https://stackoverflow.com/questions/47689536/how-to-completely-uninstall-vs-code-on-windows

    Also, J-Link is a bit weird some times. I have v7.94e and v7.88j installed on this computer, so perhaps you can try that combination.

    Best regards,

    Edvin

  • Hi Edvin,

    I have removed and reinstalled VS code, the command line tools and the jlink drivers you suggested. The only thing of note was that when reinstalling the command line tools it did not prompt me to install a jlink driver so i manually installed the versions you recommended. I also had to add the command line tools and the jlink software to the system Path variables in order for them to be found by VS Code.

    Unfortunately there is no change in the behaviour and still no threads are displayed.

    It should not matter how i am powering and connecting to the dev kit i assume? i am currently just connected and powered over USB.

    Many thanks,

    Tom

  • Hello Tom,

    You should just power it like you usually do when you program the kit. Unfortunately, I am not sure what the issue is, then. But you are able to run a debug session, right? You just don't see the thread information?

    How about debugging with Ozone? Did you try that? I do experience some bugs myself when debugging using VS Code, but most is solved after power cycling the DK, or even deleting the build folder and rebuilding the project.

    BR,
    Edvin

  • Hi Edvin,

    Sorry for the delay in replying.

    Yeah i can run the debug session in VScode but just don't get anything in the thread viewer.

    I have installed Ozone and if i debug with Ozone then i can view the threads and everything appears to work as expected which is good. It still does not answer the problem of it not working in VS code, do you know why one might work and the other not? Either way i can use Ozone for the time being and continue through the Intermediate Dev Academy course.

    Best regards,

    Tom

  • Hello Tom,

    Yes. We have seen some other reports on the same topic as well. We are still investigating. Make sure to regularly update all the extensions/plugins from Nordic, so that you will receive the fix if/when we find it. 

    BR,
    Edvin

Reply Children
No Data
Related