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.

TMS320F28335: How to get TI F28335 working in Matlab Simulinks 'external mode'?

Part Number: TMS320F28335

Hello,

I am trying to run a TI F28335 using EXTERNAL MODE in Simulink in order to log signals in real time.
Deploying to hardware & running in normal mode works fine except for some warnings, but running in external mode fails during code generation and outputs the following error message:

### Unsupported CCS Version. Skipping CCS Project creation
C:/PROGRA~3/MATLAB/SUPPOR~1/R2017b/3P778C~1.INS/TIC200~1.INS/TI-CGT~1.LTS/bin/cl2000 --compile_only --large_memory_model --silicon_version=28 --define="LARGE_MODEL" -i"/~SupportFiles/DSP280x_headers" -i"/~SupportFiles/DSP280x_headers/include" -i"C:/PROGRA~3/MATLAB/SUPPOR~1/R2017b/3P778C~1.INS/TIC200~1.INS/TI-CGT~1.LTS/include" --define="EXTMODE_DISABLEPRINTF" -v28 --float_support=fpu32 -ml -DMODEL=V16_R12_20171005_experimental -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DON_TARGET_WAIT_FOR_START=0 -DTERMFCN=1 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DEXT_MODE=1 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DDAEMON_MODE=1 -DMW_PIL_SCIFIFOLEN=16 -DSTACK_SIZE=512 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DRT -DTERMFCN=1 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DEXT_MODE=1 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DON_TARGET_WAIT_FOR_START=0 -DDAEMON_MODE=1 -DMW_PIL_SCIFIFOLEN=16 -DSTACK_SIZE=512 -DRT -DMODEL=V16_R12_20171005_experimental -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -IC:/V16_R2017b -IC:/V16_R2017b/V16_R12_20171005_experimental_ert_rtw -IC:/PROGRA~1/MATLAB/R2017b/extern/include -IC:/PROGRA~1/MATLAB/R2017b/simulink/include -IC:/PROGRA~1/MATLAB/R2017b/rtw/c/src -IC:/PROGRA~1/MATLAB/R2017b/rtw/c/src/ext_mode/common -IC:/PROGRA~1/MATLAB/R2017b/rtw/c/ert -IC:/PROGRA~1/MATLAB/R2017b/toolbox/coder/rtiostream/src/utils -IC:/ProgramData/MATLAB/SupportPackages/R2017b/toolbox/target/supportpackages/tic2000/inc -IC:/PROGRA~1/MATLAB/R2017b/toolbox/shared/can/src/scanutil -IC:/ProgramData/MATLAB/SupportPackages/R2017b/toolbox/target/supportpackages/tic2000/src -IC:/PROGRA~1/MATLAB/R2017b/toolbox/rtw/targets/common/can/blocks/tlc_c -IC:/ProgramData/MATLAB/SupportPackages/R2017b/toolbox/target/shared/externalmode_daemon/include --output_file=MW_c28xx_board.obj MW_c28xx_board.c

[...]

<Linking>
"C:/ProgramData/MATLAB/SupportPackages/R2017b/toolbox/target/supportpackages/tic2000/src/c28335.cmd", line 65: error: 
program will not fit into available memory. placement with
alignment/blocking fails for section ".text" size 0x4b68 page 0. Available
memory ranges:
RAML4L7 size: 0x4000 unused: 0x3c50 max hole: 0x3c50 
error: errors encountered during linking;
"../V16_R12_20171005_experimental.out" not built

>> Compilation failure
gmake: *** [../V16_R12_20171005_experimental.out] Error 1
The make command returned an error of 2
Der Befehl "An_error_occurred_during_the_call_to_make" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
### Build procedure for model: 'V16_R12_20171005_experimental' aborted due to an error.
Error(s) encountered while building "V16_R12_20171005_experimental":
### Failed to generate all binary outputs.

What am I doing wrong? CodeComposerStudio version is v6.1.1.00022 & Matlab version is 2017b.
Thank you for your answers!

  • All I can say is the linking step fails because your program is too large to fit in the memory allocated for it.  If you look at the memory map in the F28335 datasheet you'll see there is a lot more memory one the device than the 0x4b68 required by the .text (i.e. code) section, so it's a question of how it is allocated.

    I'm not very familiar with the Simulink interface - is there a way of configuring which sections are loaded into which memory blocks?  If so, you should modify that to allocate more space for the .text section.  

    You may like to post the question to the Mathworks support forum who will be able to provide insight into the Simulink side:

    https://www.mathworks.com/matlabcentral/answers/index

    Regards,

    Richard

  • Hi,

    Please refer this post related to similar problem.

    Try booting from flash by selecting the "Boot from Flash" option.

    External mode adds its own files to the build and hence the same model which would work in normal mode would complain in external mode for memory.

    Regards,

    Venkatesh C