Debugging access to DSP memory using OCSUnk embedded object[Copy link]
Using MATLAB's object-oriented programming technology and CCSLink technology, you can create embedded objects for all C symbols in the target program and operate the C symbols through objects. In this program, first reset the DSP and create an embedded object: restart(cc) %Reset the program and point the PC to the program entry goto(cc,'main') Position the PC to the main program entry cvar=createobj(cc,'table') %Create MATLAB object cvar for operating the embedded object table Copy code The above statement creates a MATLAB object pointing to the C symbol in the DSP, so that all or part of it can be read and modified. read(evar) %Read the embedded object into the MATLAB workspace write(cvar,4,10) %Change the 4th element of the filter coefficient to 1O set(cvar,'size',E11]) %Change the order of the filter Copy code Through CCSLink, you can not only create objects for array variables, but also create objects for all data structure variables defined in C and perform corresponding operations, for example: cvar=createobj(cc,'etype') %Create a MATLAB object pointing to a C enumeration constant write(cvar,'errorcondition','NO_ ERROR') %Reassign the enumeration constant Copy code The above statements all use the object cvar in the MATLAB environment to read, write and modify the data structure variables in the DSP C language program without stopping the execution of the program on the DSP hardware. This is very necessary and convenient for debugging real-time embedded systems.