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
  • I've worked with a DSP project where I needed to print the values of functions out. What I did was added functions to the ini file listed at the Options for Target - Debug tab's Initialization File field. If you don't have one, just use a text editor to create it and save to as file_name.ini.  The functions acted as wrappers for the stdio printf. There was an array, output[1023], being used with fft functions that I was interested in. In one context the first 512 elements were interesting, in another, all 1024 were interesting. 

    .ini contents: 

    FUNC void print_output512(void){
    	unsigned int i;
    	printf("BEGIN OUTPUT 512\n");
    	printf("BEGIN OUTPUT 512\n");		
    	printf("BEGIN OUTPUT 512\n");
    	
    	for(i = 0; i < 512; i++) {                                                       
    			  printf("%f\n",output[i]);
    		}
    	
    	}
    
    FUNC void print_output1024(void){
    	unsigned int i;
    	printf("BEGIN OUTPUT 1024\n");
    	printf("BEGIN OUTPUT 1024\n");
    	printf("BEGIN OUTPUT 1024\n");
    	
    	for(i = 0; i < 1024; i++) {                                                       
    			  printf("%f\n",output[i]);
    		}
    	
    	}

    If I recall correctly, you then compile and in debug use the command INCLUDE file_name.ini. Then you can set a breakpoint where your interested in viewing values and call the functions by name in the command window. You can copy and paste from here. 

Reply
  • I've worked with a DSP project where I needed to print the values of functions out. What I did was added functions to the ini file listed at the Options for Target - Debug tab's Initialization File field. If you don't have one, just use a text editor to create it and save to as file_name.ini.  The functions acted as wrappers for the stdio printf. There was an array, output[1023], being used with fft functions that I was interested in. In one context the first 512 elements were interesting, in another, all 1024 were interesting. 

    .ini contents: 

    FUNC void print_output512(void){
    	unsigned int i;
    	printf("BEGIN OUTPUT 512\n");
    	printf("BEGIN OUTPUT 512\n");		
    	printf("BEGIN OUTPUT 512\n");
    	
    	for(i = 0; i < 512; i++) {                                                       
    			  printf("%f\n",output[i]);
    		}
    	
    	}
    
    FUNC void print_output1024(void){
    	unsigned int i;
    	printf("BEGIN OUTPUT 1024\n");
    	printf("BEGIN OUTPUT 1024\n");
    	printf("BEGIN OUTPUT 1024\n");
    	
    	for(i = 0; i < 1024; i++) {                                                       
    			  printf("%f\n",output[i]);
    		}
    	
    	}

    If I recall correctly, you then compile and in debug use the command INCLUDE file_name.ini. Then you can set a breakpoint where your interested in viewing values and call the functions by name in the command window. You can copy and paste from here. 

Children
No data
More questions in this forum