I thought the following would put out a message and cause VDSP to pause till the gets was completed
-- but it does not. I would prefer not to have to use break points
I used to pop up some sort of response window in VDSP -- just can't remember syntax -- any body help. Not sure what to look for under "help"
#include <stdio.h>
void GetBuffer(char *buff) {
puts("If gets( ) is not waiting -- then set a break point at this line of code\n");
puts("Waiting for you to hold the switches down and then press return");
gets(buff);
}
Thanks
Hi Mike,
in a trivial example (e.g. 'do something'... GetBuffer()... 'Do something else'), the code you have posted below does cause an "stdin" pop-up that 'pauses' the application while it waits for input. This wouldn't occur if you have redirected STDIO in your application away from the default PrimIO device - is this possibly the case? Also note that such a 'halt' will only halt the core, while peripherals and DMA operations will continue to function.
Hi Craig
A trivial example that I would expect to cause the stdio popup window to occur would be
void main(void) {
char buff[80];
gets(buff);
}
I get no pop up window.
I was using a custom .xml file to handle watch point registers -- the normal VDSP environment does not reset these to zero if you change the settings.
I can't see why those settings would cause a stdio redirection. Any way, I remove the customization from "Settings" restarted VDSP and the board.
Removing the custom xml does not help
I have traced _gets as far as _dev_read -- and it gets there
--
Lets try work backwards.
Lets assume I wanted to "redirected STDIO in your application away from the default PrimIO device" how would I do that?
Then I can check to see whether that setting has been set, although I don't remember doing it.
Thanks
Mike
I also looked at help and found this -- did not work
#The -full-io switch links the application with a third-party, proprietary I/O library. The third-party I/O library provides a complete implementation of the ANSI C Standard I/O functionality at the cost of performance (compared to the Analog Devices I/O library). For details, see "stdio.h".
#Invoke this switch using two options: the Full I/O check box located in the VisualDSP++ Project Options dialog box (Compile : Processor (1) page) and the Full ANSI C Compliance option button located in the I/O Libraries area of the VisualDSP++ Project Options dialog box (Link : Processor page).
Here is my trivial example
#include <stdio.h>
int main(void) {
char buff[80] = "Original buffer";
printf("Doing a gets\n");
gets(buff);
printf("buff was >%s<\n", buff);
}
and associated executable attached
I can't see anything particular weird in anything
Hi Craig
I am still using the HPPC-ICE links to my boards -- any chance that it is an (updated) driver issue?
Now the weekend's over , going to try it in my University lab to see if I can duplicate the effect.
Just tried it with the simulator -- no window pop-up so I think that says not a specific HPPCI driver issue
You noticed how many extra blank lines this site is adding for every blank line you type in? Has somethiong changed?
I have a total of 4 'single blank lines inserted between sentences. Seeing 1 blank line, 3 blanlks lines, 2 blank lines and then 4 blank lines on the displayed page. Must be all those frustrated stdio pop-up windows trying to break through my screen
Just noticed that the ? has an extra blank line after it that I did not put in. Would almost suggest that it is a linux windows PC "carriage return" (0xD) "line feed" (0xA) confusion issue
Mike
Hi Mike.
sorry for the delay in getting back to you. Firstly, regarding redirecting STDIO; this is something that you would know you have done. It requires that you register a new DevEntry structure device driver using add_devtab_entry. It's explained in full detail in the Compiler and Libraries Manual under 'C and C++ Run-Time Library Guide'->'File I/O Support'. But it's something that you have to explicitly do in your application, rather than being an IDDE option for example.
I tried the DXE you provided in your previous post, and it produces a pop-up stdin window. I always use an HPPCI-ICE too, but also tested with HPUSB-ICE and Simulator and saw the expected pop-up on all three.
One thing that now occurs to me, is that you mentioned you are trying to avoid using breakpoints, are you removing the breakpoints from the Active/Automatic list in the IDDE? If this is the case, the required __primIO breakpoint may be getting removed, which could cause the problem. Can you please check under 'Settings'->'Breakpoints'->'Automatic' to see if this breakpoint is enabled or disabled.
thanks,
Craig
I just checked under automatic
The unhandled exception error breakpoint is enabled -- and I can ensure you that works well ![]()
The __primIO is enabled already
So I cleared it -- rebuit the example and ran it
now I am getting no I/O what so ever -- meaning print statements are NOT occurring
So I now set the __primIO breakpoint -- rebuilt the example and ran it
Print statements now occuring (O) but the gets is not (I)
Have just tried the same simple program on a machine at work -- popup window appears immediately
So it must be "my system". Just weird that the __pimIO interrupt works for print and not for gets.
I tried fgets(buff, 80, stdin) but that did not work either. Perhaps I will try to open a non I/O input stream and see if I can read the content of a file stored on the PC. That way I can check file handling issues in general
Is there any way I can print out where the stdin hook is going?
Hi Craig
I tried the other suggestions and initially thought they worked.
The problem reappears with the JTAG frequency selection operation
After the fixes -- I/O window popped up at 10 MHz JTAG frequency -- first time I tried the simple program
Switched to 33 MHz JTAG connection -- At 33 Mhz -- pop-up window does NOTappear
After a fight with the system I got the JTAG back to 25 MHz -- pop-up window does not work
-- Suggestion there -- tools should add a pop-up window that says 'recycle board and VDSP' as the selection arrow never moves until you power down VDSP
Then got it back to 10 MHz -- pop-up window still does not work
Tried building a new session with the JTAG set at 10 MHz before building the session -- also recycled board and VDSP -- pop-up window does not work at 10 MHz.
Question -- the arrow in the selection window says 10 MHz -- but is the system really at 10 MHz JTAG?
Mike
Hi Mike,
Just a shot in the dark here but from prior posts I know that you tend to use .vbs scripts for various purposes in your environment. Is it possible that in one of your scripts you have set the ADspApplication::Interactive flag to False? This would have the effect of disabling the popup while still allowing other non-blocking STDIO operations such as puts() or printf() to continue to function.
Glen
With the latest sort of tests with the very simple gets and print -- no
.vbs has been used -- also pop-up window worked until I changed JTAG
settings
How did you change your JTAG settings? With a Python script? If a script is still running in the background, the stdin dialog won't be displayed. A quick way to check if a script is still running is to look at the Debug/Halt Script menu item. If it's enabled, then a script is still running.
Manually via the settings menu
However, I have loaded a script automatically when I start the system-- see cut-andpaste from the console window.
Loading C:\Program Files\Analog Devices\VisualDSP 5.0\System\EmbeddedUnit\VDSPTools.vbs
Loading: "E:\Documents and Settings\smith\My Documents\My Webs\ENCM511_09\09Labs\DontPublish09_ENCM511LabValidation\CraigExample\Debug\CraigExample.dxe"...
Load complete.
JTAG
That should not be running as it sets up some tools -- also it is counter indicated as the stdio window worked initially at 10 MHz
However I have gone back and reset the VDSP properties, causing JTAG to default to 10 MHz -- now the stdio window does not come back up
I could not find where I am automatically loading this file through the VDSP settings, so I went and changed its name so it could not be used. I restared VDSP and saw the message
Error: Unable to open the file: C:\Program Files\Analog Devices\VisualDSP 5.0\System\EmbeddedUnit\VDSPTools.vbs
so the script is no longer loaded (and therefore can't be running in the background -- Unfortunately
stdio window did not reappear
Message was edited by: Mike Smith
I have just reloaded the original script and then checked the debug halt script button (wish I had known about that button before
when I was writing scripts).
The debug halt script menu option is greyed out -- so I think that confirms there is not a script running.
Thanks for the thought
Message was edited by: Mike Smith