analogdevicesinc / VSCode-Maxim

VSCode project folders for the Analog Devices MSDK
https://github.com/Analog-Devices-MSDK/msdk
Other
24 stars 5 forks source link

Is it possible to view Peripherals in debug mode? #10

Closed alpelectronics closed 2 years ago

alpelectronics commented 2 years ago

Right now, it is like that when I try to debug. Otherwise it is hard to know, if set a register correctly.

image

Jake-Carter commented 2 years ago

Hi @alpelectronics, apologies for the delay.

Currently, there is no peripheral browser. It would require a VSCode extension, which is in the pipeline eventually, but at the moment the recommended way to do this is with watch expressions. Ex:

image

You can set watch expressions for all registers. For example, the sysctrl register below. Adding ,b lets you print out the value in binary, and ,x prints the value in hex. You can also do logical operations inside the watch expression.

image

It's a little more of a manual effort, but it should work for you in the meantime.

alpelectronics commented 2 years ago

Thanks Jake, I will try!

sullivanmj commented 2 years ago

Awesome tip for viewing register values in the watch window with hex or binary representation!

For others who find this thread, the cortex-debug file does a pretty good job if you point it to the .svd files provided in the Maxim SDK at

MaximSDK/Libraries/CMSIS/Device/Maxim/{your device}/Include/{your device}.svd

Jake-Carter commented 2 years ago

For others who find this thread, the cortex-debug file does a pretty good job if you point it to the .svd files provided in the Maxim SDK at

MaximSDK/Libraries/CMSIS/Device/Maxim/{your device}/Include/{your device}.svd

Thanks @sullivanmj. cortex-debug is a good extension and I'd love to get a similar peripheral browser created.

I've evaluated it as a replacement for the official cpptools debugger configs that I'm currently using, since I'm not really happy with the their config options and the way they drive the MIEngine. I'm fighting cpptools a little bit to get it to work for embedded targets, but the setup is functional. The downside to bringing in cortex-debug is that our micros also include RISC-V cores which would not be covered by the extension.

I've started laying the groundwork for a custom extension with some of my colleagues, and a peripheral browser is definitely on the feature list, among other improvements. If you have any additional feedback don't hesitate to let me know.

sullivanmj commented 2 years ago

A custom peripheral browser would be awesome. Point taken about supporting RISC-V cores, I hadn't considered that since we've only used MCUs with Arm cores.

My team and I really appreciate the work you've done with this repository. None of us really like Eclipse all that much, so it was great to find some help setting up the toolchain and integrating with the SDK from VS Code.

Jake-Carter commented 2 years ago

Thanks @sullivanmj, happy to hear it!

Jake-Carter commented 2 years ago

Closing this ticket - this info has been copied into the new wiki