Other Parts Discussed in Thread: CONTROLSUITE
please help me,
I want to use simulink with h52c1 experiment kit. is it posibble? I search all document but I can't see anything about this topic
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.
Other Parts Discussed in Thread: CONTROLSUITE
please help me,
I want to use simulink with h52c1 experiment kit. is it posibble? I search all document but I can't see anything about this topic
Habib,
the h52c1 has a rs-232 interface, so you can use the com port of your machine to capture the data using simulink (serial port --->go to help).(google-->'serial port & simulink')
If you don't have com port, make an interface using the ftd232R chip (from ftdchip) to use the USB port.
regards
Gastón
Gaston,
thank you for your answer. But I want to learn how to generete simulink code on H52C1. because I will use TMDXDOCKH52C1 – Experimenter Kit in my project. first I make the project with simulink. I simulate the project on the PC and than I want to run my simulink code on the experimenter kit. is it possible?
Habib Ozer Oz
Habib,
check in your matlab help ---->>target support package, if this processor is supported by simulink.
Regards
Gastón
I can create applications for the real-time control part of concerto card, i.e the C2000 side, using Simulink blocks. I modified the code generation files used by Matlab (.tlc) to create the C code and adapt it for concerto card. I actually use almost every block: PWM, ADC, Hardware Interruptions, GPIO Input, GPIO Ouput, etc. and they all work perfectly. If you are still interested, do not hesitate to contact me.
Regards,
Hi, Juan,
Are u using F28m35H52c1? What version of matlab are you using?
Can you give some details on how you generate code from simulink?
I was watching a video http://www.youtube.com/watch?v=7ed1NLD817s
Previously, I can work well with 2812 board, but now since I am using the concerto control card, some settings might be changed?
It would help a lot if you can give me some detailed steps.
Thanks in advance.
Junyi
juan jimenez said:I can create applications for the real-time control part of concerto card, i.e the C2000 side, using Simulink blocks. I modified the code generation files used by Matlab (.tlc) to create the C code and adapt it for concerto card. I actually use almost every block: PWM, ADC, Hardware Interruptions, GPIO Input, GPIO Ouput, etc. and they all work perfectly. If you are still interested, do not hesitate to contact me.
Regards,
Hi Junyi,
Yes, I use the F28m35h52c1 control card along with CCSv5 and Matlab R2011b. If you want to use simulink for you concerto application, you must make some changes in code generation because concerto series is not supported by Matlab. Although F28m35x processor is not included in the ecoder toolbox, you can adapt the code generated by similar processors (for example F28335). The lines of code generated for these processors that are not compliant with the concerto have been investigated in this thread http://e2e.ti.com/support/microcontrollers/c2000/f/171/t/159927.aspx. Please read it. Another link that can give more insight into this issue is http://e2e.ti.com/support/microcontrollers/c2000/f/171/t/176334.aspx. Once you have identified the lines of code that must be changed, you must find the .tlc file that generate them and modified it. The .tlc files that generate the code for c2000 devices are located at folders ${MATLABROOT}\toolbox\idelink\extensions\ticcs and ${MATLABROOT}\toolbox\target\extensions\processor\tic2000\blks.
I upload to an asembla svn repository a modified version of all the .tlc files involved in this process. Please contact me again if you are interested in obtain it.
Regards,
Thanks a lot for your reply. Sure, I am interested to have it. please let me know where I can download it.
Another issue I am having is that...I followed the way to modify the makefile (as in the second link you gave me).
But there are still errors as:..which I have no idea.. I have installed the MSYS. Let me know if you know how to fix it. I will ask the author of that makefile as well. Thank again!
The build failed with the following message: process_begin: CreateProcess(NULL, ls DSP28335.h, ...) failed.
process_begin: CreateProcess(NULL, ls MW*.c rt*.c, ...) failed.
process_begin: CreateProcess(NULL, ls C:/ti/controlSUITE/device_support/f28m35x/v140/F28M35x_common/source/*.c, ...) failed.
process_begin: CreateProcess(NULL, ls C:/ti/controlSUITE/device_support/f28m35x/v140/F28M35x_common/source/*.asm, ...) failed.
C:\makefile\F28H52.mk:190: 'This is Concerto hook makefile for Matlab - Configuration Follows'
C:\makefile\F28H52.mk:191: MODELNAME: blink2
C:\makefile\F28H52.mk:192: CSPATH: C:/ti/controlSUITE/device_support/f28m35x/v140/F28M35x_common/source
C:\makefile\F28H52.mk:193: LIBCFILES:
C:\makefile\F28H52.mk:194: LIBASMFILE:
C:\makefile\F28H52.mk:195: LIBCOBJ:
C:\makefile\F28H52.mk:196: LIBASM:
C:\makefile\F28H52.mk:197: Compiler: C:/ti/ccsv5/tools/compiler/c2000_6.1.4/bin/cl2000
C:\makefile\F28H52.mk:198: Linker: C:/ti/ccsv5/tools/compiler/c2000_6.1.4/bin/cl2000
C:\makefile\F28H52.mk:199: PERLCMD: 'C:\\Program Files\\MATLAB\\R2010b\\sys\\perl\\win32\\bin\\perl' -i.bak -pe's/DSP2803x_/F28M35x_/g'
C:\makefile\F28H52.mk:200: Mflags: -I"." -I".." -I'C:\\Program Files\\MATLAB\\R2010b\\\\toolbox\\idelink\\extensions\\ticcs\\inc' -I'C:\\Program Files\\MATLAB\\R2010b\\\\extern\\include' -I'C:\\Program Files\\MATLAB\\R2010b\\\\simulink\\include' -I'C:\\Program Files\\MATLAB\\R2010b\\\\rtw\\c\\src' -I'C:\\Program Files\\MATLAB\\R2010b\\\\rtw\\c\\src\\ext_mode\\common' -I'C:\\Program Files\\MATLAB\\R2010b\\\\rtw\\c\\ert' -I'C:\\Program Files\\MATLAB\\R2010b\\\\toolbox\\dspblks\\include' -I'C:\\Program Files\\MATLAB\\R2010b\\\\toolbox\\rtw\\dspblks\\c' -D'__TICCSC__' -D'RT' -D'USE_RTMODEL' -ml -v28 --float_support=fpu32 -D'MODEL=blink2' -D'NUMST=1' -D'NCSTATES=0' -D'HAVESTDIO=' -D'ONESTEPFCN=1' -D'TERMFCN=1' -D'MAT_FILE=0' -D'MULTI_INSTANCE_CODE=0' -D'INTEGER_CODE=0' -D'MT=0' -D'TID01EQ=0'
C:\makefile\F28H52.mk:201: PERLFILT: 'if (m/COMPILER_CODE.*?(-D(.*))$/g) {print $1}'
C:\makefile\F28H52.mk:202: MYFLAGS:
C:\makefile\F28H52.mk:203: 'This is Concerto hook makefile for Matlab'
Building File:
C:\makefile\F28H52.mk:208: *** multiple target patterns. Stop.
Hi Junyi,
As I told you in the previous post, the .tlc files are stored in a svn repository so you have to use a svn client to download them. I use tortoisesvn ( you can download it here http://tortoisesvn.net/) as a svn client and assembla as svn repository (https://www.assembla.com/). Create an user account in assembla (it is free) and send me you username, and I add you as a team member of the project you are interested (called MATLAB).
With regards to the errors you get in the makefile modification proccess, I cannot help you a lot because I also got them. That is the reason because I performed my own modification for the code generation.
Best wishes, Juan
Hi Junyi,
I've already add you to the project team. You should be able to download the repository. I've create a how-to guide for the downloading and installing process. This guide also include a step-by-step explanation of the generation code process and the adaptation of CCSv5 project. I hope it is useful.
Regards,
1031.How to create Simulink project for F28m35x processors.docx
Dear; please let me ask you about:
1- if i have "a system 64 bit pc" and "matlab" and i need to work with "cc4 or cc5"? is it possible? or i need to system 32? i will use with f28035?
thanks
Hi, Ahmed,
I think that you can work on a 64-bit system. That's no problem~Because I am doing the same
Hi, Juan,
Thanks a lot, I really appreciate your great help!
Now I have all the tlc files and I tried your f28m35x_test.mdl. Unfortunately, it gives me an error as below.
Error: File: C:\Program Files\MATLAB\R2013a\toolbox\idelink\extensions\ticcs\c2000\csl_c280x_init.tlc Line: 146 Column: 19
The == and != operators can only be used to compare values of the same type
I checked that tlc file and has no idea why that error comes out. I am pretty sure I followed your steps correctly.
You may not have this problem, but if you have any idea about it, please let me know.
Thanks again!
That error is really weird. The line 146 of the file csl_c28x_init.tlc hasn't been modified at all. Moreover, that line doesn't contain any == or != operators. This line have a simple case statement whose column 16 is a white space. Please, check if the content of your file is the same as the one showed in the screenshot below. The capture shows the file csl_c28x_init.tlc included in the assembla repository.
Best,
Yes, it's exactly the same. I have checked again and still cannot solve it.
I was wondering whether we can webex and let you remote control.
It would be nice if you have time for a webex. Thanks a lot!
my email address is montanasjy@gmail.com.
Let me know whether you can webex and your email address~
Thanks!
Junyi
Hello,
Dear Juan, I face the same problem as discussed here, I need to use simulink with the h52c1.
I would be very interested in your solution. Is it possible for you to share the files with me as well? I already created an account in assembla (my username is supertester). Can you add me to the project so that I can try your modified files?
Many thanks in advance.
Best regards, Luis
Hi Luis,
I've already sent you an invitation. You should be able to download the project from the repository. If you have any issue with the "installation" process, please let me know.
Regards,
dear;
1- can I load and debug from matlab 2011 and cc5 and can I run, stop and coolect data?
2- ADC - No_ of channels how can i get it in simulink?
thanks
Hello again Juan,
Many thanks for your help. I have been trying to implement your solution but I am having some problems. After solving several problems related to my software, I completed the "installation" procedure. However, I am having problems with the CCS build of the project, which I cannot seam to solve..
I ran your simulink test model and the build process was completed suceessfully. I then used the files generated in the build process in a CCS project, like described in your tutorial, and I added the remaining files from the full project folder you made available. I also copied the includes structure of your project (with inclusion of F28M53 folders from controlstudio folder).
However, the CCS build always presents the following error:
Description: #35 #error directive: "must define RT"
Resource: c2000_main.h
Path: /H52C1_test/matlab (I changed the name of the model during tests)
Location line 30 C/C++
Type Problem
The files included in the projects (mine and yours) are the same, with the exception of those generated by matlab.
I can build your project correctly, but mine always results in this error (or any other project I try to build).
Do you have any idea why this happens or how I can solve it? (I appologise, but I am not familiar with this code...)
I trully appreciate your help.
Best regards,
Luis
p.s.: The file MW_c28xx_cap.c (not generated by the simulink build) includes the file "f28m35_test.h", so I also got an error because I changed the name of the project, but I corrected the code manually.
Hi Luis,
I am familiar with the compilation error you describe. The compiler tells you that preprocessor directive RT is used in the file c2000main.h but not defined. You must add a set of preprocessor directives to remove this error. Go to the folder that Matlab automatically generated when you built your Simulink model (named <simulink_model_name>_ticcs). Then, search for a file called defines.txt. It should be look like this (more or less):
-------------------------
MODEL=controller
NUMST=3
NCSTATES=0
HAVESTDIO
ONESTEPFCN=1
TERMFCN=1
MAT_FILE=0
MULTI_INSTANCE_CODE=0
INTEGER_CODE=0
MT=1
TID01EQ=0
------------------------
Include all these symbols in your CCS project (Right click on your project --> Show Building Settings-->CSS Build --> Advanced Options --> Predefined Symbols) and build your project again.
The compilation error shouldn't be there anymore.
Regards,
Hello Juan,
Thank you so much for your response. Including the the needed variables did resolve the issue and I was able to build and load the example.
However, I now enconter other problems. When I add any element to the example and try to rebuild it, I get build errors. For example, just by adding a GPIO output with a constant output, I get the errors in the picture and the compiler description below.
Are you familiar with these types of errors?
Thank you.
Best regards,
Luis
**** Build of configuration Debug for project f28m35_test ****
"C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
'Building target: f28m35_test.out'
'Invoking: C2000 Linker'
"C:/ti/ccsv5/tools/compiler/c2000_6.2.3/bin/cl2000" -v28 -ml -mt --float_support=fpu32 --vcu_support=vcu0 -g --define=NUMST=1 --define=MODEL=f28335x_test --define=RT --define=NCSTATES=0 --diag_warning=225 --display_error_number --diag_wrap=off -z --stack_size=0x300 -m"f28m35_test.map" --warn_sections -i"C:/ti/ccsv5/tools/compiler/c2000_6.2.3/lib" -i"C:/ti/ccsv5/tools/compiler/c2000_6.2.3/include" --reread_libs --display_error_number --diag_wrap=off --xml_link_info="f28m35_test_linkInfo.xml" --rom_model -o "f28m35_test.out" "./f28m35/F28M35x_usDelay.obj" "./f28m35/F28M35x_SysCtrl.obj" "./f28m35/F28M35x_PieVect.obj" "./f28m35/F28M35x_PieCtrl.obj" "./f28m35/F28M35x_Gpio.obj" "./f28m35/F28M35x_GlobalVariableDefs.obj" "./f28m35/F28M35x_EPwm.obj" "./f28m35/F28M35x_ECap.obj" "./f28m35/F28M35x_DefaultIsr.obj" "./f28m35/F28M35x_CpuTimers.obj" "./f28m35/F28M35x_CodeStartBranch.obj" "./f28m35/F28M35x_Adc.obj" "./matlab/f28m35x_test_main.obj" "./matlab/f28m35x_test.obj" "./matlab/MW_c28xx_pwm.obj" "./matlab/MW_c28xx_csl.obj" "./matlab/MW_c28xx_cap.obj" "./matlab/MW_c28xx_board.obj" "./matlab/MW_c28xx_adc.obj" "C:/ti/controlSUITE/device_support/f28m35x/v160/F28M35x_headers/cmd/F28M35x_Headers_nonBIOS.cmd" "../f28m35/F28M35x_generic_wshared_C28_RAM.cmd" -l"libc.a"
<Linking>
undefined first referenced
symbol in file
--------- ----------------
_f28m35x_test_P ./matlab/f28m35x_test.obj
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "f28m35_test.out" not built
>> Compilation failure
gmake: *** [f28m35_test.out] Error 1
gmake: Target `all' not remade because of errors.
**** Build Finished ****
Dear Luis,
I believe you read the tutorial I previously attached in the thread ("How to create SImulink project for F28m35x processors"). In that document, I provided a CCSv5 project associated to the simulink model f28m35x_test.mdl that can be obtained from the following repository:
https://f28m35x-simulink.googlecode.com/svn/trunk/f28m35x-simulink
I recommend you to use this project as a template for your own CCS project. You must be added as a member to the project team to be able to download the source files. If you are interested, send me your email address and I invite you (you can use the private conversation option that offers TI forum if you don't want to publish you email in this forum).
Regards,
Hi again Luis,
check the include options in the building setting panel and make sure that the paths are set correctly. Confirm that the folder hierarchy you use in your project is consistent with the structure showed in the include path window.
If the error persists, send me your CCS project and I will take it a look.
Regards,