problem in compiling codes

General discussion on mikroC PRO for AVR.
Post Reply
Author
Message
Neelkamal
Posts: 3
Joined: 14 Jan 2017 07:43

problem in compiling codes

#1 Post by Neelkamal » 14 Jan 2017 07:57

hello!!
I am new to microC and just tried to write a simple code for led blinking and other stuffs but i m having a hell lot of problems in compiling the code.
for example when i m trying to compile, these are some of the errors that it shows :
and also its showing errors in peripheral librabries at lines which seemingly are perfectly fine. idk what to do..plz help me out

0 1 mikroCARM.exe -MSF -DBG -pSTM32F103C8 -LHF -C -SSA -O11111114 -fo16 -N"D:\work\ARM Programs\music_player\sd_card\MyProject.mcpar" -SP"D:\mikroc\mikroC PRO for ARM\Defs\" -SP"D:\mikroc\mikroC PRO for ARM\Uses\" -SP"D:\work\ARM Programs\music_player\sd_card\" -SP"D:\mikroc\mikroC PRO for ARM\Uses\ST M3\" -SP"D:\work\ARM Programs\music_player\CMSIS\CM3\CoreSupport\" -SP"D:\work\ARM Programs\music_player\CMSIS\CM3\DeviceSupport\ST\STM32F10x\" -SP"D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\" -IP"D:\work\ARM Programs\music_player\CMSIS\CM3\CoreSupport\" -IP"D:\work\ARM Programs\music_player\CMSIS\CM3\DeviceSupport\ST\STM32F10x\" "core_cm3.c" "system_stm32f10x.c" "misc.c" "stm32f10x_adc.c" "stm32f10x_bkp.c" "stm32f10x_can.c" "stm32f10x_cec.c" "stm32f10x_crc.c" "stm32f10x_dac.c" "stm32f10x_dbgmcu.c" "stm32f10x_dma.c" "stm32f10x_exti.c" "stm32f10x_flash.c" "stm32f10x_fsmc.c" "stm32f10x_gpio.c" "stm32f10x_i2c.c" "stm32f10x_iwdg.c" "stm32f10x_pwr.c" "stm32f10x_rcc.c" "stm32f10x_rtc.c" "stm32f10x_sdio.c" "stm32f10x_spi.c" "stm32f10x_tim.c" "stm32f10x_usart.c" "stm32f10x_wwdg.c" "first_try.c" "__Lib_Math.emcl" "__Lib_MathDouble.emcl" "__Lib_Delays.emcl" "__Lib_System_101_102_103.emcl" "__Lib_GPIO_32F10x_Defs.emcl" "__Lib_GPIO_32F10x.emcl" "__Lib_CType.emcl" "__Lib_CString.emcl" "__Lib_CStdlib.emcl" "__Lib_CMath.emcl" "__Lib_MemManager.emcl" "__Lib_Conversions.emcl" "__Lib_Sprintf.emcl" "__Lib_PrintOut.emcl" "__Lib_Sprinti.emcl" "__Lib_Sprintl.emcl" "__Lib_Time.emcl" "__Lib_Trigonometry.emcl" "__Lib_Button.emcl" "__Lib_Keypad4x4.emcl" "__Lib_Manchester.emcl" "__Lib_OneWire_32F1xx.emcl" "__Lib_PS2.emcl" "__Lib_Sound.emcl" "__Lib_SoftI2C.emcl" "__Lib_SoftSPI.emcl" "__Lib_SoftUART_32F1xx.emcl" "__Lib_ADC_12_32F10x_10ch.emcl" "__Lib_FLASH_32F10x.emcl" "__Lib_I2C_12.emcl" "__Lib_PWM_1234.emcl" "__Lib_SPI_123.emcl" "__Lib_UART_123_45.emcl" "__Lib_CAN_1.emcl" "__Lib_USB_32F10x.emcl" "__Lib_PortExpander.emcl" "__Lib_CANSPI.emcl" "__Lib_CF.emcl" "__Lib_CFFat16.emcl" "__Lib_GlcdFonts.emcl" "__Lib_Glcd.emcl" "__Lib_LcdConsts.emcl" "__Lib_Lcd.emcl" "__Lib_Mmc.emcl" "__Lib_MmcFat16.emcl" "__Lib_MmcFat16Constants.emcl" "__Lib_RS485.emcl" "__Lib_S1D13700.emcl" "__Lib_T6963C.emcl" "__Lib_SPIGlcd.emcl" "__Lib_SPILcd.emcl" "__Lib_SPILcd8.emcl" "__Lib_SPIT6963C.emcl" "__Lib_EthEnc28j60.emcl" "__Lib_EthEnc24j600.emcl" "__Lib_TFT.emcl" "__Lib_TFT_Defs.emcl" "__Lib_TouchPanel_TFT.emcl" "__Lib_TouchPanel.emcl" "__Lib_Vectors.emcl" "__Lib_Matrices.emcl" "__Lib_IIR.emcl" "__Lib_FIR.emcl" "__Lib_FFT.emcl" "__Lib_Q15.emcl" "__Lib_Q31.emcl" "__Lib_STMPE610.emcl" "__Lib_TSC2006.emcl"
0 122 Compilation Started __Lib_Delays.c
118 123 Compiled Successfully __Lib_Delays.c
66 1164 Variable 'cycles_div_by_10' has been eliminated by optimizer __Lib_Delays.c
87 1164 Variable 'NumberOfCyc' has been eliminated by optimizer __Lib_Delays.c
104 1164 Variable 'NumberOfCyc' has been eliminated by optimizer __Lib_Delays.c
0 122 Compilation Started stdint.h
48 123 Compiled Successfully stdint.h
82 304 error: Can't open include file "stm32f10x_conf.h" #include "stm32f10x_conf.h" from D:/work/ARM Programs/music_player/CMSIS/CM3/DeviceSupport/ST/STM32F10x/system_stm32f10x.c: 65: #include "stm32f10x.h" 1 error in preprocessor. d:\work\arm programs\music_player\cmsis\cm3\devicesupport\st\stm32f10x\stm32f10x.h
0 122 Compilation Started stm32f10x.h
157 386 Members cannot have memory specifier core_cm3.h
171 386 Members cannot have memory specifier core_cm3.h
172 386 Members cannot have memory specifier core_cm3.h
173 386 Members cannot have memory specifier core_cm3.h
174 386 Members cannot have memory specifier core_cm3.h
175 386 Members cannot have memory specifier core_cm3.h
370 386 Members cannot have memory specifier core_cm3.h
432 386 Members cannot have memory specifier core_cm3.h
433 386 Members cannot have memory specifier core_cm3.h
434 386 Members cannot have memory specifier core_cm3.h
435 386 Members cannot have memory specifier core_cm3.h
436 386 Members cannot have memory specifier core_cm3.h
437 386 Members cannot have memory specifier core_cm3.h
438 386 Members cannot have memory specifier core_cm3.h
439 386 Members cannot have memory specifier core_cm3.h
440 386 Members cannot have memory specifier core_cm3.h
441 386 Members cannot have memory specifier core_cm3.h
442 386 Members cannot have memory specifier core_cm3.h
443 386 Members cannot have memory specifier core_cm3.h
444 312 Internal error '' core_cm3.h
24 304 error: Can't open include file "misc.h" #include "misc.h" 1 error in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\misc.c
1 122 Compilation Started core_cm3.h
96 300 Syntax Error: ')' expected, but 'NVIC_PriorityGroup' found misc.c
102 402 ; expected, but '->' found misc.c
102 371 Specifier needed misc.c
102 396 Invalid declarator expected'(' or identifier misc.c
102 324 Undeclared identifier 'uint32_t' in expression misc.c
102 300 Syntax Error: ')' expected, but '0x05FA0000' found misc.c
102 402 ; expected, but ')' found misc.c
102 371 Specifier needed misc.c
102 396 Invalid declarator expected'(' or identifier misc.c
102 393 '' Identifier redefined misc.c
103 371 Specifier needed misc.c
103 396 Invalid declarator expected'(' or identifier misc.c
112 300 Syntax Error: ')' expected, but '*' found misc.c
114 312 Internal error '' misc.c
23 304 error: Can't open include file "stm32f10x_adc.h" #include "stm32f10x_adc.h" D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_adc.c
24 304 error: Can't open include file "stm32f10x_rcc.h" #include "stm32f10x_rcc.h" 2 errors in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_adc.c
0 122 Compilation Started stm32f10x_adc.c
179 300 Syntax Error: ')' expected, but '*' found stm32f10x_adc.c
184 371 Specifier needed stm32f10x_adc.c
184 396 Invalid declarator expected'(' or identifier stm32f10x_adc.c
184 300 Syntax Error: ')' expected, but '==' found stm32f10x_adc.c
187 402 ; expected, but ')' found stm32f10x_adc.c
187 371 Specifier needed stm32f10x_adc.c
187 396 Invalid declarator expected'(' or identifier stm32f10x_adc.c
189 300 Syntax Error: ')' expected, but 'DISABLE' found stm32f10x_adc.c
190 371 Specifier needed stm32f10x_adc.c
190 396 Invalid declarator expected'(' or identifier stm32f10x_adc.c
191 300 Syntax Error: ')' expected, but '==' found stm32f10x_adc.c
194 402 ; expected, but ')' found stm32f10x_adc.c
194 393 'ENABLE' Identifier redefined stm32f10x_adc.c
194 312 Internal error '' stm32f10x_adc.c
23 304 error: Can't open include file "stm32f10x_bkp.h" #include "stm32f10x_bkp.h" D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_bkp.c
24 304 error: Can't open include file "stm32f10x_rcc.h" #include "stm32f10x_rcc.h" 2 errors in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_bkp.c
0 122 Compilation Started stm32f10x_bkp.c
122 324 Undeclared identifier 'RCC_BackupResetCmd' in expression stm32f10x_bkp.c
123 324 Undeclared identifier 'RCC_BackupResetCmd' in expression stm32f10x_bkp.c
134 300 Syntax Error: ')' expected, but 'BKP_TamperPinLevel' found stm32f10x_bkp.c
138 300 Syntax Error: ')' expected, but 'uint32_t' found stm32f10x_bkp.c
138 402 ; expected, but '*' found stm32f10x_bkp.c
138 396 Invalid declarator expected'(' or identifier stm32f10x_bkp.c
138 300 Syntax Error: ')' expected, but '+' found stm32f10x_bkp.c
139 371 Specifier needed stm32f10x_bkp.c
139 396 Invalid declarator expected'(' or identifier stm32f10x_bkp.c
147 300 Syntax Error: ')' expected, but 'NewState' found stm32f10x_bkp.c
150 393 ' ' Identifier redefined stm32f10x_bkp.c
150 312 Internal error '' stm32f10x_bkp.c
23 304 error: Can't open include file "stm32f10x_can.h" #include "stm32f10x_can.h" D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_can.c
24 304 error: Can't open include file "stm32f10x_rcc.h" #include "stm32f10x_rcc.h" 2 errors in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_can.c
0 122 Compilation Started stm32f10x_can.c
107 402 ; expected, but 'CheckITStatus' found stm32f10x_can.c
107 300 Syntax Error: ')' expected, but 'CAN_Reg' found stm32f10x_can.c
107 402 ; expected, but ',' found stm32f10x_can.c
107 371 Specifier needed stm32f10x_can.c
107 396 Invalid declarator expected'(' or identifier stm32f10x_can.c
107 402 ; expected, but 'It_Bit' found stm32f10x_can.c
107 402 ; expected, but ')' found stm32f10x_can.c
107 371 Specifier needed stm32f10x_can.c
107 396 Invalid declarator expected'(' or identifier stm32f10x_can.c
107 393 '' Identifier redefined stm32f10x_can.c
122 300 Syntax Error: ')' expected, but '*' found stm32f10x_can.c
125 312 Internal error '' stm32f10x_can.c
23 304 error: Can't open include file "stm32f10x_cec.h" #include "stm32f10x_cec.h" D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_cec.c
24 304 error: Can't open include file "stm32f10x_rcc.h" #include "stm32f10x_rcc.h" 2 errors in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_cec.c
0 122 Compilation Started stm32f10x_cec.c
121 324 Undeclared identifier 'RCC_APB1PeriphResetCmd' in expression stm32f10x_cec.c
123 324 Undeclared identifier 'RCC_APB1PeriphResetCmd' in expression stm32f10x_cec.c
135 300 Syntax Error: ')' expected, but '*' found stm32f10x_cec.c
140 300 Syntax Error: ')' expected, but '(' found stm32f10x_cec.c
141 300 Syntax Error: ')' expected, but '(' found stm32f10x_cec.c
145 402 ; expected, but '=' found stm32f10x_cec.c
145 371 Specifier needed stm32f10x_cec.c
145 396 Invalid declarator expected'(' or identifier stm32f10x_cec.c
145 324 Undeclared identifier 'CEC' in expression stm32f10x_cec.c
145 322 Pointer required stm32f10x_cec.c
145 317 Operator '.' is not applicable to these operands '' stm32f10x_cec.c
145 312 Internal error '' stm32f10x_cec.c
23 304 error: Can't open include file "stm32f10x_crc.h" #include "stm32f10x_crc.h" 1 error in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_crc.c
0 122 Compilation Started stm32f10x_crc.c
86 324 Undeclared identifier 'CRC' in expression stm32f10x_crc.c
86 322 Pointer required stm32f10x_crc.c
86 317 Operator '.' is not applicable to these operands '' stm32f10x_crc.c
86 324 Undeclared identifier 'CRC_CR_RESET' in expression stm32f10x_crc.c
94 402 ; expected, but 'CRC_CalcCRC' found stm32f10x_crc.c
94 300 Syntax Error: ')' expected, but 'Data' found stm32f10x_crc.c
98 371 Specifier needed stm32f10x_crc.c
98 396 Invalid declarator expected'(' or identifier stm32f10x_crc.c
98 300 Syntax Error: ')' expected, but '->' found stm32f10x_crc.c
99 371 Specifier needed stm32f10x_crc.c
99 396 Invalid declarator expected'(' or identifier stm32f10x_crc.c
107 300 Syntax Error: ')' expected, but 'pBuffer' found stm32f10x_crc.c
107 402 ; expected, but 'BufferLength' found stm32f10x_crc.c
107 393 'uint32_t' Identifier redefined stm32f10x_crc.c
107 312 Internal error '' stm32f10x_crc.c
23 304 error: Can't open include file "stm32f10x_dac.h" #include "stm32f10x_dac.h" D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_dac.c
24 304 error: Can't open include file "stm32f10x_rcc.h" #include "stm32f10x_rcc.h" 2 errors in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_dac.c
0 122 Compilation Started stm32f10x_dac.c
101 324 Undeclared identifier 'RCC_APB1PeriphResetCmd' in expression stm32f10x_dac.c
103 324 Undeclared identifier 'RCC_APB1PeriphResetCmd' in expression stm32f10x_dac.c
117 300 Syntax Error: ')' expected, but 'DAC_Channel' found stm32f10x_dac.c
117 402 ; expected, but '*' found stm32f10x_dac.c
117 402 ; expected, but ')' found stm32f10x_dac.c
117 371 Specifier needed stm32f10x_dac.c
117 396 Invalid declarator expected'(' or identifier stm32f10x_dac.c
121 300 Syntax Error: ')' expected, but '(' found stm32f10x_dac.c
122 300 Syntax Error: ')' expected, but '(' found stm32f10x_dac.c
123 300 Syntax Error: ')' expected, but '(' found stm32f10x_dac.c
124 300 Syntax Error: ')' expected, but '(' found stm32f10x_dac.c
124 312 Internal error '' stm32f10x_dac.c
23 304 error: Can't open include file "stm32f10x_dbgmcu.h" #include "stm32f10x_dbgmcu.h" 1 error in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_dbgmcu.c
0 122 Compilation Started stm32f10x_dbgmcu.c
84 402 ; expected, but 'DBGMCU_GetREVID' found stm32f10x_dbgmcu.c
86 324 Undeclared identifier 'DBGMCU' in expression stm32f10x_dbgmcu.c
86 322 Pointer required stm32f10x_dbgmcu.c
86 317 Operator '.' is not applicable to these operands '' stm32f10x_dbgmcu.c
86 317 Operator '' is not applicable to these operands '' stm32f10x_dbgmcu.c
94 402 ; expected, but 'DBGMCU_GetDEVID' found stm32f10x_dbgmcu.c
94 393 'uint32_t' Identifier redefined stm32f10x_dbgmcu.c
96 324 Undeclared identifier 'DBGMCU' in expression stm32f10x_dbgmcu.c
96 322 Pointer required stm32f10x_dbgmcu.c
96 317 Operator '.' is not applicable to these operands '' stm32f10x_dbgmcu.c
96 300 Syntax Error: ')' expected, but '0x00000FFF' found stm32f10x_dbgmcu.c
96 317 Operator '' is not applicable to these operands '' stm32f10x_dbgmcu.c
96 402 ; expected, but ')' found stm32f10x_dbgmcu.c
96 424 '}' expected ')' found stm32f10x_dbgmcu.c
97 312 Internal error '' stm32f10x_dbgmcu.c
23 304 error: Can't open include file "stm32f10x_dma.h" #include "stm32f10x_dma.h" D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_dma.c
24 304 error: Can't open include file "stm32f10x_rcc.h" #include "stm32f10x_rcc.h" 2 errors in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_dma.c
1 122 Compilation Started stm32f10x_dbgmcu.c
108 300 Syntax Error: ')' expected, but '*' found stm32f10x_dma.c
114 402 ; expected, but '->' found stm32f10x_dma.c
114 371 Specifier needed stm32f10x_dma.c
114 396 Invalid declarator expected'(' or identifier stm32f10x_dma.c
114 371 Specifier needed stm32f10x_dma.c
114 300 Syntax Error: ')' expected, but '~' found stm32f10x_dma.c
117 402 ; expected, but '->' found stm32f10x_dma.c
117 393 'DMAy_Channelx' Identifier redefined stm32f10x_dma.c
117 371 Specifier needed stm32f10x_dma.c
117 396 Invalid declarator expected'(' or identifier stm32f10x_dma.c
120 402 ; expected, but '->' found stm32f10x_dma.c
120 393 'DMAy_Channelx' Identifier redefined stm32f10x_dma.c
120 312 Internal error '' stm32f10x_dma.c
23 304 error: Can't open include file "stm32f10x_exti.h" #include "stm32f10x_exti.h" 1 error in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_exti.c
0 122 Compilation Started stm32f10x_exti.c
87 324 Undeclared identifier 'EXTI' in expression stm32f10x_exti.c
87 322 Pointer required stm32f10x_exti.c
87 317 Operator '.' is not applicable to these operands '' stm32f10x_exti.c
88 324 Undeclared identifier 'EXTI' in expression stm32f10x_exti.c
88 322 Pointer required stm32f10x_exti.c
88 317 Operator '.' is not applicable to these operands '' stm32f10x_exti.c
89 324 Undeclared identifier 'EXTI' in expression stm32f10x_exti.c
89 322 Pointer required stm32f10x_exti.c
89 317 Operator '.' is not applicable to these operands '' stm32f10x_exti.c
90 324 Undeclared identifier 'EXTI' in expression stm32f10x_exti.c
90 322 Pointer required stm32f10x_exti.c
90 317 Operator '.' is not applicable to these operands '' stm32f10x_exti.c
91 324 Undeclared identifier 'EXTI' in expression stm32f10x_exti.c
91 322 Pointer required stm32f10x_exti.c
91 317 Operator '.' is not applicable to these operands '' stm32f10x_exti.c
92 312 Internal error '' stm32f10x_exti.c
23 304 error: Can't open include file "stm32f10x_flash.h" #include "stm32f10x_flash.h" 1 error in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_flash.c
1 122 Compilation Started stm32f10x_exti.c
254 300 Syntax Error: ')' expected, but 'FLASH_Latency' found stm32f10x_flash.c
259 300 Syntax Error: ')' expected, but '(' found stm32f10x_flash.c
262 402 ; expected, but '=' found stm32f10x_flash.c
262 371 Specifier needed stm32f10x_flash.c
262 396 Invalid declarator expected'(' or identifier stm32f10x_flash.c
262 324 Undeclared identifier 'FLASH' in expression stm32f10x_flash.c
262 322 Pointer required stm32f10x_flash.c
262 317 Operator '.' is not applicable to these operands '' stm32f10x_flash.c
265 402 ; expected, but '&=' found stm32f10x_flash.c
265 393 'tmpreg' Identifier redefined stm32f10x_flash.c
265 371 Specifier needed stm32f10x_flash.c
265 396 Invalid declarator expected'(' or identifier stm32f10x_flash.c
265 371 Specifier needed stm32f10x_flash.c
265 300 Syntax Error: ')' expected, but '0x00000038' found stm32f10x_flash.c
265 312 Internal error '' stm32f10x_flash.c
23 304 error: Can't open include file "stm32f10x_fsmc.h" #include "stm32f10x_fsmc.h" D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_fsmc.c
24 304 error: Can't open include file "stm32f10x_rcc.h" #include "stm32f10x_rcc.h" 2 errors in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_fsmc.c
0 122 Compilation Started stm32f10x_fsmc.c
102 300 Syntax Error: ')' expected, but 'FSMC_Bank' found stm32f10x_fsmc.c
108 371 Specifier needed stm32f10x_fsmc.c
108 396 Invalid declarator expected'(' or identifier stm32f10x_fsmc.c
108 300 Syntax Error: ')' expected, but '==' found stm32f10x_fsmc.c
111 371 Specifier needed stm32f10x_fsmc.c
111 396 Invalid declarator expected'(' or identifier stm32f10x_fsmc.c
115 324 Undeclared identifier 'FSMC_Bank' in expression stm32f10x_fsmc.c
115 374 Array dimension must be greater than 0 stm32f10x_fsmc.c
116 371 Specifier needed stm32f10x_fsmc.c
116 396 Invalid declarator expected'(' or identifier stm32f10x_fsmc.c
117 324 Undeclared identifier 'FSMC_Bank' in expression stm32f10x_fsmc.c
117 310 Constant expression required stm32f10x_fsmc.c
117 374 Array dimension must be greater than 0 stm32f10x_fsmc.c
117 393 '' Identifier redefined stm32f10x_fsmc.c
117 312 Internal error '' stm32f10x_fsmc.c
23 304 error: Can't open include file "stm32f10x_gpio.h" #include "stm32f10x_gpio.h" D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c
24 304 error: Can't open include file "stm32f10x_rcc.h" #include "stm32f10x_rcc.h" 2 errors in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c
0 122 Compilation Started stm32f10x_gpio.c
108 300 Syntax Error: ')' expected, but '*' found stm32f10x_gpio.c
113 371 Specifier needed stm32f10x_gpio.c
113 396 Invalid declarator expected'(' or identifier stm32f10x_gpio.c
113 300 Syntax Error: ')' expected, but '==' found stm32f10x_gpio.c
115 402 ; expected, but ')' found stm32f10x_gpio.c
115 371 Specifier needed stm32f10x_gpio.c
115 396 Invalid declarator expected'(' or identifier stm32f10x_gpio.c
116 300 Syntax Error: ')' expected, but 'DISABLE' found stm32f10x_gpio.c
117 371 Specifier needed stm32f10x_gpio.c
117 396 Invalid declarator expected'(' or identifier stm32f10x_gpio.c
118 300 Syntax Error: ')' expected, but '==' found stm32f10x_gpio.c
120 402 ; expected, but ')' found stm32f10x_gpio.c
120 393 'ENABLE' Identifier redefined stm32f10x_gpio.c
120 312 Internal error '' stm32f10x_gpio.c
23 304 error: Can't open include file "stm32f10x_i2c.h" #include "stm32f10x_i2c.h" D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_i2c.c
24 304 error: Can't open include file "stm32f10x_rcc.h" #include "stm32f10x_rcc.h" 2 errors in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_i2c.c
0 122 Compilation Started stm32f10x_i2c.c
162 300 Syntax Error: ')' expected, but '*' found stm32f10x_i2c.c
167 371 Specifier needed stm32f10x_i2c.c
167 396 Invalid declarator expected'(' or identifier stm32f10x_i2c.c
167 300 Syntax Error: ')' expected, but '==' found stm32f10x_i2c.c
170 402 ; expected, but ')' found stm32f10x_i2c.c
170 371 Specifier needed stm32f10x_i2c.c
170 396 Invalid declarator expected'(' or identifier stm32f10x_i2c.c
172 300 Syntax Error: ')' expected, but 'DISABLE' found stm32f10x_i2c.c
173 371 Specifier needed stm32f10x_i2c.c
173 396 Invalid declarator expected'(' or identifier stm32f10x_i2c.c
177 300 Syntax Error: ')' expected, but 'ENABLE' found stm32f10x_i2c.c
177 312 Internal error '' stm32f10x_i2c.c
23 304 error: Can't open include file "stm32f10x_iwdg.h" #include "stm32f10x_iwdg.h" 1 error in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_iwdg.c
0 122 Compilation Started stm32f10x_iwdg.c
92 300 Syntax Error: ')' expected, but 'IWDG_WriteAccess' found stm32f10x_iwdg.c
96 402 ; expected, but '->' found stm32f10x_iwdg.c
96 371 Specifier needed stm32f10x_iwdg.c
96 396 Invalid declarator expected'(' or identifier stm32f10x_iwdg.c
96 324 Undeclared identifier 'IWDG_WriteAccess' in expression stm32f10x_iwdg.c
97 371 Specifier needed stm32f10x_iwdg.c
97 396 Invalid declarator expected'(' or identifier stm32f10x_iwdg.c
112 300 Syntax Error: ')' expected, but 'IWDG_Prescaler' found stm32f10x_iwdg.c
116 402 ; expected, but '->' found stm32f10x_iwdg.c
116 393 'IWDG' Identifier redefined stm32f10x_iwdg.c
116 371 Specifier needed stm32f10x_iwdg.c
116 396 Invalid declarator expected'(' or identifier stm32f10x_iwdg.c
116 324 Undeclared identifier 'IWDG_Prescaler' in expression stm32f10x_iwdg.c
116 393 '' Identifier redefined stm32f10x_iwdg.c
116 312 Internal error '' stm32f10x_iwdg.c
23 304 error: Can't open include file "stm32f10x_pwr.h" #include "stm32f10x_pwr.h" D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_pwr.c
24 304 error: Can't open include file "stm32f10x_rcc.h" #include "stm32f10x_rcc.h" 2 errors in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_pwr.c
0 122 Compilation Started stm32f10x_pwr.c
114 324 Undeclared identifier 'RCC_APB1PeriphResetCmd' in expression stm32f10x_pwr.c
115 324 Undeclared identifier 'RCC_APB1PeriphResetCmd' in expression stm32f10x_pwr.c
124 300 Syntax Error: ')' expected, but 'NewState' found stm32f10x_pwr.c
128 300 Syntax Error: ')' expected, but 'uint32_t' found stm32f10x_pwr.c
128 402 ; expected, but '*' found stm32f10x_pwr.c
128 396 Invalid declarator expected'(' or identifier stm32f10x_pwr.c
128 300 Syntax Error: ')' expected, but '+' found stm32f10x_pwr.c
129 371 Specifier needed stm32f10x_pwr.c
129 396 Invalid declarator expected'(' or identifier stm32f10x_pwr.c
137 300 Syntax Error: ')' expected, but 'NewState' found stm32f10x_pwr.c
140 393 ' ' Identifier redefined stm32f10x_pwr.c
140 312 Internal error '' stm32f10x_pwr.c
23 304 error: Can't open include file "stm32f10x_rcc.h" #include "stm32f10x_rcc.h" 1 error in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c
0 122 Compilation Started stm32f10x_rcc.c
193 402 ; expected, but 'uint8_t' found stm32f10x_rcc.c
193 402 ; expected, but 'APBAHBPrescTable' found stm32f10x_rcc.c
193 402 ; expected, but '=' found stm32f10x_rcc.c
193 371 Specifier needed stm32f10x_rcc.c
193 396 Invalid declarator expected'(' or identifier stm32f10x_rcc.c
194 402 ; expected, but 'uint8_t' found stm32f10x_rcc.c
194 393 '__I' Identifier redefined stm32f10x_rcc.c
194 402 ; expected, but 'ADCPrescTable' found stm32f10x_rcc.c
194 393 'uint8_t' Identifier redefined stm32f10x_rcc.c
194 402 ; expected, but '=' found stm32f10x_rcc.c
194 371 Specifier needed stm32f10x_rcc.c
194 396 Invalid declarator expected'(' or identifier stm32f10x_rcc.c
194 393 '' Identifier redefined stm32f10x_rcc.c
194 312 Internal error '' stm32f10x_rcc.c
23 304 error: Can't open include file "stm32f10x_rtc.h" #include "stm32f10x_rtc.h" 1 error in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_rtc.c
1 122 Compilation Started stm32f10x_rcc.c
90 300 Syntax Error: ')' expected, but 'RTC_IT' found stm32f10x_rtc.c
90 402 ; expected, but 'NewState' found stm32f10x_rtc.c
90 402 ; expected, but ')' found stm32f10x_rtc.c
90 371 Specifier needed stm32f10x_rtc.c
90 396 Invalid declarator expected'(' or identifier stm32f10x_rtc.c
93 300 Syntax Error: ')' expected, but '(' found stm32f10x_rtc.c
94 300 Syntax Error: ')' expected, but '(' found stm32f10x_rtc.c
96 371 Specifier needed stm32f10x_rtc.c
96 396 Invalid declarator expected'(' or identifier stm32f10x_rtc.c
96 300 Syntax Error: ')' expected, but '!=' found stm32f10x_rtc.c
99 371 Specifier needed stm32f10x_rtc.c
99 396 Invalid declarator expected'(' or identifier stm32f10x_rtc.c
102 402 ; expected, but '~' found stm32f10x_rtc.c
102 312 Internal error '' stm32f10x_rtc.c
23 304 error: Can't open include file "stm32f10x_sdio.h" #include "stm32f10x_sdio.h" D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_sdio.c
24 304 error: Can't open include file "stm32f10x_rcc.h" #include "stm32f10x_rcc.h" 2 errors in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_sdio.c
0 122 Compilation Started stm32f10x_sdio.c
163 324 Undeclared identifier 'SDIO' in expression stm32f10x_sdio.c
163 322 Pointer required stm32f10x_sdio.c
163 317 Operator '.' is not applicable to these operands '' stm32f10x_sdio.c
164 324 Undeclared identifier 'SDIO' in expression stm32f10x_sdio.c
164 322 Pointer required stm32f10x_sdio.c
164 317 Operator '.' is not applicable to these operands '' stm32f10x_sdio.c
165 324 Undeclared identifier 'SDIO' in expression stm32f10x_sdio.c
165 322 Pointer required stm32f10x_sdio.c
165 317 Operator '.' is not applicable to these operands '' stm32f10x_sdio.c
166 324 Undeclared identifier 'SDIO' in expression stm32f10x_sdio.c
166 322 Pointer required stm32f10x_sdio.c
166 317 Operator '.' is not applicable to these operands '' stm32f10x_sdio.c
167 324 Undeclared identifier 'SDIO' in expression stm32f10x_sdio.c
167 322 Pointer required stm32f10x_sdio.c
167 317 Operator '.' is not applicable to these operands '' stm32f10x_sdio.c
168 324 Undeclared identifier 'SDIO' in expression stm32f10x_sdio.c
168 322 Pointer required stm32f10x_sdio.c
168 317 Operator '.' is not applicable to these operands '' stm32f10x_sdio.c
169 324 Undeclared identifier 'SDIO' in expression stm32f10x_sdio.c
169 322 Pointer required stm32f10x_sdio.c
169 317 Operator '.' is not applicable to these operands '' stm32f10x_sdio.c
170 324 Undeclared identifier 'SDIO' in expression stm32f10x_sdio.c
170 322 Pointer required stm32f10x_sdio.c
170 317 Operator '.' is not applicable to these operands '' stm32f10x_sdio.c
171 324 Undeclared identifier 'SDIO' in expression stm32f10x_sdio.c
171 322 Pointer required stm32f10x_sdio.c
171 317 Operator '.' is not applicable to these operands '' stm32f10x_sdio.c
172 312 Internal error '' stm32f10x_sdio.c
23 304 error: Can't open include file "stm32f10x_spi.h" #include "stm32f10x_spi.h" D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_spi.c
24 304 error: Can't open include file "stm32f10x_rcc.h" #include "stm32f10x_rcc.h" 2 errors in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_spi.c
1 122 Compilation Started stm32f10x_sdio.c
119 300 Syntax Error: ')' expected, but '*' found stm32f10x_spi.c
124 371 Specifier needed stm32f10x_spi.c
124 396 Invalid declarator expected'(' or identifier stm32f10x_spi.c
124 300 Syntax Error: ')' expected, but '==' found stm32f10x_spi.c
127 402 ; expected, but ')' found stm32f10x_spi.c
127 371 Specifier needed stm32f10x_spi.c
127 396 Invalid declarator expected'(' or identifier stm32f10x_spi.c
129 300 Syntax Error: ')' expected, but 'DISABLE' found stm32f10x_spi.c
130 371 Specifier needed stm32f10x_spi.c
130 396 Invalid declarator expected'(' or identifier stm32f10x_spi.c
131 300 Syntax Error: ')' expected, but '==' found stm32f10x_spi.c
134 402 ; expected, but ')' found stm32f10x_spi.c
134 393 'ENABLE' Identifier redefined stm32f10x_spi.c
134 312 Internal error '' stm32f10x_spi.c
23 304 error: Can't open include file "stm32f10x_tim.h" #include "stm32f10x_tim.h" D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_tim.c
24 304 error: Can't open include file "stm32f10x_rcc.h" #include "stm32f10x_rcc.h" 2 errors in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_tim.c
0 122 Compilation Started stm32f10x_tim.c
77 300 Syntax Error: ')' expected, but '*' found stm32f10x_tim.c
77 402 ; expected, but 'TIM_ICPolarity' found stm32f10x_tim.c
77 402 ; expected, but ',' found stm32f10x_tim.c
77 371 Specifier needed stm32f10x_tim.c
77 396 Invalid declarator expected'(' or identifier stm32f10x_tim.c
77 402 ; expected, but 'TIM_ICSelection' found stm32f10x_tim.c
77 393 'uint16_t' Identifier redefined stm32f10x_tim.c
77 402 ; expected, but ',' found stm32f10x_tim.c
77 371 Specifier needed stm32f10x_tim.c
77 396 Invalid declarator expected'(' or identifier stm32f10x_tim.c
78 402 ; expected, but 'TIM_ICFilter' found stm32f10x_tim.c
78 393 '' Identifier redefined stm32f10x_tim.c
78 393 'uint16_t' Identifier redefined stm32f10x_tim.c
78 312 Internal error '' stm32f10x_tim.c
23 304 error: Can't open include file "stm32f10x_usart.h" #include "stm32f10x_usart.h" D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_usart.c
24 304 error: Can't open include file "stm32f10x_rcc.h" #include "stm32f10x_rcc.h" 2 errors in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_usart.c
0 122 Compilation Started stm32f10x_usart.c
130 300 Syntax Error: ')' expected, but '*' found stm32f10x_usart.c
135 371 Specifier needed stm32f10x_usart.c
135 396 Invalid declarator expected'(' or identifier stm32f10x_usart.c
135 300 Syntax Error: ')' expected, but '==' found stm32f10x_usart.c
137 402 ; expected, but ')' found stm32f10x_usart.c
137 371 Specifier needed stm32f10x_usart.c
137 396 Invalid declarator expected'(' or identifier stm32f10x_usart.c
138 300 Syntax Error: ')' expected, but 'DISABLE' found stm32f10x_usart.c
139 371 Specifier needed stm32f10x_usart.c
139 396 Invalid declarator expected'(' or identifier stm32f10x_usart.c
140 300 Syntax Error: ')' expected, but '==' found stm32f10x_usart.c
142 402 ; expected, but ')' found stm32f10x_usart.c
142 393 'ENABLE' Identifier redefined stm32f10x_usart.c
142 312 Internal error '' stm32f10x_usart.c
23 304 error: Can't open include file "stm32f10x_wwdg.h" #include "stm32f10x_wwdg.h" D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_wwdg.c
24 304 error: Can't open include file "stm32f10x_rcc.h" #include "stm32f10x_rcc.h" 2 errors in preprocessor. D:\work\ARM Programs\music_player\STM32F10x_StdPeriph_Driver\src\stm32f10x_wwdg.c
0 122 Compilation Started stm32f10x_wwdg.c
104 324 Undeclared identifier 'RCC_APB1PeriphResetCmd' in expression stm32f10x_wwdg.c
105 324 Undeclared identifier 'RCC_APB1PeriphResetCmd' in expression stm32f10x_wwdg.c
118 300 Syntax Error: ')' expected, but 'WWDG_Prescaler' found stm32f10x_wwdg.c
122 300 Syntax Error: ')' expected, but '(' found stm32f10x_wwdg.c
124 402 ; expected, but '=' found stm32f10x_wwdg.c
124 371 Specifier needed stm32f10x_wwdg.c
124 396 Invalid declarator expected'(' or identifier stm32f10x_wwdg.c
124 324 Undeclared identifier 'WWDG' in expression stm32f10x_wwdg.c
124 322 Pointer required stm32f10x_wwdg.c
124 317 Operator '.' is not applicable to these operands '' stm32f10x_wwdg.c
124 324 Undeclared identifier 'uint32_t' in expression stm32f10x_wwdg.c
124 300 Syntax Error: ')' expected, but '0xFFFFFE7F' found stm32f10x_wwdg.c
124 317 Operator '' is not applicable to these operands '' stm32f10x_wwdg.c
124 402 ; expected, but ')' found stm32f10x_wwdg.c
124 312 Internal error '' stm32f10x_wwdg.c
1 304 error: Can't open include file "stm32f103x.h" #include <stm32f103x.h> D:\work\ARM Programs\music_player\sd_card\first_try.c
2 304 error: Unknown #directive "inlcude" #inlcude <stm32f10x_rcc.h> D:\work\ARM Programs\music_player\sd_card\first_try.c
3 304 error: Can't open include file "stm32f10x_gpio.h" #include <stm32f10x_gpio.h> D:\work\ARM Programs\music_player\sd_card\first_try.c
4 304 error: Unknown #directive "inlcude" #inlcude <stm32f10x_spi.h> 4 errors in preprocessor. D:\work\ARM Programs\music_player\sd_card\first_try.c
0 122 Compilation Started first_try.c
10 402 ; expected, but 'speeds' found first_try.c
10 402 ; expected, but '=' found first_try.c
10 371 Specifier needed first_try.c
10 396 Invalid declarator expected'(' or identifier first_try.c
11 315 Invalid expression first_try.c
11 324 Undeclared identifier 'SPI_SLOW' in expression first_try.c
11 322 Pointer required first_try.c
11 324 Undeclared identifier 'SPI_BaudRatePrescaler_64' in expression first_try.c
12 315 Invalid expression first_try.c
12 324 Undeclared identifier 'SPI_MEDIUM' in expression first_try.c
12 322 Pointer required first_try.c
12 324 Undeclared identifier 'SPI_BaudRatePrescaler_8' in expression first_try.c
13 315 Invalid expression first_try.c
13 324 Undeclared identifier 'SPI_FAST' in expression first_try.c
13 322 Pointer required first_try.c
13 324 Undeclared identifier 'SPI_BaudRatePrescaler_2' in expression first_try.c
13 312 Internal error '' first_try.c
0 102 Finished (with errors): 14 Jan 2017, 12:02:07 MyProject.mcpar

