Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
We are using MCSDK 6.4.0 in Position Mode with a 3-Phase Motor with quadrature Encoder (only A+B phases, no Z Pin).How can the motor phases be swapped at runtime in Software (U,V,W -> V,U,W), e.g. when the motor is connector is wired in the opposite direction (but the motor encoder is wired correctly)?I know that i can set up the PWM Outputs in MC Workbench (as well as swap encoder pins), but i need a solution that can configure this at runtime without rebuilding the Project. I could not find a function for that (just feeding an inverted Position to MCI_ExecPositionCommand() does not take into account that the motor encoder is wired for an opposite direction as the motor phases).If this is currently not possible, can you add this feature in a future release?
Affected doc / sectionRM0492 (STM32H503) → General-purpose timers → Master mode selection (MMS) (TIMx_CR2.MMS = 0000 “Reset”)Current wording (verbatim)“MMS = 0000 – Reset: the UG bit from the TIMx_EGR register is used as trigger output (tim_trgo). If the reset is generated by the trigger input (slave mode controller configured in reset mode) then the signal on tim_trgo is delayed compared to the actual reset.”Why this is confusing / misleadingThe sentence suggests TRGO is tied to the EGR.UG bit. In reality, EGR.UG is software-only; hardware reset does not set EGR.UG. TRGO is driven by the update-generation path (UEV/UG-equivalent internal signal), not by the literal EGR bit.It does not state that with URS=1 (CR1.UPDATE REQUEST SOURCE), a reset from TRGI/ETR does not generate a UEV. Therefore, with MMS=Reset, TRGO is not emitted at the moment of reset; it only appears on a later UEV (e.g., overflow) — or never if the counter is reset before reaching ARR.The phrase “delayed compared to t
why need to monitor txe flag and btf flag to transfer data after each byte.txe says data register is empty,btf and txe says need monitor after last byte. according to reference manual.but my question is how should i know i get ack after sending 1 byte .in this case which should i check txe,btf.if i check txe if txe==1 i send 2nd byte then how should i know i get ack for byte1.if txe indicate about ack flag received/not ,then why should compulsory use btf flag at end of last byte to check wait untill btf==1 before stop condition.
I’m implementing an audio clock source switching mechanism where the system runs on the internal audio clock if no external clock is detected. As soon as an external clock becomes available, it switches to use that external clock source.This works initially, but when the external clock is lost for any reason and the system switches back to the internal clock — then later detects the external clock again and switches back — I notice that data is still being received through the SAIs, but the clock is no longer synchronized with the external clock source. It seems to continue running from the internal clock instead.Is what I’m trying to do here actually possible? void SwitchAudioMode(eAudioClockSelection::Enum ClockSelection) { if (gAudioMode == ClockSelection) { return; } else { gAudioMode = ClockSelection; } HAL_SAI_Abort(&hsai_BlockA1); HAL_SAI_Abort(&hsai_BlockA3); HAL_SAI_Abort(&hsai_BlockB3); HAL_SAI_DMAStop(&hsai_BlockA1); HAL_SAI_DMAStop(&hsai_
Hi ST community// --- EDIT --- Missed preview and made some corrections / clarificationsI'm looking for a way to mount a SD card using the Azure RTOS UsbX MSC class, while the MCU is running. The code is mostly based on the ST examples, e.g.:https://github.com/STMicroelectronics/x-cube-azrtos-h7/tree/main/Projects/STM32H735G-DK/Applications/USBX/Ux_Device_MSC The example expects that the SD card is already inserted on power up - therefore the MX_SDMMC1_SD_Init() is called before the USBX device is registered. Therefore the LBA and Blocksize values are already available when the USBX device is registered.I want to have a more general case, where I can remove and insert a SD card while the application is running. A separate thread (SD_thread_entry) which handles this behaviour and is waiting for the SD card pin to be detected. The card is then power reset, the HAL is initialized and the CardInfo read:void SD_thread_entry(ULONG thread_input) { // Thread variables ULONG flags; bool
Hi, I'm a student quite new with STM, I am using a nucleo F072RB and I have been unable to print anything onto putty for a few weeks, it was working fine before summer break but not anymore (I haven't used my nucleo during that time), I am using the same baud rate and same port com as before, I tried to run my older projects that use putty and same result, nothing appears. I have no idea what to do to try to solve it, please help. Thanks.
Hi,I'm developing a board where i'm using the STM32WB55xx microcontroller. I do not intend to use the BLE interface for now and I do not want to have this pins wired. My question is what should i do with the RF1 pin of the microcontroller given that i do not intend to use the functionality. Should I leave it hanging or should it be connected to GND or VCC?Per the description of the datasheet, the RF1 pin is the pin to connect to an antenna. It's not clear on the Datasheet what to do when I do not intend to use it. Best,Alessandro
I have integrated lwip on my STM32H563RGT6 library and my requirement is to establish connection to my AWS endpoint from MCU to the cloud along with certificates. help me by providing the necessary stacks.Were my requirement is to send/publish some data into mqtt inside the IOT core AWS.
In Motor Control Workbench's Current Sensing tab. It shows the default Shunt resistors at .005Ω. The boards that were shipped to me have .01Ω.Is this by design? What do I need to change in the Current Sensing tab to work properly with my hardware.
Hello, I've built a project with an STM32F767 and a USB HID connection. I also have a Visual Studio 2010 application to set PA0 to 1 for testing. My connection is established, and in Device Manager, the USB Custom HID device is recognized, but I can't set PA0 to 1. I built my USB HID code using Cube MX and the HidLibrary.dll driver for VB2010. I don't understand why I'm having this problem. Can anyone help? I am able to get a result, temperature acquisition and change of state of PA0 in CDC mode. Best regards. My code is attached. Sébastien.
Hi @FBL I am working on a similar project like This one (USB CDC ACM device with Power Delivery in Source mode using USBX in standalone mode, FreeRTOS and USBPD with a TCPP02). The STM32 used is the H573I.I have found some code to add in the function USBPD_DPM_Notification() in usbpd_dpm_user.c (solution you gave).But in my code, the functions called are undefined because the file usbpd_usb_if.c is not generated. What I am missing?
My goal is to use timers to follow the required timing steps for a module I’m working with. To achieve this, I decided to use two timers — TIM1 and TIM2.TIM2 is responsible for counting the T1 time step. For this, I’m using One-Pulse Mode, so TIM2 is configured to count a 2 µs delay.After TIM2 finishes, TIM1 should be triggered. TIM1 also operates in One-Pulse Mode, this time generating 25 pulses to imitate the PD_SCK signal (as shown in the datasheet timing diagram).Each pulse should stay HIGH for half of the full period (20 µs), so 10 µs HIGH and 10 µs LOW.During the generation of those 25 pulses, the DOUT pin (connected to TIM2_CH2) should be sampled. At that time, TIM2 should be disabled.Unfortunately, it is not working, this is my code:void start_measurement(void){ if (HAL_TIM_OnePulse_Start(&htim2, TIM_CHANNEL_2) != HAL_OK) { Error_Handler(); } if (HAL_TIM_Base_Start(&htim1) != HAL_OK) { Error_Handler(); } } } void HAL_TIM_PWM_PulseFinishedCallba
I would like to set a 1Hz signal on the PC14 (RTC_OUT_CALIB). I have found a manual in document AN3371 (see picture in appendix). The code is also in the appendix. Unfortunately, nothing happens on the PC14 but the RTC works. If anyone has any idea what else to add here, thank you, greetings, SF
HelloCan the STM32H743 modify data at two non-consecutive peripheral addresses in a single DMA event,A DMA event changes two peripheral addresses,
Hi,I’m looking for some help — I’m trying to generate a continuous waveform at 432.492 MHz using the Nucleo WL55JC2, but I haven’t had any success so far. I also tried at 861.1 MHz, but still got no output.After extensive troubleshooting, I discovered that the issue was caused by the TCXO (PB0) not being powered at 3.3 V, and the SP3T not being properly configured because PC3/PC4/PC5 remained at 0 V instead of 3.3 V.To address this, I modified the project — without generating the CW signal for now — simply to control the state levels of PB0, PC3, PC4, and PC5, and to make it work correctly with both the CM0+ and CM4 cores.M0PLUS main.c is:#include "stm32wlxx_hal.h" static void Error_Handler(void) { __disable_irq(); while (1) { } } int main(void) { HAL_Init(); /* Clocks GPIOB/GPIOC */ __HAL_RCC_GPIOB_CLK_ENABLE(); __HAL_RCC_GPIOC_CLK_ENABLE(); /* Configure PB0, PC3/PC4/PC5 en sortie push-pull */ GPIO_InitTypeDef g = {0}; g.Mode = GPIO_MODE_OUTPUT_PP; g.Pull = GPIO_NOPULL; g.Speed =
Hi there,I am newbie to motor control, and I am studing how to use the excellent tool named MCSDK6.Below is my work follows(MCU is STSPIN32G4):1. open MCSDK6 and select my custom board and motor, generate the project;2. open cubeMx configurate the others PINs, then generate the project;3. write some app code;4. i find the motor config is something wrong, so I open MCSDK6, change the config and generate the project again;5. then I found the config in step2 is lost.Is anything I did wrong? I think if the config could keep is better.Thanks for you help.
I have been trying to update a wild caard text area.updateTarget will be called externally, value passed in will be 0-100I started calling the function with 0 -> 10 -> 20...etc incrementally.However whenever I passed the 100, the value will fallback to 0 and start again. This is the where the problem occursOnce I reached 100, and then the 0 will be displayed properly, but for later values there will be a "0" in the third character, even though I have checked the buffer is set properly.The pattern is 0 -> 10 -> 20 -> 30 ... -> 100 -> 0 -> 100 -> 20 -> 300 -> 40 -> 500...etcBelow is an exaple of the buffer being set to "30" in asciiBut the display is If I didnt trigger any screen update, after some time I can see there is a frame rendered (around per ~30s)And the the display is back to normal again It seems to be there is some kind of cache?Anyone has a similar issue? I am using the STM32U5G9J-DK2TouchGFX: 4.26 
Hello,I'm trying to port the ST IMX335 camera driver middleware to work with the RPi 2 IMX219. Everything works well with the IMX335, however after adjusting to reflect the IMX219 registers I get no image data and a Lane 0& 1 control error flag as soon as I enable streaming.I've switched to using Dump Pipe 0 and reduced the CSI speed but it made no difference.I'm using binning and a reduced ROI to reduce the amount of data coming off the camera. Has anyone has a similar issue?Thanks
Hi everyone,I would like to know if it’s possible to debug an STM32 microcontroller without using an ST-Link, but instead with an FTDI FT4232HQ chip via its JTAG or SWD interface.If this is possible:How can I configure the debugger connection?Can it be done directly from STM32CubeIDE, or do I need to use another tool (like OpenOCD or GDB)?Thank you in advance for your help!
Hi everyone,I am working on an STM32H7S78-DK with its built-in display and developing under Keil uVision 5. I am using the RTOS X-CUBE-AZRTOS-H7RS example with the WiFiEMW3080 module, specifically the following project:Repository/Packs/STMicroelectronics/X-CUBE-AZRTOS-H7RS/1.1.0/Projects/STM32H7S78-DK/Applications/NetXDuo/Nx_Iperf_wifi.Goal:I want to create a weather display project on the screen using STemWin.Current Status:- I tested two projects independently:1. WiFi project (with WiFiEMW3080): Works perfectly.2. Display project (with STemWin): Works perfectly.- I merged both projects and adapted the .sct file to define memory regions as follows:/********************************************************************************************/LOAD_FLASH 0x70000000 0x08000000 { ; load region size_regionER_ROM 0x70000000 0x08000000 { ; load address = execution address*.o (RESET, +First)*(InRoot$$Sections).ANY (+RO).ANY (+XO)}ER_ITCM 0x00000000 0x00010000 { ; ITCM (64 KB) - Critical code ex
Hi everyone,I’m using the WS28XX library by NimaLTD from GitHub::backhand_index_pointing_right: https://github.com/nimaltd/ws28xxSetup:STM32F103TIM3 Channel 4 as PWM outputData pin on PB18×8 WS2812B LED matrixInitialization and pixel updates work perfectly:WS28XX_Init(&ws, &htim3, 72, TIM_CHANNEL_4, 64); WS28XX_SetPixel_RGB(&ws, 0, 100, 0, 0); WS28XX_Update(&ws);Issue:Immediately after power-up, some LEDs (LED 41 an 10-12 following) light up before WS28XX_Init() is even called.On the logic analyzer, I can see a valid WS2812B data burst right after startup,covering up to LED 40 with "0", followed by a ~100 ms gap,and only then my actual data frames appear. Once WS28XX_Update() runs, everything looks correct and stable.Questions:What generates this initial data burst on the PWM pin?Could TIM3 or DMA be triggered automatically during startup?Does CubeMX initialize the PWM channel before main() executes?Has anyone seen similar behaviour with WS2812B + DMA on STM32?Than
Hello, dear community!I have a problem with adding more than one button to my STM32 Button Box / joystick with buttons. I am using USB HID.I made it as simple as possible - only two buttons, simplest descriptor. The problem may be trivial, but after 4 days and ~8 hours per day - I can't find solution. I watched most of the STM32 USB training course (on yt), I was digging deep in st forum and google/bing/yahoo, but nothing helped. I think there is not a ready answer to my problem in the whole internet.About the problem: One button (the first one) is working flawlessly, but when i try to USBD_HID_SendReport for another button - nothing happens. My descriptor: // HID Report Descriptor 0x05, 0x01, // Usage Page (Generic Desktop) 0x09, 0x04, // Usage (Joystick) 0xA1, 0x01, // Collection (Application) 0x15, 0x00, // Logical Minimum (0) 0x25, 0x01, // Logical Maximum (1) 0x75, 0x01, // Report Size (1 bit) 0x95, 0x02, // Report Count (2 buttons) 0x05, 0x09, // Usage Page (
Hi,On the STM32N6570-DK board, I’m running an application that uses TouchGFX and FileX.Both the TouchGFX frame buffer and FileX temporary buffers are located in external memory (XSPI1).I’m observing intermittent write failures when SDMMC IDMA is used for direct transfers from external memory to the SD card. The issue appears as incorrect data being written — typically affecting the entire transfer block (a few kilobytes), as shown in the image below.External memory is attributed as non-cacheable all the time. Selecting various shareability options for the ext memory introduces very strange behavior, so it's been disabled finally.However, when the write operation is performed from internal SRAM (either via an intermediate buffer in SRAM or the FileX driver’s scratch buffer), the transfers are always successful.I’ve also found a very similar case involving the TouchGFX frame buffer and SD card buffer in external memory on the STM32F7 platform.https://community.st.com/t5/stm32-m
Not sure whether its me looking at the wrong places but I can't find the project that came with the Nucleo-FR401RE eval board? Looked under the STM32CubeF4 examples, nothing seems to match.Can somebody point me to the right place?Thanks-- Alex
Hi,I have a container with buttons, images and text (around 30).I would like to change the alpha from 255 to 128 of each widget inside the container.On the documentation, it says it it possible with container with FadeAnimator in Mixins :https://support.touchgfx.com/docs/development/ui-development/ui-components/containers/container#propertiesbut I think it is a mistake in the documentation.So, without this feature, what is the best way to change all the alpha value of each widget in a container ?If the function forEachChild (https://support.touchgfx.com/docs/api/classes/classtouchgfx_1_1_container#function-foreachchild) is recommended, can I have a link of an exemple program using this function or a zip file with a test program with this feature ?Regards,Sébastien
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.