Logging actions - Keil Microvision with Proteus Pro - stm32

I work with STM32CubeMX, Keil Microvision and Proteus Simulator, I use C programming language in Keil microvision, how can I print value of some variable and display that value in Proteus log window, any help will be welcome. Do I need to include some library for that action, I tried printf function but program doesn't recognize that part

Related

Debug .hex file with STM32CubeIDE

I am quiet new to STM32 developement.
I made a custom .hex file, which corresponds to my binary file with a CRC at a given address. To achieve this, I followed this instructions.
Right now, I am stuck at step 11, where the author tells STM32CubeIDE to debug current project with its custom .hex file instead of standard .elf file.
My problem is that this instructions are quiet old and IDE's UI is different now. How can I achieve this step with latest STM32CubeIDE version ? (1.6.1 at time of writing)
Thanks.
It is quite simple.
Create HEX
Manually flash it
Start debugging the normal way. Simply do not let openOCD or ST-LinkGDBServer to flash the chip.
Enjoy.
I have got the same problem, and my solution is to use stm32cubeProgrammer. It can't show the debug information, so I use usart to show the CRC result.

avrdude programmer is not responding when uploading a .hex file

I'm trying to upload a hex file to atmega328 on my arduino UNO board that I builded with eclipse's AVR plugin but when I run avrdude -pm328p -carduino -P/dev/ttyACM0 -b9600 -Uflash:w:/home/bruno/workspace/testAVR/Release/testAVR.hex:a I get avrdude: stk500_recv(): programmer is not responding
I tried to upload a blink led code using arduino IDE and it worked fine.
This is a fairly general error that can be caused by any number of things. Try adding a -vvv flag (or maybe -vvvv) which will give you more verbose output when programming.
One thing to try is hitting the reset button on the Arduino immediately after avrdude writes the first few bytes.
Ensure that there is nothing shorted, and that the Uno has a stable power source. Also, if there is anything connected to the RX/TX pins, that can cause a programming issue.
Make sure you are using the correct programmer, if your Arduino is a clone, you might need -c arduino-ft232r.

Activating/Using ISim tool chain with Eclipse (VHDL)

I'm attempting to program very basic VHDL on eclipse using the Sigasi plugin with an educational license - with the aim to be, I can program a simple entity and a test bench for it, then compile and simulate it in Xilinx's ISim.
I have installed Eclipse, Sigasi & Xilinx ISE Webpack, and have attempted to add the ISim toolchain to Eclipse as shown in the Sigasi website here
It appears okay but it says I need to "activate" the toolchain (as shown below)
However, when I follow the "click here to activate now", I get taken to the scree below - from which nothing happens. If I click Apply, nothing happens, there's no further options!
My question - how do I actually configure ISim to launch from Eclipse, is what I want to do actually possible or have I misunderstood and if so, how do I do it.
Thanks very much for your help!
David
When you enable the ISim toolchain, Sigasi will automatically compile your files with ISim when you save your files. You can check the output in the Console View
To start a simulation, you need to set a top-level first. You can do this in the Hierarchy View. Next, click on the Simulate button.
You can find more details in the Sigasi Studio manual

Is GpioPinDriveMode.InputPullUp and GpioPinDriveMode.InputPullDown Supported?

When writing a Windows Universal App to run on a Raspberry Pi 2 with Windows 10 IoT I would like to have my input pin as a PullDown input. The GpioPinDriveMode enumeration includes input pullup and input pulldown as shown here. My concern is that the Visual Studio 2015 intellisense is showing a "not supported" tool tip when using the pullup or pulldown enumeration. Is it in fact not supported ?
The short answer to your question is yes - but you can also always verify this in your code as well.
E.g., in C#:
if (buttonPin.IsDriveModeSupported(GpioPinDriveMode.InputPullUp))
blah, blah, blah
HTH.

How to stop Matlab crashing on (wrong) mex-file execution with CUDA functionality

I'm currently developing a mex-file with CUDA functionality to be used in MATLAB. When I'm doing something wrong (e.g. wrong pointers or something like that), MATLAB always crashes (windows prompts me to end, send the report for mathworks or attempt to continue). Is there a way to prevent this from happening? It's really annoying to develop like that but as you probably know yourself: Hardly anybody can write perfect code without 'trial and error'...
Thanks so far!
As far as I know, there is no way to prevent Matlab from crashing on a mex bug. But you may be able to attach a debugger to the Matlab process and step through the code.
I know for a fact that this works if your code is in an external dll that you load into Matlab. I am not sure if this works with mex files.
From the Matlab MEX file page,
mex -g yourmexfile.c
if you're not doing this already.
You can debug Matlab mexfiles including CUDA codes using Visual Studio and NVIDIA Nsight for Visual Studio by the following procedure.
Define the system environmental variable NSIGHT_CUDA_DEBUGGER and set it to 1.
Launch Matlab.
Launch NVIDIA Nsight. Right click on the Nsight Monitor icon on the taskbar and select Options. Select the CUDA tab. For the option Use this Monitor for CUDA attach, click the drop-down menu and select True.
Open your project in Visual Studio, set the breakpoints and compile it.
Go to Tools -> Attach to Process.
Click the drop-down menu next to the Transport field, and choose Nsight GPU Debugger.
Ensure that your host machine name is listed in the Qualifier field.
Note that this field is blank by default; you will have to manually select your machine name the first time this dialog is opened.
When you enter your computer's hostname in the Qualifier field, a list of available processes will appear in the dialog box. Processes that may be attached with CUDA usage will appear with CUDA listed in the Type column. If a process is grayed out and CUDA is listed in the Type column, it is already being debugged, so it is not attachable. Processes that are grayed out without CUDA in the Type column indicates that it has no CUDA usage in the process to be debugged. Processes that may be attached will appear normally, and the Attach button will be enabled.
Ensure that Matlab has CUDA in the Type column and select it.
From the Matlab command line, invoke the function defined in the CUDA mexfile. The execution will then stop at the first breakpoint and debugging could start.