cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Custom firmware and displaying different sensors on Unicleo-GUI

aesteban
Associate III

Hi everyone.

I'm trying to use a NUCLEO-F401RE, a X-NUCLEO-IKS02A1, and a STEVAL-MKI197v1 and the following software: v3.2.0.4544 AlgoBuilder, v1.25.1.11665 Unicleo-GUI, v1.15.0 STM32CubeIDE, v6.11.0 STM32CubeMX and the X-CUBE-ALGOBUILD and x-CUBE-MEMS1 software packages (everything running on windows 11).

 

First I didnt use AlgoBuider

I selected every sensor each board has on the x-cube-mems1 (package) and build it using CubeIDE (no error or warnings), but the Unicleo-GUI shows only the X-NUCLEO sensors, being unable to switch between (for example) the different Gyr/Acc sensors.

aesteban_0-1714118947233.png

If i dont select the board extension IKS02A1 CubeIDE gives no trouble (0 error and warnings) but the Unicleo-GUI doesnt recognice my board and i get stuck here:

aesteban_1-1714119311042.png

(note: If i select to list all coms it appears, but shows nothing and cannot start)

 

When I try to create a custom firmware for AlgoBuilder, if I select the Algo custom aplication option without the MEMS IKS board extension. I copy the project into the path /STMicroelectronics/AlgoBuilder/FirmwareTemplate but it doesnt show up on the AlgoBuilders Target display. and I cannot even choose the option of just the IKS02A1 alone as a template.

(Note: I downloaded an already made custom firmware for a different board as a test and it appears, so its the correct path)

 

Any help on both this problems would be so greatly appreciated,

thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Petr S
ST Employee

First problem was that your timers should be switched, TIMER2 have to support Capture Compare functionality and you have the timer with this functionality (TIM1) in TIMER1 (I understand that it was logical choice to use TIM1 as TIMER1 but...).

Second problem was that you need to implement the BSP_SENSOR_XXX_GetOrientation functions in custom_mems_control_ex.c file. Here is the example of implementation for LSM6DSO which is onboard on IKS01A3:


#if ((defined CUSTOM_ALGOBUILDER_FW_TEMPLATE) || (defined CUSTOM_DATALOGFUSION_DEMO) || (defined CUSTOM_TILTSENSING_DEMO) || (defined CUSTOM_GESTURERECOGNITION_DEMO) || (defined CUSTOM_CARRYPOSITION_DEMO) || (defined CUSTOM_ECOMPASS_DEMO) || (defined CUSTOM_DYNAMICINCLINOMETER_DEMO) || (defined CUSTOM_ACTIVITYRECOGNITION_DEMO) || (defined CUSTOM_ACTIVITYRECOGNITIONWRIST_DEMO) || (defined CUSTOM_FITNESSACTIVITIES_DEMO) || (defined CUSTOM_PEDOMETERWRIST_DEMO) || (defined CUSTOM_POSEESTIMATION_DEMO) || (defined CUSTOM_STANDINGSITTINGDESK_DEMO))
/**
  * @brief  Get accelerometer sensor orientation
  * @PAram  Orientation Pointer to sensor orientation
  * @retval None
  */
void BSP_SENSOR_ACC_GetOrientation(char *Orientation)
{
#if (defined BSP_MOTION_SENSORS || defined BSP_HYBRID_SENSORS)
#ifdef CUSTOM_ACC_INSTANCE_0
  Orientation[0] = 's';
  Orientation[1] = 'e';
  Orientation[2] = 'u';
#endif
#endif
}
#endif

#if ((defined CUSTOM_ALGOBUILDER_FW_TEMPLATE) || (defined CUSTOM_DATALOGFUSION_DEMO) || (defined CUSTOM_DYNAMICINCLINOMETER_DEMO) || (defined CUSTOM_FITNESSACTIVITIES_DEMO))
/**
  * @brief  Get gyroscope sensor orientation
  * @PAram  Orientation Pointer to sensor orientation
  * @retval None
  */
void BSP_SENSOR_GYR_GetOrientation(char *Orientation)
{
#if (defined BSP_MOTION_SENSORS)
#ifdef CUSTOM_GYR_INSTANCE_0
  Orientation[0] = 's';
  Orientation[1] = 'e';
  Orientation[2] = 'u';
#endif
#endif
}
#endif

#if ((defined CUSTOM_ALGOBUILDER_FW_TEMPLATE) || (defined CUSTOM_DATALOGFUSION_DEMO) || (defined CUSTOM_ECOMPASS_DEMO))
/**
  * @brief  Get magnetometer sensor orientation
  * @PAram  Orientation Pointer to sensor orientation
  * @retval None
  */
void BSP_SENSOR_MAG_GetOrientation(char *Orientation)
{
#if (defined BSP_MOTION_SENSORS)
#ifdef CUSTOM_MAG_INSTANCE_0
  Orientation[0] = 'n';
  Orientation[1] = 'e';
  Orientation[2] = 'u';
#endif
#endif
}
#endif

Attached is the functional ioc for CubeMX v6.11.0 and json for MEMS Studio v1.2.0

View solution in original post

21 REPLIES 21
Miroslav BATEK
ST Employee

Hello @aesteban,

would you please describe what you would like to achieve in more details?

Concerning the first issue I don't know what application did you generate and if you even select any applications in CubeMX.

Concerning the second issue there might be issue with generated AlgoBuilder firmware template, if you can share it we can check it.

We have recently release our new application called MEMS Studio which replaces Unicleo-GUI and AlgoBuilder, you can try it if you want.

aesteban
Associate III

Hello,