User avatar
danilo.milovic
mikroElektronika team
Posts: 501
Joined: 05 Dec 2016 14:59

Re: problem in compiling codes

#2 Post by danilo.milovic » 16 Jan 2017 12:02

Hi,

can you please send me your whole project, so I can see where is the error?

Regards,

Danilo

Neelkamal
Posts: 3
Joined: 14 Jan 2017 07:43

Re: problem in compiling codes

#3 Post by Neelkamal » 16 Jan 2017 18:07

#include <stm32f103x.h>
#inlcude <stm32f10x_rcc.h>
#include <stm32f10x_gpio.h>
#inlcude <stm32f10x_spi.h>
#include <stm32f10x_dma.h>
#include <stm32f10x_dac.h>


/* I have used PA5,PA6, PA7 for SCK, MISO AND MOSI and CS will be connected to PA8 (as input pull up)
The program has two functions, firstly it will go through a loop back and check wheather the connections are right
i.e. will try give an error if not successful
using SPI2, DMA1_Channel_3, DAC_Channel_2
*/
static const uint16_t speeds [] = {
[SPI_SLOW] = SPI_BaudRatePrescaler_64 ,
[SPI_MEDIUM] = SPI_BaudRatePrescaler_8 ,
[SPI_FAST] = SPI_BaudRatePrescaler_2 } ;

void GPIO_Setup()
{ RCC_ABP2PeriphClockCmd( RCC_APB2Periph_GPIOA , ENABLE); //SPI1 CLOCK ENABLED
GPIO_TypeDef GPIOA;
GPIO_InitTypeDef GPIOA_str;

GPIOA_str.GPIO_Speed= GPIO_Speed_50MHz;
GPIOA_str.GPIO_Pin=0xA0 ; //pin 5,7 of PORTA
GPIOA_str.GPIO_Modde= GPIO_Mode_AF_PP; // alternate function push pull
GPIO_StructInit( &GPIOA_str);
GPIO_Init(GPIOA, &GPIOA_str);

GPIOA_str.GPIO_Pin=0x0040 | 0x0100 ; //pin 6 of PORTA for MISO and pin 8 for chip select or SS Line
GPIOA_str.GPIO_Modde= GPIO_Mode_IPU; //input pull up
GPIO_StructInit( &GPIOA_str);
GPIO_Init(GPIOA, &GPIOA_str);


}

void SPI_Setup()
{
//spi config
RCC_ABP2PeriphClockCmd( RCC_APB2Periph_SPI1 , ENABLE)
SPI_TypeDef SPI1;
SPI_InitTypeDef SPI1_str;
enum spiSpeed = { SPI_SLOW, SPI_MEDIUM, SPI_FAST }; //these are already defined in the header files with prescalers 64, 8, 2
SPI1_str.SPI_Direction = SPI_Direction_2Lines_FullDuplex; //for recieve and transmission at the same time
SPI1_str.SPI_Mode = SPI_Mode_Master; //for mcu as master and my mmc as slave automatically
SPI1_str.SPI_DataSize = SPI_DataSize_8b; //
SPI1_str.SPI_CPOL = SPI_CPOL_LOW; // presacler 64
SPI1_str.SPI_CPHA= SPI_CPHA_1Edge ;
SPI1_str.SPI_BaudRatePrescaler = SPI_BuadRatePrescaler_8;
SPI1_str.SPI_NSS= SPI_NSS_Soft;
SPI1_str.SPI_CRCPolynomial = SPI_CRCPolynomial_7 ;

SPI_StructInit( &SPI1_str);
SPI_Init(&SPI1);
SPI_Cmd( SPI1, ENABLE);

}

