WATCH ON-DEMAND | STM32 Summit 2026
Ask questions and find answers on how to deploy, debug, and optimize AI models on ST microcontrollers, microprocessors, and smart sensors.
Most recent activity
Hello!I am using CubeAI (version 9.1) to generate code for running an ML model on a microcontroller.When I generate the code with CubeMX using my .keras model, there are no compilation issues, and it runs perfectly.However, when I generate the code with CubeMX using my .tflite model (quantized in int8) and then using it to compile my project, I encounter an overflow error during compilation:region 'FLASH' overflowed by 22340 bytes.This is quite surprising because, according to CubeMX, my quantized .tflite model is about two times smaller in both RAM and FLASH usage compared to the .keras model (I’ve attached a photo showing the FLASH and RAM usage for both models).tflite quantified modelKeras modelI use tensorflow 2.12. My theory is that the libraries required to run my int8 model take up more FLASH space, but I’m not sure. Or maybe I made a mistake when integrating the model into my project. Does anyone have an idea where this problem might come from?
I am working on deploying a 1D CNN model on an STM microcontroller using STM32CubeMX with the X-CUBE-AI package to convert the TensorFlow Lite model into C code. While testing the model, I noticed significant discrepancies in predictions: On Laptop: Using the quantized model for inference gives reasonable predictions. On Microcontroller: Using the same test data, the predictions differ substantially when validating the model on hardware. Steps Taken: Ensured the test data was preprocessed identically for both laptop and microcontroller predictions. Used X-CUBE-AI to generate C code from the quantized TFLite model. Deployed the generated C code on the microcontroller for validation. Questions: What could cause such prediction differences between the laptop and microcontroller? Could this issue be related to quantization or numerical precision differences during deployment? Are there any additional steps or configurations in X-CUBE-AI to ensure consistent performance between platfor
Hello,I am facing some strange errors when trying to analyze any TFLite model. The errors are occurring in the following situations:Situation 1: STM32Cube.AI MCU RuntimeWhen analyzing a TFLite model, it fails and shows an error message: "TOOL ERROR: List index out of range."Situation 2: STM32Cube.AI Neural-ART RuntimeAfter clicking on the Analyze button, it's stuck at 0%. Nothing else happens, even after I wait for 30 minutes.I am using:CubeIDE version: 1.17.0X-CUBE-AI version: 9.0.0 and 9.1.0Please note that all those TFLite models work fine with CubeIDE 1.16.0, X-CUBE-AI 9.0.0, and STM32H7A3.I am attaching 2 tflite models for your reference.
I'm trying to make a snoring detector embedded on stm32wb55 dk board but everytime I encounter an inference unsuccessful :\ to be precise, the returned error looks like that input size or dimension is wrong.this is the code that I am running #include "microphone.h" #include "dbg_trace.h" #include "arm_math.h" #include "arm_const_structs.h" #include "ai_platform.h" #include "snoring_dataset.h" #include "snoring_dataset_data.h" //#define AUDIO_OUT_MS (20) //#define AUDIO_OUT_SAMPLING_FREQUENCY 16000 #define FFT_SIZE 512 #define FFT_BINS 256 #define TARGET_BINS 40 // Final bins after averaging #define FRAME_SIZE 960 // 60 ms at 16 kHz #define STRIDE_SIZE 480 // 30 ms overlap #define SEQUENCE_FRAMES 16 // Number of frames for the new model #define CLASSIFIER_INPUT_SIZE (SEQUENCE_FRAMES * TARGET_BINS) // 640 floats #define BUFFER_SIZE 32 // Circular buffer size for frames #define REDUCE_FACTOR 6 // Average 6 bins together #define CIRCULAR_BUFFER_SIZE SEQUENCE_FRAMES // Circular buff
Hi, I have a STEVAL-STWINKT1B that I am using to log data into my PC with HSDPython_SDK. How can I set the accelerometer range (for example IIS3DWB to 16g)? Regards, Ivan
Hopefully someone can give me a hint on what I am doing wrong.I am logging sensor data with the STEVAL-PROTEUS1 board to the PC using the fp-sns-datapro1 project and the cli_example method. When I try to convert the binary .dat to .csv of the ISM330DHCX by using the HS-DL_NanoEdge_Conversion.bat the hsdatalog_to_nanoedge.py script rises and exception at line 102HSDatalogApp.st_hsdatalog.HSD.HSDatalog_v1 - ERROR - Memory Error occoured! You should batch process your ...It also crashes when converting IIS3DWB .dat, but data logged from IIS2DLPC and SST22H sensors are converted correctly.I have also tried to convert the example samples provided in directory STM32CubeFunctionPack_DATAPRO1_v1.1.0\Utilities\SwUtilities\HS_Datalog\PROTEUS_batch_file_examples\AcquisitionExample and the same behaviour occurs.I am using python 3.8 and fp-sns-datapro1 version 1.1.dat collected by bluetooth via STSBLESens App or by USB in MSD mode have also the same problem.Best regards
Hi, I'm using the B-U585I-IOT02A development board and I have some problems using external memories with AI. The board has an external PSRAM memory in OCTO SPI and a NOR FLASH in OCTO SPI (quad?) but this seems impossible to use with X-Cube-AI. I am stuck today and I cannot find the information through the various documents that I have seen on internet. 1. Is it possible to use OCTO-SPI PSRAM to extend RAM for AI ?On ST cloud developer, all boards with OCTO-SPI PSRAM seem not to work to expand RAM. On the AI configuration window in CubeMX, it is impossible to choose PSRAM memory because it's not "physical" memory.I made different attempts, I set the PSRAM in Memory Mapped Mode, I assigned it in the linker, I assigned the AI activation buffer on the PSRAM, but in addition to being slow, the AI results are incorrect. I know there is a time between a valid write and a read, is this the problem ? 2. How to program the model binary into OCTO-SPI External NOR Flash ?
I am trying to implement a neural network on the LSM6DSV16IS IMU using an X-NUCLEO-IKS01A1 board.The neural network was trained and exported from MATLAB in ONNX format. Subsequently, the model was quantized using ST Edge AI Developer Cloud, and I downloaded the generated library for the IMU.I referred to the following tutorials as guidelines:How to implement a neural network on LSM6DSO16IS and ISM330ISST MEMS ISPU GitHub repositoryHowever, I encountered some differences in my case and decided to download the template (I tried both template and template_stedgeai).I modified the main.c file in inspu/src/main.c, but it fails to compile. On the other hand, when I try to compile the file in inspu_stedgeai/src/main.c, the console outputs: "Nothing to build for project ispu_stedgeai".At this point, I am unsure how to proceed.My main questions are:Is it possible to use ST Edge AI Developer Cloud to directly obtain the three folders (lib, inc and src) that can be integrated into the project in
Hello everyone: I encountered a problem when importing the ONNX model and using the X CUDE AI tool for analysis. I have tried many solutions but couldn't solve it. I hope someone here can help me. The specific problem is as follows: ST Edge AI Core v1.0.0-19894 NOT IMPLEMENTED: Only step=1 is supported for each axis: [2] This is a problem that occurred after adding the SPDConv module to the YOLOv5 model. Before that, the model could be imported and analyzed smoothly.
Hi,I am using STM32MP257-DK2 microcontroller on a Linux PC and I am trying to analyze a AI-model using the CubeAI. But I keep getting the following error:I have already installed the MP2 component, SDK and everything (including the CubeMX and CubeAI) is upgraded.Verification of installed STM32MP2 component:The package is green, indicating installed and has the "uninstall" option.Any suggestions on how this error can be fixed?
Hi,I am following this tutorial to use my own image recognition model with the STM32H747I-DISCO board. I have already ran the demos and they seem to work fine.I first configure the model in CUBE-MX successfully and then copy the required files to the demo project.When I compile the code in the STM-IDE I get the following error a bunch of times:undefined reference to `forward_conv2d_if32of32wf32'I also get this: STM32H747I_DISCO_PersonDetect_Google_CM7.elf section `.bss' will not fit in region `DTCMRAM' STM32H747I_DISCO_PersonDetect_Google_CM7.elf section `.axiram_section' will not fit in region `AXIRAM' STM32H747I_DISCO_PersonDetect_Google_CM7.elf section `.sram_section' will not fit in region `SRAM123' section .axiram_section VMA [24000000,241ad7ff] overlaps section .bss VMA [20017a40,2c6301a7] even though CUBE-MX said that the used memory is within the flash and ram available (as shown in the image included). The declaration is in layers_conv2d.h but I can't
When I analyze the ONNX model in CubeAl,it says INTERNAL ERROR : Unkonwn dimensions : CH.The code of the model is simple as follows,input_size = 1 hidden_size = 1 output_size = 1 num_layers = 1I don't know why and I will really appreciate any advice or workarounds. Thank you:class LSTMNet(nn.Module): def __init__(self, input_size, hidden_size, output_size, num_layers=1) super(LSTMNet, self).__init__() self.lstm = nn.LSTM(input_size, hidden_size, num_layers, batch_first=False) # batch_first=False self.fc = nn.Linear(hidden_size, output_size) def forward(self, x): h0 = torch.zeros(num_layers, x.size(1), hidden_size).to(x.device) c0 = torch.zeros(num_layers, x.size(1), hidden_size).to(x.device) out, _ = self.lstm(x, (h0, c0)) out = self.fc(out[-1, :, :]) return out
This ONNX model is compiled with a standard MCU and runs on it (both with and without quantization). However, I encounter the following error when using the Neural-ART Accelerator NPU (both with and without quantization):INTERNAL ERROR: Scale, zero-point, and quantizer must be set simultaneously. It seems to me that all the model's onnx operations are supported (https://stedgeai-dc.st.com/assets/embedded-docs/stneuralart_operator_support.html)
Hello everyone! First post here. I'm a grad student in Computer Science and Engineering and I'm looking to learn Machine Learning on MCUs. My professor suggested I use the STM32 Nucleo development boards for this. I was wondering if anyone had a rough guideline and perhaps links to some resources which you found really useful on how to get started with this topic. I would be really grateful for any help. Thank you!
I am using X-CUBE-AI 9.0.0 in my project and need to run a quantized mobilenet_v2.0.35 model (.tflite). The model takes 4*56*56*3 (Batch * width * height * channel) input, but I am unable to find a way to run it with that input shape. The generated code sets input _1 size to 56*56*3 bytes only. I can't figure out how to provide batch input.I am using STM32CubeAI runtime. I also see differences in input/output parameters between the original model and the one optimized by X-CUBE-AI.I'd highly appreciate any guidance about how to run inference using batches. I am attaching the Netron screenshot of the comparison below: Comparison between original (left) and optimized model EDIT: In the generated report file, I can see batch size 4 is used in the layer breakdown table. But input and output size don't show that. ----------------------------------------------------------------------------------------------------------------- input 1/1 : 'serving_default_input_10', uint8(1x56x5
Hi everyone,In X-CUBE-AI, it provides two different runtime, TFLite Micro and STM32Cube.AI. When I checked the used kernel by TFLite Micro, it seems that it doesn't use the optimized kernel from CMSIS-NN. For the case of STM32Cube.AI, we can't find how it implements the kernel because it is not open-source. However, we can guess it actually uses CMSIS-NN for the implementation because its latency is much shorter than TFLite Micro.My question is: does anyone know how to let TFLite Micro use CMSIS-NN library when using X-CUBE-AI package to generate related C-files?Thank you very much for your assistance and reply.Best regards,Jeff
We are using the Nano Edge studio to run the STWIN DTMF Classifier on the STEVAL-STWINCSV1 on a Linux system. We followed the instructions from: https://wiki.st.com/stm32mcu/wiki/AI Entitled: How to create a dual-tone multi-frequency classifier using NanoEdge AI Studio When we run and capture 100 lines of samples, we move to the "Import Signal" and 99% of the data is misaligned and classed as corrupted. We have a space as our separator, but we need a new line to separate each line and this causes corruption. We also noted that on occasion we have, as an example, 0.0.000. We have tried modifying the code in the classifier example: for( uint16_t class_cpt = 0; class_cpt < CLASS_NUMBER; class_cpt++ ){printf( " %.3f", output_class_buffer[ class_cpt ] );}printf( "\n" ); But no matter how we format the code the date is always classed as corrupt. We are unable to use the button to "Open file location" as it does nothing. 1) Could you please tell us where we would find the outp
As stated, I have problem analyzing the ONNX model ported from a pytorch model. The code of the model is simple as follows: class LSTM(nn.Module): def __init__(self, input_size, hidden_size, num_layers, num_output=1): super(LSTM, self).__init__() self.num_layers = num_layers self.input_size = input_size self.hidden_size = hidden_size self.num_output = num_output self.lstm = nn.LSTM(input_size=input_size, hidden_size=hidden_size, num_layers=num_layers, batch_first=True) self.fc = nn.Linear(hidden_size, num_output) def forward(self, x, device='cuda'): ula, (h_out, _) = self.lstm(x) out = self.fc(h_out[-1]) return out Netron vis:I will really appreciate any advice or workarounds. Thank you!
Hi ,I go into the hardfault handler when trying to run the ai_network_run which I call inside my run_inference function which is inside my ADC ISR , then it calls ai_platform_network_process , that is where we get thrown into the HardFault Handler . here is my code in case anyone has improvements please don’t hesitate to reply .Note : I tried all the previously mentioned suggestions like clocking CRC and increasing stack size , I increased both stack size and heap size to 0x8000 . /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2024 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this
I built a simple FCNN model based on onnx(regression, 4 input and 4 output), including three hidden layers with 64, 32, 16 nodes, and successfully "validate on target" in STM32 through X-CUBE-AI.Now I want to send(receive) data directly to(from) the STM32 via the serial port, instead of clicking the button "validate on target". However, I don't know how the data from the npy file was sent during the "validate on target" process. Is there any documentation to explain the process?
When I used V4.3.1 before, there was a "5 Emulator" step, but it doesn't exist in V4.6.0.Is Emulator no longer available?
Dear community members,Here’s your chance to win some prizes from ST until the end of 2024! You can join the challenge by sharing your ISPU neural network implementation. We’ll provide instructions and hints during the ISPU webinar held on October 29, 2024. https://content.st.com/iot-applications-with-neural-networks-in-mems-sensors.html Your proposal must relate to embedding a neural network on an ST MEMS sensor with ISPU.The ISPU is an ultralow power, computationally efficient, high-performance programmable core that can execute signal processing and AI algorithms in the edge. It is available in the LSM6DSO16IS and ISM330IS sensors from STMicroelectronics. Simply create a comment in this thread. You can also attach files to document your solution (.log, .mp4, .docx, .jpg, .png, .xlsx, .7z, .hex, .c, .cpp, .zip). Use the “kudos” button on ideas or implementations from other members to indicate that you like them. Everybody can vote on implementations and ideas, and the most voted on
I am trying to use MEMS Studio to configure the Machine Learning Core (MLC) of the ISM330DHCX sensor on both the B-U585I-IOT02A and a custom board, but after installing MEMS Studio and connecting the board, I realized that it is not recognized by the software. How can I use MEMS Studio with a board that is not on the supported list? If this is not possible, what is an alternative way to utilize the MLC functionality of the ISM330DHCX? *This post has been translated from Korean to comply with the ST Community guidelines.
I was able to run the Serial emulator in NANOEDGE AI STUDIO Validation, so as the next step, I run [COMPILE LIBRARY] in Deployment and don't know where to put the libneai.a file generated in Project Explore.Also, please let me know if any other settings are required.The evaluation board is B-L475E-IOT01A2.
Hi everyone,I am working on implementing an image classification model on an STM32 board using the X-CUBE-AI extension. I am relatively new to embedded software development; my background is primarily in AI and deep learning. While I have managed to generate the necessary .c and .h files for my model using the X-CUBE-AI extension, I am having trouble providing input to the model from an image stored on an SD card. As far as understand from created cods I have modify acquire_and_process_data and post_process functions that have write down below. Also I have provide output of my code. In main function just MX_X_CUBE_AI_Process function works in while for AI proces.Here’s a brief summary of what I’ve done so far:Model Conversion: Successfully converted my image classification model using the X-CUBE-AI tool and generated the necessary files.SD Card Integration: Implemented functions to read BMP image files from the SD card and store them in a memory buffer. These functions
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.