IAR Teminal IO not logging printf output - arm

I am building an embedded application project using the IAR Embedded Workbench Arm 8.30.1. I used printf statement to log output to the Terminal IO. However, i can't see the output logged to the Terminal IO window and the log file. But theAuto Window` displays the values of the variable correctly. I am using ST-Link debugger.
No output in Terminal IO after the printf statement is executed

In Project, opention general options, library config = enable semi-hosting. Just to the right, pick the "stout/sterr" method - "via hosting", or via "SWO" if you have a debugger pod attached.
Download to start the debug session. Chose View->Terminal I/O,, and you printfs should come out there.
Bug IAR if it can't work - they can help also.

Related

Printing (in C) to IDE console on STM32CubeIDE

I'm starting to use CubeIDE to program a NUCLEO-F401RE board (with sensors attached) and in one of my projects I had to get the voltage of the board and print it somewhere on my laptop (connected to the board via usb cable).
I got this to work using HAL_UART_Transmit function to send the string and PuTTY, on my laptop, to receive and print the string.
Now, I noticed that there is a Console integrated in the IDE where the IDE automatically prints control information, compilation errors and such and I'd like to print the voltage (possibly using printf since I'm programming in C) here rather than using PuTTY, but it doesn't seem so straightforward (as in many other IDEs that I've used) from what I've read on the internet, for instance, here.
I get that here we have two different computers talking to each other, so printing using printf is not as easy as in other situations where code is written, compiled and executed all on the same computer.
My question is:
why isn't there a "console tab" in the IDE where the result of the printf, generated on the board, is displayed? And if there is, how to set it up? Is it simply some settings configuration in the project properties or do I have to modify the low level I/O C functions as stated in the discussion linked above?
Thank you.
Create a new Command Shell Console.
Configure the new Console just as you did with PuTTY.

How to debug C application using eclipse IDE under Linux

As you know,eclipse IDE has a convenient attached debugging facility for C project.You can see it from the GUI and you can use this facility to debug process that are already in running status,like daemon process..
My question is that when a process just started and I want to debug it from the begining of the process(i.e. from the first line of main function),how I can do it using the IDE?
I know under Windows,there is a tool called gflag,using this tool we can do some configuraitons before starting the process,and when the process is launched,the gflag can detect this and let the debugger tool(e.g. virtual studio) attach the process automatically.
Do not tell me that use sleep fuction.
Check CDT reverse debugging. You will need GDB 7.0 or later for this feature.
Refer
How_do_I_do_Reverse_Debugging
Open source code with eclipse and double click the left of line number to add a break point. Then you can create a session to debug your application

Serial Port Program crashes (no core dump)

im making a C project for university in Linux, its basicaly a protocol for file transfer between 2 computers. The program works fine and it sends many files without any problem, but there is 1 or 2 files i have tested and the program just crashes without any report and i just dont know how to debug the problem. Any help would be appreciated.
I also dont know if i should post the code or not, because both files (application and protocol) have over 1.5k lines of code.
In most Linux Distributions the core dumping is disable by default (which can be viewed from the system resource limit "ulimit -c" will be zero if it is disabled). To enable the same, use "ulimi -c unlimited".
To add, in Ubuntu like modern distributions, they have customized program to send the report/core file to Ubuntu developers specified in "/proc/sys/kernel/core_pattern". Make sure to change it for development purpose to debug further.
You can even try "valgrind" or "gdb live debugging" to have more clarity about the problem.

Debugging C applications in MonoDevelop fails

debugging in MonoDevelop does not work for me. First of all, I have installed MonoDevelop, GNU Debugger plugin and ctags through Ubuntu software center and I'm using Ubuntu 10.10.
When I press "Debug" it goes into debug mode but very quickly returns to "normal mode". My simple application contains some scanf so it should wait for input and I have also set a lot of breakpoints.
My application works perfectly when I run it without debugging and it debugs fine if I use gdb manually. Of cause, I've tried rebooting and installing multiple times.
Any ideas on what goes wrong?
Update:
I have checked the MonoDevelop log and it goes like:
OnTargetEvent, type - TargetExited
...
Thanks, Lasse
I suggest you file a bug.
You might want to check for errors in the MD log (~/.config/MonoDevelop/log) and the debugger output pad. Also, are you using an external console?
It have now been fixed :) : https://bugzilla.novell.com/show_bug.cgi?id=624776

Eclipse cross-compile... how can I do that?

I am developing on a Windows machine using Eclipse in C code.
All the files are physically located on a Linux server.
I am using Eclipse only for editing and code browsing.
When I want to compile, I open a terminal and telnet to the Linux server from which I call a file that sets up few variables and eventually invoke a "make" command.
The server is pretty busy.. I would then like to be able to compile locally [and then just ftp these executable files back to the Linux machine so that I can execute them.. unless Eclipse can do that on its own :) ].... any idea how can that be done? I am not well versed in Eclipse or OS usage.... so if you could answer and explain what I should do.. I would really appreciate...
I changed the Build Command under Project Properties menu by just calling the script file on the server I usually invoke to compile... That looked fairly simple.. well... that was too good to be true... and of course.. it didn't work! I am getting this error if I use the default "make" (Cannot run program "make": Launching failed).... while getting (Cannot run program "T:\compile": Launching failed) if I try to invoke my script file that I use to compile...
thanks,
You should take a look at running a crosstool-ng setup on your windows box inside cygwin. And then have eclipse use that compiler. This will allow you to develop for your target Linux platform easily.
Here's some slides
It sounds like you're developing for a desktop/server platform, so you'll have to make sure you set up your crosstool-ng with the same versions of standard libs as your server has (libc, libstdc++, etc). You also want to make sure your crosstool-ng has the same version of gcc as the target as well.
If you don't want to mess with getting all that setup, you could always install Linux as a virtual machine on your windows box and work inside there.

Resources