The basic arduino code of Sense2GoL pulse always goes to the error callback.

Announcements

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
checkmateeerree
Level 1
Level 1
10 sign-ins 5 replies posted 5 sign-ins

I'm a beginner, trying to code the Sense2GoL pulse radar kit, and I'm trying to detect speed. However, everytime I run it, I always go to the error callback. Here is the code (it's based off the default arduino tutorial) Also, I am using release 1.4.0 from Infineon releases (https://github.com/Infineon/XMC-for-Arduino/releases/download/V1.4.0/package_infineon_index.json)

#include <IFXRadarPulsedDoppler.h>
#include <LED.h>

// IFX Radar Pulsed Doppler Object
IFXRadarPulsedDoppler radarDev;
LED Led;

void myErrorCallback( uint32_t error )
{
Serial.print("--- ERROR: 0x");
Serial.println( error, HEX);

Led.On( LED_GREEN );
Led.On( LED_RED );
Led.On( LED_BLUE );

while( 1 )
;
}


void myResultCallback(void)
{
uint8_t targetDirection = radarDev.getDirection();
if(targetDirection == 1)
{
// turn on Red LED for departing target
Led.Off( LED_GREEN );
Led.On( LED_RED );
Led.Off( LED_BLUE );
Serial.println("departing");
}
else if(targetDirection == 2)
{
// turn on Green LED for approaching target
Led.On( LED_GREEN );
Led.Off( LED_RED );
Led.Off( LED_BLUE );
Serial.println("approaching");
}
else if(radarDev.targetAvailable() == true)
{
// turn on Blue LED for just normal motion with no meaningful direction
Led.Off( LED_GREEN );
Led.Off( LED_RED );
Led.On( LED_BLUE );
Serial.println("motion");
}
else
{
// turn off LEDs for no motion
Led.Off( LED_GREEN );
Led.Off( LED_RED );
Led.Off( LED_BLUE );
}
}

 

float raw_i[256];
float raw_q[256];


void setup() {

Led.Add( LED_RED );
Led.Add( LED_GREEN );
Led.Add( LED_BLUE );

Led.Off( LED_RED );
Led.Off( LED_GREEN );
Led.Off( LED_BLUE );

Serial.begin(115200);

radarDev.registerResultCallback(myResultCallback);
radarDev.registerErrorCallback(myErrorCallback);

radarDev.initHW();
radarDev.begin();

}

void loop() {
// put your main code here, to run repeatedly:
radarDev.run();
}

 

Please help, this is urgent. It always goes to the myerrorcallback.

 

Thanks in advance

0 Likes
1 Solution
Michael_Kiessli
Employee
Employee
First like given 5 replies posted 5 sign-ins

Hi checkmateerree, 

Unfortunately I was not subscribed to this topic, so I did not notice your replay. 

please unzip the attachment, and please replace the S2GL-Pulsed-Doppler library. 

For me it it is located at C:\Users\xxx\AppData\Local\Arduino15\packages\Infineon\hardware\arm\1.5.0\libraries\BGT24LTR11-Pulsed-Doppler-Radar\src\cortex-m4\libRadar_S2GL_Pulsed_Doppler_lib.a

and give it a try. The plotter example shows some strange peak, that I need to investigate, but the example for the LED and the serial port are working fine. 

Once you can confirm that this works on your side also, I will trigger the update on Github. 

Thank you! 

Best Regards
Michael

View solution in original post

0 Likes
5 Replies
Michael_Kiessli
Employee
Employee
First like given 5 replies posted 5 sign-ins

Hi 

Can you please provide the error code that is raised, when the error callback is called? 

Thank you!

Michael

Hi Michael, 

Thanks for responding!

The error callback I get printed out to the serial monitor is 0xFE03, I haven't been able to find what that means online, so I'm pretty clueless about it. 

0 Likes

Hi Michael,

I just wanted to follow up on my previous reply. Is there anything I can do to find out more about or fix this error that I'm facing?

Thanks!

0 Likes
Michael_Kiessli
Employee
Employee
First like given 5 replies posted 5 sign-ins

Hi checkmateerree, 

Unfortunately I was not subscribed to this topic, so I did not notice your replay. 

please unzip the attachment, and please replace the S2GL-Pulsed-Doppler library. 

For me it it is located at C:\Users\xxx\AppData\Local\Arduino15\packages\Infineon\hardware\arm\1.5.0\libraries\BGT24LTR11-Pulsed-Doppler-Radar\src\cortex-m4\libRadar_S2GL_Pulsed_Doppler_lib.a

and give it a try. The plotter example shows some strange peak, that I need to investigate, but the example for the LED and the serial port are working fine. 

Once you can confirm that this works on your side also, I will trigger the update on Github. 

Thank you! 

Best Regards
Michael

0 Likes

Hi Michael,

Replacing the library with your file worked, and removed all the errors we were facing.

Thanks a lot!

- checkmateeerree

 

 

0 Likes