Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
Hi all.I have a small problem understanding the timer 16 of the STM32G030K6T6 microcontroller. According to the data sheet, it should use the TIMPCLK clock, which corresponds to the PCLK clock.My system clock is supplied by the HSI (SYSCLK = 16 MHz). I have set my AHB prescaler to 4 and the APB prescaler to 1, so HCLK = PCLK = 4 MHz. Since my APB prescaler is equal to 1, the timer clock should be TIMPCLK = PCLK = 4 MHz.I then implemented a delay function with timer 16. So that the counter runs up in 1 us steps, I have to set the prescaler of the timer to 15 instead of 3. This means that the timer 16 still has a 16 MHz signal as an input signal.Now my question is: Have I misunderstood something here, is the data sheet wrong or is my code not correct? I have attached the quotes from the data sheet and my code. I hope you can help me. Datasheet RM0454 Rev 5:"Timer clockThe timer clock TIMPCLK is derived from PCLK (used for APB) as follows:1. If the APB prescaler is set to
I’m working on a custom board with an STM32F446REt6 and a USB Type-C 2.0 connector (GCT SB4105-GF-A). I haven’t implemented any external pull-up on the D+ and D- lines, but on the CC1 and CC2 pins I have 5.1k pulldown resistors. I managed to load the firmware via DFU and Windows recognizes the device without any issues — the firmware upload works perfectly. However, when I try to use the Virtual COM (CDC), Windows returns an error saying “Unknown USB device (Device descriptor request failed).” I’ve already installed the ST USB drivers but nothing changed. In my .ioc project I enabled USB_OTG_FS, then in middleware I enabled USB_Device and selected Virtual COM. I tried leaving the device descriptor at default and also modifying it, but the issue persists.Given that DFU works perfectly, I assume the hardware is fine, and the problem is somewhere in the firmware configuration?I’m attaching the USB schematic section below. Has anyone experienced something similar? Any suggestions on what m
I want to route the internal comparators on the STM32G0B1 to the inputs of the encoder module. I can't find a way to do this in CubeMX. When I select "Encoder Mode" in the timer configuration, there is no option to route the comparators to the timer. Is this configuration possible?
Hi everyone, I'm currently working on a project where I'm controlling a small DC motor using a PWM signal, based on the temperature read from an LM35DZ temperature sensor. I'm using an STM32 microcontroller, and generating the PWM signal with Timer2, Channel 2 (on pin PB3). The PWM signal is working correctIy, I tested it using an LED, which lights up fully at higher temperatures, confirming that the PWM output is active. The ADC readings and temperature conversion are working fine. I'm printing the raw ADC value, voltage, and calculated temperature via UART, and everything looks correct. The calculated PWM duty cycle is also being set properly using __HAL_TIM_SET_COMPARE(...). The problem is that the motor never spins. I'm using a 2N2222 NPN transistor as a switch, and a 1N4148 diode for flyback protection (cathode connected to +5 V, anode to the transistor’s collector). The motor is powered from a 5 V power bank, and I’ve made sure that the GND of the STM32 and the GND of the power b
I'm working on a second project using AI and I came across the ToF sensor that can be used to detect hand gestures. It is possible to use the AEK-LCD-DT028V1 LCD together with the Nucleo-F401RE board and the X-NUCLEO-53L8A1 sensor.
Hello,Is there a way to power the control board of the EVLSERVO1 without using the power board? I would like to just play around with the MCU before connecting to 48V for motor control. The ST-LINK V3SET does not provide any power to the board. Br,Lukas
Hi to everybody.I can't get spi to work with linked lists. I followed the procedures in the documentation but it still doesn't work. Maybe someone can tell me why.This is my configuration: STM32U575, cubeMX 6.12.0, cubeIDE 1.9.0The linked list has two nodes. The first one writes 4 bytes on SPI2 and the second one reads 4 bytes on SPI2.I don't see the clock strokes on the SPI2 bus.Thanks a lot in advance.main.cint main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* Configure the System Power */ SystemPower_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_GPDMA1_Init(); MX_ADC1_Init(); MX_DAC1_I
Hey everyone,I’m working on a USB audio project using TinyUSB on my STM32H7S78-DK Discovery board, and I’ve hit a wall with UAC2.0 on the High-Speed port. I’m hoping someone here has experience with this setup and can point me in the right direction!What I’ve Achieved So FarBoard: STM32H7S78-DK (three USB-C ports)ProgrammerFull-Speed (USB FS)High-Speed (USB HS)TinyUSB ported successfully to the boardCDC example works perfectly on the Full-Speed portAttempted UAC2.0 on Full-Speed port, but Windows rejects itWindows insists on at least a High-Speed device for USB Audio Class 2.0What I’m Trying to DoI want to stream multi-channel audio (UAC2.0) over the High-Speed USB-C port. Unfortunately, I can’t get TinyUSB’s UAC2.0 example to enumerate or work on HS. The descriptors seem correct, but Windows doesn’t recognize the device as a valid UAC2.0 HS audio interface.What I’ve CheckedClock configuration – HS PHY clock is enabled, and I’ve verified 480 MHz operation.Pin mapping – USB1 HS D+/D– pi
hi i am working with HTTPS client code on stm32u585 microcontroller, using netx tcp/ip stack for the implementation. my requirement is to create a HTTPS post request with a json payload( nearly 8000 bytes). is there any reference or example available on HTTPS post request using netx. all i can see is the get request in the official GitHub.if any example or reference regarding this issue will be much helpful for implementation. with regards sabarinath
This is just a friendly PSA/warning to others who may be using this code: do not name any global/extern variable instances "context" if you use hardware-accelerated vector rendering. If you do, you'll probably run into strange hard faults or data corruption issues.The function `stencil_buffer_set_prealloc()` writes four bytes to the global symbol with name "context", and thanks to how library linkage works there are no errors or warnings about this collision with their intended "context" variable. The library function writes the value 0x202CCC5C in my code, and from the value (and behavior when I mess with it) this looks like a pointer to some memory in RAM. This appears to be related to vector font rendering (or possibly all vector rendering).See this relevant Stack Overflow answer for details about how this problem arises. I was not aware of this pitfall, and I will be religiously using static and name-mangling any globals from now on (I already am u
Hello all, I am developing ptp master and slave with offload. Now I have a master sending the sync and a slave sending delay_req: with the master sending back delay_resp: Given this message exchange, the slave should be able to correct its time, but, to do this, it needs some timestamp. Referring to figure 788: How can I (the slave) get t1,..,t4? Thank you P.S. Every delay_req has :originTimestamp (seconds): 0so it seems that hw does not correct the timestamp
Hi ST team,I'm working with the STM32U5-DK2 board and implementing USB Device MSC class using USBX and external flash (via OSPI) as storage. Everything works fine when VBUS sensing is disabled in STM32CubeIDE — the host detects the device correctly as a USB MSC device.However, when I enable VBUS sensing in CubeIDE (i.e., "Device Only" mode), the USB device is not detected at all by the host (no enumeration).Questions:Why does enabling VBUS sensing prevent the device from being enumerated as a USB MSC device?What are the minimum required CubeMX configurations to support VBUS-based detection (using PA9), but without using UCPD or USB PD features?Is there any internal pull-up or alternate pin setting that needs to be done for PA9 in this context?Is there any known erratum or additional hardware jumper/settings specific to the DK2 that could affect VBUS sensing?Any guidance to make VBUS-based detection + USBX MSC work reliably (without relying on UCPD/PD) would be greatly appreciated.Thank
Hi I am trying to achieve output compare mode in TIM1 in stm32f407vgtx board . I am trying to generate a delay of one ms and running a timer clock at 1mhz after divide it with prescaler. I have enabled upcounter,TIM_CCER_CC1E bit in CCER, TIM_EGR_CC1G bit and loaded CCR1 as 999(one ms) and ARR as 0xFFFF but my counter is exceeding the value and it is going upto 65535 which is the ARR value . I have not configured OC1M[2:0]bit (capture/compare mode register 1 (TIMx_CCMR1)) as I am not toggling PA8 or any thing on that pin which is linked with TIM1_CH1. I want when ever counter value matches CCR1 it generates interrupt and I am toggling led inside that IRQ handler. Can you help me where I am wrong please. B.R Ashish
Hello @Amel NASRI ,I am using nucleo-f767ZI board. I have custom LCD board which use NV3041A QSPI interface.I am trying to read manufacture ID from NV3041A on QSPI interface.My code is as belowstatic void MX_QUADSPI_Init(void) { /* USER CODE BEGIN QUADSPI_Init 0 */ /* USER CODE END QUADSPI_Init 0 */ /* USER CODE BEGIN QUADSPI_Init 1 */ /* USER CODE END QUADSPI_Init 1 */ /* QUADSPI parameter configuration*/ hqspi.Instance = QUADSPI; hqspi.Init.ClockPrescaler = 4; hqspi.Init.FifoThreshold = 1; hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_NONE; hqspi.Init.FlashSize = 1; hqspi.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_1_CYCLE; hqspi.Init.ClockMode = QSPI_CLOCK_MODE_0; hqspi.Init.FlashID = QSPI_FLASH_ID_1; hqspi.Init.DualFlash = QSPI_DUALFLASH_DISABLE; if (HAL_QSPI_Init(&hqspi) != HAL_OK) { Error_Handler(); } /* USER CODE BEGIN QUADSPI_Init 2 */ /* USER CODE END QUADSPI_Init 2 */ } void NV3041A_ReadData(uint8_t command, uint32_t addre
Hello ST Team,I am currently working with the STM32U5 Discovery board (B-U585I-IOT02A) to connect to Azure IoT Central, and I’ve tried two different approaches. I'm facing two distinct issues in each method, as described below:1. YouTube Method – TrustZone IssueReference: https://www.youtube.com/watch?v=BZn2PCvgL9sThe video references a specific GitHub repository for the Azure connection demo, but the repo is currently unavailable .I proceeded using the latest available X-CUBE-AZURE package from the official ST GitHub.When I run the project on my B-U585I-IOT02A board, I get the following runtime error: STM32U5_TrustZone_DisableThis seems to be a TrustZone configuration mismatch between the project and the board2. ST Community Tutorial – DNS and SPI ErrorsReference: https://community.st.com/t5/stm32-mcus/how-to-quick-connect-stm32u5-to-azure-iot-central/ta-p/49685I followed the ST community Quick Connect guide.Wi-Fi connects successfully to my access point.However, the board fails to re
Moved from this thread.Any method to implement X-CUBE-CRYPTOLIB in a project ?
I have referred to the Example project "LPUART_WakeUpFromStop_Init". Configured an LP-UART in interrupt mode with a baud rate of 9600, Stop bit 1, Parity None, and enabled the HSI clock source for it. When the device enters the stop mode, try to send a character to wake it. But it is not all waking up. We need to try this on Nulceo WB55 evaluation board. Once it works, we need to use it on our product which uses the uC STM32WB55VGQ.
I have an application consisting on two different tasks:1. Control a DMX bus which requires the MCU to transmit a command to the UART every 22ms2. Send an uplink message via Lora periodically (every 10 seconds for example)I am using the RAK3172 SoC which is based on the STM32WLE5CC (single core Cortex-M4)I am hypothesizing that the LORA stack blocks the single core context for up to 100ms during the lora transmission. During this time, the main thread does not execute. Is this correct? And if so, is is possible to minimize the time the main thread is blocked?I am using Arduino just for the PoC. I am also open to experiment with FreeRTOS multi threading, but I suspect that this is a design limitation and cannot be worked around due to having a single core. I see there is a similar post created by @jflaxman which exposes a similar problem. The user reported they worked around it by adding a separate MCU for the background task and using the STM strictly for LORA comms.In order
I'm looking for CAD resources of NUCLEO-H755ZI-Q board Revision D-01. Currently en the web-page there are for revision C-01. Thanks
I am working through this course but am stuck because the new 2.0.0 version of SM no longer provides the batch files like provisioning_auto.bat that are referenced in the course and I am unsure how to continue.Also posted this on the course page at https://community.st.com/t5/stm32-online-courses/stm32h5-secure-manager-course/bc-p/817896/highlight/true#M24 but putting it here, too, for better visibility. Any help is appreciated.Thanks,Chris
Hello All,Can anyone share the list of compatible cameras with STM32N647A0.As, going through STM32N6 DK, camera interfaced is B-CAMS-IMX 5Mpx.Is it possible to interface an 8Mpx camera with STM32N647A0 as one of the camera vendors are in a view to go for 2Mpx with STM32N647A0 but we wanted to use an 8Mpx for the design. Is it possible?Can anyone guide in this?? or if anyone can share the list of cameras with small form factors that are compatible. Best Regards,Sakshi
Dear STMicroelectronics Support Team, I am encountering an issue with ADC calibration on the STM32N657 microcontroller. Despite multiple attempts, the calibration process consistently fails. Below are the details of my setup and observations for your reference: Hardware Configuration: ADC: ADC1, Channel 1 Reference Voltage: VREF+: External 1.8V (measured 1.76V) VREF-: Ground Other: Enabled ICache/DCache, GPIO, USART1, and system isolation. Software Configuration: Initialization Code: SCB_EnableICache(); SCB_EnableDCache(); HAL_Init(); MX_GPIO_Init(); MX_ADC1_Init(); MX_USART1_UART_Init(); SystemIsolation_Config(); // Debug: Check registers post-init printf("Post-Init ADC_CR: 0x%08lX\r\n", hadc1.Instance->CR); // Output: 0x00000000 printf("Post-Init ADC_ISR: 0x%08lX\r\n", hadc1.Instance->ISR); // Output: 0x00000000 // Explicit MSP init (debug) HAL_ADC_MspInit(&hadc1); printf("Post-MSP ADC_CR: 0x%08lX\r\n", hadc1.Instance->CR)
Hello,I'm using LPTIMR1 to wake up from STOP2 mode and then use ADC to read battery voltage range from 10 - 15 V. The wakeup to use ADC is random as per user input (in seconds, minutes or hours).static void MX_ADC1_Init(void) { ADC_ChannelConfTypeDef sConfig = {0}; hadc1.Instance = ADC1; hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV4; hadc1.Init.Resolution = ADC_RESOLUTION_12B; hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc1.Init.ScanConvMode = ADC_SCAN_DISABLE; hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV; hadc1.Init.LowPowerAutoWait = ENABLE; hadc1.Init.LowPowerAutoPowerOff = ENABLE; hadc1.Init.ContinuousConvMode = DISABLE; hadc1.Init.NbrOfConversion = 1; hadc1.Init.DiscontinuousConvMode = DISABLE; hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START; hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; hadc1.Init.DMAContinuousRequests = DISABLE; hadc1.Init.Overrun = ADC_OVR_DATA_OVERWRITTEN; hadc1.Init.SamplingTimeCommon1 = ADC_SAMPLETIME_79CYCLES_5; h
Hello everyone,I am currently working with the STM32N6570-DK board and the MB1854B ST camera module.For testing purposes, I have compiled and run the following example from ST's GitHub repository:https://github.com/STMicroelectronics/STM32CubeN6/tree/main/Projects/STM32N6570-DK/Applications/DCMIPP/DCMIPP_ContinuousMode .In this example, the camera operates at a resolution of 2592x1944.Now, I would like to change the camera configuration to capture video at a lower resolution, such as 640x480 or 384x288.Could someone please guide me on:How to configure the camera for 640x480 or 384x288 resolution?Are there specific register changes needed for the IMX335 sensor?I have checked the IMX335 datasheet, but I couldn’t find register-level details—where can I find the correct registers or configuration sequence?Any help or code snippet showing how to set a different resolution would be greatly appreciated.Thank you.
Hello everyone,I am encountering an over-current issue with the B-G431B-ESC1 when attempting to use position control with a quadrature encoder. Here's what I've done so far:Steps I Have Taken:Motor Profiler:I uploaded the Motor Profiler firmware and ran the profiler to obtain the motor parameters. The parameters from the profiler are as follows:Motor Parameters:Hardware Family: MOTORLabel: BDUAV C4250Description: BDUAV C4250 560KvPole Pairs: 7Nominal Current: 40 ANominal DC Voltage: 24 VStator Resistance (Rs): 0.1 ΩStator Inductance (Ls): 0.02 HMagnetic Structure: Surface Mount Permanent Magnet Synchronous Motor (SM-PMSM)Back EMF Constant (BEmf): 1.53 V·s/radInertia: 4.44 (unit depends on context, often kg·m² or g·cm²)Friction: 3.63 (unit depends on context)Max Rated Speed: 6020 RPMQuadrature Encoder Details:Pulses Per Mechanical Revolution: 2048Index Pin: PresentCompatibility:FOC (Field Oriented Control)SixStep ControlMotor ID: BDUAV C4250MC Workbench Configuration:I created a new pro
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.