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
Hello, I am trying to use the MLC on the LSM6DSOX with the 6D Position Recognition Sample.The Interrupts on INT1 are triggered as expected, but when I read the MLC0_SRC (0x70U) it always returns 0. Moreover, I tried different samples - same problem.I was able to read other registers, for example the TAP_SRC where the data is properly returned. (Double Tap/Single Tap)So, is there a difference in reading the MLC0_SRC and TAP_SRC except the address?Thanks in advance, Manuel
Hello,I have a recurrent error when I try to validate a model using X-CUBE-AI : "TOOL ERROR: Weights are incompatible with model: xxxxx loaded, 89864 found", where xxxxx depends on the model I try to validate. The error occurs in the CubeMX software as well as in command line, for all the models I tried to validate (Keras and ONNX).The error also occurs when I follow the "Getting started" ST's video and try to validate the specified model (https://www.youtube.com/watch?v=grgNXdkmzzQ).You can find attached the network analyze report and the faulty network validation report.Any help would be welcome
..
Hey!After doing some work I connected a Nucleo-L011K4 to the STEVAL-MKI197V1 breakout sensor board with the LSM6DSOX. I am connected through SPI, loaded the configuration (header file) on it and get it running. I've also set up a GPIO on the Nucleo board that is connected to the INT1 pin of the sensor board and makes an interrupt when the INT1 of the sensor gets high. This all works and the interrupt is called when expected. However, I also want to read the code of the interrupt, which would be 0 or 4 depending on the detected movement.I use the following code bit lsm6dsox_all_sources_t status; uint8_t mlc_out[8]; lsm6dsox_all_sources_get(&dev_ctx, &status); if (status.mlc_status.is_mlc1){ lsm6dsox_mlc_out_get(&dev_ctx, mlc_out); sprintf((char*)tx_buffer, "Detect MLC interrupt code: %02X\r\n", mlc_out[0]); tx_com(tx_buffer, strlen((char const*)tx_buffer)); }I use this to print out the code, ONLY when I notice the interrupt from INT1.The problem is, that the int
I am looking to create a project where I can set/latch the interrupt pin INT1 on high when the LSM6DSOX is detecting state X (where X is state 1/2/3 etc.) and goes down (low) when in a generic/static state (state 0). How is this possible? I found in one of the application notes that the PAGE_RW flag (17h) has something to do with the flag. However, I am not able to find how I can customize the output signal like described above.Has anyone experience with interrupts and how should one do this?
I am building CNN model on TensorFlow and after that I generate C code for STM32 micro using CubeMX-AI.Here's my modelmodel = models.Sequential() model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(32, 32,1))) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(64, (3, 3), activation='relu')) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(64, (3, 3), activation='relu')) model.add(layers.Flatten()) model.add(layers.Dense(32, activation='relu')) model.add(layers.Dense(4))I tested it on micro controller and get good results.here's the result of the 4 classes when input belongs to 3rd classOutput =-9.430237 Output =-7.165620 Output =1.203057 Output =-10.133130 but in order to get the probability I added SoftMax classifier to the last layer, here's the new modelmodel = models.Sequential() model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(32, 32,1))) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(64, (3, 3
Hi, As the title says, I'm trying to use a model with integer weights in cube_ai for speed and size performances. I converted the original keras model to int operations using TFtiny, but when I try to import it, cube_ai throws an error warning me that only float32 operations are allowed. I saw in the user manual and in the generated code that int operations should be supported, isn't this the case? If so, how should I go about converting my model to only integer operations?
When I'm trying to analyze the network in CubeMX I get the following error: TOOL ERROR: Unsuportet Layer Type: LSTM. Is there any possible Version of Cube AI wich supports an Recurrent Type Layer such as LSTM or GRU?
Hi, I'm working on a project involving using NN with cube ai to track objects from images coming from a camera sensor. I would like to find a way to downsample an image in the fastest / less cpu intensive way possible (the video feed is approximately 8fps and i'd like to leave the cpu unused most of the time to have more computing power for the ai library). Downsampling from dcmi directly is not an option (need to show the full resolution, full framerate image on an lcd). How could i go about it? I looked ad the dma2d documentation and didn't find anything regarding downsampling, what is the usual way to solve this problem?
Hello,I created a CNN model used Keras with tensorflow here's the modelmodel = models.Sequential() model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(32, 32,1))) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(64, (3, 3), activation='relu')) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(64, (3, 3), activation='relu')) model.add(layers.Flatten()) model.add(layers.Dense(32, activation='relu')) model.add(layers.Dense(4))when I test the model on Python using model.evaluate()I get the following resultsloss: 0.0086 - accuracy: 0.9955but when I test on STM32 , using the code creaded from CUBE-MX-AI :I get always result of negative value from -15 to -23 for the 1st output and 0's for the last three outputs.after commented the code of randomizing the input data in MX_X_CUBE_AI_Process() the result is some negative value for 1st output and 0's for the last three outputs.I can't understand why I didn't get the same result as testing on python .
I am using cube ai 5.0.0 , and the version of my IAR is v8.32.My board is NUCLEO-LM476RG.I followed the tutorial exactly step by step, but it raised this error.What can I do?The further question is: is validation on target necessary? I can validate my network on colab. Can I develop my own applications without this step?========================update==========================I solved the IDE not found problem by installing IAR at disk C,but I found another problem.LOAD ERROR: STM32 - no connected board(s), invalid firmware or the board should be re-started========================update==========================I solved it on my own. You must connect your USART port to the PC.You have to implement the hardware connection.Therefore you will have to use 2 port to "control" the board.Note that this port is different from the port connecting the board.So when validating on target, you have to select the right COM
Hi, I am trying to deploy a Keras model that fits in the board STMH743XI-E02. In order to do so, I've created the model, and loaded it into the project according to the current documentation.I've tried to use several USART ports to enable communications with the board, and I've tested the USART communications with an example project that correctly send the data to my terminal. Meaning, that my configuration is correct, at least on the board to use the USART.But when it comes to use STM32CUBEMX and the AI additional package, after analyzing the model, and validate it on desktop, the following error appears to me, once and again:LOAD ERROR: STM32 - no connected board(s), invalid firmware or the board should be re-startedMy last configuration usses USART1 Asynchronous for communications. I'be tried with pins:PB14, PB15PA9, PA10PD8, PD9 (USART3)I've used the validation template on the AI package.The clock is set to 480MHz on the Clock configuration tab.Minimmum Stack size to 0x2000 on the
Hi,I am looking for a dev. tool to try to implement pre-trained various classifiers from sensors data into a microcontroller.I want to implement various ML models including NNs, SVM, Random Forest and Naïve Bayes. The sensor types for the inputs would be accelero, gyro, magneto, physiological, GPS from various sensor manufacturers depending on model and its task.As I am new to microcontroller, I don't really know yet what type of board should I chose to get the most generic and powerful-enough prototyping platform for these applications.For now I spotted the Nucleo boards (look great for prototyping) and also STEVAL-MKI109V3 (look good to monitor sensors)Some more infos:power consumption doesn't matter for now (though I would prefer staying on MCUs)the most consuming model would be a CNN with up to 1million paramsinput data is light (no images, only temporal positioning, dynamic and physio signals)Some software dev. tools I found:X-CUBE-AITensorflow Lite for MCUemlear & sklearn-por
I just want to ask one simple question. is it possible to use Machine learning & AI with STM32F3 Discoveryboard ? If it is no, which board we can use Machine learning & AI? Thank you very much in advance
Hello In UM2526 User manual "Getting started with X-CUBE-AI Expansion Package for Artificial Intelligence (AI)"I found the following sectionI think that .h5 model is enough for Cube-AI to generate model in C code for STM32, or should I include .json file as well?Best RegardsHossam Alzomor
Hi guys,I was wondering if there are people interested in artificial inteligence computed on embedded devices? Recently i have found a smart chip for accelerating neural networks produced by a Korean company called NM500 http://general-vision.com/documentation/TM_NM500_Hardware_Manual.pdf and i am trying to play with it. I have found that the NM500 uses 16bit parallel bus and the manufacturer is using fpga as a interface to this bus. I find this quite limiting, because there is no easy way how to implement this chip without their fpga to my PCB designs.Thats why i have decided to programm a small C library form STM32 which uses DMA and standard GPIO to communicate with NM500 at full speed. Now i am creating a small developement kit (arduino footprint compatiblie), with STM32F7, three NM500, SD card, 128mb ram and camera interfaceWhat do you think about NM500 ? I was wondering, since i havent found any posts about this chip in the forums if there are others interested in it? I
Hello,I am using STM32CubeMX Ver 5.5.0 with X-CUBE-AI .In the generated code inside function MX_X_CUBE_AI_Process() I found the following code just before aiRun function /* ---------------------------------------- */ /* Data generation and Pre-Process */ /* ---------------------------------------- */ /* - fill the input buffer with random data */ for (ai_size i=0; i < AI_CNN_IN_1_SIZE; i++ ) { /* Generate random data in the range [-1, 1] */ ai_float val = 2.0f * (ai_float)rand() / (ai_float)RAND_MAX - 1.0f; /* Convert the data if necessary */ if (type_ == AI_BUFFER_FMT_TYPE_FLOAT) { ((ai_float *)in_data)[i] = val; } else { /* AI_BUFFER_FMT_TYPE_Q */ /* Scale the values in the range [-2^M, 2^M] */ val *= max_; /* Convert float to Qmn format */ const ai_i32 tmp_ = AI_ROUND(val * scale_, ai_i32); in_data[i] = AI_CLAMP(tmp_, -128, 127, ai_i8); } }I can't understand why the input buffer is filled with random data instead of the original input data?I expect
I recently found out about the STM32Cube AI toolkit, which holds much promises. In the ST blog they specified that it currently only supports mcu's with an FPU but aims to bring support also to fixed-point implementation. It states that a Cortex M4 or higher is currently required. When can we expect support for example Cortex M0?https://blog.st.com/stm32cubeai-neural-networks/
Hello,I am using X-CUBE-AI version 5.0.0, in the generated application template code , aiInit recives a pointer "activations", which is passed to " AI_<>_DATA_ACTIVATIONS()".What should be the value of this parameter ?Best RegardsHossam Alzomor
Hello,In CubeMX-AI , after loading the H5 model and analyzing it, there is an option to validate on desktop without providing validation data.How the validation is done using validation input as random numbers?and How L2R is calculated?
Dear STM Community,I am trying to deploy a simple tflite model on my STM32, but I can't get through the analyze step. The model is intended to get a Nx42 matrix (dynamic size), perform some multiplications and additions, and return a fixed size vector with extracted features such as min, max, and mean vaules. The tflite model runs on computer without any problem.The error I get is the following:INTERNAL ERROR: tuple index out of rangeI also tried to create a keras model of it with a custom layer, but for understandable reasons it is not working either. I attach the tflite file, maybe it will help.Thanks,Daniel
Hello Everybody,I just wanted to share with you two projects I have done with CUBEMX.AI.ALL networks are trained with TensorFlow 2.0.Tensoflow2.0 saved networks(Keras Format) receives an error when converting in CUBEMX so I changed some options in python code to make it compatible with CUBEMX.AI.Links to github:https://github.com/nimaaghli/STM32AI_MNISThttps://github.com/nimaaghli/STM32AI_QuickDrawLink to video demonstrations:https://www.youtube.com/watch?v=8oBEGNwsj4Ahttps://www.youtube.com/watch?v=_YbzxUagpbw
A new feature that puts together the Machine Learning Core (MLC) feature of the DSOX and the ST.box hardware and interface is now available on ST BLE Sensor app.This powerful feature allows yougo beyond the Mode 2 (Expert mode) interacting with the Unico tool-chain for the .ucf file generation, as explained in this series of post on MLC embedded feature. A few ready-to-use .ucf files are available on public Github repository at this link (Gym activity recognition, Vehicle stationary detection, Vibration monitoring, etc), even if these are intended mostly for a preliminary evaluation.But how to use it in practice? Select the MLC virtual sensor from the "Input options" n and upload the .ucf file you created with Unico. I suggest you to use the ST.box itself to acquire the motion pattern for your specific app dataset creation.You can find the app-generated MLC user interface in the comment below :red_triangle_pointed_down:
Hey all!Recently I've purchased the STEVAL-MKSBOX1V1 (SensorTile.Box), and I've been blown away by the board. First of all, great job!Now I have a following question: I want to use this board to generate data of vibrations. Before buying the board, I already did some exploratory work with the STEVAL-MKI109V3 and a separate LSM6DSOX sensor. In UNICO I noticed the different configurations of the sensor (2g,4g,8g etc, and 26Hz, 52Hz etc). However, I do not know where I can configure the MKSBOX1V1, since it does not connect to Unico. How am I supposed to do this? What is the base configuration of the SensorTile.Box's LSM6DSOX? What is the difference if I don't change this configuration?Thanks in advance!
Is it possible to use accelerometer in low power-, or ultra-low power mode in combinationwith MLC?All current calculations, i found were based on the 170µA of accelerometer in high performance mode.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.