This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CMSIS dsp - no hardware debugging

Hi,
I normally work with data in Matlab, but I have to to convert my Matlab work to CMSIS dsp library. I don't have any experience in embedded programming and I can't understand how some things work.
I downloaded Keil MDK pack with their IDE and CMSIS dsp pack. I can open pack installer in IDE, choose Simulator as board and copy example with DSP_Lib. Then I have example program and it builds, everything looks fine.
How can I however run this program and analyse input and output signal?
If I start debug I can go throught entire program but I can't get any values. There is code:
#if defined(SEMIHOSTING)
#include <stdio.h>
#endif
Printing output could help but it doesn't work as semihosting is not definied in any of DSP examples. So how can I get values of output so I could what signal did I get? I don't have any hardware so I need to simulate this procces.
In this Youtube clip there is at least memory window where You can see nice decimal values of an array in testOuput variable. If I try to do the same I can only see some random hex values.
Any help with understanding how it works or how to get what I need would be great.
 
Parents
  • My go-to for print output is the Event Recorder. I used the CMSIS DSP FIR example for a Cortex-M0 target. It ran out of the box, with the only modifications needed being to change the debugger target and add EventRecorder. These steps worked for me:

    1. Use the Manage Run Time Environment tool to enable Event Recorder and send STDOUT to EVR. This will add EventRecorderConf.h to your project, under the Compiler group.
    2. Add #include "EventRecorder.h" to your main file
    3. Open EventRecorderConf.h and use the configuration wizard set the timer source to SysTick
    4. Add the statement EventRecorderInitialize(EventRecordAll,1); to main(), before you do any STDIO.
    5. Open the project options and add SEMIHOSTING to the list of defines on the C/C++ tab
    6. (Optional) Set the debugger to Simulation (because I don't have MDK Pro, so couldn't use the default debug target of fast models)
    7. Recompile
    8. Launch the debugger
    9. Set up your memory window to the data you want to see. Right click in the middle of the displayed data and set the format (e.g., float) so that it doesn't show as hex.
    10. Open a debug printf window with View > Serial Windows > Debug (printf) window
    11. Run the code

    If all went well, you should see non-zero floating-point data in your output and whatever you wanted printing in the debug printf window.

    EventRecorder is very useful and quite well documented. You can use the EventRecorder API to push any data you like to the debug host. The IDE also supports user-defined debug functions (see uVision help) that can be defined to pretty-print your output to the debugger's command window, 

Reply
  • My go-to for print output is the Event Recorder. I used the CMSIS DSP FIR example for a Cortex-M0 target. It ran out of the box, with the only modifications needed being to change the debugger target and add EventRecorder. These steps worked for me:

    1. Use the Manage Run Time Environment tool to enable Event Recorder and send STDOUT to EVR. This will add EventRecorderConf.h to your project, under the Compiler group.
    2. Add #include "EventRecorder.h" to your main file
    3. Open EventRecorderConf.h and use the configuration wizard set the timer source to SysTick
    4. Add the statement EventRecorderInitialize(EventRecordAll,1); to main(), before you do any STDIO.
    5. Open the project options and add SEMIHOSTING to the list of defines on the C/C++ tab
    6. (Optional) Set the debugger to Simulation (because I don't have MDK Pro, so couldn't use the default debug target of fast models)
    7. Recompile
    8. Launch the debugger
    9. Set up your memory window to the data you want to see. Right click in the middle of the displayed data and set the format (e.g., float) so that it doesn't show as hex.
    10. Open a debug printf window with View > Serial Windows > Debug (printf) window
    11. Run the code

    If all went well, you should see non-zero floating-point data in your output and whatever you wanted printing in the debug printf window.

    EventRecorder is very useful and quite well documented. You can use the EventRecorder API to push any data you like to the debug host. The IDE also supports user-defined debug functions (see uVision help) that can be defined to pretty-print your output to the debugger's command window, 

Children
No data