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.

Rookie ask for help: What to do after code generation using Matlab2012b ?

Hi,

I'm using Matlab2012b embedded coder toolbox and CCSv4.2.4.

I followed the instructions in Chapter 42 of Embedded Coder User's guide downloaded from the Mathworks website. Now I've succeed in building the project with Matlab, but when I imported the project to CCSv4 and rebuild it, in the console a lot of similar problems display: [E0002] illegal mnemonic specified. 

One of the two files with build errors is header file, the other one ends with .s62 extension.

And is it possible to MatLab automatically start the CCSv4 instead of CCSv3, that would be much of convenience!

Thanks a lot !!!

  • Hi,

    I am not very experienced with Embedded Coder (it's been a while since I worked heavily with Mathworks), but one thing the error message uncovers is a possible mismatch between the assembly file (.s62) and the target processor configured in the project. I am not sure which processor you are using, but the .s62 file extension is used for linear assembly files designed for C62x devices (they should be compatible with all the newer device families: C67x, C64x, C64x+, C674x, C66x).

    If your device family is C6000, then another possibility is that the autogenerated file has a bug - in this case it would be a problem with the Mathworks tool itself.

    Sorry, I don't know how to configure Matlab to launch a different version of the CCS. Maybe what you are looking for is at page 42-7: Configure Windows Path for TI Debug Server Scripting (DSS).

    Hope this helps,

    Rafael

  • Hi, Rafael, thanks a lot first, the platform I'm using ist the C6713DSK. I've managed the problem by referencing a video, strongly recommended for those who are struggling using CCSv4 or CCSv5 with Matlab embedded coder, here is the link:

    http://www.youtube.com/watch?v=7ed1NLD817s&feature=youtu.be

    Here is generally what I've done:

    1. In the Matlab command window, I typed in checkEnvSetup('ccsv4', 'c6713DSK', 'check') , then it lists several software and their versions and so on. The CCSv4 listed is restricted from 4.0.0 to 4.2.0, while mein is 4.2.4, fearing non-compatible issues I downloaded CCSv4.2.0 and CGT 6.1.18. Maybe Matlab will work with higher CCS versions, but I'm not sure.

    2. In the Malab command window, I typed in xmakefilesetup , uncheck "Display operational configurations only", then select "ticcs_6000_dspbios_ccsv4" ,in the "Tool Directories" tab, choose corresponding folders for the tools. Click "Apply", then click "New" to create a clone of that configuration. Leave the "Execute" tab unchanged, click "OK".

    3. Open a model in Matlab, after configuring the target preference, build the model. CCSv3 could be started from Matlab, but CCSv4 couldn't. CCSv4 and Matlab get related through makefile. The .mdl file will be changed to .rtw file, then compiled by the TLC(target language compiler) into several .c and .h files, then create a .mk file, which is previously configured using xmakefilesetup command. Then a DOS window appears, it seems that the generated makefile is being executed, and calls CCSv4'scompiler, linker, source files, header files and so on. Finally an executable file .out is generated under CustomMW folder.

    4. Open CCSv4, open the target configuration file .ccxml, right click on it and select "Launch selected configuration", then connect the target by choosing Target -> Connect Target. Then load the ,out file to DSP by choosing Target -> Load Program, browse to the CustomMw folder and select the .out file.

    Then it works!!

    In Matlab forum I've seen someone used the batch file in "ticcs_6000_dspbios_ccsv4_clone" execute tab and added some arguments. It's supposed to flash the memory directly without step4. But on my PC it doesn't work, because in the DOS window it says .bat could not be found, although that is already specified in the "ticcs_6000_dspbios_ccsv4_clone" configuration.

    I think CCSv3 is best supported by the Matlab since that's fully automatic, CCSv4 makefile approach is "semi-automatic". I tried to import project generated from Matlab into CCS's workspace, but a couple of errors occured during Build. I don't know why CCSv4 and CCSv5, these higher versions are not well supported by Matlab, compared with CCSv3. I really really wish that in future release Matlab 2013a or 2013b, this situation will be changed.

    I'm a master student and rookie to DSP, there must be some errors or misunderstanding in the post, please point them out if any, I could learn from them.

    Thanks, Rafael and thanks the video again in Youtube, that helped me a lot. Here's the link:

    http://www.youtube.com/watch?v=7ed1NLD817s&feature=youtu.be