This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Debug Server: scanf / stdin / System.in not working



Hello,

I am using the Debug Server from CCS 4.2 to control my C5505 eZdsp. I am familiar with the tool chain and the flash tool which is provided via http://code.google.com/p/c5505-ezdsp/. Instead of running that tool from CCS I want to run it from my own JAVA program. Currently, I am able to upload a program (such as the flash tool) to memory and run it. I am also able to capture the "printf" output from my DSP, it is nicely redirected to System.out. Nice! However, the flash tool asks a lot more from the C IO interface. Somehow, my debugger cannot process functions like "scanf". How can I attach a stream, such as System.in, to the DSP (stdin)? Note: I can request user input with System.in, that works. However, the DSP also asks for input, but that request seems to be unprocessed.

The output of my JAVA program (running the eZdsp flash tool):

Boolean Option:
    id: ClearBreakpointsOnLoad
    name: Generic Debugger Options.Program/Memory Load Options.Disable all breakpoints when loading a different program
    value: true
Boolean Option:
    id: AddCEXITbreakpointAfterLoad
    name: Generic Debugger Options.Program/Memory Load Options.Halt at program termination (requires setting a breakpoint)
    value: true
Boolean Option:
    id: AddCIOBreakpointAfterLoad
    name: Generic Debugger Options.Program/Memory Load Options.Enable CIO function use (requires setting a breakpoint)
    value: true
Radio Button Option:
    id: VerifyAfterProgramLoad
    name: Generic Debugger Options.Program/Memory Load Options.Verification Options
    value: Fast verification
    choices:
        Full verification
        Fast verification
        No verification
Boolean Option:
    id: UseLegacyStopMode
    name: Generic Debugger Options.Realtime Options.Halt the target before any debugger access (will impact servicing of interrupts)
    value: false
Boolean Option:
    id: AllowInterruptsWhenHalted
    name: Generic Debugger Options.Realtime Options.Service critical interrupts when halted (enables non-intrusive accesses on legacy drivers)
    value: false
Boolean Option:
    id: UsePreEmptiveAccesses
    name: Generic Debugger Options.Realtime Options.Perform pre-emptive accesses (debug access may stall the target)
    value: false
Boolean Option:
    id: PoliteRealtimeMode
    name: Generic Debugger Options.Realtime Options.Enable polite mode (respect HPI, DBGM and FRAMEID)
    value: true
String Option:
    id: AutoRunToLabelName
    name: Generic Debugger Options.Auto Run Options.Run to symbol
    value: main
Boolean Option:
    id: AutoRunToLabelOnRestart
    name: Generic Debugger Options.Auto Run Options.On a program load or restart
    value: true
Boolean Option:
    id: AutoRunToLabelOnReset
    name: Generic Debugger Options.Auto Run Options.On a reset
    value: false
Boolean Option:
    id: ConnectOnStartup
    name: Generic Debugger Options.Launch Options.Connect to the target on debugger startup
    value: false
Boolean Option:
    id: EnableInstalledBreakpoint
    name: Generic Debugger Options.Launch Options.Restore breakpoints from previous session
    value: true
Boolean Option:
    id: IgnoreSoftLaunchFailures
    name: Generic Debugger Options.Launch Options.Continue debug launch if target connection or program load fails
    value: true
Boolean Option:
    id: HaltOnConnect
    name: Generic Debugger Options.Connection Options.Halt the target on a connect
    value: false
Boolean Option:
    id: AutoResetOnConnect
    name: Generic Debugger Options.Connection Options.Reset the target on a connect
    value: false
Boolean Option:
    id: RemoveDebugStateAtConnect
    name: Generic Debugger Options.Connection Options.Remove remaining debug state at connect
    value: true
Boolean Option:
    id: AutoConnectIfChildConnects
    name: Generic Debugger Options.Connection Options.Auto connect if a child connects
    value: true
Boolean Option:
    id: ThreadDebuggingEnabled
    name: Generic Debugger Options.OS Aware Debug Options.Display processes and threads in the debug view
    value: true
Boolean Option:
    id: AutoRefreshThreads
    name: Generic Debugger Options.OS Aware Debug Options.Update process list on every halt
    value: true
Radio Button Option:
    id: ModuleDebuggingEnabled
    name: Generic Debugger Options.OS Aware Debug Options.Automatically load module symbols
    value: Never
    choices:
        Never
        When modules are loaded and unloaded (intrusive on target execution, and requires a patched kernel)
        Whenever halted in the module load/unload routines (you must manually set breakpoints in the appropriate routines for this to work)
String Option:
    id: ModuleNameList
    name: Generic Debugger Options.OS Aware Debug Options.Module name list
    value:
String Option:
    id: ModuleSearchPath
    name: Generic Debugger Options.OS Aware Debug Options.Module symbol search path
    value:
Boolean Option:
    id: PipelineAccuracy
    name: Generic Debugger Options.Simulators will flush the pipeline on a halt
    value: true
Boolean Option:
    id: PreventStepIntoAsm
    name: Generic Debugger Options.Automatically step over functions without debug information when source stepping
    value: true
Boolean Option:
    id: ResetOnRestart
    name: Generic Debugger Options.Reset the target on a program load or restart
    value: false
Boolean Option:
    id: LowPowerRunMode
    name: Generic Debugger Options.Allow power transitions while running if supported (low power running)
    value: false
Boolean Option:
    id: DisableIntWhileAsmStepping
    name: Generic Debugger Options.Disable interrupts.When assembly stepping
    value: true
Boolean Option:
    id: DisableIntWhileSrcStepping
    name: Generic Debugger Options.Disable interrupts.When source stepping
    value: true
Boolean Option:
    id: DisableIntWhileRunning
    name: Generic Debugger Options.Disable interrupts.When running
    value: false
Radio Button Option:
    id: TMS320C55XX_DisassemblyStyle
    name: TMS320C55XX.Disassembly Style
    value: Mnemonic
    choices:
        Algebraic
        Mnemonic
Boolean Option:
    id: TMS320C55XX_HexDisplay
    name: TMS320C55XX.Immediate Values.Hexadecimal Display
    value: false
Connecting to device...
C55xx: GEL Output: Configure PLL (100.00 MHz).

C55xx: GEL Output: Wait until TESTLOCKMON is high...

C55xx: GEL Output: After checking TESTLOCKMON bit...

C55xx: GEL Output: PLL Init Done (100.00 MHz).

C55xx: GEL Output: Target Connection Complete.

Input your binary file path...
SPI EEPROM...
Writing data to device...
Opening €DÇ㟼ýÈúY@K:mBNZôå‰Oéá\‚,°X•PPêÆÈ dGÛ(?Ã9eª°öc•㎊òK•’„9¼JnS÷pÁ0š—|H‘aX„'_’ŇյÀD©o–n‘ÌyéËFšB qŽƒˆZ—–p?...
Unable to find file!
Connected.

  • Perhaps I should rephrase my question. With CCS it is possible to debug your program by using printf and scanf statements. Whenever your DSP executes those statements, they are redirected to the 'command line' of CCS, nice! However, now I want to have the Debug Server to take over that role. It is instantiated through JAVA. Now, whenever the DSP executes a printf statement, the printf statement is nicely redirected to the command line of my program. However, it seems that the Debug Server does not respond to scanf statements issued by the DSP. How can I fix that?

    I hope you now can help and understand my problem better.

  • Do you still need help with this issue?

    You should submit your question to the Code Composer Studio support forum. I am pretty sure you already found this Wiki Support Page

  • We do not  see anything regarding scanf support in the WikiPages.
    The code does not halt at scanf and wait for user inputs when you run via DSS only.

    The same works fine if you run the script from scripting console. Is there anyway to make this work without using the IDE?

    --
    Chaitanya