Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
Hi everybody,I read 15 analog channels with DMA on my STM32f446. It works very well (It's tiggrered by TIM3 every 200ms).So I'd like to add Vbat. First, I've added it as the 16th channel of DMA, it works, but I saw the battery voltage decreases (around 0.05V in two hours), so I think I read it too often.So I'd like to read it periodically (every minute for example).I'm trying to read my 15 first channels with DMA and then a classic read for Vbat, but the value is always wrong (around 560 instead of 1000).Is it possible to do that (two different means to read ADC) ?Thank you,
Hi!My application requires NIST-compliant random number generation, and I see some unclear/contradicting info on the Reference Manual, the AN4230 application note, and the public NIST certificate. My MCU is STM32H563ZI.- Reference Manual: https://www.st.com/resource/en/reference_manual/rm0481-stm32h52333xx-stm32h56263xx-and-stm32h573xx-armbased-32bit-mcus-stmicroelectronics.pdf- AN4230: https://www.st.com/resource/en/application_note/an4230-introduction-to-random-number-generation-validation-using-the-nist-statistical-test-suite-for-stm32-mcus-and-mpus-stmicroelectronics.pdf- Public NIST certificate E163: https://csrc.nist.gov/CSRC/media/projects/cryptographic-module-validation-program/documents/entropy/E163_PublicUse.pdf Confusing/contradicting info:- E163 gives a RNG_CR of 0x08F01EXX, but AN4230 says value should be 0x00F01E00 (note difference in bit 27). Also, manual says bit 27 "must be kept at reset value.".- Reset values on the manual do not match my
Dear all,I have been modifying the VENC_SDCard_ThreadX example and wanted to start some activity based on the user button, triggered by interrupt using the usual HAL + BSP helpers to init the gpio, and registering a handler function for falling flanks.So I tried BSP_PB_Init(BUTTON_USER1, BUTTON_MODE_EXTI);and implemented BSP_PB_Callback(). Symptom: Hitting the button turned the program to be stuck in some unrelated irqhandler (debugger name-clash -- the defaulthandler triggered), the callback has not been triggered.I had a look at the BSP implementationn and retried the same with HAL functions, same effect, this code in BSP_PB_Init() sparked my interest: (void)HAL_EXTI_GetHandle(&hpb_exti[Button], BUTTON_EXTI_LINE[Button]); (void)HAL_EXTI_RegisterCallback(&hpb_exti[Button], HAL_EXTI_COMMON_CB_ID, ButtonCallback[Button]);which registers a callback, and further down the line in stm32n6xx-hal-driver-exti.c there is an HAL_EXTI_IRQHandler implementation which
Hi ST team,I am seeing what appears to be a silicon-level issue on STM32H563RGV6, revision X, related to the SWAP_BANK option byte.When SWAP_BANK is enabled, a USB OUT endpoint stops being re-armed during a flash mass erase of the inactive bank. The USB ISR still executes, but the BULK OUT path wedges because the OUT endpoint is no longer re-armed. Once the mass erase completes, the endpoint behavior returns to normal.Key observations:MCU: STM32H563RGV6Revision: XThe issue is specifically tied to SWAP_BANK being setThe problem occurs during mass erase of the inactive bankThe symptom is specifically USB OUT not being re-armedThis does not look like a total USB interrupt loss; ISR activity can still occurOther endpoint activity is not affected in the same wayThe entire application, including vector table and read-only data used by the relevant path, is relocated to SRAMBank selection / inactive-bank arithmetic has been verified and is correctThis does not appear to be a normal software i
Hi, I have an stm32g473 which use the clock of another system as external clock on PF0 / OSC_IN. This clock is them multiplied by 74 through the PLL. I need to synchronize my code with the external clock (i.e. wait for it to rise). What is the simplest way to do this? Can I use PF0 both as OSC_IN and as an GPIO in input mode to generate an event on the rising edge? or should I root the clock to both OSC_IN and another GPIO? Are there other possibilities did not find in the reference manual (e.g. using the HSE as a trigger to one of the timer or an event I could WFE on ?)Thanks.
Hi all, I am currently working with the STM32WLE5JC for a LoRa/LoRaWAN-based IoT node and would like to clarify some points regarding LoRa FHSS and LR-FHSS support. From several discussions in the STMicroelectronics Community, I noted the following statements from ST employees and contributors: “There is no way to activate the frequency hopping as the LoRa stack does not offer this feature on the STM32WL.” “After further investigation, it appears that the Semtech SX1262 does not support LoRa FHSS, (but supports for LR FHSS). This is a hardware limitation rather than a driver limitation.” “There is no reference to LoRa FHSS in the driver code or documentation.” It is also understood that: Semtech SX1262 RF IP (which the STM32WLE5 is based on) does not support LoRa FHSS from a hardware perspective Based on this, my understanding is that: :backhand_index_pointing_right: STM32WLE5JC does not support LoRa FHSS However, I would like clarification on the following: 1. LoRa FHSS Support C
I was wondering if there is any possibility to change the NCS from NCS1_port2 to NCS2_port2 using the OTP registers on the STM32N6.I checked the registers but couldn’t find any option to adjust this. Maybe its not possible. Just to confirm my understanding:The default setting for ROM boot is XSPI1 using XSPIM_Port_2, and NCS1 is "required" by the ROM boot code to correctly load the FSBL via LoadAndRun. https://community.st.com/t5/stm32-mcus-products/stm32n6-it-s-possible-to-change-xspi2-to-xspi1-for-boot-using/m-p/847884/highlight/true#M287378 Kind regards,Zimmeri
Greetings Everybody, Since few months i have been trying my hands on RAK3172. I have successfully implemented ADC, UART/USART and I2C on RAK but without SUBGHZ and everything is working fine. I have also made my custom code for RAK3172 SUBGHZ and it is also working fine. I have established communication with two RAK3172 modules and they are communicating with each other as on successful data transfer between the two i am toggling LED connected to one of the GPIOs. Now problem comes when i am enabling UART/USART and SUBGHZ code. On startup i am sending 64 bytes of data out on UART/USART connected to USB to TTL converter. On every power ON i am trying to find 64 bytes of data on terminal but without any successs. Is there anything that i am doing wrong ?
I am currently using the STM32H735G-DK.While white and red seem to display correctly, black(0x0000) appears as a dark purple when rendered. Even when displaying textures, there is a slight purple tint mixed in throughout the image.I am writing to the framebuffer in RGB565 mode, and the LCD is reading directly from it. What could be causing this color distortion?
Dear ST,The STM32H5 overview page seems to display the wrong number(1) of CANFD controllers for STM32H5E4 in the line comparison table. The datasheet says it's 3, like for all the others in the STM32H5E/F lines.Also, I couldn't find anything in the errata sheet about non usable CAN instances.
Hello Forum,I want to use a Nucleo 64 STM32F401 Board to test I2C connection with an unknown master (reverse engineering).The Bus consits of 1 Master (unknown Controller) an 1 Slave (My STM32F40). The Master sends out a Read Request at Addr. 5 and the Slave should respond with 3 Bytes. I've connected the I2C Bus to PB6/PB7 of the Nucleo Board. On Softwareside I Initialized with bare metal Code, see attachment.I my setup a I2C Master sends out a Adress byte with read request to address 5, but my Controller doesn't do a thing at all. I would expect at least an ACK Bit, but nothing can be monitored.From the Signal capture the bus looks fine for me, but in which mode do I need to configure the stm32 slave? Is this standard mode or fast mode. Is the clock speed of any concern in this case (slave)? How to config the CCR and TRISE register in this case.The Port seems to be configured correct, the IDR of GPIOB detects a "1" on PB6/PB7.In my example I've also enabled interrupts, but
Hello,We programmed our STM32L011 microcontroller with firmware that enters STOP mode and waits for an interrupt.However, we accidentally disabled the interrupt on the PA4 line. As a result, the device now immediately enters STOP mode, and we are unable to reprogram it.Could you please advise how we can recover the device in this situation?Thank you in advance.
Hello!We are using an STM32L0 microcontroller as a power switch.The device works correctly when the firmware is started from STM32CubeIDE using the Run command.However, if we switch the power supply off and then back on, the STM32L0 does not boot.We suspect there may be an issue related to the reset circuit.Please see the attached schematic. The relevant device is U6.Could you please advise?Thank you in advance.
Hello world!I want to move a motor with serial commands. I use the stm32g051 PWM and a DC motor. And for the sake of lower consumption of energy and cpu I use a dma in circular mode. And of course I want to change the pwm from time to time. But somehow, there is always a delay of more than 10 seconds between the calling of the function and the change in the motor behaviour. mid_error_t tim_forward_buffers(void) { for (uint16_t i=0; i<PWM_BUF_LEN; i++){ pwm_ch1[i] = (uint32_t)(param.speed * (htim2.Init.Period-2))/ MAX_SPEED; //pwm_ch1[i] = 0; // htim2.Init.Period; pwm_ch2[i] = 0; } __HAL_TIM_SET_COMPARE(&htim2, TIM_CHANNEL_1, pwm_ch1[0]); __HAL_TIM_SET_COMPARE(&htim2, TIM_CHANNEL_2, pwm_ch2[0]); return MID_ERROR_OK; }You may guess that the PWM_BUF_LEN is too big... There is just one element in pwm_ch1 and pwm_ch2. What may cause this problem? I use the __HAL_TIM_SET_COMPARE to change the pwm faster and the pwm_ch1 pwm_ch2 just contain one elem
Hello, i found a bug in the code generated by the Motor Control Workbench usign the 6-step algorithm. Even with Open Loop mode enabled, the code is still using the PID for the initial duty cycle computation (state CHARGE_BOOT_CAP in the TSK_MediumFrequencyTaskM1()). If the PID isn't set up right and starts with a low duty cycle, the motor won't turn. This means the Hall sensors don't trigger, the duty cycle never updating, and the motor just sits there even if you set a high duty cycle value. The Open Loop mode shall bypass the PID controller, otherwise it is useless. I fixed it by changing row 174 of mc_tasks_sixstep.c as follows: from: MCI_ExecBufferedCommands(&Mci[M1]); /* Exec the speed ramp after changing of the speed sensor */ to: if (SDC_GetOpenLoopFlag(pOLS[M1])) { SDC_SetControlMode(pSDC[M1], MCM_DUTY_MODE); } else { MCI_ExecBufferedCommands(&Mci[M1]); /* Exec the speed ramp after changing of the speed sensor */ } Leo Edited to apply source code formatti
Hi i am getting this error while opening motor pilot for gui in motor control,pls go throgh below attached file.
I recently built a motion-control setup using an STM32 MCU to drive a NEMA 23 stepper via a DM542 driver. STM32 timers reliably generate step pulses while DMA reduces CPU load, enabling smooth microstepping and precise speed control. Key tips: match driver current to motor specs, use a 24–48V stiff supply, keep motor and logic wiring separate, and provide cooling for the driver. Implement trapezoidal acceleration to avoid missed steps and add homing/limit switches for safety. For multi-axis systems, synchronize timers or use an RTOS for higher-level planning. Happy to share sample timer code or a parts list on request.
Hi,I am testing PD11 on an STM32H563ZI with a NUCLEO-H563ZI board.The pin is configured as plain GPIO input using STM32 HAL:GPIO_InitStruct.Pin = GPIO_PIN_11; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; GPIO_InitStruct.Pull = GPIO_PULLUP; // or GPIO_PULLDOWN / GPIO_NOPULL HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);I rebuild and reflash the firmware for each case, then read the pin with HAL_GPIO_ReadPin(GPIOD, GPIO_PIN_11).What I observe is:GPIO_MODE_INPUT + GPIO_PULLUP -> LOWGPIO_MODE_INPUT + GPIO_PULLDOWN -> HIGHGPIO_MODE_INPUT + GPIO_NOPULL -> LOWI also checked the pin with a multimeter, and the measured pin level matches what the MCU reads.I have rebuilt and reflashed multiple times and I keep getting the same pattern.My expectation was that a floating input with internal pull-up should read HIGH, and with internal pull-down should read LOW.Is there anything special about PD11 on NUCLEO-H563ZI / STM
Using STM32CQubeCLT 1.20's libnano:I am trying to print an uint64_t using inttypes.h via an vsnprintf(line, sizeof(line), fmt, ap) wrapper and the sending the line via UART to a Terminal.However, using print_wrapped("%" PRIu64"\n", (uint64_t)1) gives only an output of "lu\n".I know that for floating point support I need to add -u _printf_float to the linker options. Is there something similar for 64bit integers? Or do I have to compile my own version of libnano?
Hi ST Community,I create LBPAM application which continuously convert ADC4 data channel 22 (PC4) of STM32U575 VGTX.I add HAL_DBGMCU_EnableDBGStopMode(); so I can debug in stop mode. I run LPTIM1 and ADC4 before going to STOP mode. I also move VoltageData buffer to SRAM4 uint16_t VoltageData[32] __attribute__((section(".sram4")));LPBAM configuration contains one queue in Circular mode and only one node for ADC4 conversion.After enter stop mode 2, no adc4 trigger, and VoltageData always is 0.I attach my configuration so you guy can check it.Thank you.
Background: I am designing a high-speed imaging system for an industrial press. I am using an STM32 to synchronize a camera (TIM3) and two flashes (TIM4) based on an external hardware trigger.The Setup:Both timers are in One-Pulse Mode (OPM) and Combined Reset + Trigger Mode (SMS = 1000).Both are triggered by the exact same physical edge using HAL_TIMEx_RemapConfig(&htim4, TIM_TIM4_ETR_TIM3_ETR)The digital filter is set to 16 µs for both (ClockDivision = DIV4, TriggerFilter = 0xf).The Goal: When a valid trigger arrives, both timers start automatically. TIM3 fires its pulse almost immediately. TIM4 counts down a configurable delay (via CCR) before firing the flashes.To prevent mechanical double-triggers from the sensor, I need a firmware "blind window." Once the initial valid trigger is received, I want to completely ignore the ETRF pin for a few milliseconds.The Catch: I want to disable the ETR input from inside TIM3's HAL_TIM_PWM_PulseFinishedCallback (which fires right after the
Hello!I was working on a project of mine and put it on pause for a few weeks and now when I tried to connect the stlink to my PC its no longer detected. Its not showing up in the device manager and the stlink has dim red and green lights lit.Does this mean that it's somehow bricked? What could have caused it?I tried it on two of my computers and with 3 different cables. I am assuming it's a different problem from this one https://community.st.com/t5/stm32-mcus/how-to-solve-connection-errors-when-connecting-and-programming/tac-p/786977 .Thanks in advance!
Hi all,I'm planning to get STM32H573I-DK to evaluate X-CUBE-AUDIO-KIT Livetune because there are project examples for specific boards and this is one of them. I'll be using an STM32U5A9 MCU eventually and both have an M33 core. This should make it easier to port from one to the other. I see that there are two versions of STM32H573I-DK: MB1677-H573I-D01 Board schematic has a WM8904 audio codec and MB1677-H573I-C02 Board schematic has a CS42L51 audio codec. This last one is marked as "Discontinued Product" by the manufacturer.Do the examples for STM32H573I-DK work for either version of the board without any modification or does it require a specific version/codec?Thanks.
I'm looking at Rev 9 of the STM32L412xxx Datasheet, as linked on Digikey, and I'm having a hard time understanding the current consumption figures specified for the Low-power Run & Low-power Sleep modes on the MCU. Per the table on pg.24 (shown below), the current draw is 83uA/MHz in LPRun mode, which is higher even than the normal Run mode up to 26MHz (range2), which doesn't make sense to me. Further, the current draw in LPSleep mode is also 83uA/MHz, which suggests there's no power savings putting the MCU to sleep in Low-power mode? Can somebody tell me what I'm missing here, or is this a typo and one or both of those figures are wrong?
hello,I encountered a problem while developing for stm32u585.I change the iwdg reload value by HAL_IWDG_Init(), and then HAL_PWR_EnterSTANDBYMode(), but the new reload value does not take effect: hiwdg.Instance = IWDG; hiwdg.Init.Prescaler = IWDG_PRESCALER_64; hiwdg.Init.Window = 4095; hiwdg.Init.Reload = 3600; hiwdg.Init.EWI = 0; HAL_IWDG_Init(&hiwdg); HAL_IWDG_Refresh(&hiwdg); HAL_Delay(300); //more than one downcount HAL_PWR_EnterSTANDBYMode();if delay before refresh, it seems work hiwdg.Instance = IWDG; hiwdg.Init.Prescaler = IWDG_PRESCALER_64; hiwdg.Init.Window = 4095; hiwdg.Init.Reload = 3600; hiwdg.Init.EWI = 0; HAL_IWDG_Init(&hiwdg); HAL_Delay(300); //more than one downcount HAL_IWDG_Refresh(&hiwdg); HAL_PWR_EnterSTANDBYMode();Is this the correct process ? If I want to ensure the modification is successful, what should I pay attention to
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.