Issue with the "Using Doppler Radar for Gesture Recognition with the Infineon Sense2GoL-Pulse & Edge Impulse"

Hello,
I’m currently working on the “Using Doppler Radar for Gesture Recognition with the Infineon Sense2GoL-Pulse & Edge Impulse” (https://www.edgeimpulse.com/blog/infineon-sense2gol-pulse?_ga=2.113397191.1301950860.1627904426-1752203311.1626256325). I encounter an issue when I launch the arduino code, Sense2GoL-Pulse-serial.ino. In a first step, I used the arduino-cli for compile the code but it doesn’t work. Then I check the arduino-ide and I have errors during the code verification. I’ve already check on the internet to fix the “variable or field … declared void” but I didn’t succeed to fix it. Notice that before that I download all the software needed.
I’m so sorry if my question seems stupid for somebody but I really didn’t find the answer.
Thanks for your help!

erreur1|690x228

Hi @Emmajcd,

First make sure you are compiling and flashing from the Windows Arduino CLI rather than the Windows Arduino IDE. Also, the Arduino board package that I am using requires a custom branch to be checked out from Infineon’s Github repo, please follow the steps below and then try recompiling:

install the Infineon XMC board package:

  1. Select ‘Preferences’ > ‘Additional Boards Manager URLs’, add the following URL https://github.com/Infineon/Assets/releases/download/current/package_infineon_index.json
  2. From the Boards manager: ‘Tools > Board > Boards Manager…’, search for and install ‘Infineon’s XMC Microcontroller’
  3. Update the Infineon Arduino hardware folder with the latest code from the 24Ghz-radar branch on GitHub:
    • Open a terminal application, and clone the Infineon XMC-for-Arduino repo to your computer: git clone https://github.com/Infineon/XMC-for-Arduino.git
    • Now checkout the 24Ghz-radar branch: cd XMC-for-Arduino && git checkout 24Ghz-radar
    • Now, copy and paste over the contents of this XMC-for-Arduino GitHub repository into the location where your Infineon board package is installed for your Arduino IDE, for example, on my Mac this directory is: ~/Users/jenny/Library/Arduino15/packages/Infineon/hardware/arm/1.4.0

Restart your Arduino IDE & now you should be able to compile/flash successfully from the Arduino CLI:

C:\Sense2GoL-Pulse-serial> arduino-cli compile --fqbn Infineon:arm:XMC4700_Radar_Baseboard Sense2GoL-Pulse-serial -e --output-dir . --verbose
[...]
Sketch uses 47280 bytes (2%) of program storage space. Maximum is 2048000 bytes.
Global variables use 26828 bytes of dynamic memory.

C:\Sense2GoL-Pulse-serial> arduino-cli upload --fqbn Infineon:arm:XMC4700_Radar_Baseboard --input-file .\Sense2GoL-Pulse-serial.ino.hex --verbose
Waiting for upload port...
java -jar "C:\Users\jenny\AppData\Local\Arduino15\packages\Infineon\tools\XMCFlasher\1.2.1/XMCFlasher.jar" -p "./Sense2GoL-Pulse-serial.ino.hex"  -device "XMC4700-2048"
--------------------------
Infineon XMC Flasher Lite
Copyright Infineon Technologies 2017
--------------------------
Windows 10
Operating System: Windows 10

Initialisation
--------------------------
Windows 10
Loading JLink Library...
JLink Library Version: V6.90a

Configuring Device
Device Name : XMC4700-2048
Interface   : SWD
Speed       : 4000
File Upload
--------------------------
Uploading ./Sense2GoL-Pulse-serial.ino.hex
... Done
--------------------------
... Finished Succesfully

Then finally the Edge Impulse data forwarder: edge-impulse-data-forwarder --baud-rate 500000 --frequency 75

Example output:

C:\Sense2GoL-Pulse-serial> edge-impulse-data-forwarder --baud-rate 500000 --frequency 75
Edge Impulse data forwarder v1.13.14
Endpoints:
    Websocket: wss://remote-mgmt.edgeimpulse.com
    API:       https://studio.edgeimpulse.com/v1
    Ingestion: https://ingestion.edgeimpulse.com

[SER] Connecting to COM9
[SER] Serial is connected (00:05:91:16:67:47)
[WS ] Connecting to wss://remote-mgmt.edgeimpulse.com
[WS ] Connected to wss://remote-mgmt.edgeimpulse.com

? To which project do you want to connect this device? Jenny Plunkett / Sense2GoL-Pulse Radar
[SER] Detecting data frequency...
[SER] Detected data frequency: 74Hz
? 2 sensor axes detected (example values: [13.16,13.33]). What do you want to call them? Separate the names with ',': I,
Q
[SER] Overriding frequency to 75Hz (via --frequency)
[WS ] Device "Sense2GoL Pulse" is now connected to project "Sense2GoL-Pulse Radar"
[WS ] Go to https://studio.edgeimpulse.com/studio/16659/acquisition/training to build your machine learning model!
2 Likes

Hello Jenny,

I don’t know how to thank you, now it works. I would never have found it without your help, thank you very much, you have been really helpful.

Hello @jenny
Thanks to your answer, I succeeded to create my impulse proprely. I am at the step of deployment but it doesn’t work. Indeed, my librairie is well added (see

).

But I have this message since this morning that I don’t succeed to solve :

C:\\Users\\emmaj\\AppData\\Local\\Arduino15\\packages\\Infineon\\tools\\arm-none-eabi-gcc\\5.4-2016q3/bin/arm-none-eabi-g++" -mcpu=cortex-m4 -mthumb -fpermissive -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DXMC4700_E196x2048 -DXMC4700_Radar_Baseboard -DF_CPU=144000000L -DARDUINO=4700 -DARDUINO_ARM_XMC -DARDUINO_ARCH_ARM -DARM_MATH_CM4 -DINTERRUPT_USE_ERU -DSERIAL_USE_U1C1 -DXMC4_SERIES -DARM_LIB_CMSIS_DSP -DARM_LIB_CMSIS_NN "-IC:\\Users\\emmaj\\AppData\\Local\\Arduino15\\packages\\Infineon\\hardware\\arm\\1.4.0/cores/xmc_lib/XMCLib/inc" "-IC:\\Users\\emmaj\\AppData\\Local\\Arduino15\\packages\\Infineon\\hardware\\arm\\1.4.0/cores/xmc_lib/CMSIS/DSP/Include" "-IC:\\Users\\emmaj\\AppData\\Local\\Arduino15\\packages\\Infineon\\hardware\\arm\\1.4.0/cores/xmc_lib/CMSIS/NN/Include" "-IC:\\Users\\emmaj\\AppData\\Local\\Arduino15\\packages\\Infineon\\hardware\\arm\\1.4.0/cores/xmc_lib/CMSIS/Include" "-IC:\\Users\\emmaj\\AppData\\Local\\Arduino15\\packages\\Infineon\\hardware\\arm\\1.4.0/cores/xmc_lib/LIBS" "-IC:\\Users\\emmaj\\AppData\\Local\\Arduino15\\packages\\Infineon\\hardware\\arm\\1.4.0\\variants\\XMC4700" "-IC:\\Users\\emmaj\\AppData\\Local\\Arduino15\\packages\\Infineon\\hardware\\arm\\1.4.0/variants/XMC4700/config/XMC4700_Radar_Baseboard" "-IC:\\Users\\emmaj\\AppData\\Local\\Arduino15\\packages\\Infineon\\hardware\\arm\\1.4.0\\cores/avr" "-IC:\\Users\\emmaj\\AppData\\Local\\Arduino15\\packages\\Infineon\\hardware\\arm\\1.4.0/cores/usblib" "-IC:\\Users\\emmaj\\AppData\\Local\\Arduino15\\packages\\Infineon\\hardware\\arm\\1.4.0/cores/usblib/Common" "-IC:\\Users\\emmaj\\AppData\\Local\\Arduino15\\packages\\Infineon\\hardware\\arm\\1.4.0/cores/usblib/Class" "-IC:\\Users\\emmaj\\AppData\\Local\\Arduino15\\packages\\Infineon\\hardware\\arm\\1.4.0/cores/usblib/Class/Common" "-IC:\\Users\\emmaj\\AppData\\Local\\Arduino15\\packages\\Infineon\\hardware\\arm\\1.4.0/cores/usblib/Class/Device" "-IC:\\Users\\emmaj\\AppData\\Local\\Arduino15\\packages\\Infineon\\hardware\\arm\\1.4.0/cores/usblib/Core" "-IC:\\Users\\emmaj\\AppData\\Local\\Arduino15\\packages\\Infineon\\hardware\\arm\\1.4.0/cores/usblib/Core/XMC4000" "-IC:\\Users\\emmaj\\AppData\\Local\\Arduino15\\packages\\Infineon\\hardware\\arm\\1.4.0\\cores" "-IC:\\Users\\emmaj\\AppData\\Local\\Arduino15\\packages\\Infineon\\hardware\\arm\\1.4.0\\variants\\XMC4700" "-IC:\\Users\\emmaj\\Documents\\Arduino\\libraries\\Sense2gol_Pulse_project_inferencing\\src" "-IC:\\Users\\emmaj\\AppData\\Local\\Arduino15\\packages\\Infineon\\hardware\\arm\\1.4.0\\libraries\\BGT24LTR11-Pulsed-Doppler-Radar\\src" "C:\\Users\\emmaj\\Documents\\Arduino\\libraries\\Sense2gol_Pulse_project_inferencing\\src\\edge-impulse-sdk\\CMSIS\\DSP\\Source\\TransformFunctions\\arm_dct4_init_f32.c" -o nul [...] C:\Users\emmaj\AppData\Local\Arduino15\packages\Infineon\hardware\arm\1.4.0/variants/XMC4700/config/XMC4700_Radar_Baseboard/pins_arduino.h:81:14: error: expected unqualified-id before numeric constant #define A0 0 ^ C:\Users\emmaj\Documents\Arduino\libraries\Sense2gol_Pulse_project_inferencing\src/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h:158:17: note: in expansion of macro 'A0' q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ ^ C:\Users\emmaj\AppData\Local\Arduino15\packages\Infineon\hardware\arm\1.4.0/variants/XMC4700/config/XMC4700_Radar_Baseboard/pins_arduino.h:82:14: error: expected unqualified-id before numeric constant #define A1 1 ^ C:\Users\emmaj\Documents\Arduino\libraries\Sense2gol_Pulse_project_inferencing\src/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h:163:17: note: in expansion of macro 'A1' q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/ ^ C:\Users\emmaj\AppData\Local\Arduino15\packages\Infineon\hardware\arm\1.4.0/variants/XMC4700/config/XMC4700_Radar_Baseboard/pins_arduino.h:81:14: error: expected unqualified-id before numeric constant #define A0 0 ^ C:\Users\emmaj\Documents\Arduino\libraries\Sense2gol_Pulse_project_inferencing\src/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h:176:17: note: in expansion of macro 'A0' q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ ^ C:\Users\emmaj\AppData\Local\Arduino15\packages\Infineon\hardware\arm\1.4.0/variants/XMC4700/config/XMC4700_Radar_Baseboard/pins_arduino.h:82:14: error: expected unqualified-id before numeric constant #define A1 1 ^ C:\Users\emmaj\Documents\Arduino\libraries\Sense2gol_Pulse_project_inferencing\src/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h:177:17: note: in expansion of macro 'A1' q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ ^ C:\Users\emmaj\AppData\Local\Arduino15\packages\Infineon\hardware\arm\1.4.0/variants/XMC4700/config/XMC4700_Radar_Baseboard/pins_arduino.h:83:14: error: expected unqualified-id before numeric constant #define A2 2 ^ C:\Users\emmaj\Documents\Arduino\libraries\Sense2gol_Pulse_project_inferencing\src/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h:178:17: note: in expansion of macro 'A2' q31_t A2; /**< The derived gain, A2 = Kd . */ ^ C:\Users\emmaj\AppData\Local\Arduino15\packages\Infineon\hardware\arm\1.4.0/variants/XMC4700/config/XMC4700_Radar_Baseboard/pins_arduino.h:81:14: error: expected unqualified-id before numeric constant #define A0 0 ^ C:\Users\emmaj\Documents\Arduino\libraries\Sense2gol_Pulse_project_inferencing\src/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h:190:21: note: in expansion of macro 'A0' float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ ^ C:\Users\emmaj\AppData\Local\Arduino15\packages\Infineon\hardware\arm\1.4.0/variants/XMC4700/config/XMC4700_Radar_Baseboard/pins_arduino.h:82:14: error: expected unqualified-id before numeric constant #define A1 1 ^ C:\Users\emmaj\Documents\Arduino\libraries\Sense2gol_Pulse_project_inferencing\src/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h:191:21: note: in expansion of macro 'A1' float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ ^ C:\Users\emmaj\AppData\Local\Arduino15\packages\Infineon\hardware\arm\1.4.0/variants/XMC4700/config/XMC4700_Radar_Baseboard/pins_arduino.h:83:14: error: expected unqualified-id before numeric constant #define A2 2 ^ C:\Users\emmaj\Documents\Arduino\libraries\Sense2gol_Pulse_project_inferencing\src/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h:192:21: note: in expansion of macro 'A2' float32_t A2; /**< The derived gain, A2 = Kd . */ ^ C:\Users\emmaj\Documents\Arduino\libraries\Sense2gol_Pulse_project_inferencing\src/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h: In function 'float32_t arm_pid_f32(arm_pid_instance_f32*, float32_t)': C:\Users\emmaj\AppData\Local\Arduino15\packages\Infineon\hardware\arm\1.4.0/variants/XMC4700/config/XMC4700_Radar_Baseboard/pins_arduino.h:81:14: error: expected unqualified-id before numeric constant #define A0 0 ^ C:\Users\emmaj\Documents\Arduino\libraries\Sense2gol_Pulse_project_inferencing\src/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h:275:15: note: in expansion of macro 'A0' out = (S->A0 * in) + ^ C:\Users\emmaj\AppData\Local\Arduino15\packages\Infineon\hardware\arm\1.4.0/variants/XMC4700/config/XMC4700_Radar_Baseboard/pins_arduino.h:81:14: error: expected ')' before numeric constant #define A0 0 ^ C:\Users\emmaj\Documents\Arduino\libraries\Sense2gol_Pulse_project_inferencing\src/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h:275:15: note: in expansion of macro 'A0' out = (S->A0 * in) + ^ C:\Users\emmaj\Documents\Arduino\libraries\Sense2gol_Pulse_project_inferencing\src/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h: In function 'q31_t arm_pid_q31(arm_pid_instance_q31*, q31_t)': C:\Users\emmaj\AppData\Local\Arduino15\packages\Infineon\hardware\arm\1.4.0/variants/XMC4700/config/XMC4700_Radar_Baseboard/pins_arduino.h:81:14: error: expected unqualified-id before numeric constant #define A0 0 ^ C:\Users\emmaj\Documents\Arduino\libraries\Sense2gol_Pulse_project_inferencing\src/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h:309:22: note: in expansion of macro 'A0' acc = (q63_t) S->A0 * in; ^ C:\Users\emmaj\AppData\Local\Arduino15\packages\Infineon\hardware\arm\1.4.0/variants/XMC4700/config/XMC4700_Radar_Baseboard/pins_arduino.h:82:14: error: expected unqualified-id before numeric constant #define A1 1 ^ C:\Users\emmaj\Documents\Arduino\libraries\Sense2gol_Pulse_project_inferencing\src/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h:312:23: note: in expansion of macro 'A1' acc += (q63_t) S->A1 * S->state[0]; ^ C:\Users\emmaj\AppData\Local\Arduino15\packages\Infineon\hardware\arm\1.4.0/variants/XMC4700/config/XMC4700_Radar_Baseboard/pins_arduino.h:83:14: error: expected unqualified-id before numeric constant #define A2 2 ^ C:\Users\emmaj\Documents\Arduino\libraries\Sense2gol_Pulse_project_inferencing\src/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h:315:23: note: in expansion of macro 'A2' acc += (q63_t) S->A2 * S->state[1]; ^ C:\Users\emmaj\Documents\Arduino\libraries\Sense2gol_Pulse_project_inferencing\src/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h: In function 'q15_t arm_pid_q15(arm_pid_instance_q15*, q15_t)': C:\Users\emmaj\AppData\Local\Arduino15\packages\Infineon\hardware\arm\1.4.0/variants/XMC4700/config/XMC4700_Radar_Baseboard/pins_arduino.h:81:14: error: expected unqualified-id before numeric constant #define A0 0 ^ C:\Users\emmaj\Documents\Arduino\libraries\Sense2gol_Pulse_project_inferencing\src/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h:358:40: note: in expansion of macro 'A0' acc = (q31_t) __SMUAD((uint32_t)S->A0, (uint32_t)in); ^ C:\Users\emmaj\AppData\Local\Arduino15\packages\Infineon\hardware\arm\1.4.0/variants/XMC4700/config/XMC4700_Radar_Baseboard/pins_arduino.h:82:14: error: expected unqualified-id before numeric constant #define A1 1 ^ C:\Users\emmaj\Documents\Arduino\libraries\Sense2gol_Pulse_project_inferencing\src/edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h:361:40: note: in expansion of macro 'A1' acc = (q63_t)__SMLALD((uint32_t)S->A1, (uint32_t)read_q15x2 (S->state), (uint64_t)acc); ^ Using library Sense2gol_Pulse_project_inferencing at version 1.0.2 in folder: C:\Users\emmaj\Documents\Arduino\libraries\Sense2gol_Pulse_project_inferencing Using library BGT24LTR11-Pulsed-Doppler-Radar at version 1.0.1 in folder: C:\Users\emmaj\AppData\Local\Arduino15\packages\Infineon\hardware\arm\1.4.0\libraries\BGT24LTR11-Pulsed-Doppler-Radar Error during build: exit status 1

I don’t understand where the problem comes from.
Thanks for your help !

Hi @yodaimpulse, I saw your message in the other conversation :slight_smile:

1 Like

@Emmajcd Looking into these errors as I also experience them on my Windows machine. Will update

Thanks!

1 Like

Hi @jenny, thank you very much ! :slight_smile:

Hi @jenny, do you have any update on my issue ? :slight_smile:
Thanks !

Hi @Emmajcd apologies not yet, working on it!

1 Like

Hi @Emmajcd, it seems the Edge Impulse SDK has changed since I wrote this blog post. My team and I are still looking into resolving the definition errors between the CMSIS DSP and the Arduino pin names.

Thanks!

1 Like

Hi @jenny, thank you very much for looking at it !

Hi @Emmajcd,

Haven’t forgotten about this thread! I am working with our embedded engineers to resolve the header definition conflicts. Will update ASAP with the resolution!

Thank you!
Jenny

We have a fix, will be rolled out in the next patch release (tomorrow or Monday).

The issue here is the random macros that Arduino cores define. Here (not sure if it’s in the updated core or not) A0, A1 and A2 are now defined in the Infineon core, and thus any code that uses these as variables will have them replaced by the macro value (edge-impulse-sdk/CMSIS/DSP/Include/dsp/controller_functions.h in this case). This seems to be a common issue with Arduino cores, we also had this with f.e. max and min on some targets, which have different signatures than the C++ stdlib min/max functions - very annoying.

1 Like

Hi @jenny

I encountered another issue after fixing the above problem. I pass the compile but can’t flash the program to the board. It also shows a different error message in different terminals:

I have tried it on different Windows PCs and double check all the steps, but it still doesn’t work.

Thanks for your help!

Hi @davyyoda,

In your first screenshot (MINGW64), make sure that you run the compile step first:

arduino-cli compile --fqbn Infineon:arm:XMC4700_Radar_Baseboard Sense2GoL-Pulse-serial -e --output-dir .

and that you have a .ino.hex file in your Sense2GoL-Pulse-serial directory before running the uploader.

It looks like Java may not be on your system PATH, which is why PowerShell cannot find it in the second screenshot. I recommend trying some of the fixes here to see if that helps: https://stackoverflow.com/questions/16811332/cannot-run-java-from-the-windows-powershell-command-prompt.

1 Like

Hi @shawn_edgeimpulse,

It works after a Java update, appreciate your help! :smile:

2 Likes

Glad to hear it’s working!

I have Demo Distance2goL XENSIV™ 24 GHz radar BGT24LTR11, Can I use this in Arduino Ide