int SPI_ReadWrite ( SPI_TypeDef SPIx, uint_8 *rbuf, uint_8 *tbuf, nb, enum spiSpeed Speed)
{ int i;
SPIx ->CR1 = (SPIx ->CR1 & ~SPI_BaudRatePrescaler_256) | spiSpeed[ Speed ];

if(tbuf)
for( i=0;i<nb;i++)
{ SPI_I2S_SendData(SPIx, *tbuf++);
}
else
SPI_I2S_SendData( SPIx, 0xff);

if(rbuf)
for( i=0;i<nb;i++)
{
*rbuf++= SPI_I2S_RecieveData(SPIx); //will be used by DMA as Content of Data register
}
else
SPI_RecieveData(SPIx);

}

void loop_back( SPI_TypeDef SPIx, uint_8 *rbuf, uint_8 *tbuf, nb, spiSpeed Speed)
{
GPIO_Write_Bit(GPIOA, GPIO_Pin_8, 0); //chip select pin
SPI_ReadWrite( SPIx, *rbuf, *tbuf, nb, Speed);
GPIO_Write_Bit( GPIOA, GPIO_Pin_8, 1);


}

void DMA_Setup()
{
RCC_APB2PeriphClockCmd( RCC_APB2Periph_DMA1, ENABLE); //USING DMA1
DMA_DeInit( DMA1_Channel2); // wherever DeInit funtion is used, this will initialize the argument with native values
DMA_DeInit( DMA1_Channel3); //Channel 2 for Tx and channel 3 for Rx.
DMA_InitTypeDef DMA1_str;
uint_32 dummy[]={0xffff}; //from this address, the data will be tranferred continuosly

/*DMA1_str.DMA_MemoryBaseAddr = (uint32_t)(&(SPI1->DR)); //spi ka data register will be Memory base address for DMA.

*/
DMA1_str.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;
DMA1_str.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;
DMA1_str.DMA_PeripheralInc = DMA_PeripheralInc_Disable; //we are using circular mode (although i still dont know wtf this is :(
DMA1_str.DMA_Mode = DMA_Mode_Normal ;
DMA1_str.DMA_Priority = DMA_Priority_VeryHigh;
DMA1_str.DMA_M2M = DMA_M2M_Disable ;

//tx channel on channel 2
DMA1_str.DMA_MemoryBaseAddr = dummy[];

DMA_Init( DMA1_Channel2, &DMA1_str);
}


