Developer support experience survey - We value your feedback
Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Dear STM32 Community, We believe that the example projects provided for the STM32Cube embedded software are a valuable resource when developing projects. We would like to better understand how developers use these examples in their workflow and explore ways to improve them. Therefore, we have a few questions we would like to ask: From where do you obtain the examples, and why? Are you working with the examples through the STM32Cube MCU packages, the STM32CubeMX Example Selector, or through GitHub? Is there a particular reason you prefer one channel over the others? How do you use the examples in your work with STM32 embedded software? Do you use the examples to learn how to use a driver or a feature, as reference code for implementation, and/or for debugging? What is working well, and what can we do to improve the examples and/or your experience working with them? You can either reply directly in this thread or feel free to send me a private message. &nb
I am faced with a flash erase issue at page 126 on a 256k device (STM32G0B1KCU7), although the writing at this location works well (but only one time, of course). It seems to be related to the dual/single bank option.I've seen a clue in the "STM320B1RE cannot erase page 127 on 256k version" topic.But changing the bank mode with SetupSTM32CubeProgrammer in production is not an option.What code should I add to my application to change this bank option?Many thanks in advance for any help.
Hello, I am a fairly new user of STM32. I recently came across the concept that in order to transmit over I2C from one STM32 to another, I must put the address of the slave STM32 as a parameter in the transmit function. In order to do this, I must set the address of the slave STM32 in CubeIDE. But when generating code in CubeMX, there is no code that generates the address of the slave in the slave’s program even when its 7-bit address is set, so I must manually do for example #define I2C_SLAVE_ADDRESS 0x33 in the slave’s program in CubeIDE. I discovered this from an unofficial tutorial, but I was wondering where specifically I could get official confirmation of this in STM’s official resources? (By specifically I mean for example say it’s in the reference manual, which chapter / sub chapter)? Any insights would be greatly appreciated - thanks!
I am setting up continuous ADC sampling with DMA in circular mode on an STM32, with the half-transfer and transfer-complete callbacks splitting the buffer into two halves for processing. The sampling rate is fairly high, and I am trying to understand the practical limits of this pattern. If the processing in one callback takes longer than the time it takes the DMA to fill the next half, samples get overwritten, but how do people normally detect that this has happened in production code? Do you rely on the DMA overrun flag, keep a timestamp or counter in each callback to spot a missed half, or simply size the buffer so the worst-case processing time always fits? I would also like to know whether there is a recommended way to double-buffer with two separate arrays instead of one circular buffer, and whether that makes overrun detection any easier. Any examples of how you have structured this in a real project would be very helpful.
Hey, I’m trying to make 2 stm32 MCU’s communicate with each other over i2c. In order to do that of course I would need the address of the chip to put into the transmit function. Theyre STM32U575ZITQ6 to be exact, and theyre on nucleo STM32U575 144 pin boards. I am quite new to STM32 and am not quite sure where I could find these addresses, possibly in the reference manual or data sheet in an i2c section but not sure where specifically to look for that - any insights would be much appreciated?Another quick question - what type of address is this typically named as? For example when communicating stm32 to temperature sensor there was the default address which was put in the codes transmit function (I think that’s what I’m looking for but confirmation would be helpful but also a register address, etc.Thanks!
This: Download from: https://github.com/ST-TOMAS-Examples-USB/c0_usbx_hid_mouse I downloaded the Zip, unzipped, and tried to import into CubeIDE v2.1.1: When I press ‘Finish’, nothing happens; the project does not appear in the Project Explorer. Even with a new, empty workspace. It does import OK to CubeIDE v1.13.0, but then the build fails:this error popup has to be cleared 9 times:and the console says:12:32:19 **** Build of configuration Debug for project c0_usbx_hid_mouse ****make -j8 all USBX/App/subdir.mk:25: *** unable to generate command line. Stop."make -j8 all" terminated with exit code 2. Build might be incomplete.12:32:21 Build Failed. 1 errors, 0 warnings. (took 1s.666ms) There are no specific download instructions given on the GitHub page - am I missing something?Should the zipfile download work? On Windows11 Pro
MCU / setupSTM32F746IGK, VDD = 3.3 V HSE 16 MHz, PLL: M=8, N=200, P=/2 → SYSCLK = 200 MHz (AHB=200, APB1=/4, APB2=/2) Scale 1 + Over-drive, FLASH_LATENCY_6 Already below the 216 MHz maximum Application executes from the ITCM Flash alias (0x002xxxxx; AXI alias 0x080xxxxx) Cortex I-Cache and D-Cache disabled at startup ART accelerator / prefetch enabled in HAL (ART_ACCELERATOR_ENABLE, PREFETCH_ENABLE) Bare metal, 1 ms cyclic scheduler, no RTOS X-CUBE-STL Flash TM every 1 ms: 1 KB window, HW CRC-32 (poly 0x04C11DB7, init 0xFFFFFFFF, word reverse in / reverse out). Expected CRC is a table built offline from the same image (zlib.crc32 / IEEE 802.3).What we see After several hours in RUN (typically ~11–19 h, not at POST), Flash TM returns STL_FAILED (0xD32D) on a 1 KB window. A software CRC of the same window also mismatches, so this is not only the CRC peripheral.On fail we dumped the 1 KB window from the CPU. The dump CRC always equals the TM computed CRC and differs from the programmed im
I’m using ST67W + STM32U585CIU6 + ThreadXI have some questions with ST67W Network Driver.1.In spi_port.c, it seems user can not apply own spi_cs pin or spi_rdy pin. And mostly I want these pins are controlled by hardware.2.In folder W61_bus, includes many of FreeRTOS headers and functions. But I use ThreadX, project can’t build successful. Can ST fix this or give user more options?
Hello everybody,on Zephyr RTOS ver 4.5.0 some of the STM32F4 ADC DTS binding properties has been moved on “adc123_common” node. Example : app.overlay changes between zephyr 4.4.2 and 4.5.0 (st,adc-prescaler)Ver 4.4.2 &adc1 { status = "okay"; st,adc-prescaler = <4>; pinctrl-0 = <&adc1_in3_pa3>; pinctrl-names = "default";}; Ver 4.5.0&adc123_common { status = "okay"; st,adc-clock-source = "SYNC"; st,adc-prescaler = <4>; /* ADCCLK = PCLK2 / 4 */};&adc1 { status = "okay"; pinctrl-0 = <&adc1_in3_pa3>; pinctrl-names = "default";}; My questions are :where could I find some details about how some STM32 binding properties has been moved to different nodes from Zephyr 4.4.0 and 4.5.0? I didn’t find that information in the Zephyr release notes. Do that changes affect also some other STM32 peripherals/nodes ?Thanks
I'm working on a project on STM32F429 discovery board, because of the small size of the internal flash I have used SD card module with SPI communication standard to store the imagesFor the STM32F429 Discovery board, I have developed functional code to read data from an SD card via the SPI4 interface.The failure encountered while working with the SD card was not due to a single bug, but rather a chain of five architectural and software-related mismatches between FatFs, FreeRTOS, the HAL SPI4 driver, and the hardwareprotocol for microSD initialization.Errors occur consistently during SD card initialization.
We’ve been running a flight controller on the STM32N657 and wanted to share some measurements and ask about two things we’re unsure of. Setup: OV9281 global-shutter camera (120 fps, 320 x 240) over CSI-2 into DCMIPP, an INT8 gate-detection network on the Neural-ART NPU, policy + state estimator on the Cortex-M55 with Helium, attitude loop at 8 kHz. Measured on our engineering sample:- CSI-2 DMA into SRAM + ISP: 0.41 ms- NPU inference (INT8): 1.92 ms- Policy MLP + state estimator: 0.06 ms- Mixer + bidirectional DShot: 0.13 msCamera to motor command is about 10.8 ms, dominated by the 8.3 ms frame interval. Questions:1. When the NPU and the M55 both hit XSPI-mapped memory (we keep frame buffers and activations in external PSRAM), what's the recommended way to keep control-loop ISR jitter low? Loop code and its data already sit in internal SRAM; is there anything on the bus/arbitration side we should know about?2. Is there an ST example that feeds DCMIPP output straight into the NPU input
Hello, In my application using the STM32U073 series MCU I must erase one of the last pages of flash (actually several of them but for this example I’ll just use one).Page 62, addresses 0x0801f000 - 0x0801f800, and when I call HAL_FLASHEx_Erase I get no errors either from the function return or the pageError parameter that gets written to inside the erase function, both report success.However when I look at the memory with the memory viewer I see that the first words at that page are still not erased. I moved the erase function out of the many layers of other code and tried to execute it directly in main after the peripherals and initializations have been done, but the outcome was the same. This version of the code is attached, as well as screenshots of the debugger with memory view and the UART terminal for debug output. Memory View after eraseMemory view before erase Start of DebugUART Outputint main(void){ /* Reset of all peripherals, Initializes the Flash interface and the Sy
I have tried everything I could find on google, but I am still stuck. I have been struggling to get ADC1 and ADC2 to initialize independently in scan mode on a STM32G431k8T. When I call HAL_ADC_Start_DMA(adc, adc_buffer, ADC_BUFFER_SIZE), the first ADC will work normally, but if I call it on the second ADC it fails on that call immediately. I cannot even debug a single step into the second call. Ether ADC works as expected if I do not call HAL_ADC_Start_DMA on the second ADC. Below is how I have both ADC’s configured via STM32CubeMX, any help would be greatly appreciated. static void MX_ADC1_Init(void){ /* USER CODE BEGIN ADC1_Init 0 */ /* USER CODE END ADC1_Init 0 */ 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_ASYNC_DIV4; hadc1.Init.Resolution = ADC_RESOLUTION_10B; hadc1.Init.DataAlign = ADC_DATA
I am using an STM32F072B-DISCO board as an interface between two serial data streams. I have USART4 operating at 1.5 MBit/s and USART1 operating at 115,200 Bits/s. I am using both in DMA mode to avoid blocking code. This is the initialisation: And the callback for when serial data is received: I am using port PC12 to indicate when a byte is received as shown below: So the receive complete callback routine is definitely being executed (PC12 is connected to D2 on the logic analyser trace), but no data is being sent out on USART1 (D8). i have the normal selections set in STM32CubeMX for USART DMA operation per the below.If I enable the code in the main While loop, then the Hello! messages are continuously sent out. My hunch is that USART DMA transmission isn’t possible within the receive complete callback routine, is this the case please? If so, else can I try please?I also tried using HAL_UART_Transmit_IT() to send out the Hello! messages from within the callback routine, but with the
Hello everyone,I am working on the STM32H7 platform using the FatFs library for file handling.My current version from ST is V.2.1.8 based on the R0.12c developer version.This also seems to be the most recent version for this firmware package.https://htmlpreview.github.io/?https://github.com/STMicroelectronics/STM32CubeH7/blob/master/Release_Notes.htmlI found out that there are more recent versions of this library in the github repository:https://github.com/STMicroelectronics/stm32-mw-fatfs/tree/r0.16_stm32cube_20261120Can anybody tell my if there is any risk by using the updated ST version V.4.1.1 based on the R016.c developer version for the STM32H7 platform? Is ST going to update the version for all platforms shortly? I saw that the newer version also includes some patches for CVEs been found…Thanks for sharing any information to this topic!
Hello, I hope everyone’s doing well. I have trouble getting the MCE to work on the STM32N6 (my issue is highlighted in bold below). Side note, the AES_256 example doesn’t work for me (on the discovery board). First of all, the configuration in CubeMX makes no sense, when I select AES_256 there should be 8x32 bit values, not 4x32 bit: Well, that’s manageable. So I generate the code and this is the first set of relevant code that I slightly modified: MCE_HandleTypeDef hmce1;__ALIGN_BEGIN static const uint32_t NonceMCE1[2] __ALIGN_END = { 0x00000000,0x00000000};__ALIGN_BEGIN static const uint32_t pKeyMCE1[8] __ALIGN_END = { /* my awesome key */ }; // MODIFIED from [4]->[8]// ....static void MX_MCE1_Init(void){ /* USER CODE BEGIN MCE1_Init 0 */ /* USER CODE END MCE1_Init 0 */ MCE_AESConfigTypeDef ContextAESConfig = {0}; /* USER CODE BEGIN MCE1_Init 1 */ /* USER CODE END MCE1_Init 1 */ hmce1.Instance = MCE1; if (HAL_MCE_Init(&hmce1) != HAL_O
Hi,Is there any software stack support available for industrial Ethernet protocols such as EtherCAT and PROFINET on the STM32H7S7 series?Also, does STMicroelectronics offer any microprocessors or microcontrollers that support industrial Ethernet protocols such as PROFINET, EtherCAT, and PROFIBUS?
Nucleo-STM32H563ZI running under ThreadX using CubeMX 6.18.1 and CubeIDE 2.2.0. Working with GPS which defaults at 9600. I send commands to make it run at 115200, then I deInit UART4 and reinitialize it using the same steps as the original initialization, but it goes to a HardFault as soon as I call HAL_RCCEx_PeriphCLKConfig(), before any code is exercised at all in that function.Before the HardFault happened I was able to work continue on, but there was no code to handle any received data, just a printf() telling me UART4 was running at 115200. When I added the code to receive data, then it started giving the HardFault. Why would later code cause a HardFault?I made sure that global interrupts are on for UART4.I attempted to debug the HardFault, but I’m not too clear on what the registers tell me (nothing other than the address where it dies), and the fault analysis tells me nothing at all other than a HardFault occurred.I removed all the DMA, but it still goes to HardFault.
Hello,I am working with an STM32N657 on the NUCLEO-N657X0-Q and I am trying to use the Ethernet PTP PPS signal as a hardware start trigger for TIM3.TIM3 is configured as follows: HAL_TIMEx_TISelection(&htim3, TIM_TIM3_TI1_ETH1_PPS, TIM_CHANNEL_1);sSlaveConfig.SlaveMode = TIM_SLAVEMODE_TRIGGER;sSlaveConfig.InputTrigger = TIM_TS_TI1FP1;sSlaveConfig.TriggerPolarity = TIM_TRIGGERPOLARITY_RISING;sSlaveConfig.TriggerPrescaler = TIM_TRIGGERPRESCALER_DIV1;sSlaveConfig.TriggerFilter = 0;HAL_TIM_SlaveConfigSynchro(&htim3, &sSlaveConfig);TIM3 itself uses an external clock on ETR2 and should only be enabled by the rising edge of ETH1_PPS.The internal connection works correctly when I use the normal/fixed PPS mode.For example: ETH1->MACPPSCR = 1U;In this case the PPS rising edge reaches TIM3, TIM3->CR1.CEN becomes set, TIM3 starts counting and the rest of my application starts correctly.However, I cannot get the same internal connection to
STM32G474, SPI1 master RXONLY, 8-bit, MSB first, CPOL=0 / CPHA=1, NSS software, CS on a plain GPIO. Sensor: MT6701 in SSI mode, 24-bit frame. Read: HAL_SPI_Receive(&hspi1, buf, 3, ...).Only one of four combinations fails:SCK / MISO GPIO speed CPOL / CPHA 3-byte readLOW 0 / 1 24 SCK pulses, frame wraps by 8 bits (33 E8 20 read as E8 20 33)MEDIUM / HIGH / VERY_HIGH 0 / 1 32 SCK pulses, correctLOW 1 / 0 correctfull duplex 0 / 1 24 SCK pulses, correctThe wrap-around means one extra byte is returned first and the last byte of the frame is lost. Rotating the bytes back makes the CRC pass, so the data on the wire is correct and only the alignment is wrong. frame wrpas when clk speed lowthe correct when clk speed high the logic analyzer when 3bytes and speed high the logic analyzer when 3bytes and speed low Two measurements:- At LOW the first byte is available 0.27 us after SPE = 1; at MEDIUM it takes a full byte time (about 6.2 us). 0.27 us is far too short
Looking to add 4 mics to the most recent X-Cube-Audio release with livetune.I’m not too familiar with the MDF peripheral but we were able to modify the existing release for the H5 and now are moving to the U5 series. I have added the following to stm32_audio.conf.h // data stream for mics 3 and 4#define UTIL_AUDIO_MDF_DATA_IN_MIC34_PIN#define UTIL_AUDIO_MDF_DATA_IN_MIC34_AF GPIO_AF6_MDF1#define UTIL_AUDIO_MDF_DATA_IN_MIC34_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()#define UTIL_AUDIO_MDF_DATA_IN_MIC34_PIN GPIO_PIN_0#define UTIL_AUDIO_MDF_DATA_IN_MIC34_PORT GPIOC#define UTIL_AUDIO_MDF_INSTANCE0 MDF1_Filter0#define UTIL_AUDIO_MDF_INSTANCE1 MDF1_Filter1#define UTIL_AUDIO_MDF_INSTANCE2 MDF1_Filter2#define UTIL_AUDIO_MDF_INSTANCE3 MDF1_Filter3#define UTIL_AUDIO_MDF_OUTPUT_CLOCK_PIN MDF_OUTPUT_CLOCK_0#define UTIL_AUDIO_MDF_MAX_CH_NB 4U#define UTIL_AUDIO_DMA_USED#define UTIL_AUDIO_MDF_INSTANCE
Hi,split from this thread USBX Debug Logging | CommunityI am running:CubeIDE 2.2.0 CubeMX 6.18.1 H5 MCU Package 1.7.0 FileX 6.4.0 USBX 6.4.0 ThreadX 6.4.0I guess I do not understand what the UX_ENABLE_DEBUG_LOG macro does, I assumed it would causethe USBX stack to generate a slew of debug messages, which I could post-process, and maybe shine somelight on a problem I as trying to debug. Now that I know it does nothing, I can understand why thecode doesn’t compile, as there is no need to enable UX_ENABLE_DEBUG_LOG.The change I made was just to get it to compile, in usbx/common/core/src/ux_utility_debug_log.c I disabledthe following statements, as the variable ‘source’ does not exist.#if 0 /* Calculate the string length. */ debug_location_string_length = UX_DEBUG_LOG_SIZE; _ux_utility_string_length_check(source, &debug_location_string_length, UX_DEBUG_LOG_SIZE); debug_message_string_length = UX_DEBUG_LOG_SIZ
Hi,Running USBX/ThreadX with MSC and HUB host classes, on an STM32H573. I enabled UX_ENABLE_DEBUG_LOG to get some USBX debug info from the software stack, andit doesn’t compile. Fixed the compile error in usbx/common/core/src/ux_utility_debug_log.c, and thenset a breakpoint in the logging function _ux_utility_debug_log(), and it never gets called? Can someone provide some history here, was this feature deprecated at some point?Lots of online troubleshooting guides indicate that this is a useful debug technique?I grep’d the code and found two instances where the stack actually calls UX_DEBUG_LOG(),and both are in the host_class_CDC software, which my product does not use.ThanksKen
Split from this discussion STM32U575xx USBX CDC ACM only transmits less than 8 bytes | CommunityIt is NOT a real cause nor solution. The USBD_CDCACM_EPINCMD_FS_MPS defines the size of a notification endpoint, incorrectly referred to as “command endpoint” in ST documents and code. The constant related to data In endpoint is USBD_CDCACM_EPIN_FS_MPS.
Hello!I am using a Siana N6Cam board with an STM32N657, an ST-LINK-V3MINIE, and STM32CubeProgrammer v2.23.0. The board has a separate USB data connection for the application’s USB CDC interface.I flash an AI application and model to external flash, then use a RAM FSBL to start the application while the board is in DEV_BOOT mode.Issue: With the USB data cable already connected, the application’s USB CDC COM port does not enumerate after the FSBL starts the application. If I unplug and replug only the USB data cable, the COM port appears. No reflashing is needed.I need the COM port to appear automatically when the application starts, without a physical cable replug.Could you advise:Does STM32N6 require an explicit USB device disconnect/reconnect or PHY reset when handing off from a RAM FSBL to the application? What should I check in the USB PHY clock, VBUS sensing, and USB initialization sequence on the Siana N6Cam? I observe even in Booting the signed FSBL from external flash - it needs
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.