3
votes

I use Qt Creator to develop embedded application using Bare Metal configuration for STM32. When I debug this application under different IDEs like KIEL uVision, IAR System Workbench or some Eclipse IDE I have special view available where I can see processor specific registers in tree list. Is there something similar for Qt Creator?

I've seen the register view in debug view. Is there possibility to tell it which memory address to show?

EDIT: The application I'm writing is in C and C++. The target is microcontroller based on ARM architecture in this case STM32. There will be no Qt or QML code.

My goal is to use QtCreator as IDE for developing this application. This quite easy as you just configure the compiler (arm-none-eabi-gcc), debugger (arm-none-eabi-gdb) and gdb-server (openocd) in the kit configuration. This allows me to create executable elf file for bare metal target and then flash it to the FLASH memory inside the microcontroller.

All these steps are already done.

However the debugging part gets tricky as part of the memory space is direct hardware configuration and not pure memory. This memory space contains the configuration for the peripherals which allows you to e.g. talk over UART, I2C, ETHERNET, USB or just configure the pins or clock speed.

You need to look at these values and compare them with reference manual and see what each bit does. Currently it is possible to look at the memory map and read it there but Keil uVision, IAR System Workbench and Ecplipse based IDEs have nice plugin where you can see the values exactly as in the reference manual. (see the images)

So my question is if there is some plugin or some way how to view and edit these or if I have to write this plugin myself?

In the latter case I would need to know how to connect to the debugger instance and write commands and read output - mainly read data @address and write data @address. I understand that the gdb uses the MI mode. I tried to connect to gdb from different process but that is not possible so I guess that I'll have to create plugin for Qt Creator. The register description is in file format SVD which is XML with defined structure.

To summarize the last part I look for code that I have to implement in the plugin that will connect me to the running gdb and allow me to send and receive data when it hits breakpoint.

STM32 Memory mapKeil registersEclipse registers

1
This seems like using the wrong tool for the job. If you're not using Qt or QML, why are you choosing to use QtCreator? You've listed off a number of environments that have the feature you want, so why are you choosing to not use those? - rjp
I use Qt and QML for Win, Mac and Linux programs and also for Android. Seems to me that it has the capability. The only thing missing is this special view. The other environments have this feature but they are terrible as IDEs. IAR and Keil use their own build system and compilers which is not suitable for me as I need to add custom stuff during built therefore I use CMake. There are also not portable. Doubt Wine would help. - phodina
What about Eclipse with GNU ARM tools? It seems like you're trying to hammer a square peg into a round hole because you like square pegs better than round pegs. You might be able to make it work with brute force, but there are much better solutions. - rjp
I've worked with Eclipse for few years and I never got attached to nor to JAVA so I tend to avoid it. Your right about hammering square peg into round hole. However the question is little deeper as you get access to the MCU you can do a lot of nice stuff e.g. visualize framebuffer, view files on filesystem, analyze received network packets, check memory... You just need to export and import the data. This also something Eclipse doesn't have. - phodina
Eclipse with GDB should be able to import and export data from the STM32's address space. I guess I am confused by what you're asking then, because I have never used an IDE that offers what you've mentioned except for reading and writing the micro's address space. - rjp

1 Answers

1
votes

You don't say whether you are debugging C++ code or QML code, so I can't answer with a yes or no. Those register values are useful if you are debugging at the assembly language level (which in itself may or may not be useful).

If you're debugging C++ code, then you can configure your compiler to generate an assembly listing of that code, but you will be debugging at a pretty low level.

If you're debugging QML code, then you would need an assembly listing of the QML engine, which I doubt you will be able to get. More importantly, I suspect that it would be a waste of time to try to debug a declarative language like QML with such a low level procedural debugger. The point of a language like QML is to get you above all that.