void DMA1_rx (SPI_TypeDef SPIx, void *rbuf, uint_8 nb) //using Channel_3 for recieving from the card.
{
DMA1_str.DMA_MemoryBaseAddr = (uint_32)rbuf ;
DMA1_str.DMA_DIR = DMA_Peripheral_SRC;
DMA1_str.DMA_MemoryINC = DMA1_MemoryInc_Enable;

DMA_Init( DMA_Channel3, &DMA1_str);

DMA_Cmd( rxChan, ENABLE);

SPI_I2S_DMACmd ( SPIx, SPI_I2S_DMAReq_rx, ENABLE );
while( DMA_GetFlagStatus (DMA_FLAG_TC2)== RESET );
DMA_Cmd( rxChan, DISABLE);
SPI_I2S_DMACmd ( SPIx, SPI_I2S_DMAReq_rx, DISABLE );
}

void DMA1_tx( SPI_TypeDef SPIx, void *rbuf, uint_8 nb)
{
DMA1_str.DMA_PeripheralBaseAddr = &DAC->DHR12R1 ; // DAC ka Data Holding Register will be Peripheral Adress for DMA.
DMA1_str.DMA_DIR = DMA_Peripheral_DST ;
DMA1_str.DMA_MemoryInc = DMA_MemoryInc_Disable;
DMA_Init( DMA_Channel3, &DMA1_str);
DMA_Cmd ( txChan, ENABLE);
SPI_I2S_DMACmd ( SPIx, SPI_I2S_DMAReq_tx , ENABLE );


DMA_Cmd ( txChan, DISABLE);
SPI_I2S_DMACmd ( SPIx, SPI_I2S_DMAReq_tx , DISABLE );
}

