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

21 REPLIES 21
Petr S
ST Employee

Sorry, I was testing some new unofficial CubeMX version and it modified the ioc. Unfortunately I have to say there is most likely some regression in CubeMX v6.11.1. After some modifications the project works but only in v6.11.0 and in unofficial v6.12.x.

Please completely uninstall v6.11.1 and then install v6.11.0 from st.com. Attached is the suitable ioc. Here is what I've changed to compile with 0 errors 0 warnings but maybe in 6.11.0 it could work without the changes, I didn't try.

 

PetrS_1-1715853570531.pngPetrS_2-1715853622462.png

There is also warning (in X-CUBE-ALGOBUILD v1.3.0) which points out that in demo_serial.c file in void Report_Error(uint32_t err) function the uint8_t buffer[24]; array has to be actually uint8_t buffer[260];. After fixing that you should generate correct FW. This has been fixed in v1.4.0 already.

Please let me know...

aesteban
Associate III

Sorry for the late reply, the code compile and the custom firmware now shows up on the algobuilder, mems studio and unicleo (if uploaded to the board from STM32IDE), but there is a new issue.

 

I added the LSM6DSO sensor to the project to get the data from it, setting it to VDD and the LSM6DSOX to GND.

When I try to compile an AlgoBuilder project with the following configuration:

aesteban_0-1715944330583.png

it gives me this errors: 

aesteban_1-1715944365232.png

aesteban_2-1715944436401.png

I tried to use MEMS Studio and with the same input gives the error:

aesteban_3-1715944529946.png

 

I also tried switching the sensors (setting the ISK gyr to GND and de DIL to VDD) but keeps with the same issue.

Petr S
ST Employee

Have you updated capabilities.json/xml files to reflect your HW? Get the inspiration in example Projects in X-CUBE-ALGOBUILD package. Then you could try to migrate X-CUBE-ALGOBUILD to v1.4.0 in CubeMX before project generation (if not done already).

Petr S
ST Employee

 

PetrS_1-1715947821886.png

 

On Algobuilder if I use the "firmware_template" path the target does not appear, using "FirmwareTemplate" appears giving the previous error, if i add wrongly on purpose the capabilities it gives me the MEMS Studio error of not supported, and if i add it right gives the same error than before, so the capabilities on algobuilder are correct.

On the other side, using MEMS Studio with the custom firmware on the "firmware_template" path, if I manually add the custom capabilities, I can generate the C code but when building gives the same error shown on the last post.

aesteban
Associate III

I'm also trying an easier code, instead of "Sensor hub / Rotation Vector 6x / Graph" I tried "Sensor hub / Acceleration / Graph" and the code compiles, but when i execute it, it just takes one measurement equal to zero and nothing else.

Petr S
ST Employee

@aesteban it's hard to say without having it. Please share both your generated firmware template which you copied into the firmware_template MEMS Studio directory (including ioc) and also your complete AlgoBuilder project. 

Okay, I send you the debug project I used to isolate the issue and a .7z with the generated template.

I'm finally using Algobuilder instead of MEMS Studio due to the extra troubles MEMS Studio its giving me on things that AlgoBuilder has no issue.

Thanks

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
aesteban
Associate III

Switching the TIMs was the keypoint, the accelerometer, gyro and magnetometer give now the RAW data correctly, but the rotation block in MEMS Studio gives NaN measurements, what may be happening?