ESP32 and LSM9DS1 not compiling

For general Flowcode discussion that does not belong in the other sections.
stefan.erni
Valued Contributor
Posts: 893
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 175 times
Been thanked: 206 times

ESP32 and LSM9DS1 not compiling

Post by stefan.erni »

Hi Ben

If I add LSM9DS1 component i get an error and I can not compile anymore.

regards

Stefan

Program:
Test_LSM9DS1.fcfx
(40.66 KiB) Downloaded 340 times

stefan.erni
Valued Contributor
Posts: 893
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 175 times
Been thanked: 206 times

Re: ESP32 and LSM9DS1 not compiling

Post by stefan.erni »

Hi Ben

With the LSM9DS1 component i can not compile,
and there is a problem if i load the program again, the I2C channel is not longer select

regards

Stefan

Maybe some problem with the channel?
Snag_b8f250.png
Snag_b8f250.png (38.78 KiB) Viewed 7286 times

stefan.erni
Valued Contributor
Posts: 893
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 175 times
Been thanked: 206 times

Re: ESP32 and LSM9DS1 not compiling

Post by stefan.erni »

Hi Ben

I removed some unused code in the programm and still i can not compile if the LSM9DS1 is includet.

I suspect something is wrong in the component.

regards

Stefan



Here is the error message

../main/esp-project.c: In function 'FCD_0ea61_LSM9DS1_AccelGyroMagnet1__Write_Register':
../main/esp-project.c:192:10: error: 'FCR_RETVAL' is used uninitialized in this function [-Werror=uninitialized]

../main/esp-project.c: In function 'FCD_0ea61_LSM9DS1_AccelGyroMagnet1__Read_Bearing':
../main/esp-project.c:487:10: error: 'FCR_RETVAL' may be used uninitialized in this function [-Werror=maybe-uninitialized]
MX_UINT8 FCD_0ea61_LSM9DS1_AccelGyroMagnet1__Initialise()
Attachments
Test_2.fcfx
(25.79 KiB) Downloaded 172 times

medelec35
Matrix Staff
Posts: 1624
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 576 times
Been thanked: 543 times

Re: ESP32 and LSM9DS1 not compiling

Post by medelec35 »

Hi Stefan.
Sorry for the delay.
Thank you for the bug report.

I'm looking into this now.
Martin

medelec35
Matrix Staff
Posts: 1624
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 576 times
Been thanked: 543 times

Re: ESP32 and LSM9DS1 not compiling

Post by medelec35 »

Hi Stefan
All the compiler errors have been fixed.
The channel issue requires more looking into, but I have attached the updated component, so you can carry on with your project.
Browse to this location using File Explorer, it's hidden by default so just paste the link into your address bar.

Code: Select all

C:\ProgramData\MatrixTSL\FlowcodeV10\Components
Replace the existing file with the attached file.
If Flowcode is already open, then you will need to reload your project for the new components to work
If you run any component updates, then the components you added will be overwritten.
Can you let me know if it works for you, please?
Attachments
LSM9DS1_AccelGyroMagnet.fcpx
(8.38 KiB) Downloaded 182 times
Martin

medelec35
Matrix Staff
Posts: 1624
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 576 times
Been thanked: 543 times

Re: ESP32 and LSM9DS1 not compiling

Post by medelec35 »

Hi Stefan.
For the channel issue can you try the attached, please.
Attachments
LSM9DS1_AccelGyroMagnet.fcpx
(8.4 KiB) Downloaded 187 times
Martin

medelec35
Matrix Staff
Posts: 1624
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 576 times
Been thanked: 543 times

Re: ESP32 and LSM9DS1 not compiling

Post by medelec35 »

Does not look like the channel issue has worked, so back to the original statement
The channel issue requires more looking into
It was worth a try.
Martin

stefan.erni
Valued Contributor
Posts: 893
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 175 times
Been thanked: 206 times

Re: ESP32 and LSM9DS1 not compiling

Post by stefan.erni »

Hi Martin

Thanks Martin. I can compile now.
The channel select is simply for me to work with it for a while.
Just select channel1 when loading the program.

I will test the component to see if the measured values are correct and let you know how it goes.

regards
Stefan

stefan.erni
Valued Contributor
Posts: 893
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 175 times
Been thanked: 206 times

Re: ESP32 and LSM9DS1 not compiling

Post by stefan.erni »

Hi Martin

The LSM9DS1 is working.
From the magnetometer the data looks good.
But the data from Acceloro and Gyro dont look correct.
as if the result is not on the correct place in the 16Bit signet integer and then the +- bit is wrong....
I have also noticed this with the component BMM150. There I read the register and set the two 8bit together to a 16 bit signet integer, then the data was correct.
Snag_7803d0.png
Snag_7803d0.png (325.37 KiB) Viewed 4668 times
only a small hint...you have to pay attention to ... to change (swap) the IF for using it instead of MPU6886
Snag_77bee8.png
Snag_77bee8.png (37 KiB) Viewed 4668 times
Attachments
Snag_7a2a5a.png
Snag_7a2a5a.png (61.86 KiB) Viewed 4668 times

stefan.erni
Valued Contributor
Posts: 893
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 175 times
Been thanked: 206 times

Re: ESP32 and LSM9DS1 not compiling

Post by stefan.erni »

Hi Martin

The channel issue requires more looking into
Do you already have an idea for a solution for setting the channel every time?

regards

Stefan

Post Reply