Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
Hello.I work on a project (the microcontroller is STM32H733VGT6) where VBAT mode is used. When the main power supply is switched off a supercapacitor supplies power to the backup domain (RTC, backup memory). This works correctly but the behavior of the system at low VBAT voltages is not what I want.The datasheet specifies that 1.2 V is the lower limit of operation in VBAT mode. However, when the voltage drops below this value there are no guarantees what will happen. In my case the reset of backup domain occurs far below the mentioned limit (0.3 V).According to the reference manual the VBAT voltage can be monitored and when its not between the upper and lower limit a tamper event can be generated that will reset the backup domain. For some reason I am not able to configure this event correctly. The screens below are 2 pages from the reference manual that seem to prove that what I want to achieve is possible. Here is my attempt (one of many) to configure the tamper even
Hello,In our project we are using STM32N6.We want to use UCPD1_CC1 and UCPD1_CC2 pins as a GPIO but CubeIDE does not generate code for these pins as GPIO.How we can use these pins as GPIO?Best regrads,Egemen Aksoy
HII am on one of the latest stacks, looking to make the bonding list a FIFO, need of some better understanding of your nvm for that. Q: Do you always add the new bonding key to the end of your nvm ? When I delete a bonding entry, does it shift others?In case first/middle bonding entry is in-valid , does next bonding key is written there? Bottom line is it possible? Any way to read/ write the bonding list entries via api? ( add key command ? )
Hi everyone,I'm developing a USB OTG Highspeed using STM32F756ZG with USB3340 USB PHY.Currently I'm using two OUT endpoint (EP1 and EP2), the host PC send each request (EP1 --> EP2 --> EP1 --> EP2 and so on). I got a problem when I try to send a request too fast (200us period), at that time the USB device only receive 1 endpoint in "OTG_HS_IRQ Handler" interrupt despite of the host PC send both EP1 and EP2.I have a few question, can anyone explain to me:1. Following the reference manual of STM32F756, it say "It guarantees max USB bandwidth for up to one frame (1ms) without system intervention". My understanding is USB can not handle if two request is send faster than 1ms. Is it correct? 2. If the PC need to transfer very fast, how I can prevent this problem. I have checked some document and it say that the host PC need to check NAK request but I wonder it already have in USB device or not.Thank all.
Hello !I have to admit that I am stumped on this problem, I've been trying to make it work for the past few days.My issue is with an STM32F301K8T6 (LQFP32) and its ADCs : I have two reflective optical sensors (ITR8307) that are connected to ADC_CHANNEL_12 and ADC_CHANNEL_11. The value read with an oscilloscope are good (they are read directly on the pin so it isn't a soldering issue), they are going from roughly 3.3V to 0.6V.The issue is that the value read from the code doesn't really change, it gives me some random value on startup and oscillates around it, almost as if it was floating. I have tried polling for a single channel, scan mode, DMA, setting the sample time very high and very low, but nothing works... The impedance of the circuit is pretty low (a few kOhms at most), and it works perfectly with an ESP32.All of the VDD and VSS pins are reading the correct values, however one thing I've noticed is the value given by the ADCs are shifting when I apply 0V or 3.3V to the PA1 pin
Hi, I'm in the process to design a board and an application based on the STM32U5G9ZJT6Q. I plan to disable the SMPS power supply. So I'll put the following pins to ground:- VSSSMPS- VDDSMPS- VLXSMPSI plan to utilize several GPIOs, about 90+. At page 19 of the MCU's datasheet, I read the following: GPIOs (without SMPS / with SMPS) - NA/101 respectively.Does this mean that I need to enable SMPS, in order to have the 101 available GPIOs ? Or can I run them with internal LDO instead, and still have the 101 GPIOs ? (which I'd prefer, for noise reasons). Power consumption is not an issue.Thank you very much in advance !CheersMatteo
Using Zephyr 4.1.99 and the STM32H735G-DK (Zephyr calls it stm32h735g_disco) results in a build failure. Has anyone else seen this or have a solution for it? (.venv) grunzasr@zephDev:~/zephyrApps$ west build -p -d H735_build -b stm32h735g_disco /home/grunzasr/zephyrproject/zephyr/samples/modules/lvgl/demos-- west build: making build dir /home/grunzasr/zephyrApps/H735_build pristine-- west build: generating a build systemLoading Zephyr default modules (Zephyr base).-- Application: /home/grunzasr/zephyrproject/zephyr/samples/modules/lvgl/demos-- CMake version: 3.25.1-- Found Python3: /home/grunzasr/zephyrproject/.venv/bin/python3 (found suitable version "3.11.2", minimum required is "3.10") found components: Interpreter-- Cache files will be written to: /home/grunzasr/.cache/zephyr-- Zephyr version: 4.1.99 (/home/grunzasr/zephyrproject/zephyr)-- Found west (found suitable version "1.3.0", minimum required is "0.14.0")-- Board: stm32h735g_disco, qualifiers: stm32h73
Hi! I am working on a project in which I'd like to use an stm32U0 MCU. It'll be my first time with one of these, and I'm choosing it because my design includes a battery (+charger & fuel gauge), so I'm interested in learning about low-power things. I have a single button on my device. I'd like to fashion a "hold to power on, hold to power off" functionality with this button. I also am using a fuel gauge that has some LEDs that can be triggered by a pushbutton. I'm trying to wrap my head around how to accomplish two things with a single button, and am considering the use of a MOSFET to accomplish this. Here comes my question: I think that to "power off" my device, I want my MCU to enter Shutdown mode. I think that I can then wake it back up by connecting my button to a WKUP pin. But, I'm considering whether this pin is controlled directly by my pushbutton, or by way of a MOSFET. ChatGPT is making a lot of fuss about the 'strict electrical characteristics' of WKUP pins
Hi, i'm working with the SensorTile.box. I installed the ST BLE Classic app and was trying to upload a standard app from Expert View to train the Vibration Monitor. I flashed the V3.4.7 firmware, as this seems to be the stable one from the suggestions, but nothing is working. It keeps failing to upload the app to the device. i was trying to press the "user" button to reset it while the smartphone was looking for the connection. It can find the box, propose to overwrite the file, but after that, i get an error "there is an error loading the App on the board.Please suggest a solution! I'm stuck for several days already.thanks in advance,
Hello,I have problem statement, in which I have to re-Initialize lptimer for different timer value, as per current scenario, I haveClock: 32Khz (LSI)Divisor = 128Period: Any time as per dynamic input. So I want information about how I can safely reset the lptimer and then again re-init for different timer. Here is the reference lptimer code. where/* uint32_t effectiveFreq = 32000/ 128; // 250 Hz uint32_t tickTimeInMS = 1000 / effectiveFreq; // 4 ms*/ #define TICK_TIME_IN_MS 4 void ReInit_LPTIM1(uint32_t timerInMS) { /*lptimer reset block start*/ HAL_LPTIM_IC_Stop_IT(&hlptim1, LPTIM_CHANNEL_1); __HAL_LPTIM_DISABLE(&hlptim1); if (HAL_LPTIM_DeInit(&hlptim1) != HAL_OK) { Error_Handler(); } __HAL_RCC_LPTIM1_FORCE_RESET(); __HAL_RCC_LPTIM1_RELEASE_RESET(); /*lptimer reset block end*/ LPTIM_OC_ConfigTypeDef sConfig1 = {0}; hlptim1.Instance = LPTIM1; hlptim1.Init.Clock.Source = LPTIM_CLOCKSOURCE_APBCLOCK_LPOSC; hlptim1.Init.Clock.Prescaler = LPTIM_PRESCALER_
Hello,I’m working on an embedded project using ThreadX, and I’ve encountered what appears to be a queue memory overflow issue.I’ve created two queues: one for data messages and one for events. Both are configured to hold 100 messages of the following structure:typedef struct { ENGINE_ID origin; ENGINE_ID destination; EVENTS objectEvent; CMDVALUES command; } INTERNAL_QUEUE_OBJECT;All fields are enums or uint32_t values (implicitly 4 bytes each), so the structure size is 16 bytes. However, the compiler optimise it to 4 bytes total.here, I have the queue configuration (everything align with ULONGS):#define QUEUE_SIZE 100 #define QUEUE_MESSAGE_SIZE sizeof(INTERNAL_QUEUE_OBJECT) #define QUEUE_MESSAGE_SIZE_ULONGS ((QUEUE_MESSAGE_SIZE + sizeof(ULONG) - 1) / sizeof(ULONG)) TX_QUEUE dataQueueHandle = {0}; TX_QUEUE eventQueueHandle = {0}; ULONG dataQueueBuffer[QUEUE_SIZE * QUEUE_MESSAGE_SIZE_ULONGS]; ULONG eventQueueBuffer[QUEUE_SIZE * QUEUE_MESSAGE_SIZE_ULONGS]; tx_queue_create(&data
Hello,I'm working on a project using the STM32H735G-DK development board. I'm trying to receive audio data from the on-board digital MEMS PDM microphone (U33) using SAI4 Block A in Master Receive mode. I selected PDM mode in CubeMX and configured SAI4_A as Master Receive. SAI4_CK2 is set as the clock output pin, and SAI4_D1 as the data input. I’m using PLL3P as the clock source for SAI4A, set to 49,152. Middleware PDM2PCM is enabled. I’m currently using HAL_SAI_Receive() (not DMA yet), but BDMA is enabled.When I run the program, the microphone always returns a constant value (like 0xFF), or no data at all.Has anyone successfully used the on-board PDM microphone with SAI4 on this board? What is required to activate the SAI4_CK2 clock and receive valid data? Thanks for the help.
Hi ST team,I'm using the STM32F446 MCU with the STEVAL-IPM15B power board to run a BLDC motor (310 V, 130 W, 8 poles) using Motor Control SDK v6.3.0. I'm trying to determine the exact motor parameters using the Motor Profiler tool through Motor Pilot.The Motor Pilot successfully detects the board and connects, but when I start the profiling process, it stops at 7%. At that point, the motor stalls and begins to overheat, and no profiling results are returned. However, if I do not enable the Motor Profiler checkbox and use a configuration with approximate motor parameters, the motor runs — but I’m unable to operate it reliably at lower speeds (below 1000 RPM), likely due to parameter inaccuracies.I’ve attached a screenshot showing Motor Pilot stuck at 7%. My hardware connections and power supply are verified and stable, and the MCU is confirmed to be compatible with the Motor Profiler.Has anyone encountered this issue before? Any suggestions on how to get past the 7% stall during profili
Hi,I am trying to setup an USB HS CDC example with NUCLEO-H7S3L8.After setting up the projects for both CDC_Standalone and NUCLEO-H7S3L8 board example (for the latter I manually enabled the USB HS Device from CubeMX), I successfully ran each example to run from the external OSPI memory connected to the XSPI2 port.STM32CubeMX standalone version is 6.13.0, while STM32CubeIDE version is 1.17.0.STM32H7RS package version is the STM32Cube_FW_H7RS_V1.1.0.1) I understand that setting up the CDC_Standalone example should result in a working example, but it does not.2) The USPD interface is an TCPP03-M20, the BSP included in the board example (not the CDC_Standalone example) comes with a driver for this device which I understand it is automatically used by quickly looking at the code, but it seems it is not working neither."Not working" means that the USB device is not detected from the PC.So for both cases, the function USBPD_DPM_Run() called into the main while loop hangs the execution of
I am using the OCTSPI1 of STM32L4Q5CGTX to set HYPERRAM to memory-mapped mode.Memory can be read and written correctly.When I use STM32CubeIDE to check the HYPERBUS signals with an oscilloscope while the CPU is stopped with a break during program execution, CS# periodically becomes active, RWDS becomes HIGH during the CA section, and a clock is also output. Why does memory-mapped mode drive the HYPERBUS even when HYPERRAM is not being accessed? Is this a HYPERBUS specification?Can anyone answer this question?Thank you in advance.
Dear All,I am interfacing my STM32U5G9 device with VS1011 audio decoder, over SPI using DMA.My setup mostly works, I can configure the decoder send and receive data from the chip.But over a long period of time (hours of having the device running) I am no longer able to send data and I see that my SPI peripheral is effectively in a stuck state. The registers of the SPI and the DMA in that state are shown below and they are not changing over a reasonable amount of time:SPI1 peripheral configuration:and the SPI registers when the peripheral is stuck:DMA configuration:and the DMA registers when the device is stuck:From what I gather from the manual, at this stage the peripheral has 2 packets that it's supposed to send (DMA CBR1 register) and there is nothing happening based on the CSR register, is this correct?Is there a specific issue revealed by the values of the registers?Is there something that can be done configuration wise to avoid this issue?Is there anything that can be done at run
Hi, I was trying to implement timer interrupt on an ST32F407 Discovery board. The ST-Link on my board has been broken so I used an external ST-Link dongle and I have it connected by following this post:https://electronics.stackexchange.com/questions/182763/how-to-use-an-external-st-link-v2-with-the-stm32f4-discovery-board I set up the timer so it will trigger interrupt once every 1s, but when I upload the code it does not go into interrupt. Only when I debug and put a break point in the callback function that it can execute the interrupt.Here is a link to my code:https://github.com/datcamap/DISCOVERYstm32.git Callback function
I've inherited some code, the original owner is long gone, and I'm trying to understand his code which has ZERO comments (I'm sure I'm not the only person who's been in this position)It's using the STM32H747IGT6 so it's dual core, got one M4 and one M7 core. They are using SRAM2 to communicate, but he's got it set up so the M4 (which is generating the data) writes a single uint32 of data into one location in SRAM2 and then triggers the MDMA to move it to another location in SRAM2 where the M7 can pick it up.I haven't worked with a dual-core STM32 before, but this feels like overkill. If both cores can read & write SRAM2, why bother with the MDMA? Why not just have the M4 write the data directly to where the M7 will be looking for it and skip the MDMA completely?And why is he setting the destination bus to AXI (and leaving the source bus at is default of AXI) when the system architecture diagram shows SRAM2 as being in the AHB bus matrix? I'm thinking th
Hi All, I am looking for a small 4-5 digit monochrome display to use with STM32L0 series in a coin cell powered application. Actually the display I am searching is similar to the ones used in kids watch or small temperature or humidity meters. I only need to display time or a 3 digit counter. I prefer to have wires or pins instead of the glass display with conducting rubber alignment and the length of the display should be less than 3cm. It is really hard to find even how to search for this display. It would be really great if someone can help with this. Attaching an image as an example. Thanks in advance,Best regards
I want to measure ADC on multiple pins. I don't need DMA, just measure PA0 then measure PA2. Measuring PA0 works, but when I switch the channel to 2 it still measures from PA0:In my main loop I do this: // Configure channel ADC_ChannelConfTypeDef sConfig = {0}; sConfig.Channel = ADC_CHANNEL_2; sConfig.Rank = ADC_RANK_CHANNEL_NUMBER; if (HAL_ADC_ConfigChannel(&hadc, &sConfig) != HAL_OK) { return 0; } // Read one ADC value HAL_ADC_Start(&hadc); HAL_ADC_PollForConversion(&hadc, HAL_MAX_DELAY); uint32_t adcValue = HAL_ADC_GetValue(&hadc); HAL_ADC_Stop(&hadc);For rank I tried 0, 1, 2, ADC_RANK_CHANNEL_NUMBER. Still only measures PA0 not PA2.Here is my MX_ADC_Init static void MX_ADC_Init(void){ ADC_ChannelConfTypeDef sConfig = {0}; hadc.Instance = ADC1; hadc.Init.OversamplingMode = DISABLE; hadc.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV1; hadc.Ini
I want to know what the C library in the GCC toolchain used by STM32 MCUs
I'm a starter in embeded systems and my teacher told me to write a code for this stm32 and add a button to in on breadboard then it needs to toggle with it ( one push on button turn on the light r5 or pc13 and another push to same button turns off the same led ) I'm sure its a easy task to do but as a person don't knows anything about writing a code or work with embeded systems i couldn't find it anywhere i hope someone can help me with that (also i bought a udemy course too but it starts all started its good to learn but i need to do this in hurry. I've been working on it like 2 or 3 days and how fast im complete how good its going) Thanks All Of You !!!
Hello,We want to use the STM Crypto Library " X-CUBE-CRYPTOLIB" for a project at our company. Since we will only be using a portion of it, the question arises whether it is possible to customize the static ".a" file ourselves (to make it smaller) or to provide a customized one from STM. The reason is that the memory on the microcontroller is very limited, so saving a few kilobytes would be very helpful.We look forward to your feedback.Kind regards,Rojeda
I was using Nucleo-h563zi board in which my application was to run it using external power source so for that i shifted the jumper to E5V to power the board usign external 5V. I was using AMS1117 voltage regulator to convert it to 5V from 12V but accidentaly due to failure or it 12V was given to E5V pin after the LD4 and LD6 led is red and the LD5 is not turning on as usual when the jumper is shifted to STLK for programming.After this when i try to program by changing the jumper to STLK it is detected but while uploading it is showing "No stlink device found"i found that the 5V,3.3V is shot circuited. what is the possible reason and how to repair it.Can you please suggest some way to repair it.
Hello, the problem here is that SPI works :) I am successfully using SPI on my STM32H743 MCU for many years now.Now I encountered the problem with the same code, the same configuration of SPI but the difference is that the slave SPI chip is not there ( a new module with the same chip is not yet assembled). I am running the same code to debug something else , yet this SPI communication returns HAL_OK ! No timeout!I never had this before ('cause I always had my slave chip connected) . The HAL_SPI_TransmitReceive() function of SPI library still returns HAL_OK :)Here is a fragment of my code (SPI configured duplex master, data 16-bit, FIFO =1, speed 1.875 MBits/s, software driving CS) :Spi4NSSEn; // chip select enabled// addr_cmd[] provides 2 addresses for 2 channels of ADC converter// pots_bin is a buffer for the ADC result in 0-256 range of POT sweepif(HAL_SPI_TransmitReceive(&pots_hspi, (uint8_t *)addr_cmd, (uint8_t *)pots_bin, 2, 5000) != HAL_OK ) // transmit and receive 2 dat
ST Community highlights – April to June 2026
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.