cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the LSM6DSOX from SensorTile.box?

NB.1990
Associate II

Hi, I'm relatively new to microprocessors and everything ST. I've recently been assigned to a project that is supposed to use the LSM6DSOX to track movement within a 3D space. I have the SensorTile.box and a STM32Nucleo-L476RG board. I've been having a lot of trouble trying to use the sensor within the SensorTile.box. I tried using Unico GUI, but it won't detect my sensor when I connect it to my computer. I confirmed the SensorTile.box is on, and my computer detects its presence (I'm able to see it in the File Explorer and access the contents of the board). I have STM32CUBEIDE installed, I installed the X-CUBE-MEMS1 Additional Software Pack, I tried downloading the STM Virtual COM Port drivers, but I still can't seem to get this to work. I am running Windows 10, and have tried the most recent versions of all the above mentioned software. Can anybody help me get started, or at least steer me in the right direction? The online videos I've found have people seamlessly using Unico GUI, which I just can't seem to get working with the SensorTile.box. The Virtual COM port detects my Nucleo Board just fine, though. I feel very overwhelmed by all the different aspects of the IDE and microprocessors and all of this, and am quite lost in this situation. Simply put (I think), how do I get the data generated from the LSM6DSOX sensor, and use that data on another board or device (the Nucleo board). Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Community member​ , don't worry �� Windows is doing well detecting your ST.box as a mass storage device.

The fact is that ST.box can work in different modes: Mode 1, Mode 2 and Mode 3, increasing the "complexity" of the approach. Your sentence here below refers to Mode 1 and Mode 2 --> see here for a detailed description.

>> I have uploaded different firmware to my ST.box through the ST BLE Sensor app. I haven't had any issues between connections between the ST.box and my Smartphone.

So you can upload an app on the ST.box directly from the STBLE Sensor on your smartphone (via Bluetooth). In this way, your PC (and Unicleo-GUI too) will detect the ST.box as an external mass storage device, and not as a VCOM.

>> Windows is detecting the ST.box only as a storage device (SD card) and not as a microcontroller board or a device connected through the VCOM port.

However, to establish the communication between PC and ST.box on Unicleo you have to upload the DataLogExtended.bin project in function pack FP-SNS-STBOX1 in Mode 3, i.e. not from smartphone, but from PC. The easiest way to do it is use the STLINK V2 utility on, and flashing that firmware via JTAG connection (not USB/VCOM), but if creating the ad-hoc cable is time consuming, you can use the USB and the DFU method described here (https://community.st.com/s/question/0D50X0000BYnQt6SQF/sensortilebox-not-connecting). Use the attached file, already in .dfu extension.

>> My desire is to be able to create my own code on an IDE and upload it to the board as firmware, accessing the LSM6DSOX sensor.

If you want to go deeper, I suggest you to start from FP-SNS-STBOX1 examples that contains the drivers for the LSM6DSOX, opening it with an IDE (e.g. STM32CubeIDE, which is open and dedicated precisely to STM32, or Atollic TrueSTUDIO which is free) and using the ST Link V2 for debugging.

Regards

View solution in original post

13 REPLIES 13
Eleon BORLINI
ST Employee

Hi @Community member​ , let's see how can I help you. Consider first of all that Unico-GUI doesn't interface with the SensorTile.box tool. Unico-GUi interfaces properly with STEVAL-MKI109V3 tool. But don't worry, it depends on what you intend to do with the LSM6DSOX.

Application example 1: assume you want to use the basic digital feature of the LSM6DSOX for your movement recognition (e.g. it is a gesture such as wrist tilt, simple vibration, wake up, pedometer, etc...). You can interface the ST.box with Unicleo-GUI (which is different from Unico-GUI), flashing on the ST.box microcontroller the DataLogExtended.bin that you can find in the firmware function pack FP-SNS-STBOX1 of ST.box, as explained in the UM2626, p.10ss (en.FP-SNS-STBOX1_firmware\STM32CubeFunctionPack_STBOX1_V1.0.0\Projects\STM32L4R9ZI-SensorTile.box\Examples\DataLogExtended\Binary). For a deeper evaluation, you have to program the ST.box and to do this you can use the STLINK utility of your STM32Nucleo-L476RG board (via JTAG). You have by now to build a cable to interface the CN6 Nucleo connector with the JTAG connector on the ST.box using their schematics. You can find examples of the use of these digital feature in the X-CUBE-MEMS1 package.

Application example 2: assume you want to use the advanced digital feature of the LSM6DSOX, such as the Machine Learning Core or the Finite State Machine, and you want to create your own application. There are 2 ways:

  • Easy way: use the STBLE Sensor app, but you have to wait a few days, mid December, with which you will be able to configure the DSOX in MCL and FSM mode;
  • Pro-mode way (interface with the STM32Nucleo-L476RG board as described above)
    • use the DSOX on SensorTile.box to acquire the data of the specific context you want to characterize (a particular movement in 3D space, in your case),
    • save the acquired data on the onboard SD card (you can create a dedicated app similar to the Data recorder in Expert mode, selecting as Input Acceleration sensor and Gyroscope sensor, and save to SD card in output. You can see in this how to do it).
    • after you have created a proper dataset on the ST.box SD card, you can use Unico-GUI in offline mode (de-select the "Communication with the motherboard" flag on the initial Unico screen), follow the indication and the flow described in the MLC app note for the DSOX register configuration (upload of the dataset, selection of the filter and features, labels, Weka decision tree generation and C-code generation)
    • you can then copy the C-code that describes the configuration of the DSOX registers for your 3D movement recognition obtained with Unico in the firmware function pack FP-AI-SENSING1, which is supported by the ST.box.

I know it is not the simplest topic ever, but it's quite a powerful tool. Let me know how things are going

Regards

Thanks @Eleon BORLINI​  for the detailed response. However, unfortunately, the Unicleo-GUI is also not detecting my SensorTile.box, or even my Nucleo board. Upon launching the application, it gives an error message stating "Not detected any suitable port. Please, check if the board is connected." I've double-checked, and my Windows Device manager shows that my Nucleo board is detected on the STMicroelectronics STLink Virtual COM port (COM8), but my SensorTile.box is not being detected on a COM port, despite my computer recognizing it as a connected device. If I enable the setting in Unicleo-GUI to list all available COM ports (not just Nucleo Boards), it allows me to connect to COM8, however, it lists every attribute as "Unknown", and does not let me interact with the board. I've double checked and made sure my Virtual COM port driver software is up-to-date, and everything is powered and connected as it should be. So now my question is, why is my hardware not being detected correctly? Both pieces of Hardware have hardly been used, as the Nucleo board has simple LED test code on it, and the last thing I uploaded to the SensorTile.box was the motion tracking sample application on the ST BLE Sensor smartphone app. I'm sure this is an error on my end, but I do know what step I could have skipped or performed incorrectly. Is there any advice or insight you could give on this issue? Thank you!

Hi @Community member​ , Unicleo-GUI interfaces in a native way with STM32Nucleo-L476RG plus X-NUCLEO-IKS01A2 and A3. What I can infer, and this is the issue, is that your SensorTile.box VCOM is not detected by your PC. The fact that the Nucleo board is detected is an evidence that STM32 drivers are well installed. So I have a couple of questions:

  • Is your SensorTile.box detected by your smartphone bluetooth? (It seems the case but pls confirm this point)
  • When you plug the ST.box into the PC USB, does the PC gives error messages?
    • If so, can you upload on your ST.box the Data recorder on SD card app via STBLE Sensor?
  • Did you ever uploaded a particular FW on your ST.box?
    • You can in this case restore the default firmware
    • Check this topic to understand if your issue is similar

Regards

@Eleon BORLINI​ , thanks again for the response.

Yes, the SensorTile.box is detected by my smartphone (Android) via Bluetooth.

When I plug the ST.box into my computer, no error message occurs. Windows automatically opens its directory, which in this case is USB Drive (F:). Using the ST BLE Sensor app on my smartphone, I am able to record data from the ST.box and write it to the SD card, and I can access the generated .csv file on my computer with no problems.

I have uploaded different firmware to my ST.box through the ST BLE Sensor app. I haven't had any issues between connections between the ST.box and my Smartphone.

I know I don't have a lot of knowledge in this area, but from my perspective it seems like Windows is detecting the ST.box only as a storage device (SD card) and not as a microcontroller board or a device connected through the VCOM port. My desire is to be able to create my own code on an IDE and upload it to the board as firmware, accessing the LSM6DSOX sensor.

Hopefully this information is helpful.

Thanks!

Hi @Community member​ , don't worry �� Windows is doing well detecting your ST.box as a mass storage device.

The fact is that ST.box can work in different modes: Mode 1, Mode 2 and Mode 3, increasing the "complexity" of the approach. Your sentence here below refers to Mode 1 and Mode 2 --> see here for a detailed description.

>> I have uploaded different firmware to my ST.box through the ST BLE Sensor app. I haven't had any issues between connections between the ST.box and my Smartphone.

So you can upload an app on the ST.box directly from the STBLE Sensor on your smartphone (via Bluetooth). In this way, your PC (and Unicleo-GUI too) will detect the ST.box as an external mass storage device, and not as a VCOM.

>> Windows is detecting the ST.box only as a storage device (SD card) and not as a microcontroller board or a device connected through the VCOM port.

However, to establish the communication between PC and ST.box on Unicleo you have to upload the DataLogExtended.bin project in function pack FP-SNS-STBOX1 in Mode 3, i.e. not from smartphone, but from PC. The easiest way to do it is use the STLINK V2 utility on, and flashing that firmware via JTAG connection (not USB/VCOM), but if creating the ad-hoc cable is time consuming, you can use the USB and the DFU method described here (https://community.st.com/s/question/0D50X0000BYnQt6SQF/sensortilebox-not-connecting). Use the attached file, already in .dfu extension.

>> My desire is to be able to create my own code on an IDE and upload it to the board as firmware, accessing the LSM6DSOX sensor.

If you want to go deeper, I suggest you to start from FP-SNS-STBOX1 examples that contains the drivers for the LSM6DSOX, opening it with an IDE (e.g. STM32CubeIDE, which is open and dedicated precisely to STM32, or Atollic TrueSTUDIO which is free) and using the ST Link V2 for debugging.

Regards

@Eleon BORLINI​ ,

Thank you, I think I have a much better understanding of how this whole system works, I appreciate your help. This has certainly cleared up much of the confusion I had, and everything seems to be working as intended. I believe I know how to take the next steps to get started, now. Essentially, I'll be creating my own "project" on the STM32CubeIDE, and then flashing the generated binary file to the board while it is in DFU mode via USB. I believe this is the correct method, albeit slightly simplified?

Thank you so much for your time over these past few days, you have been very helpful.

Thanks!

Hi @Community member​ , thank you for your appreciation :)

Yes, that is a correct method, although I would suggest you another way to debug your code. The dfu or bin file is not so straightforward to be downloaded on the STM32 MCU of the ST.box if you have your own source code/project and you want to run it in debug mode on the ST.box itself. In this case, it is better to use the STLINK V2 you have on the STM32Nucleo-L476RG board via JTAG pins, connecting it to the SensorTile.box J2 connector. This connection is unfortunately not immediate, because you have to wire the pins one to one, but you can do it following the schematics pinout. In any case, I would suggest you to start from the example projects of the FP-SNS-STBOX1 firmware function pack. Regards

can you explain this step by creating a detailed video so that whoever new to pro mode can do create a machine learning project??

Regards

and the video for the application example 1 and application example 2 in which you elaborated the pro mode way