Error in the device library "F28M36X_device.h"
1 view (last 30 days)
Show older comments
Hello,
I finally decide to ask a question after trying to solve the problem on my own and with the forum. I would like to use the AnalogIO input on simulink to compare a voltage value and blink a led or not. I don't think the "code" is the problem. In fact when I deploy to hardware I have an error. First, the compiler didn't found the "F28M36X_Device.h". So, I put all de F28M36 library in the folder it want it to be. And now, I have another issue, the compiler tells me that it expected a ";". I check the library code and there is a ";"... I'm out of solutions.. Could you help me ?
Here is the diagnostic :
### Generating code into build folder: C:\MATLAB\ADC_ert_rtw
### Invoking Target Language Compiler on ADC.rtw
### Using System Target File: C:\Program Files\MATLAB\R2017b\rtw\c\ert\ert.tlc
### Loading TLC function libraries
### Initial pass through model to cache user defined code
.
### Caching model source code
### Writing header file ADC.h
.
### Writing header file rtwtypes.h
### Writing source file ADC.c
### Writing header file rtmodel.h
### Writing source file ert_main.c
### TLC code generation complete.
### Evaluating PostCodeGenCommand specified in the model
### Using toolchain: Texas Instruments ARM Code Generation Tools v5.2.5 | gmake (64-bit Windows)
### 'C:\MATLAB\ADC_ert_rtw\ADC.mk' is up to date
### Building 'ADC': "C:\PROGRA~1\MATLAB\R2017b\bin\win64\gmake" -B -f ADC.mk all
C:\MATLAB\ADC_ert_rtw>cd .
C:\MATLAB\ADC_ert_rtw>if "" == "" ("C:\PROGRA~1\MATLAB\R2017b\bin\win64\gmake" -B -f ADC.mk all ) else ("C:\PROGRA~1\MATLAB\R2017b\bin\win64\gmake" -B -f ADC.mk )
C:/PROGRA~3/MATLAB/SUPPOR~1/R2017b/3P778C~1.INS/TICONC~1.INS/TI-CGT~1.LTS/bin/armcl --compile_only --silicon_version=7M3 --endian=little --define="LARGE_MODEL" -i"/~SupportFiles/DSP280x_headers" -i"/~SupportFiles/DSP280x_headers/include" -i"C:/PROGRA~3/MATLAB/SUPPOR~1/R2017b/3P778C~1.INS/TICONC~1.INS/TI-CGT~1.LTS/include" -g -mv7M3 --gcc -DMODEL=ADC -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DTERMFCN=0 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -D__CORTEX_M=3 -DMW_F28M36x -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -DSTACK_SIZE=2560 -D__MW_TARGET_USE_HARDWARE_RESOURCES_H__ -DRT -DMW_NUM_UDP_RECEIVE_BLKS=0 -DMW_UDP_MAXRECEIVELENGTH=0 -DMW_NUM_TCP_RECEIVE_BLKS=0 -DMW_NUM_TCP_TRANSMIT_BLKS=0 -DMW_NUM_UDP_TRANSMIT_BLKS=0 -DMW_MAC_ADDR1=0xA8 -DMW_MAC_ADDR2=0x63 -DMW_MAC_ADDR3=0xF2 -DMW_MAC_ADDR4=0x80 -DMW_MAC_ADDR5=0x90 -DMW_MAC_ADDR6=0x80 -D_DEBUG -DTERMFCN=0 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTID01EQ=0 -D__CORTEX_M=3 -DMW_F28M36x -DEXTMODE_DISABLEPRINTF -DEXTMODE_DISABLETESTING -DEXTMODE_DISABLE_ARGS_PROCESSING=1 -DSTACK_SIZE=2560 -DRT -DMODEL=ADC -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -IC:/MATLAB -IC:/MATLAB/ADC_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_concerto/src -IC:/ProgramData/MATLAB/SupportPackages/R2017b/toolbox/target/supportpackages/tic2000_concerto/inc -IC:/ti/controlSUITE/device_support/f28m36x/v208/MWare/driverlib -IC:/ti/controlSUITE/device_support/f28m36x/v208/MWare/inc -IC:/ti/controlSUITE/device_support/f28m36x/v208/MWare -IC:/ti/controlSUITE/device_support/f28m36x/v208/MWare/board_drivers -IC:/ProgramData/MATLAB/SupportPackages/R2017b/toolbox/target/supportpackages/armcortexmbase/scheduler/include -IC:/ti/controlSUITE/device_support/f28m36x/v208/MWare/third_party/uip-1.0 -IC:/ti/controlSUITE/device_support/f28m36x/v208/MWare/third_party/uip-1.0/uip --output_file=ADC.obj ADC.c
"C:/ti/controlSUITE/device_support/f28m36x/v208/MWare/third_party/uip-1.0/uip/F28M36x_Device.h", line 31: warning: explicit type is missing ("int" assumed)
"C:/ti/controlSUITE/device_support/f28m36x/v208/MWare/third_party/uip-1.0/uip/F28M36x_Device.h", line 31: error: expected a ";"
"C:/ti/controlSUITE/device_support/f28m36x/v208/MWare/third_party/uip-1.0/uip/F28M36x_Device.h", line 32: warning: explicit type is missing ("int" assumed)
"C:/ti/controlSUITE/device_support/f28m36x/v208/MWare/third_party/uip-1.0/uip/F28M36x_Device.h", line 32: error: expected a ";"
2 errors detected in the compilation of "ADC.c".
>> Compilation failure
gmake: *** [ADC.obj] Error 1
C:\MATLAB\ADC_ert_rtw>echo The make command returned an error of 2
The make command returned an error of 2
C:\MATLAB\ADC_ert_rtw>An_error_occurred_during_the_call_to_make
'An_error_occurred_during_the_call_to_make' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
### Creating HTML report file ADC_codegen_rpt.html
### Build procedure for model: 'ADC' aborted due to an error.
Error(s) encountered while building "ADC":
### Failed to generate all binary outputs.
Here is the library code with an error on line 31 and 32 :
extern __cregister volatile unsigned int IFR;
extern __cregister volatile unsigned int IER;
#ifndef F28M36x_DEVICE_H
#define F28M36x_DEVICE_H
#ifdef __cplusplus
extern "C" {
#endif
#define TARGET 1
// User To Select Target Device:
#define DSP28_F28M36Hx_100MHZ 0
#define DSP28_F28M36Hx_150MHZ 0
#define DSP28_F28M36Px_125MHZ 0
#define DSP28_F28M36Px_150MHZ TARGET
// Common CPU Definitions:
extern __cregister volatile unsigned int IFR;
extern __cregister volatile unsigned int IER;
#define EINT __asm(" clrc INTM")
#define DINT __asm(" setc INTM")
#define ERTM __asm(" clrc DBGM")
#define DRTM __asm(" setc DBGM")
#define EALLOW __asm(" EALLOW")
#define EDIS __asm(" EDIS")
#define ESTOP0 __asm(" ESTOP0")
#define M_INT1 0x0001
#define M_INT2 0x0002
#define M_INT3 0x0004
#define M_INT4 0x0008
#define M_INT5 0x0010
#define M_INT6 0x0020
#define M_INT7 0x0040
#define M_INT8 0x0080
#define M_INT9 0x0100
#define M_INT10 0x0200
#define M_INT11 0x0400
#define M_INT12 0x0800
#define M_INT13 0x1000
#define M_INT14 0x2000
#define M_DLOG 0x4000
#define M_RTOS 0x8000
#define BIT0 0x0001
#define BIT1 0x0002
#define BIT2 0x0004
#define BIT3 0x0008
#define BIT4 0x0010
#define BIT5 0x0020
#define BIT6 0x0040
#define BIT7 0x0080
#define BIT8 0x0100
#define BIT9 0x0200
#define BIT10 0x0400
#define BIT11 0x0800
#define BIT12 0x1000
#define BIT13 0x2000
#define BIT14 0x4000
#define BIT15 0x8000
//---------------------------------------------------------------------------
// For Portability, User Is Recommended To Use Following Data Type Size
// Definitions For 16-bit and 32-Bit Signed/Unsigned Integers:
#ifndef DSP28_DATA_TYPES
#define DSP28_DATA_TYPES
typedef int int16;
typedef long int32;
typedef long long int64;
typedef unsigned long long Uint64;
typedef float float32;
typedef long double float64;
#endif
#ifndef _TI_STD_TYPES
#define _TI_STD_TYPES
/*
* These types are also defined in DSP/BIOS 5.x's <std.h> and the
* SYS/BIOS 6.x's <xdc/std.h> files. We need to protect their
* definition with the #ifndef/#define guard to avoid the duplicate
* definition warning.
*
* SYS/BIOS requires that the <xdc/std.h> file be included before
* any other .h files.
*/
typedef int Int;
typedef unsigned Uns;
typedef char Char;
typedef char *String;
typedef void *Ptr;
typedef unsigned short Bool;
typedef unsigned long Uint32;
typedef unsigned int Uint16;
typedef unsigned char Uint8;
typedef long Int32;
typedef int Int16;
typedef char Int8;
#endif
//---------------------------------------------------------------------------
// Include All Peripheral Header Files:
#include "F28M36x_Adc.h" // ADC Registers
#include "F28M36x_AnalogSysCtrl.h" // C28 AnalogSysCtrl Registers
#include "F28M36x_Comp.h" // Comparator Registers
#include "F28M36x_CpuTimers.h" // 32-bit CPU Timers
#include "F28M36x_DevEmu.h" // Device Emulation Registers
#include "F28M36x_Dma.h" // DMA Registers
#include "F28M36x_Epi.h" // EPI Registers
#include "F28M36x_Ecap.h" // Enhanced Capture
#include "F28M36x_Epwm.h" // Enhanced PWM
#include "F28M36x_Eqep.h" // Enhanced QEP
#include "F28M36x_Flash.h" // Flash Error Registers
#include "F28M36x_Gpio.h" // General Purpose I/O Registers
#include "F28M36x_I2c.h" // I2C Registers
#include "F28M36x_Ipc.h" // C28 Inter-processor Communication
// Registers
#include "F28M36x_Mcbsp.h" // McBSP Registers
#include "F28M36x_NmiIntrupt.h" // NMI Interrupt Registers
#include "F28M36x_PieCtrl.h" // PIE Control Registers
#include "F28M36x_PieVect.h" // PIE Vector Table
#include "F28M36x_Ram.h" // RAM Registers
#include "F28M36x_Sci.h" // SCI Registers
#include "F28M36x_Spi.h" // SPI Registers
#include "F28M36x_Sysctrl.h" // System Control/Power Modes
#include "F28M36x_XIntrupt.h" // External Interrupts
#if (DSP28_F28M36Hx_100MHZ)
// Timer definitions based on System Clock
// 100 MHz devices
#define mSec0_5 50000 // 0.5 mS
#define mSec0_75 75000 // 0.75 mS
#define mSec1 100000 // 1.0 mS
#define mSec2 200000 // 2.0 mS
#define mSec5 500000 // 5.0 mS
#define mSec7_5 750000 // 7.5 mS
#define mSec10 1000000 // 10 mS
#define mSec20 2000000 // 20 mS
#define mSec50 5000000 // 50 mS
#define mSec75 7500000 // 75 mS
#define mSec100 10000000 // 100 mS
#define mSec200 20000000 // 200 mS
#define mSec500 50000000 // 500 mS
#define mSec750 75000000 // 750 mS
#define mSec1000 100000000 // 1000 mS
#define mSec2000 200000000 // 2000 mS
#define mSec5000 500000000 // 5000 mS
#endif
#if (DSP28_F28M36Hx_150MHZ)
// Timer definitions based on System Clock
// 150 MHz devices
#define mSec0_5 75000 // 0.5 mS
#define mSec0_75 112500 // 0.75 mS
#define mSec1 150000 // 1.0 mS
#define mSec2 300000 // 2.0 mS
#define mSec5 750000 // 5.0 mS
#define mSec7_5 1125000 // 7.5 mS
#define mSec10 1500000 // 10 mS
#define mSec20 3000000 // 20 mS
#define mSec50 7500000 // 50 mS
#define mSec75 11250000 // 75 mS
#define mSec100 15000000 // 100 mS
#define mSec200 30000000 // 200 mS
#define mSec500 75000000 // 500 mS
#define mSec750 112500000 // 750 mS
#define mSec1000 150000000 // 1000 mS
#define mSec2000 300000000 // 2000 mS
#define mSec5000 750000000 // 5000 mS
#endif
#if (DSP28_F28M36Px_125MHZ)
// Timer definitions based on System Clock
// 125 MHz devices
#define mSec0_5 62500 // 0.5 mS
#define mSec0_75 93750 // 0.75 mS
#define mSec1 125000 // 1.0 mS
#define mSec2 250000 // 2.0 mS
#define mSec5 625000 // 5.0 mS
#define mSec7_5 937500 // 7.5 mS
#define mSec10 1250000 // 10 mS
#define mSec20 2500000 // 20 mS
#define mSec50 6250000 // 50 mS
#define mSec75 9375000 // 75 mS
#define mSec100 12500000 // 100 mS
#define mSec200 25000000 // 200 mS
#define mSec500 62500000 // 500 mS
#define mSec750 93750000 // 750 mS
#define mSec1000 125000000 // 1000 mS
#define mSec2000 250000000 // 2000 mS
#define mSec5000 625000000 // 5000 mS
#endif
#if (DSP28_F28M36Px_150MHZ)
// Timer definitions based on System Clock
// 150 MHz devices
#define mSec0_5 75000 // 0.5 mS
#define mSec0_75 112500 // 0.75 mS
#define mSec1 150000 // 1.0 mS
#define mSec2 300000 // 2.0 mS
#define mSec5 750000 // 5.0 mS
#define mSec7_5 1125000 // 7.5 mS
#define mSec10 1500000 // 10 mS
#define mSec20 3000000 // 20 mS
#define mSec50 7500000 // 50 mS
#define mSec75 11250000 // 75 mS
#define mSec100 15000000 // 100 mS
#define mSec200 30000000 // 200 mS
#define mSec500 75000000 // 500 mS
#define mSec750 112500000 // 750 mS
#define mSec1000 150000000 // 1000 mS
#define mSec2000 300000000 // 2000 mS
#define mSec5000 750000000 // 5000 mS
#endif
#ifdef __cplusplus
}
#endif /* extern "C" */
#endif // end of F28M36x_DEVICE_H definition
3 Comments
Antoine Bostem
on 6 Apr 2018
Did you get a solution ?
The error is on the
extern __cregister volatile unsigned int IFR;
extern __cregister volatile unsigned int IER;
Matlab wants a semicolon before the volatile. But we can't do that...
Answers (0)
See Also
Categories
Find more on Texas Instruments C2000 F28M3x Concerto Processors in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!