What i'm trying to make is a custom board consisting on a nucleo board (dont mind if its L401RE or R476RG), a X-NUCLEO-IKS (dont mind if its 02A1 or 01A3) and a STEVAL-MKI197V1.

 

I'm trying to work with AlgoBuilder and get the data mostly from the STEVAL sensors. The example workflow below will be using nucleo L476RG, x-nucleo-iks01A3 and the steval:

- I enabled the defaults for this board and activate the PB8 and PB9 for I2C1

- I set Tim1 and Tim 2 with internal clock and default parameters and PB7 as an EXTI

- I activate clock source and calendar from the RTC

- For the algobuilder Software pack i selected this (the warning goes off later on when i select the MEMS custom motion sensor):

aesteban_0-1714988943020.png

- For the MEMS Software pack i selected this (to make everything easier for starters i selected only the Steval sensor):

aesteban_1-1714989337133.png

The algobuilder pack configuration is as shown below:

aesteban_2-1714989583185.png

and the MEMS is this one (everything on I2C1):

aesteban_3-1714989624997.png

The project settings are like this (IKS board is 01A3, ignore the wrong project name):

aesteban_4-1714989717550.png

On code generator i checked the "Generate peripheral inicialization as a pair .c.h" and everything else is default.

The code generated succesfully with no errors or warnings.

 

Building it on STM32CubeIDE gives two warning:

../ALGOBUILD/Target/bsp_ip_conf.h:32:31: warning: implicit declaration of function 'MX_TIM1_Init'; did you mean 'MX_I2C1_Init'? [-Wimplicit-function-declaration]

../ALGOBUILD/Target/bsp_ip_conf.h:36:31: warning: implicit declaration of function 'MX_TIM2_Init'; did you mean 'MX_I2C1_Init'? [-Wimplicit-function-declaration]

 

If i run the code using the CubeIDE and try to connect the board i get this error (im tying now with MEMS Studio too):

aesteban_5-1714990501798.png

(I know there are no sensor data, but it should at least display the sensor available, am i wrong?)

 

if i copy the project folder and get it into "C:\Users\user\STMicroelectronics\MEMS Studio\algobuilder\FirmwareTemplate" it does not show up in the firmware target

Copying the project into "C:\Users\user\STMicroelectronics\AlgoBuilder\FirmwareTemplate" gives the same outcome on algobuilder

 

Thanks in advance for the help

Petr S
ST Employee

Hello @aesteban,

For the quick look I would mention these points:

  • In your third picture you've switched PB7 and PB13 - PB7 should be MEMS_INT_PIN_A and PB13 should be BSP BUTTON
  • In your fifth picture you selected Advanced Application Structure but it has to be Basic as stated in Known Limitations in Release Notes
  • I don't see your other settings like DMA, NVIC, CRC so unless you share your .ioc file I won't be able to investigate more
  • I also suggest to increase stack size to 4000
  • I'd like to mention that we've released X-CUBE-ALGOBUILD v1.4.0 couple of days ago and we now support MEMS Studio only, it's worth to try it, use your HW but apply the same settings in your CubeMX project as we do in our examples and then it should work on your side too
Petr S
ST Employee

The path to copy your project to should be:

c:\Users\<user>\STMicroelectronics\MEMS Studio\algobuilder\firmware_template\

aesteban
Associate III

Hi, thanks for your advice, unfortunately it still doesn't work. I attach to this reply a .ioc updated with your advice to make help easier.

A question i'm having is, where are those example settings documentation you mentioned?

As for MEMS Studio, my program gives so many errors with the same block and subdesigns configuration of algobuilder (which works fine on my tests), so im using X-CUBE-ALGOBUILD v1.3.0 to ensure algobuilder support. (It gives code errors, not block configuration errors).

 

Thank you so much.

Petr S
ST Employee

I didn't test it but what I see for the first look is that:

  • You use the same I2C address for LSM6DSOX (DIL24) and LSM6DSO (on IKS01A3 board) which leads to conflict so you should switch it to GND

PetrS_2-1715594064843.png 

 

  • You didn't activate CRC which is needed in case you use Motion libraries

PetrS_1-1715593943695.png

  • You also didn't set DMA which is needed for receiving messages from MEMS Studio, should be like this

PetrS_3-1715594311252.png

  • The USART2 Baud Rate should be 921600 bits/s like this

PetrS_4-1715594462300.png

  • And finally you didn't enable interrupt for both timers

PetrS_5-1715594693996.png

Please try it and let me know.

aesteban
Associate III

Hi, thanks for pointing out those mistakes, unfortunately it still doesn't work

I still get the TIM warnings of my first message.

Also, and i dont get the warning:

"Error:C:/ST/STM32CubeIDE_1.15.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.100.202403111256/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld.exe: warning: STM32L4xx-Nucleo-Project.elf has a LOAD segment with RWX permissions"

(the default firmwares work with it).

I also enabled usart nvic

By the way, i want to use the LSM6DSOX sensor instead of the  LSM6DSO so, is it an option to add that sensor and set it to GND instead of the DIL24?

 

Anything else that i could do?

I upload the updated .ioc

Petr S
ST Employee

What versions of STM32CubeMX and STM32CubeIDE do you use? Please try latest CubeMX v6.11.1 and CubeIDE v1.15.1. I have slightly modified the ioc file in terms of GPIO pullups, project and code generator settings. It compiles well on my side, I just didn't test it in MEMS Studio on HW.

aesteban
Associate III

Im using the latest  versions released, but the .ioc you provided me doesn't open, it gives an error about being made on CubeMX version 6.12.0

aesteban_0-1715852366231.png