Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
Hi,I am using the application core of the STM32WB55VGY6 (not the radio core). I created a CubeMX project and added a simple HAL_GPIO_TogglePin() call. Literally just 2 lines of code in the entire project.When I use a for loop as a delay, the code works as expected. However, when I use HAL_Delay(), it does not.For some reason the SysTick_Handler() is never called... I’ve attached the full project, including the .ioc file. The application code itself is minimal (only two lines).From the configuration:The timebase source is set to SysTickInterrupts are enabledThe SysTick_Handler() is generated, but it is never triggeredHas anyone encountered this on the STM32WB application core, or have any suggestions on what might be missing or misconfigured?Thanks.
Board: NUCLEO-N657X0-Q, revision CI'm trying to communicate with an I2C sensor (VL53L7CX) using the I3C1 peripheral. I have written small routines to try this out based on this tutorial (chapter 9.10.). The problem is: no signal appears on the data pins (measured by an oscilloscope). Not even the slave address. They seem completely dormant.I have tried the "I3C Direct Command DMA" example project on the board. I don't have I3C devices, but measurement yielded digital signal waveforms, as expected. This confirms that the peripheral is in fact operational.What have I missed in my code or hardware setup? Any help is appreciated! Thank you!(I attached the mixed bus code and the .ioc file)
I am using stm32l552zetxq. I am testing standbymode with wakeup from event. According to reference manual RM0438, there are 5 wake up pin to wake up the mcu from standby/shutdown mode wkup1 to 5 with polarity setting option in PWR_CR3 and PWR_CR4. But i could not find whic are those 5 pins in datasheet and in reference manual. By searching i find that PA0,PC13,PE6,PA2,PC5 in a documents ""en.STM32L5-System-Power_control_PWR.pdf" in page no 40. Now my question is what is the wkup no of which pin. It should be mentioned either in data sheet or in reference manual. It be very help full to me kindly provide the document with page no or article number and te documents.
Hi,I would appreciate any guidance or best practices for minimizing code size by eliminating unused functions when using the STM32 extension for VS Code with CubeMX generated code (bare metal) as some code I'm writing has become very large.What is the recommended way to configure the compile/build process so that unused functions are not compiled or linked into the final image flashed to the microcontroller, in order to save flash space?I am not familiar with CMake, so if this can be achieved without using CMake, that would be preferred.If custom configuration text is required (for example Makefile edits or similar), could you please outline them in detail and whether these changes are generally safe, or if they require careful consideration.Any clarification on the recommended approach would be greatly appreciated.Thank you
Hi,I am using a STM32C031G6U6 and I would appreciate some clarification regarding HAL timebase and SysTick timebase selection.I want to use SysTick as a 1ms interrupt so in CubeMX I selected SysTick as timebase (see screenshot): None of the other timers - including TIM3 - are not enabled as shown here: These are the other settings: I then generated the code. But there is no sign of any SysTick related functions/handlers in the interrupt file stm32c0xx_it.c as you can see here: /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file stm32c0xx_it.c * @brief Interrupt Service Routines. ****************************************************************************** * @attention * * Copyright (c) 2026 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. * I
Dear all,I'm trying to generate a waveform using DAC OUT1.I configured pin PA4 as analog (works)I configured DAC1 without DMA and it worksI configured TIM6 and it works Then I configured DAC with DMA, configured DMA, but output never changes.Where can I check? I enclose the minimun configuration code: /* DAC Configuration */ if(!(RCC->APB1ENR & RCC_APB1ENR_DAC1EN)) RCC->APB1ENR |= RCC_APB1ENR_DAC1EN; // Enable DAC clock DAC1->CR |= DAC_CR_DMAEN1 | DAC_CR_MAMP1_3 | DAC_CR_EN1; // DMA1 enable | Amplitude 511 |Wave generation disabled | Timer6 TRGO event | Trigger enable | Buffer enable | DAC1_OUT1 enable /* DAC Timer */ if(!(RCC->APB1ENR & RCC_APB1ENR_TIM6EN)) RCC->APB1ENR |= RCC_APB1ENR_TIM6EN; // Enable TIM6 clock TIM6->CR2 |= TIM_CR2_MMS_2; // The update event is selected as a trigger output (TRGO). TIM6->DIER |= TIM_DIER_UIE | TIM_DIER_UDE; //Enable interrupt | Enable DMA request TIM6->EGR = TIM_EGR_UG; // Re-initializes the timer coun
Hello,I may have made a *** of myself on a prototype, and need a bit of help with a work-around. I have an external clock signal on TIM20_ETR (PG5) for some pulse counting stuff. This works.However, I intended to use the same clock signal to trigger TIM2 one-pulse (and later TIM5 one-pulse as well), and thought that I could use tim_trgo from TIM20 to clock them. My problem is that, now I have the prototype PCBs in hand, I cannot figure out how to pass the TIM20_ETR clock signal on to tim_trgo – or if it is even possible.My best guess is that I can set TIM20_CR2 MMS to 0010 (Update), and set PSC and ARR to 0. I have already set TIM20_SMCR to use TIM20_ETR as the trigger source. If I understand the timer functionality correctly, this should give me an update event for each clock pulse.This work-around will make me lose the TIM20 counter feature, but if I can just get the external trigger signal out on tim_trgo, then I can use that to clock TIM1 or TIM8, which can then be used for the act
Starting with the BLE_Heartrate example, I want to measure a voltage on PA8 of STM32WBA65. The BLE_Heartrate project already has the option of using ADCCTRL to read the internal temperature so as to calibrate the BLE power.I have added PA8 as ADC_Channel1 in CubeMX. Do I need to call MX_ADC4_Init or not?How do I achieve a read of PA8 in my timed task? The call to ADCCTRL_RequestRawValue always returns without error, but the value read is always 1 or 2. There is definitely 1.0v on this pin.My code (copied from the temp_measurement.c of WPAN) is:static ADCCTRL_Handle_t LLADCRequest_Handle = { .Uid = 0x00, .State = ADCCTRL_HANDLE_NOT_REG, .InitConf = { .ConvParams = { .TriggerFrequencyMode = LL_ADC_TRIGGER_FREQ_LOW, .Resolution = LL_ADC_RESOLUTION_12B, .DataAlign = LL_ADC_DATA_ALIGN_RIGHT, .TriggerStart = LL_ADC_REG_TRIG_SOFTWARE, .TriggerEdge = LL_ADC_REG_TRIG_EXT_RISING, .ConversionMode = LL_ADC_REG_CONV_SINGLE, .DmaTransfer = LL_ADC_REG_DMA_TRANSFER_NONE, .Overrun =
Hi,i am using STM32G0B1KB and the UCPD peripherals to implement an USB-PD device with 2 ports:- Port 1 is DRP- Port 2 is Source onlyI need the dead battery pulldowns for port 1, so I will connect the UCPD1_DBCCx pins with the UCPD1_CCx pins as described in the manual. However, for port 2 I don't need to present the dead battery pull-downs - when the MCU is unpowered (dead battery) and the user connects some other device (e.g. smartphone) to port 2, simply nothing should happen. The manual states:> If dead battery behavior is not required (for example for source only products), then UCPDx_DBCC1 and UCPDx_DBCC2 pins must both be tied to ground.What resistance can be used to connect those pins to ground? Since I don't have any pins left, can I instead use the DBCC pins for something entirely different? E.g. connect LEDs (to GND) or some other digital output with a weak external pull-down resistor (e.g. 10kOhm)? Will this prevent the MCU from enabling the pull-downs?Thanks!
Board: NUCLEO-N657X0-QRevision: CProblem: MCU cannot pull PA2 to low, only to about 2.5V. I tried it in push-pull and open drain modes. SB6 has been desoldered to isolate it from the analog attenuation circuit, but it didn't work with it soldered. It doesn't work with the "GPIO_IOToggle" example project either, same behaviour. Pulling the pin up to 3V3 works just fine. PA2 is the pin so far which has caused this issue. Holding the reset button makes the pin go high (3V3), indicating a hardware issue, as far as I know. My best guess is it is somehow pulled up through a pull up resistor, but I haven't found any evidence of it in the documentation.I attached some documentation which I investigated.Any help is appreciated, thank you!
I’m working on an STM32 project that uses the ADC to read sensor voltages. However, I’ve noticed inconsistent readings—sometimes fluctuating even when the input voltage is stable. I’ve tried adjusting the sampling time and using different reference voltages, but the problem persists.Has anyone encountered similar ADC accuracy issues on STM32? Are there best practices for minimizing noise or improving stability in these readings? Any guidance or examples would be really helpful.
Hello, hope everyone is well. I'm working on the software side for a micro mouse bot. We're planning on using the STM32G070RB for the microcontroller. For prototyping, I'm using the NUCLEO-G070RB. I separated the ST Link from the board, and wired the two together, as shown below (source and the schematic:( And here's the schematic below: When I flash a program (I use openOCD, but I've also tried STM32CubeIDE), it works until I unplug the ST-Link, then it doesn't seem to work until I plug it back in. Any advice? Am I missing an additional connection? To clarify, the Arduino powers the Nucleo board.
Hey team,I am working on a project using the STM32F103CB MCU. The device operates from both USB and battery power. The battery configuration consists of four 1.5 V alkaline cells arranged as 2S2P, providing a nominal 3 V supply. USB power is provided at 5 V.When both power sources are connected simultaneously, the PCB is designed to prioritise USB power. However, when the USB cable is unplugged while the battery remains connected, the MCU core resets and the LCD connected to the PCB hangs, resulting in no further operation.I am using the Arduino IDE for development. During debugging, I observed that the setup() function executes when the USB is unplugged, confirming that a reset occurs even though the battery supply is present. This indicates that the USB-to-battery transition is causing a reset condition rather than a seamless power handover.I monitored the MCU supply voltage (VDD) during the USB disconnect event. Initially, the voltage dropped to around 2.0 V. After addin
Hello STM Community,I'm facing an issue with my STM32 device on Windows 11. The Virtual COM Port (VCP) driver is not working, and in the Device Manager, the device is shown as:Unknown USB Device (Device Descriptor Request Failed)Here are the details:Device: own boardTroubleshooting Steps Tried:Uninstalled the STM VCP driver and restarted my PC.Reinstalled the VCP driver from the official STM website.Used a different USB cable and port (all working with other devices).Verified USB settings in the BIOS.Checked Windows Updates for driver compatibility issues.Despite these efforts, the problem persists.Has anyone else encountered this issue with Windows 11? Are there any additional steps or settings I need to configure to resolve this?Thank you for your assistance!Best regards,A.Sujith
Im using i2c on stm32 nucleo and the slave is a cheap imu (mpu6500). Sometimes the bus just gets stuck and doesnt work. And the weird thing is if i plug everything out, flash code again and run it it will not work. Until it randomly works again until the next random fail. I tried with various setups, with pull ups from stm32, with external 5k pull ups.Initially i was running bare metal code but i thought something is worng with the code and switched to HAL to do simple read or write. Everything is the same, randomly works and doesn't work.Did anyone experience and solve something similar?
Hi everyone, I am working with the STM32-NUCLEO-WL55JC2 board and I want to transmit ADC values over LoRa radio. Since this is a dual-core MCU (Cortex-M4 + Cortex-M0+), I would like to clarify the recommended implementation approach. My goal is: Read analog data using ADC Send the ADC values via LoRa communication Possibly use the dual-core architecture efficiently My questions are: Is it recommended to run the ADC acquisition on the M4 core and the LoRa/Sub-GHz radio stack on the M0+ core? What is the best method for sharing ADC data between the two cores (IPCC, shared RAM, mailbox, etc.)? Are there any reference examples in STM32CubeWL that demonstrate a similar workflow (sensor data → radio transmission). Are there configuration considerations in STM32CubeMX/IDE when enabling ADC together with the radio stack? Any guidance, documentation references, or best practices would be greatly appreciated. Thank you!
Hello,I have an STM32G441 and using DMA to transmit some SPI data. All works so far. The problem is the chipselect. I am using the software chipselect. So before I start the DMA I pull CS low. Then when the DMA complete interrupt fires I pull it high again. The problem is, it cuts off about 3 or 4 bytes. This is obvious because the DMA is done while there is still SPI data in the buffer. What is the go-to solution for this? How can I reliably get an interrupt when the DMA is done and the SPI is done transmitting all data? At the moment I simply start a timer when the DMA is done that triggers a second interrupt after a certain time that I measure with a logic analyzer. Seems a bit makeshift and has to be adjusted each time the baudrate is changed. I also noticed that all the SPI interrupts fire premature. So is it the only solution to waste a timer on the SPI?
Hi,How to set UID using CubeMX and read in STM32L476 and use it for device commissioning process?
I am currently using an STM32L011F4U6 to communicate with some other chips and it is failing to pull either I2C line down to GND fully when signalling, they are seemingly clamped to approximately 1.2V at a minimum as shown below making it impossible to communicate with my I2C devices which need the I2C lines to drop below 0.5 V to register a low state. Is this something anyone else has dealt with?I2C waveforms with 10k pullups at Normal Mode speedsI am using PA9 for SCL, PA10 for SDA, using the I2C1 peripheral.In the photograph above I am using 10 kOhm resistors for pullups and the speed is Normal Mode. I am targeting Fast Mode speeds and use 2 kOhm resistors in the original circuit but I changed both to see if they had any effect - which they did not. The issue is the same in fast mode with the stronger pullups.I have probed the circuit with a ammeter to verify the required sink current is within the expected range. With the 2 kOhm resistors the current sank to pull down to 0 V w
Hello,I am currently reviewing a hardware design based on the STM32H563ZIT6 and have some questions regarding the internal and external behavior of the NRST pin.My main question is how the NRST pin operates specifically during an NVIC_SystemReset.Currently, we are using an external pull-up resistor (connected to 3.3V) on the NRST pin.According to the Datasheet (DS) and Reference Manual (RM), I confirmed that the NRST pin has an internal weak pull-up (RPU), which is typically 40 kΩ.Although the Datasheet and Reference manual do not explicitly disclose the internal circuit diagram of the NRST pin used during NVIC_SystemReset, I found information in the community stating that NRST internally has an "Open-drain" structure.link : https://community.st.com/t5/stm32-mcus/why-my-stm32-doesn-t-start/ta-p/49367 Therefore, I assume the circuit topology is as follows:Rpu: STM32 internal weak pull-up (typically 40 kΩ)Rnrst: The external pull-up resistor we attached (currently 10 kΩ)Vnrst:
Hi.I created code and flash memory that is already 80% used. Is that okay? Will it affect performance?Thank you:)
Is there a board schematic for STM32L432KC somewhere?I want to acces pin PA13. But I can find no connector or easy acces point.Thanks
In STM32Cube_FW_H7RS_V1.3.0, file Projects/STM32H7S78-DK/Applications/ROT/STiROT_iLoader/STM32CubeIDE/prebuild.bat:As currently written, it fails in a couple of places. Here are the changes necessary for it to run:(The system won't let me upload the edited batch file.)
I am attempting to make a previously developed design run with Trustzone enabled. I have been unable to get the HSPI1 PSRAM to function.I've set the peripheral's GTZC's attributes to NSEC|NPRIV.I've set the appropriate GPIO pins' attributes to NSEC.I've set the MPCWM Config to consider the memory as NSEC|NPRIVI've set the appropriate/associated DMA channels as NSEC|NPRIV.None of these seem to have any effect. The Initialization code hangs/timesout in:BSP_HSPI_RAM_Config16BitsOctalRAM in stm32u5a9j_discovery_hspi.c.RCC->AHB2ENR2 shows the HSPI clock enabled.Can anyone point to a minimal working example of using the AP512 on the STM32u5A9J-DK with trustzone enabled?
I am working on a BLDC motor 6-step (trapezoidal) control using a NUCLEO-G474RE controller board and NUCLEO-IHM07M1 (L6230) power board with a 48V supply.Below is my phase activation for one commutation step: __HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_1, curr_duty);__HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_2, 0);__HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_3, 0);HAL_GPIO_WritePin(GPIOC, GPIO_PIN_10, SET); // UL EnableHAL_GPIO_WritePin(GPIOC, GPIO_PIN_11, SET); // VL EnableHAL_GPIO_WritePin(GPIOC, GPIO_PIN_12, RESET); // WL DisableProblemThe L6230 gate driver IC overheats quickly, even though I am running only an open-loop 6-step sequence.My ParametersSwitching frequency: 9 kHz (tested from 8 kHz up to 50 kHz)PWM duty cycle: ramping from 10% → 40%Step duration: ramping down from 60 ms → 20 msWhat I Have TriedChanging commutation step duration (15 ms → 60 ms)Slower and faster duty-cycle rampChanging PWM switching frequencyVerified PWM compare values and GPIO logic for each s
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.