Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Good free C debug environment for embedded work

Status
Not open for further replies.

digi001

Full Member level 5
Joined
Apr 5, 2011
Messages
244
Helped
22
Reputation
44
Reaction score
21
Trophy points
1,298
Activity points
2,904
Hi is there a good free C debugger for embedded work?

---------- Post added at 10:44 ---------- Previous post was at 10:20 ----------

I may try to use Microsoft Visual C++ Express 2010.
I would like to run the program:



/* Hello World program */

#include<stdio.h>

main()
{
printf("Hello World");


}




I am getting many errors. Can anyone tell me how this is done?
 

digi001 said:
Hi is there a good free C debugger for embedded work?
There are many, but you need to specify which MCU you will use.


I may try to use Microsoft Visual C++ Express 2010.
This is not for embedded programming, but for PC programming.


I would like to run the program:



/* Hello World program */

#include<stdio.h>

main()
{
printf("Hello World");


}
In which enviroment are you running this code? What errors are you getting?
 
  • Like
Reactions: digi001

    digi001

    Points: 2
    Helpful Answer Positive Rating
Ok here is what I am looking to accomplish:

I'm an EE that sometimes does programming in C. Most of the time I am working with existing code from a programmer and need to debug it to work with hardware peripherals etc. I forget the basic syntax since I only program maybe 1 week out of a month. Sometimes I forget how things work, so I try to look it up on the internet but am usually overwhelmed by the amount of stuff and can't find an answer quickly. So i think it would be easier just to code things, tweak it and look at the output myself.

I work with TI microcontrollers,freescale,microchip.....but what I would like is a independent compilier that I can work with, that doesn't require me to compile the entire code, dump it on the embedded processor, run it and breakpoint. I would like just a very simple interface i can print output to and test some basic code.

For example, I forgot when you cast what happens

int a=0xFFFF;
long b;

b=long(a);

I didnt know whether b becomes 0xFFFF0000 or 0x0000FFFF

little embedded things like this i would like to run on a independent complier that doesnt require any embedded pcb.
 

Well you can use simulator of any modern enviroment to achieve this. Maybe some enviroments have capabilities of virtual screen (mine doesn't).
But staying in your example when someone wants to observe the result of a cast. There is a watch window where you can load variables and observe their values. You can run the code step by step, or by placing breakpoints. I know it is strange when you first work with PC and then with embedded systems, but you can acquire all information you need from the watch window, as well as from other debugger windows.

Hope it helped,
Alexandros

---------- Post added at 17:24 ---------- Previous post was at 17:22 ----------

Since you are working with a lot of MCUs, I would like to tell you that I use IAR EW, a compiler that cooperates with a lot of architectures.
 
  • Like
Reactions: digi001

    digi001

    Points: 2
    Helpful Answer Positive Rating
@digi001

If you are looking for a Free and Open Source alternative:

You could install the Code::Blocks IDE which supports a myriad of Open Source GCC variants including, TI MSP430, ARM, AVR, SDCC, etc.

Of course, Code::Blocks also supports both the Windows, Mac and Linux platforms and compatible GCC compilers as well.

Code::Blocks



@alexxx

There are several embedded platforms which support the .NET Framework and associated languages, like C#, which allow you to utilize the Microsoft Visual Studio for both code development and debugging.

.NET Micro Framework

MSDN .NET Micro Framework

Wiki .NET Micro Framework

Although it primarily supports ARM variants, I have heard the PIC32 maybe a viable target in the future.

BigDog
 
  • Like
Reactions: digi001

    digi001

    Points: 2
    Helpful Answer Positive Rating
@alexxx
thanks for some reason i didnt know about the simulator option.
i tried it out for my processor in code composer studio and well i am not able to get it to work so far, but it should i would hope.

@bigdog
what about Dev C++?
 

I've used both Bloodshed Dev C++ and Code::Blocks. Code::Blocks seems to be much more active in its development and also seems to readily support more GCC variants and platforms.

If you install Code::Blocks and create a new project, you'll see the wide range of GCC variants it officially supports.

BigDog
 
  • Like
Reactions: digi001

    digi001

    Points: 2
    Helpful Answer Positive Rating
I decided to try DevC++ because it looked like a more simple interface. I am not concerned that their software is outdated and not supported because I do not plan to actually develop any code for microcontroller using this tool, I just want this tool to run some very simple C commands.

I am able to write a simple program and output to console.

However! I get this error when trying to debug:

Visual Studio Just-In-time Debugger
-an unhandled win32 exception occurred in gdb.exe

Any idea why I cannot debug on DevC++?
 

However! I get this error when trying to debug:

Visual Studio Just-In-time Debugger
-an unhandled win32 exception occurred in gdb.exe

Any idea why I cannot debug on DevC++?

What OS are you currently running? Is it 64bit?

Are you using the latest version of the Windows Compatible GCC and tools?

Apparently, the executable gdb.exe has failed to run.

You may want to give Code::Blocks a try, it is not a complicated interface.

I successfully install it on a Vista64 system with the included GCC and tools and it seems to function as expected, no problems as yet.

BigDog
 

Yes it is a 64 bit XP.

Ok i just tried Code::Blacks and getting the same exact error message!

---------- Post added at 15:20 ---------- Previous post was at 14:54 ----------

Well i ended using some of the things I learned in Code::Blocks and DevC to get Visual C++ up and running. No errors and it lets me debug. I guess i will use this for the time being.
 

Yes it is a 64 bit XP.

64-bit XP, that maybe your problem. It was never well supported, unlike its 32-bit brother.

Well i ended using some of the things I learned in Code::Blocks and DevC to get Visual C++ up and running. No errors and it lets me debug. I guess i will use this for the time being.

Before you attempt to enter debug mode, when you compile the code, do you receive any compiler errors?

Can you post your code? Or zip up the project directory and upload it?

BigDog
 

No errors on compile. I think your right it may be win xp 64.

Well I am ok for the time being. I can debug using Visual C++ but DevC++ or CodeBlocks doesnt work.
 

Yes, unfortunately Windows XP Pro 64 has always been treated like a red headed stepchild for some reason.

If you are just practicing C/C++ code techniques, then Visual C++ should fulfill your requirements.

BigDog
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top