Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hi,I have an STM32F7 design with SD card connected via SDIO interface.In many posts I read that SD cards have to be initialized with a 1 bit wide bus and a clock of 400 kHz. Switching the bus width from 1 to 4 bit using the command HAL_SD_ConfigWideBusOperation(&hsd1, SDMMC_BUS_WIDE_4B) is simple. However, I have some doubts about the clock frequency. Many examples inizialize the clock at higher frequencies in the first initialization. This seems to contradict the SD card specification.Best regardsJan
I'm using STM32CubeMX to generate initialization code for all my hardware. I initially tried USART1 TX with GPDMA1 Channel 0 - all data was transmitted over TX except neither the GPDMA1_Channel0_IRQHandler() nor the USART1_IRQHandler() didn't trigger. I used the same configuration settings but chose GPDMA Channel 10 - now both the GPDMA1_Channel10_IRQHandler() and the USART1_IRQHandler() get triggered.Is this a known limitation? I haven't found anything relevant in MCU's Errata.Note that the USART1 HAL_UART_Transmit_IT() triggers interrupt. So it's clearly a GPDMA issue.The 2nd problem is that USART1 RX with GPDMA1 won't work with all the Channels I have tried so far (Channel 1 and Channel 11). If anyone else has experienced same issue please let me know which GPDMA1 channels worked with any USARTx.EDIT: USART1 RX with GPDMA1 triggers interrupt for Channels 3, 4, and 7 but doesn't trigger for Channels 0, 1, 10, 11 (the rest I haven't tried yet).
Presently we are using STM32F767ZI for our ongoing projects. Our application demands high speed data transfer rate through ethernet. We are taking the help of UDP for transfer of real time audio data between 2 STM32F767ZI Nucleo Boards. Further we need to increase the speed of Transmission and Reception of this audio data. So, we seek help for the following information among the community members.1.Presently, the HAL Drivers are in polling. Can we convert this HAL Drivers to utilize DMA? Would it make any difference in the speed of Tx and Rx.?2.How to increase the speed of LwIP Ethernet in STM32F767ZI? With/ Without DMA!3.What parameters decide the speed of data transfer in LwIP middleware that is there in the cube IDE?
I have STM32F769I DISCO discovery boardI am unable to find a simple code to display text on LCD
How do I get a non-HAL project going but with CMSIS for a STM32F051? I've seen a few references describing how to add various folders containing the required files to the projects build settings. The problem for me is the folders described do not exist on my installation for some reason. They are typically under \STM32CubeIDE\plugins\....If I create a HAL project I can see what I expect I need added to the project automatically along the lines: stm32f051x8.h , stm32f051xx.h and system_stm32f0xx.h. So the IDE does have them somewhere. I tried searching my IDE installation to locate the original source location but no hits. Creating a Target Project Type as blank is really blank. Trying to include any of the above generates errors along the line "file not found" . I've considered just copying the .h files from a HAL project but this feels kind of dodgy, Plus I expect there is a proper way and this isn't it.
Hello everyone,I am encountering an issue with the HAL_Delay() function and ThreadX in my project. Before initializing ThreadX, HAL_Delay() works as expected. Specifically, the callback function:void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) { /* USER CODE BEGIN Callback 0 */ /* USER CODE END Callback 0 */ if (htim->Instance == TIM6) { HAL_IncTick(); } /* USER CODE BEGIN Callback 1 */ WR_TIMER_process(); /* USER CODE END Callback 1 */ }is triggered correctly, and the uwTick variable increments as intended.I am using Timer6 for the system ticks on a custom PCB with an STM32H743BIT MCU. However, after calling the MX_ThreadX_Init() function, the uwTick variable stops updating, and the HAL_TIM_PeriodElapsedCallback is no longer triggered. Here is my setup:MCU: STM32H743BITCompiler: arm-none-eabi-gcc (Arm GNU Toolchain 14.2.Rel1 (Build arm-14.52)) 14.2.1 20241119CubeMX Version: 6.14.0ThreadX Version: 6.4.0Debugger: J-Link 8.32Ozone Version: 3.38g It seems
I managed to create a working example ethernet NetXDuo project for the nucleo-h753zi board based of this guide:https://community.st.com/t5/stm32-mcus/creating-a-dual-ipv6-amp-ipv4-netxduo-udp-application-for/ta-p/570521See my repository here:https://github.com/mo-krauti/nucleo-h753zi-ethernet-netxduoThis only works by adding a delay before starting NetXDuo. Why could that be? I also could not find any link mentioning this online? Generally I think setting up the Ethernet Controller on H7 is quite hard compared to the F7 series.
Hi,On the keynote speech, I saw that FreeRTOS will be the main kernel.Does that mean that ThreadX will not be offered as an alternative?What is the reason for this change?What about NetXDuo as a middleware?I am quite happy with how ThreadX and its components worked with each other. Over the years, I have developed several products with NetXDuo, USBX middlewares with ThreadX as an operating system. Not sure why ST is stepping back to FreeRTOS. Curious to know. Best regards,Navin
Everything else is working fine.Setup packet with SET_ADDRESS received and processed.Next GET_DESCRIPTOR for DEVICE which is sent back ok I've verified the data written to the Tx FIFO is correct.Correct number of bytes it transmitted but the bytes are not correct.I'm using a STM32H743-EVAL board, hardware is working fineAny suggestions?p.s. the Device Descriptor received displayed by USB View
Good afternoonI am working on the STM32H755 and am dealing with the retransmissions from my CAN FD periphery. According to the ISO-11898-1:2024 standard, the number of retransmissions should be configurable:"- from 0 (no retransmission),- to at least 6 (6 retransmission attempts),- and the highest number in this range can allow unlimited retransmission attempts."Currently I have FunctionalState AutoRetransmission in FDCAN_InitTypeDef set to ENABLE and on the oscilloscope I see an infinite number of retransmissions when I disconnect between two nodes. Now I want to limit the retransmission count to 6 retransmissions.Can I do this?Thank you very much for your answer.Manuel
I've got the NUCLEO-G491RE board and have it connected to my PC over the only USB port which is of course also used for the debugger. Both printf() and HAL_UART_Transmit() work to send data to a terminal program on the PC, but I can't use polling for my communication (there's too much else going on). If I call HAL_UART_Transmit_IT() it returns HAL_OK but doesn't actually transmit anything, and any subsequent calls to printf() or HAL_UART_Transmit() no longer do anything. I'm assuming this is because this isn't a "real" UART but some kind of virtual UART that gets converted into USB commands that cooperate with the debugger. Is there a way to use interrupt-driven communication over this (virtual) serial port? Thanks, Chris
I'm setting up the ADC in "manual continuous" mode where hadc1.Init.ContinuousConvMode = DISABLE and then I call HAL_ADC_Start_IT() inside of HAL_ADC_ConvCpltCallback(). I get the first call to HAL_ADC_ConvCpltCallback and calling HAL_ADC_Start_IT() returns HAL_OK but the callback never gets called again.What am I missing?Thanks,Chris ADC_MultiModeTypeDef multimode = {0}; ADC_ChannelConfTypeDef sConfig = {0}; /* USER CODE BEGIN ADC1_Init 1 */ /* USER CODE END ADC1_Init 1 */ /** Common config */ hadc1.Instance = ADC1; hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV2; hadc1.Init.Resolution = ADC_RESOLUTION_12B; hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc1.Init.GainCompensation = 0; hadc1.Init.ScanConvMode = ADC_SCAN_DISABLE; hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV; hadc1.Init.LowPowerAutoWait = DISABLE; hadc1.Init.ContinuousConvMode = DISABLE; hadc1.Init.NbrOfConversion = 1; hadc1.Init.DiscontinuousConvMode = DISABLE; hadc1.Init.ExternalTrigC
On an STM32G4, if an I2C error occurs (e.g. a bus error) during a DMA driven I2C transaction, is the intention that the HAL I2C driver abort the DMA transfer?Starting at line 6599 in stm32g4xx_hal_i2c.c (v1.2.5), I see code in the I2C_ITError function that looks like it's intending to cancel an ongoing DMA transfer. However, when using the HAL_I2C_Master_Seq_*_DMA functions, it does not appear that it actually does.Consider the case of a HAL_I2C_Master_Seq_Transmit_DMA, followed by a HAL_I2C_Master_Seq_Receive_DMA (a basic I2C write-read transaction with repeated start). At the end of the initial transmit, the HAL_I2C_EV_IRQHandler will call I2C_Master_ISR_DMA, which in turn calls I2C_ITMasterSeqCplt (line 5477), which will set the PreviousState variable of the I2C handle to I2C_STATE_MASTER_BUSY_TX (line 6014). Then, if an I2C error occurs during the receive DMA transfer, the HAL_I2C_ER_IRQHandler will call the I2C_ITError function (line 4699), which will fail to abo
Hello, for my first project with a microcontroller I'm doing a 16 button gamepad USB HID with the aid of ChatGPT. I have no idea of what I'm doing really. I'm Using a STM32f103C8T6 and STLink V2. I made a polling version that constantly read pins and then sends a report based on "button states"; it works well, but I am interested in a more efficient way of doing it.So I got to interrupts. I made a version that triggers on falling and rising edges, then it updates the buttons_state in the callback. It works well, but the main loop is always running and sending reports every 1 Systick (1ms I think), so I guess it has almost the same efficiency as the polling method.My intention was to to use __WFI() instruction in the main loop to make the CPU wake up only on button press/release (EXTI interrupts); something like this: while (1) { __WFI(); uint32_t now = HAL_GetTick(); if ((now - last_report_time) >= 1) { send_report(button_state); last_report_time = now;
Hi,We are currently implementing ADC on the STM32G491 MCU using ADC2, Channel 15, with Vref set to 3.3V.The ADC configuration is as shown below: hadc2.Instance = ADC2; hadc2.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV2; hadc2.Init.Resolution = ADC_RESOLUTION_12B; hadc2.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc2.Init.GainCompensation = 0; hadc2.Init.ScanConvMode = ADC_SCAN_DISABLE; hadc2.Init.EOCSelection = ADC_EOC_SINGLE_CONV; hadc2.Init.LowPowerAutoWait = DISABLE; hadc2.Init.ContinuousConvMode = DISABLE; hadc2.Init.NbrOfConversion = 1; hadc2.Init.DiscontinuousConvMode = DISABLE; hadc2.Init.ExternalTrigConv = ADC_SOFTWARE_START; hadc2.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; hadc2.Init.DMAContinuousRequests = DISABLE; hadc2.Init.Overrun = ADC_OVR_DATA_PRESERVED; hadc2.Init.OversamplingMode = DISABLE; if (HAL_ADC_Init(&hadc2) != HAL_OK) { Error_Handler(); } /** Configure Regular Channel */ sConfig.Channel = ADC_CHANNEL_15; sConfig.Rank =
The reason is that the update of the HAL library caused the SD card problem, which led to bus_hault after the restart. The SD card will only be restarted when there is a read/write issue. The reset process is deinit followed by init.Later, it was found that DPSM was an unexplainable setting, causing the driver to believe that there was data directly read from the fifo, but the data program was written to DPSM in conjunction with SDMMC_CK.Then I changed the driver code to seem to have solved the problem, and restarted the code by adding abort before deinit and init.1、Why does the SD card often malfunction? Is it caused by the clock waveform? Is this waveform setting incorrect for DPSM?I adjusted the frequency to 4M, but the Voltage overshoot was very large.Yellow represents CK and pink represents 3.3V voltage2、I used a soft restart for the SD card, but it seems to be of no use. Is there a way to solve the problem of the SDMMC getting stuck at a certain state due to being stuck at the DP
I'm currently working on a project involving the STM32H755ZI and setting up SDMMC1 for file operations using FatFs. While configuring the SDMMC interface, I noticed that CubeMX provides the option to enable IDMA (Internal DMA), but there's very little guidance available on how to correctly implement and utilize it, especially in conjunction with FreeRTOS and FatFs.My questions:How exactly should IDMA be enabled and configured in CubeMX/CubeIDE?Aside from enabling "Use DMA Template" and selecting IDMA for SDMMC, are there specific buffer alignment or cache management requirements (e.g., ALIGN_32BYTES(...) or MPU settings)?Is IDMA recommended or sufficient for use with FreeRTOS-based projects using FatFs on SD cards, or should MDMA be preferred in more demanding scenarios?Could anyone share a working example or reference project using STM32H7 + SDMMC1 + IDMA + FatFs (ideally FreeRTOS-compatible)?While AN5200 and other app notes mention DMA templates and performance guidance, they don’t f
I am using the STM32N6570-DK board to drive some sensors and show the data on the LCD. But I encountered some problems. I follow the steps below:1. open the STM32CUBEMX and choose the STM32N6 MCU, and select the secure domain only option.2. configurate the clock and set the CPU frequency at 600MHz,and set the PLL1 at 1200MHz, using the HSE.3. generate code, and import some BSP programs into the application part, the FSBL only import some basic HAL files, and I didn't add any lines into it.4. click into the stm32n6570_discovery_lcd.c, and add lines as follows:add these into the BSP_LCD_Init():RIMC_MasterConfig_t RIMC_master = {0};RIMC_master.MasterCID = RIF_CID_1;RIMC_master.SecPriv = RIF_ATTRIBUTE_SEC | RIF_ATTRIBUTE_PRIV;HAL_RIF_RIMC_ConfigMasterAttributes(RIF_MASTER_INDEX_LTDC1 , &RIMC_master);HAL_RIF_RIMC_ConfigMasterAttributes(RIF_MASTER_INDEX_LTDC2 , &RIMC_master);HAL_RIF_RIMC_ConfigMasterAttributes(RIF_MASTER_INDEX_DMA2D, &RIMC_master);HAL_RIF_RISC_SetSlaveSecureAttri
Hello Experts,i am facing a similar issue on the STM32F407G discovery board. Is there any solution or a temporary fix for this iisue?https://community.st.com/t5/stm32cubemx-mcus/re-freertos-semaphore-not-initialised-correctly-by-cubemx/td-p/780252 Changing the initial state of the semaphore to Depleted does nothing in the semaphore definition and creation:In freertos.c, inside the function MX_FREERTOS_Init(). i think the second function parameter should be zero I am trying a simple GPIO interrupt to task signaling, but the task always takes a semaphore without the GPIO interrupt the first time. I have attached the complete freertos.c file for context. This is the console screenshot to highlight the bug: I tried to manually change:myBinarySem01Handle = osSemaphoreCreate(osSemaphore(myBinarySem01), 1);tomyBinarySem01Handle = osSemaphoreCreate(osSemaphore(myBinarySem01), 0);Now the task does not take the semaphore during start up, but the moment the GPIO in
Hi, When I run st-info --probe as a normal user, I get:$ st-info --probelibusb: warning [darwin_detach_kernel_driver] USB device capture requires either an entitlement (com.apple.vm.device-access) or root privilegeFound 0 stlink programmerOnly when I prefix with sudo do I see my ST-Link appear: $ sudo st-info --probeFound 1 stlink programmerversion: 2...Platform & Environment:Host: Apple M1 MacBook AirmacOS Version: Monterey / Ventura (tested both)ST-Link Tools: Installed via Homebrew (brew install stlink)libusb: system-provided (no special libusb-compat)I reinstalled stlink via Homebrew and tried other versions, but the problem still occurs intermittently: sometimes I can probe normally as a non-root user, and other times I need to use sudo. On top of that, PlatformIO also requires sudo to upload code. Any help would be greatly appreciated.My Question:How can I grant non-root access to ST-Link on Apple Silicon so that st-info --probe works as a normal user? Is there an offici
Hi all.I have this piece of code: __HAL_RCC_CORDIC_CLK_ENABLE(); CORDIC->CSR |= CORDIC_CSR_NARGS; CORDIC->CSR |= (CORDIC_CSR_PRECISION_3 | CORDIC_CSR_PRECISION_2 | CORDIC_CSR_PRECISION_1 | CORDIC_CSR_PRECISION_0); CORDIC->CSR |= CORDIC_CSR_FUNC_1; // Phase function (atan2) int32_t a = 1000; int32_t b = 1000; CORDIC->WDATA = a; CORDIC->WDATA = b; volatile double result_from_hw = (double)CORDIC->RDATA / 2147483648.0 * 180.0; volatile double result_from_sw = ((atan2((double)a, (double)b)) / M_PI) * (180.0); __NOP(); __NOP(); __NOP();The result from SW is 45 (as expected).However the result from HW is 43.2.WHY??
Using a custom board.Used CubeMX and CubeIDE to develop the code which is attached to this post.A read of WHO_AM_I_A results with the command in rxData[0] and nothing in rxData[1].Same thing happens when reading registers.
Hi, I am working with STM32H757I-EVAL. The task is to record audio, store it in SD Card. Since, STM32H757I-EVAL has PDM Data format as well as DFSDM data format which would be better to interface with or is there anyother data format that can be used?
Hi All I have a breakout board, I've been testing some ws2812 code , I'm using TIM1 with DMA + PWM I developed the code on the G030, it's a 32 pin package. I'm using internal clock and have it running at 48MHz for Timers. Works has intended. Switch to C011 in an 8 Pin package. Created new project in MX and just copied over the code I added. I'm using internal clock and have it running at 48MHz for Timers. Code does not work. complies fine, but the leds not work. In both porjects I am using TIM1 , configured the same way. I don't have a Scope where I can view the PWM output Question: Does anyone of a any differences between how TIM1 works between both MCU? I looked through AN5969 Migrating between STM32G0 and STM32C0 MCUs and nothing jumped out. Can I use CudeMonitor to review the PWM? Any suggestions would be highly appreciated. Regards, Stephen
Hello, I have a problem with my code, I have a 1PPS signal from a GPS on a PB0 input, I want to measure a 10.00Mhz signal on the PC0 input. I have a uart4 tio display the result. My problem is that the result is always zero on my screen "Frequency 0.00 Hz" I don't understand why. can someone help me ? (Code attach) Best regards
ST Community highlights – April to June 2026
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.