Get ready for the STM32 Summit 2026 | Online, November 3
Ask questions and find answers on how to deploy, debug, and optimize AI models on ST microcontrollers, microprocessors, and smart sensors.
Most recent activity
I would like to use CubeAI to run a tflite model on microcontroller, but I get ERROR 119 message during the analyzing model step. I tried to search for this error code, but could not find any sources that reveals what it actually means. I attach the screenshot of the message. The log file mentioned in the error message provides no further info about the problem. CubeMX and CubeAI is runnining in a Windows environment, and has been updated to the latest versions.The tflite model works in other environments without any problem. It has been converted from a tensorflow keras model, using GRU and Dense layers. Could it be the problem, that CubeAI does not support tflite models that has been converted from GRU layers? If so, is there any specification what kind of keras layers can be used?Thanks,Daniel
Hello thank you very much. I did a course on neural networks with keras in EDX, and I can now train, save and load my networks on an STM32F4VE, with compression 8, using STM32Cube AI. The verification with my data set works well. And now how do I continue? How do I send my data to the STM32 to make predictions?For example, I used Keras in Anaconda 3, and I used the MNIST data set, in Keras I can make predictions based on images that I enter with my numbers and my calligraphy, and it predicts very well. That same set of images that I wrote myself, I normalize them, and export them in a comma separated file, the images are floating numbers. I use that file to do the verification with STM32Cube AI and it works very well. That is to say that until now everything is going very well, my question now is, How do I continue ?, How do I modify the code generated by STM32Cube AI, to receive my image and that the microcontroller, process it and give me the output?Best Regards,
I was using NUCLEO-L476RG.When I tried to validate on target, I can build successfully but the message below showed up.How can I do?===========================update=========================I found that the rom size seemed to be too large. Maybe it is the main reason ?(But CubeMX didn't raise any warning)===========================update=========================However, the rom percentage cannot decrease,no matter how I reduce the complexity of my density layer.What does the percentage mean ?
aiSystemPerformance.c :line 937 and 940for (int i = 0; i < net_exec_ctx[idx].report.n_inputs; i++) {for (ai_size i = 0; i < AI_BUFFER_SIZE(&ai_input[i]); ++i) {In my opinion, different running variable i should be used for the above for loops.One loop is inside of the other loop, but they share the same running variable i.
Hello,I have a problem running "Validation on Target" because many of the source files cannot be found (see log below). I use the MDK-ARM toolchain. When I generate the code and open the project in Keil uVison most of the project files cannot be found because the include directories are wrong! This shouldn't be the case. Fixing this manually is a big pain.Is anybody using the MDK-ARM Toolchain without this problem?Building project Generating project Temporary project loaded Temporary AI configuration done Generating temporary project code Building project Build target 'mxAI762925399611' assembling startup_stm32l476xx.s... compiling network.c... "no source": Error: #5: cannot open source input file "Src/network.c": No such file or directory Src/network.c: 0 warnings, 1 error compiling network_data.c... "no source": Error: #5: cannot open source input file "Src/network_data.c": No such file or
Hi, We need to use motion sensor LSM6DSOX for position tracking. We can not use GPS in the system, and the position accuracy we need to achieve is 1 m after moving 11 meters. So I have a question related to LSM6DSOX :In the datasheet, the output is linear acceleration, the linear acceleration there means raw acceleration data or the acceleration without gravity components?Does the machine learning core do sensor fusion, provide temperature compensation for accelerometer and gyroscope bias, and output orientation and linear acceleration (remove gravity)?What algorithm is used for the sensor fusion in the machine learning core? KF (Madgwick algorithm), EKF or linear optimization algorithm? The reason I would like to know is that we do not need real-time process, so it’s possible for us to process data in a PC, we are thinking to use a more advanced algorithm to improve accuracy. If advance algorithm is already done in the machine learning core, then there is not
Hello.I run into a following error while building my project using ai: make: *** No rule to make target '/home/user/git/stm32/Drivers/CMSIS/DSP/Source/SupportFunctions/arm_copy_q15.c', needed by 'Drivers/CMSIS/DSP/Source/SupportFunctions/arm_copy_q15.o'. Stop.Everything else seems to be built nicely, but this one stucks out. As i figured out myself, the arm_copy_q15.c is not located in this subfolder, but the location should be: '/home/user/git/stm32/test_projects/test_board_ai_f767zi/Drivers/CMSIS/DSP/Source/SupportFunctions/arm_copy_q15.c'Is thre some mistake pathing the file and what can I do to fix it. I use CubeMX 5.4.0 and CubeAI 4.1.0.
Hello, I am doing a project where I will be implementing a trained neural network (trained with Keras) onto a STM32F746-DISCOVERY board with X-Cube AI. The goal is to train the network to recognize audio samples converted into spectrograms. This would mean that on the microcontroller, I would need to convert the audio input into spectrogram images, and then input that into the neural network for recognition.Does anyone have any good sources or similar projects regarding either creating spectrograms on a STM32 microcontroller or a good image recognition project on an STM32 MCU using x-cube AI?Thank you!
Hi ST,I've read the part about weight/bias compression in the X-Cube-AI documentation (6.1).If not confidential can you tell a bit more about the Weight-sharing-based algorithm (k-means clustering)?What is the meaning of the factor (x4 or x8)?Is the algo based on some research papers? such as https://arxiv.org/abs/1510.00149 ?Thanks in advance.Best,Adrien B
..
Hi,I'm trying the quantization of Keras (.h5) pretrained neural networks with some different quantization schemes.Using the 'stm32ai.exe' command I run the following command:$ stm32ai.exe quantize -q <pathtoconfig.json>Then I drag and drop the quantized <my_nn_name>.h5 and <my_nn_name_Q>.json output files in X-Cube-AI menu in CubeMX and generate my code.In the generated file <my_nn_name>.h, there are #defines for IO buffer formats. I believe they depend on the schemes chosen in config.json file and the quantization process.The code generation seems to work fine, except for the 'ss/sa' for 'Integer arithmetic'. For lines of interest, I get:... #define AI_GENERICNETWORK_IN_NUM (1) #define AI_GENERICNETWORK_IN { \ AI_BUFFER_OBJ_INIT(AI_BUFFER_FORMAT_U8, 512, 1, 2, 1, NULL), \ } ... #define AI_GENERICNETWORK_OUT_NUM (1) #define AI_GENERICNETWORK_OUT { \ AI_BUFFER_OBJ_INIT(AI_BUFFER_FORMAT_U8, 1, 1, 6, 1, NULL), \ } ...In this case the call of "ai_platform_network_
Which Keras version is Cube.AI using? I am having a problem with different versions. My model is being generated with Tensor Flow Keras 2.2.4-tf
Hello,i'm trying to validate the generated C model inside STM32CubeMX.I'm follow the Getting started documentation (UM2526 - rev 3)Like page 22, (4.5 Validating the generated C model) i wan't to use custom data-set (CSV file) on inputs and on outputs, but i have an error:I use previously self-generated values from STM32CubeMX validations files at "/home/user/.stm32cubemx/stm32ai_output/"Seem to be an issue with shape detection:With output csv file like this:# file created : 2019-11-13 15:28:48# output C-model features - 10/109.932567382812500000e+031.614522812500000000e+05-6.814434570312500000e+03-1.008901718750000000e+051.514196777343750000e+038.807486328125000000e+034.036426171875000000e+04-3.264179492187500000e+04-1.473285644531250000e+04-1.134370546875000000e+05I have the message: "Using reference output file, shape=(1, 10)"And if i use csv output file like this:# file created : 2019-11-13 15:28:48# output C-model features - 10/109.932567382812500000e+03,1.
Hello,I have some questions about using the code generatorI am currently using an NUCLEO-L476RG with X-NUCLEO-CCA02M1 and I want to use a tflite model for speech commands recognition.I use X-CUBE-AI version 4.1.0 with ApplicationTemplate.My AI initialization function generated by CubeMX:void MX_X_CUBE_AI_Init(void) { /* USER CODE BEGIN 0 */ /* Activation/working buffer is allocated as a static memory chunk * (bss section) */ AI_ALIGNED(4) static ai_u8 activations[AI_SPEECH_CMD_DATA_ACTIVATIONS_SIZE]; aiInit(activations); /* USER CODE END 0 */ }My function to retrieve the result of my prediction:int aiRun(const void *in_data, void *out_data) { ai_i32 nbatch; ai_error err; /* Parameters checking */ if (!in_data || !out_data || !speech_cmd) return -1; /* Initialize input/output buffer handlers */ ai_input[0].n_batches = 1; ai_input[0].data = AI_HANDLE_PTR(in_data); ai_output[0].n_batches = 1; ai_output[0].data = AI_HANDLE_PTR(out_data); /* 2 -
The LSM6DSOX is one of the most innovative products in ST MEMS Sensors portfolio. And, of course, is onboard on the ST.box. Two pro-mode application directly shows part of the capability of this product:BLELowPower application: besides explaining how to use FreeRTOS and low power techniques to send the data to STBLESensor via Bluetooth, this application shows how to enable the capability of LSM6DSOX accelerometer to detect events like FreeFall, Single/Double Tap, WakeUp, Tilt and 6D orientation, also sending them to STBLESensor.BLEMLC application, on the other hand, directly shows how to program the LSM6DSOX machine learning core. In particular, this sample programs the accelerometer to run an activity recognition algorithm or a vibration monitoring algorithm and to send the results to application. To enable the activity recognition algorithm on the MLC, you have to select the STBLESensor [Activity Recognition] tab. You can also work in debug mode using the STBLESensor debug console an
The purpose of the FP-SNS-STBOX1, which is the main functional pack (FP) dedicated to the ST.box, is to provide examples that show how to build custom applications for the Pro Mode at a FW level. Its flexibility allows the ease portability of this FP across different STM32 microcontrollers, so that you can build your customized app not starting from scratch.The available pro-mode applications, a couple of which will be explained in the near future posts, are:BLEFOTA: uses ultra-low power implementation based on an RTOS for transmitting the data via BLE connectivity;BLELowPower: creates a BootLoader and an application for Firmware-Over-the-Air (FOTA) update;BLEMLC: programs the LSM6DSOX machine learning core for activity recognition or vibration monitoring and transmits the results via BLE;BLESensors: transmits sensor data in the simplest way for BLE trasmission;DataLog: saves the sensor data to the SD card (with FreeRTOS).Together with these applications, there are also a couple o
This is the log of Validation on DesktopStarting AI validation on desktop with random data... Neural Network Tools for STM32 v1.1.0 (AI tools v4.1.0) -- Importing model -- Importing model - done (elapsed time 1.366s) -- Building X86 C-model . -- Building X86 C-model - done (elapsed time 35.235s) -- Setting inputs (and outputs) data Using random input, shape=(10, 270) -- Running X86 C-model TOOL ERROR: Weights are incompatible with model: 794136 loaded, 89864 found Creating report file C:\Users\Ilario Coppola\.stm32cubemx\stm32ai_output\network_validate_report.txt TOOL ERROR: Weights are incompatible&nb
Hy everyone,is possible to configure different values for MLC_ODR, FSM_ODR, XL_ODR and GYRO_ODR, or they must be set equals each others?Thanks and best regards,Leonardo M.
Hi,I am evaluating the MCL on LSM6DSOX. I am using a custom board, not the official motherboard, so Unico cannot communicate with my hardward to upload the configuration to the chip. I think I need to do the configuration manually (basing on Weka decision tree .txt file from manually generated .ARFF files) but I stucked...Anyone succeeded the configuration manually because I found no documentation on this? Could you please kindly give me some instructions on this? About how to change registers properly, which registers should be changed etc... I am reading the datasheet and application notes from ST but I am still much confused ...Thank you very much.
I'm wondering what the hard limit is for the MLC configuration in the LSM6DSOX. I'm using Unico 9.0.0.0 to configure four IIR2 filters and I loaded 4 decision trees (basically a small random forest). The Unico software created the .ucf file successfully. But when I wrote the configuration into the LSM6DSOX, it wouldn't give me any valid values in the register that held the decision tree outputs. The valid outputs were 1, 2, and 3, and the registers would only report 0.Is there a documented size limit on this MLC size? Even if there is a software bug in this version of Unico, it would be nice to be able to double-check to see that the .ucf file isn't configured to write past the end of the memory map.
In app note 5272 page 19, it shows that we can apply a user offset to the accelerometer (the USER OFFSET block). It also looks like the "Advanced functions" branches off before the Digital HP filter, Slope Filter, and User Offset. So my question is - if I apply a user offset, does the MLC use it? I'd imagine that the User Offset could be used as a type of accelerometer calibration, but I'm not sure if the MLC takes advantage of it.
In the Introduction to STM32Cube.AI part 2 there is link to colab notebook. Is this still active. I get an error. Is it possible to get acmes to the files.Thanks.
Hi experts!I am trying to use a NN made on Keras on my NUCLEO-F303K8 (MCU STM32F303K8T6).I've already configured my project, setup the USART2 and imported my NN (.h5)I successfully validated my project on desktop but when I tried to validate it on target, I got:ERROR: no connected board(s) or invalid firmware or the board should be re-startedI've updated all the firmwares and then tried to perform the validation with manual config (set USART2 with the right bound rate, SW4STM32, etc). And then now I am getting:No board connected to the machine with MCU STM32F303K8TXBut this is exactly what my MCU is.My versions:STM32CubeMX - 5.2.0Firmware - STM32Cube FW_F3 V1.10.0X-CUBE-AI - 4.0.0Eclipse - Neon.3 Release (4.6.3)System Workbench for STM32 - Ac6 - 2.5.0.201904120827I've also tried some solutions on other topics in the forum. None of them worked.
Hello,Please note that STM32CubeMX v5.0.1 is available on the web since yesterday.The main updates in this minor release are the following:some bug fixes Performance enhancements when loading ioc file and creating new projectSupport the Artificial Intelligence pack X-Cube-AIYou can either upgrade your current STM32CubeMX version to 5.0.1 or install 5.0.1 version directly from st.com as follows:[Upgrade] from STM32CubeMX 5.0.0 main window : [Fresh install] Download 5.0.1 from www.st.com/stm32cubemx:If you want to install the Artifical Intelligence pack through STM32CubeMX:If you face any issue with this new release, you can submit your question in the STM32 Q&A space using the relevant topics:STM32CubeMXMachine Learning & AI
I use STM32 Nucleo f429zi. I tried to replicate the application on the following link, and followed all the steps. I use USART3 with pins PD8 and PD9 (the manual says these pins are connected to ST-Link)https://www.youtube.com/watch?v=grgNXdkmzzQI use STM Cube IDE. On STM Cude IDE -> there is Debug option to flash the code on Board. However, when I try to Debug - there are errors generated in the app_x-cube-ai.c file.void MX_X_CUBE_AI_Process(void) { aiValidationProcess(); /* USER CODE BEGIN 1 */ int nb_run = 20; int res; /* Example of definition of the buffers to store the tensor input/output */ /* type is dependent of the expected format */ AI_ALIGNED(4) static ai_i8 in_data[AI_IMAGECLASSIFICATION_IN_1_SIZE_BYTES]; AI_ALIGNED(4) static ai_i8 out_data[AI_IMAGECLASSIFICATION_OUT_1_SIZE_BYTES]; /* Retrieve format/type of the first input tensor - index 0 */ const ai_buffer_format fmt_ = AI_BUFFER_FORMAT(&ai_input[0]); // ai_input undeclared const
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.