Hello there,
I am a newbie in embedded systems, Currently I am using ARM-based Digital Signal Processing Lab-in-a-Box with Cypress FM4 board (FME-176L-S6E2CC-ETH Starter Kit) . Program is -
// loop_intr.c
#include "audio.h"
volatile int16_t audio_chR=0; //16 bits audio data channel rightvolatile int16_t audio_chL=0; //16 bits audio data channel left
void I2S_HANDLER(void) { /****** I2S Interruption Handler *****/
gpio_toggle(TEST_PIN);
audio_IN = i2s_rx(); audio_chL = (audio_IN & 0x0000FFFF); //Separate 16 bits channel leftaudio_chR = ((audio_IN >>16)& 0x0000FFFF); //Separate 16 bits channel right
//Process audio_OUT = ((audio_chR<<16 & 0xFFFF0000)) + (audio_chL & 0x0000FFFF); //Put the two channels toguether againi2s_tx(audio_OUT);
}
int main(void){ gpio_set_mode(TEST_PIN,Output); audio_init ( hz48000, mic_in, intr, I2S_HANDLER); while(1){}}
When I try to built the target It shows following output in Build out put window
Build started: Project: DSP_LiB*** Using Compiler 'V6.19', folder: 'C:\Keil_v5\ARM\ARMCLANG\Bin'Build target 'S6E2CC'drivers/delay.c(27): error: expected '(' after 'asm'__asm void delay_cycles(unsigned int cycles) ;{ ^drivers/delay.c(27): error: expected ';' after top-level asm block__asm void delay_cycles(unsigned int cycles) ;{ ^ ;drivers/delay.c(27): error: expected identifier or '('__asm void delay_cycles(unsigned int cycles) ;{ ^3 errors generated.compiling delay.c...C:/Users/anadaf/AppData/Local/Arm/Packs/ARM/CMSIS/5.9.0/CMSIS/DSP/Source/FilteringFunctions/FilteringFunctionsF16.c(36): warning: In file included from...C:/Users/anadaf/AppData/Local/Arm/Packs/ARM/CMSIS/5.9.0/CMSIS/DSP/Source/FilteringFunctions/arm_levinson_durbin_f16.c(228): warning: GCC does not allow variable declarations in for loop initializers before C99 [-Wgcc-compat] for(int p=1; p < nbCoefs; p++) ^C:/Users/anadaf/AppData/Local/Arm/Packs/ARM/CMSIS/5.9.0/CMSIS/DSP/Source/FilteringFunctions/arm_levinson_durbin_f16.c(235): warning: GCC does not allow variable declarations in for loop initializers before C99 [-Wgcc-compat] for(int i=0; i < p; i++) ^C:/Users/anadaf/AppData/Local/Arm/Packs/ARM/CMSIS/5.9.0/CMSIS/DSP/Source/FilteringFunctions/arm_levinson_durbin_f16.c(246): warning: GCC does not allow variable declarations in for loop initializers before C99 [-Wgcc-compat] for(int i =0;i < nb ; i++) ^C:/Users/anadaf/AppData/Local/Arm/Packs/ARM/CMSIS/5.9.0/CMSIS/DSP/Source/FilteringFunctions/arm_levinson_durbin_f16.c(246): error: redefinition of 'i' for(int i =0;i < nb ; i++) ^C:/Users/anadaf/AppData/Local/Arm/Packs/ARM/CMSIS/5.9.0/CMSIS/DSP/Source/FilteringFunctions/arm_levinson_durbin_f16.c(235): note: previous definition is here for(int i=0; i < p; i++) ^3 warnings and 1 error generated.compiling FilteringFunctionsF16.c...".\obj\DSP_LiB.axf" - 4 Error(s), 3 Warning(s).Target not created.Build Time Elapsed: 00:00:01
Please help me out.
Hi there, thank you for your question. Please look at the list of Support Forums here: https://community.arm.com/support-forums/ and let me know where to move your question to. Many thanks.
This source code looks like it was written for the Arm Compiler 5 with embedded assembly. See:
https://developer.arm.com/documentation/dui0472/k/Using-the-Inline-and-Embedded-Assemblers-of-the-ARM-Compiler/Embedded-assembler-syntax-in-C-and-C--?lang=en
You are using Arm Compiler 6, which uses a different syntax. See:
https://developer.arm.com/documentation/100068/0620/Migrating-from-armcc-to-armclang/Inline-assembly-with-Arm-Compiler-for-Embedded-6
Please see our migration and compatibility guide: