Error in PIL execution for F28027 C2000 TI MCU

조회 수: 8 (최근 30일)
Sanjeev Gupta
Sanjeev Gupta 2020년 1월 17일
답변: Aditya Padmanabha 2021년 10월 18일
In order to get started with PIL and see it working, I made a small program whose screenshot is attached.
1.PNG
->I took a gain and created a subsystem out of it
-> configured settings for PIL block creation
-> build subsystem to hardware (an untitled .slx file with PIL block generated)
-> connected it to system, and run the entire model in Normal mode.
1) I am getting following error regarding data types (See last few lines), so what should be the data type for F28027 (C2000 MCU's) ?
2) Also, Stand Alone execution block is checked in settings (does it affect it?)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
### Connectivity configuration for "E:\MATLAB\TARGET_FEEDBACK\Subsystem_ert_rtw": Texas Instruments C2000 Base ###
### Using toolchain: Texas Instruments C2000 Code Generation Tools v16.9.2 | gmake (64-bit Windows)
### 'E:\MATLAB\TARGET_FEEDBACK\Subsystem_ert_rtw\pil\Subsystem.mk' is up to date
### Building 'Subsystem': "C:\PROGRA~1\MATLAB\R2017b\bin\win64\gmake" -B -f Subsystem.mk all
E:\MATLAB\TARGET_FEEDBACK\Subsystem_ert_rtw\pil>cd .
E:\MATLAB\TARGET_FEEDBACK\Subsystem_ert_rtw\pil>if "" == "" ("C:\PROGRA~1\MATLAB\R2017b\bin\win64\gmake" -B -f Subsystem.mk all ) else ("C:\PROGRA~1\MATLAB\R2017b\bin\win64\gmake" -B -f Subsystem.mk )
C:/PROGRA~3/MATLAB/SupportPackages/R2017b/3P.instrset/tic2000codegentools.instrset/ti-cgt-c2000_16.9.2.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/SupportPackages/R2017b/3P.instrset/tic2000codegentools.instrset/ti-cgt-c2000_16.9.2.LTS/include" -v28 -ml -DMODEL=Subsystem -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DTERMFCN=1 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DDAEMON_MODE=1 -DMW_PIL_SCIFIFOLEN=4 -DSTACK_SIZE=512 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DRT -DMW_EXEC_PROFILER_ON -DCA_CHECK_LONG_LONG_ENABLED=1 -DCA_CHECK_FLOATING_POINT_ENABLED=1 -DCODER_ASSUMPTIONS_ENABLED=1 -DRTIOSTREAM_RX_BUFFER_BYTE_SIZE=128 -DRTIOSTREAM_TX_BUFFER_BYTE_SIZE=128 -DCODE_INSTRUMENTATION_ENABLED=1 -DMEM_UNIT_BYTES=2 -DMemUnit_T=uint16_T -DTERMFCN=1 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -DCA_CHECK_LONG_LONG_ENABLED=1 -DCA_CHECK_FLOATING_POINT_ENABLED=1 -DCODER_ASSUMPTIONS_ENABLED=1 -DRTIOSTREAM_RX_BUFFER_BYTE_SIZE=128 -DRTIOSTREAM_TX_BUFFER_BYTE_SIZE=128 -DCODE_INSTRUMENTATION_ENABLED=1 -DMEM_UNIT_BYTES=2 -DMemUnit_T=uint16_T -DDAEMON_MODE=1 -DMW_PIL_SCIFIFOLEN=4 -DSTACK_SIZE=512 -DRT -DMODEL=Subsystem -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -IE:/MATLAB/TARGET_FEEDBACK -IE:/MATLAB/TARGET_FEEDBACK/Subsystem_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:/ProgramData/MATLAB/SupportPackages/R2017b/toolbox/target/supportpackages/tic2000/src -IC:/ProgramData/MATLAB/SupportPackages/R2017b/toolbox/target/supportpackages/tic2000/inc -IC:/ti/controlSUITE/device_support/f2802x/v230/f2802x_common/include -IC:/ti/controlSUITE/device_support/f2802x/v230/f2802x_headers/include -IC:/ti/controlSUITE/device_support/f2802x/v230 -IC:/ProgramData/MATLAB/SupportPackages/R2017b/toolbox/target/shared/externalmode_daemon/include -IC:/PROGRA~1/MATLAB/R2017b/toolbox/rtw/targets/pil/c -IE:/MATLAB/TARGET_FEEDBACK/Subsystem_ert_rtw/pil -IC:/PROGRA~1/MATLAB/R2017b/extern/include/coder/connectivity/XILTgtAppSvc -IC:/PROGRA~1/MATLAB/R2017b/toolbox/coder/rtiostream/src/utils -IC:/PROGRA~1/MATLAB/R2017b/extern/include/coder/connectivity/CoderAssumpTgtAppSvc -IC:/PROGRA~1/MATLAB/R2017b/extern/include/coder/connectivity/CodeInstrTgtAppSvc -IC:/ProgramData/MATLAB/SupportPackages/R2017b/toolbox/target/supportpackages/tic2000_base/pil/+tic2000codertargetpil/../../src --output_file=xil_interface_lib.obj C:/PROGRA~1/MATLAB/R2017b/toolbox/rtw/targets/pil/c/xil_interface_lib.c
C:/PROGRA~3/MATLAB/SupportPackages/R2017b/3P.instrset/tic2000codegentools.instrset/ti-cgt-c2000_16.9.2.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/SupportPackages/R2017b/3P.instrset/tic2000codegentools.instrset/ti-cgt-c2000_16.9.2.LTS/include" -v28 -ml -
"C:/PROGRA~3/MATLAB/SupportPackages/R2017b/3P.instrset/tic2000codegentools.instrset/ti-cgt-c2000_16.9.2.LTS/include/stdbool.h", line 36: warning: incompatible redefinition of macro "false" (declared at line 26 of "E:/MATLAB/TARGET_FEEDBACK/Subsystem_ert_rtw/rtwtypes.h")
"C:/PROGRA~3/MATLAB/SupportPackages/R2017b/3P.instrset/tic2000codegentools.instrset/ti-cgt-c2000_16.9.2.LTS/include/stdbool.h", line 37: warning: incompatible redefinition of macro "true" (declared at line 30 of "E:/MATLAB/TARGET_FEEDBACK/Subsystem_ert_rtw/rtwtypes.h")
C:/PROGRA~3/MATLAB/SupportPackages/R2017b/3P.instrset/tic2000codegentools.instrset/ti-cgt-c2000_16.9.2.LTS/bin/cl2000 --compile_only --large_memory_model --silicon_version=28 --define="LARGE_MODEL" -i"/~SupportFiles/DSP280x_headers" -i"/~SupportFiles/DSP280x_headers/include" -
"### Creating standalone executable "Subsystem.out" ..."
C:/PROGRA~3/MATLAB/SupportPackages/R2017b/3P.instrset/tic2000codegentools.instrset/ti-cgt-c2000_16.9.2.LTS/bin/cl2000 -z -IC:/PROGRA~3/MATLAB/SupportPackages/R2017b/3P.instrset/tic2000codegentools.instrset/ti-cgt-c2000_16.9.2.LTS/lib --stack_size=512 --warn_sections --heap_size=1024 --reread_libs --rom_model -m"Subsystem.map" -l"rts2800_ml.lib" --define BOOT_FROM_FLASH=1 --define BOOT_USING_BL=0 --output_file=Subsystem.out xil_interface_lib.obj xil_data_stream.obj xil_services.obj xil_interface.obj xilcomms_rtiostream.obj xil_rtiostream.obj rtiostream_utils.obj coder_assumptions_app.obj coder_assumptions_data_stream.obj coder_assumptions_hwimpl.obj Subsystem_ca.obj coder_assumptions_rtiostream.obj pil_main.obj rtiostream_serial_c28x.obj c2802xBoard_Realtime_Support.obj f2802x_cputimers.obj f2802x_defaultisr.obj F2802x_GlobalVariableDefs.obj f2802x_piectrl.obj f2802x_pievect.obj f2802x_sysctrl.obj f2802x_usdelay.obj f2802x_codestartbranch.obj f2802x_adc.obj profiler_Support.obj xil_instrumentation.obj codeinstr_data_stream.obj codeinstr_rtiostream.obj ../instrumented/MW_c28xx_board.obj ../instrumented/MW_c28xx_csl.obj ../instrumented/Subsystem.obj ../instrumented/Subsystem_data.obj C:/ProgramData/MATLAB/SupportPackages/R2017b/toolbox/target/supportpackages/tic2000/rtlib/IQmath.lib C:/ProgramData/MATLAB/SupportPackages/R2017b/toolbox/target/supportpackages/tic2000/src/c2802xPeripherals.cmd C:/ProgramData/MATLAB/SupportPackages/R2017b/toolbox/target/supportpackages/tic2000/src/c28027.cmd
<Linking>
"### Created: Subsystem.out"
"### Invoking postbuild tool "Hex Converter" on "Subsystem.out"..."
C:/PROGRA~3/MATLAB/SupportPackages/R2017b/3P.instrset/tic2000codegentools.instrset/ti-cgt-c2000_16.9.2.LTS/bin/hex2000 -i "Subsystem.out" -o "../instrumented/../../Subsystem.hex" -order MS -romwidth 16 -q
"### Done Invoking postbuild tool "Hex Converter" ..."
"### Successfully generated all binary outputs."
E:\MATLAB\TARGET_FEEDBACK\Subsystem_ert_rtw\pil>exit /B 0
### Starting application: 'Subsystem_ert_rtw\pil\Subsystem.out'
Starting PIL simulation
*** User inputs:
Target Configuration: C:\PROGRA~3\MATLAB\SupportPackages\R2017b\toolbox\target\supportpackages\tic2000/CCS_Config/f28027.ccxml
Program Name: E:\MATLAB\TARGET_FEEDBACK\Subsystem_ert_rtw\pil\Subsystem.out
Board Name: unspecified (connect to first board)
CPU Name: unspecified (connect to first CPU)
*** Starting debug session...
*** Debug Session Name: Texas Instruments XDS100v1 USB Emulator_0/C28xx
*** Board Name: Texas Instruments XDS100v1 USB Emulator_0
*** CPU Name: C28xx
*** Connecting to target...
*** Loading the program to the target...
*** Program is running.
*** Disconnecting from target...
*** Terminating debug session...
*** LOAD & RUN DONE.
Data type "double" is not supported for SIL or PIL execution with the current target configuration. This is because the host size (8 bytes) and target size (4 bytes) do not match. To avoid this error, do not use this data type at the component interface.
Component:Simulink | Category:Model error
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

답변 (1개)

Aditya Padmanabha
Aditya Padmanabha 2021년 10월 18일
Hi Sanjeev,
Pleace change the dataype of the inputs to Single instead of double. Double is represented as 32-bit floating point in C2000 targets with COFF formato of executable. So you should run PIL keeping all inputs as non-double data types.
Thanks,
Aditya

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by