void DAC_Setup()
{
RCC_APB1PeriphClockCmd( RCC_APB1Periph_DAC, ENABLE);
DAC_InitTypeDef DAC1_str;
DAC_StructInit( &DAC1_str);
DAC1_str.DAC_OutputBuffer= DAC_OutputBuffer_Enable;
DAC_Init( DAC_Channel_2, &DAC1_str);
DAC_Cmd( DAC_Channel_2, ENABLE);
DAC_DMACmd( DAC_Channel_2, ENABLE);
}

void Triangular_wave((uint32_t)DAC_TriangleAmplitude_x) //generate a triangular wave of amplitude x
{
DAC_Setup();
DAC_str.DAC_Trigger= DAC_Trigger_None;
DAC_str.DAC_WaveGeneration = DAC_WaveGeneration_Triangle;
DAC_str.DAC_LFSRUnmask_TriangleAmplitude = DAC_TriangleAmplitude_x;
DAC_Init( DAC_Channel_3, &DAC1_str);
DAC_Cmd( DAC_Channel_3, ENABLE);

DAC_WaveGenerationCmd(DAC_Channel_2, DAC_Wave_Triangle, ENABLE); //This will generate a triangular wave of amplitude max
}


void Timer_Setup()
{



}

void main()
{
setup();
DMA_Setup();

uint_8 rxbuf[4], txbuf[4];
int i,j;
for(i=0; i<nb; i++)
{
*tbuf=i*4+5;
loop_back(SPI1, *rxbuf, *txbuf, 8, SPI_MEDIUM);
}
for(i=0; i<nb; i++)
{
if(*rxbuf==*txbuf)
//program sahi h
else
break();
}








}
Attachments
This is my code..
This is my code..
Untitled.png (180.36 KiB) Viewed 5655 times

User avatar
danilo.milovic
mikroElektronika team
Posts: 501
Joined: 05 Dec 2016 14:59

Re: problem in compiling codes

#4 Post by danilo.milovic » 17 Jan 2017 10:52

Hi,

I apologize I wasn't specific enough when I said send me the whole project, I meant whole folder with all the files generated by mikro C, with all header and c files.

Regards,

Danilo

Post Reply

Return to “mikroC PRO for AVR General”