Getting started with an open source project (Cortex-m debugger)
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Getting started with an open source project (Cortex-m debugger)
Hello Linux lovers!
I'm an experienced programmer for embedded platforms (8051, PIC, AVR, ARM Cortex-M) and I've a solid knowledge in C programming and assembly. I also have some experience in Linux software development (C, C++ and wxwidgets), but I used to write simple programs for specific functions.
Recently I've started developing for Cortex-M microcontrollers (STM32F4) using gnu tools and openocd for debug. Initially I tried to use Eclipse IDE, after all configurations I've got it working, but Eclipse is so bloated and buggy that is impossible to use it for medium to big projects. Now I'm using make scripts for compile and gdb + openocd (terminal) for debugging, believe or not: still easier and more productive than using Eclipse.
Well, the gdb alone isn't very suitable to debug microcontroller firmware, since you need to watch peripheral's registers and see them in a proper way (access by their names and have labeled bit fields). I tried ddd, but it didn't help so much and still using the old X11 style.
So I've decided to write my own GUI interface for gdb (ARM) following this goals:
- Use wxwidgets;
- Each Cortex-M microcontroller will have a xml file that describes the memory map and all peripheral registers;
- Highlight C and assembly code;
- Show details about the current context (Thread or Handler mode, privileged or unprivileged mode, pending exceptions, etc).
In the future I plan to make it cross-platform, but initially it will only run on Linux.
My problem is that I don't have experience for creating and managing medium or large open source projects and what tools I need to use. For example, I see a lot of code repositories that uses advanced make scripts, configuration scripts, documentation tools, etc. Can anyone explain what tools I need and why? Maybe someone can post an initial template for c++ projects? Any hints for this project?
I suppose at a bare minimum you will want to check out Autoconf and Automake.
Autoconf is more important when you are developing for multiple platforms. It depends on another Gnu piece of software, M4. Autoconf produces shell scripts which will automatically configure your source files depending on platform and features.
Automake will produce makefiles, which as you probably know, run the sequence of commands necessary to compile, link, and install your software (among other things).
Both programs can be rather complicated, but the Gnu website has decent documentation on both, should be enough to get you started:
There is also a pretty decent book on the Gnu autotools from No Starch if you really want to get down and dirty: http://www.nostarch.com/autotools.htm
As for documentation tools, there are thousands of different ones that you could use. My suggestion is to have a search, try a few, and standardize on the one you like best.
Also: Many IDEs will create skeleton make/configure files and templates when you start a new project. I am most familiar with Kdevelop, but again, have a search and see what's out there.
No problem. You can also use make to build documentation targets, such as man pages, html or pdf docs, and the like.
There is also a newer build system out ther called Cmake that a lot of projects are using now (KDE comes to mind). I have not used it yet personally, but it is probably worth checking out.
That's a personal choice I suppose. If you prefer the CLI you can of course use vim or emacs. I myself use Kdevelop, and like it very much. It has hundreds of features, the most useful of which I find is the fact you can mouseover any variable or function call and a popup will show you where it is defined, and even open headers or other files so you can read the definition. Downside is that it needs at least kdelibs installed which is a pain in the butt if you don't use KDE.
If you develop on different computers I would recommend creating a remote git repository on github, makes it very easy to share your source between different computers.
Ah, I gotcha. I've very little experience with those kind of tools, but I understand they help to vastly speed up GUI development. It is much easier (and less bug-prone) to layout your GUI visually than to do so with straight code. I'd give them a try, maybe with just a tiny project first to see how they work.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.