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.
Related
I'm searching the internet for a day now and I couldn't find the answer. So I'm connecting from system A (my computer) through ssh to system B (my Raspberry pi) and try to run a program (in c not python) with the input given by something that acts like a keyboard on system B. Can someone explain how to do this? Thank you.
I tried using the function scanf(One who doesn't take risks will not win), but of course this didn't work.
After I tried to use a pipe from a separate program that logs the input of system B.
Then I was clueless hanging around on the internet, but couldn't find something about it.
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.
My setup consists of the Espressif SDK using eclipse and a nodemcu, which I want to program in C.
I have followed all he steps and I can compile and flash the board from the eclipse environment. I don't press any buttons to load the flash because the board can handle it by itself (at least that's what I read). According to this apparently I have a nodemcu 0.9, but the board I have doesn't look quite like the one in the picture (the microstrip antenna looks weird .. and on the back of the board it says www.doit.am ESP12E devkit V2 ... the antenna on mine doesn't even look like the one on the site listed behind the board).
I looked past everything and kept on going. I compiled the blinky example on espressif and flashed it. I saw that it created the eagle.flash.bin and eagle.irom0text.bin and loads them in 0x00000 and 0x10000 respectively (according to documents I've read this is ok). When i reset the board I can see that it really flashed and there is a program in it since the led is blinking. Then I tried the hello_world example. Everything went accordingly and after I reset the board I see that the led keeps on blinking at the same frequency and when I connect to the board via the terminal.exe provided by espressif I can only see garbage in the output, even though the baud is correct according to the code (even so I tried all different bauds possible in terminal.exe).
Ok ... then I went to the blinky example again and increased the delay between blinks. Flashed it and the the frequency stayed the same. I know that it created new .bin files, but still, nothing changed. This led me to create a new project. I did it, following the instructions provided by Mikhail Grigorev. I just put an infinite loop, expecting to get nothing, but after flashing the newly compiled firmware I can still see the led blinking at the same frequency even though there is absolutely nothing in the code, I even wiped the flash before (yes, I verified the flash was empty).
So this lead me to test every single example I could compile. I noticed that some didn't blink the led and others did, like nothing happened. After that i downloaded the nodemcu firmware, and after loading it I noticed that it worked properly and I could even see the ESP in the available wifi networks.
I really don't understand what's happening. Why do some examples work and others don't? Why can't I modify the source code of a simple blinky and see the change? I really prefer to use the esp module this way, since I don't like the arduino interface or the way that it uses a static setup and loop functions, and I don't want to program it in LUA.
I even checked the makefiles provided by espressif and the only difference I can see are the BOOT and APP variables. I even tried modifying them, but still .. no changes.
Can anybody help me?
Ok, finally found my problem. The thing is that the espressif SDK needs some software bits on certain addresses of the flash. What initially happened is that I erased the flash as soon as I got the board, assuming all those binaries would have already been stored in flash.
The next thing I did is that I tried putting all the other binaries, but I was putting them in the wrong addresses, so the software wouldn't work.
Finally, after many many hours of reading forums and reading documentation, I found the correct addresses and it worked.
The addresses are:
0x00000 - boot_v1.6.bin
0x01000 - firmware application (I set the makefile to BOOT=new, APP=1, SIZE_MAP=6)
0x3fc000 - esp_init_data_default.bin
0xfe000 - blank.bin
0x3fe000 - blank.bin
I'm a rookie at C in general and VS 2013 also. I am trying to use some C code provided by a vendor in VS 2013 express. It compiles and runs without problem using the command line compiler but I would like to use the IDE.
I started a new project, C++ for console app, and I have pasted the code into the IDE and saved it as xyy.c so that it builds successfully. I thought it would be nice to have it in a GUI, so I duplicated the effort with a Win32 app project. It also builds.
The program's job is to connect to a PCI card that has Plx chip as an interface and program an FPGA. The Win32 program succeeds, even though I can't see any of the info printed by the program. The console program fails and I think it is because it fails to find the driver for the Plx chip. I thought I would get a clue by single stepping through the Win32 program to see which driver was supposed to be found.
However, after the first pass through a while loop, I get a pop up that says "Source Not Found" and "stack.cpp not found". Google wasn't any help to me.
I be grateful for any suggestions.
You might have "Enable .NET Framework source stepping" enabled (see http://msdn.microsoft.com/en-us/library/cc667410.aspx). So when you are at Stack... and trying to step into, it will actually try, but you don't have the sources for that. There is also a new experience for using the .NET framework reference source that was announced recently: http://blogs.msdn.com/b/dotnet/archive/2014/02/24/a-new-look-for-net-reference-source.aspx
I faced the same problem. I advise at the moment of receiving the information "stack.cpp not found" to look at the stack trace and check if there is something like this: "RTC".
If there is, you need to change the flag along the path (for example, set the Default or a more convenient configuration for you):
Project Properties -> C/C++ -> Code Generation -> Basic Runtime Checks
More details: https://learn.microsoft.com/en-us/cpp/build/reference/rtc-run-time-error-checks?view=msvc-160
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.