Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hello everyone,I'm developing an application using USBX CDC ACM class in standalone mode. I've written an execution loop for scheduling USB stack operations and there are no problem with READ transaction; i'm able to receive correctly every data from my host pc.There is a problem or perhaps my misunderstanding on WRITE transaction (i mean from STM32 device to host pc). I'm not sure how to interpret state returned by ux_device_class_cdc_acm_write_run function. The device receive a packet (few bytes from host) and it has to answer back few bytes. On first packet, my host receive every byte sent by device but when the host send another packet, the device will send back data but nothing is received; i need to send another packet to "push" data to host.It is not very clear (for me) what is the correct behavior in respect of ux_device_class_cdc_acm_write_run exit status.when device has to send N bytes so the write_run function is called with requested_length == N;the write_run func
Hi,1. I have my own application (migrated from H7 to N6) with FileX writing to the SD card in real-time.And I see that 4-bit data bus is unusable at all (a lot of disk errors).The 1-bit data bus in NORMAL mode works sometimes. HIGH-SPEED is not working properly.The same data throughput was recorded on STM32H747I-DISCO perfectly via 4-bit bus.Could you please advise on this?2. Looking at STM32CubeN6\Projects\STM32N6570-DK\Applications\FileX\Fx_MultiAccess example,I see that 1-bit data bus in Normal mode is used.Is there any issue with the SDMMC on STM32N6 chip or STM32N6570-DK board (signal integrity)? Regards,A
I can't get TIM1 to trigger DMA in my code (main.c)Am I missing something?
I am working on programming a custom-designed board featuring the STM32H747IGT6 MCU using the Keil MDK-ARM environment. While I can successfully program and debug the Cortex-M7 (CM7) core, I encounter an "INTERNAL PARAMETER ERROR" when attempting to flash the Cortex-M4 (CM4) core.Current Configuration:Software Versions:STM32CubeMX: 6.8.1Keil MDK: 5.31 with the latest Device Family Pack (DFP) version 4.1Debugger:STLINK-V3SETMemory Allocation (as per STM32H747IGT6 Reference Manual):IROM1: Start Address = 0x08100000, Size = 0x00100000IRAM1: Start Address = 0x10000000, Size = 0x00048000RAM for Algorithm: Start Address = 0x10000000, Size = 0x00001000I have also experimented with alternative IRAM1 configurations via Keil's "Options for Target" settings, but the issue persists.Observations:The CM4 core can be programmed successfully using the STM32 Programmer tool, indicating that the hardware is functional.I have followed the guidelines provided in ST's Application Note AN5286 for dual-core
I try to create a new project, nothing is written in main.c! It is a first check after setting up 'LWIP', 'SDIO' and Freertos in the GUI and got this mistake!multiple definition of `errno'; ./Middlewares/Third_Party/LwIP/system/OS/sys_arch.o:/home/denis/STM32CubeIDE/workspace_1.9.0/FreeRtos_SDIO_Web/Debug/../Middlewares/Third_Party/LwIP/system/OS/sys_arch.c:45: first defined hereSTM32CubeIDE Version: 1.9.0 PS - This error not appear then I was on STM32CubeIDE Version: 1.8.0
Hello!I am writing a program that uses FreeRTOS and LwIP libraries. I would want to check ARP table, but functions from ip4 directory are not considered thread-safe. How can I check ARP table when using FreeRTOS or how can I make sure calling thread-unsafe functions won't break my program?I saw that there is an LwIP mutex that can be used to lock the stack via LOCK_TCPIP_CORE() and UNLOCK_TCPIP_CORE() macros, but I am not sure how to use them properly or if it is even a good approach. Thank you in advance!
Hi everyone,I'm currently working on a project to turn an STM32 microcontroller into a USB printerdevice. I have spent a considerable amount of time searching for a comprehensive guideor a complete implementation for the classic USB printer device class on the STM32platform, but unfortunately, I haven't found a solution yet.I did find this valuable ST Community post that provides a walkthrough for setting up aUSB Communications Device Class (CDC): LINK, This has led me to a few specific questions:1. CDC vs. Printer Class: For those experienced with both, how significant is thedevelopment effort to move from a CDC implementation to a compliant USB PrinterClass (Class Code 07h) device? I understand the Printer Class has its own setof specifications, but I'm trying to gauge the complexity of adapting the existingCDC examples.2. Successful Implementations: Has anyone in the community successfully configuredan STM32 as a USB printer device? I've come across a few forum posts where this hasb
I've got an STM32G491RE on a NUCLEO-G491RE board and I'm driving the DAC using TIM4's TRGO and pulling values out of a memory buffer using DMA. It was a bit of a challenge getting set up, but now that it's running it's beautiful.What's weird is that I've got TIM4 initialized with both prescaler and counter set to 4, and since that board is running at 72 MHz that means I'm triggering the DAC every 347 ns but it's supposed to have a max of 1 Msps.Am I correct in assuming it's just ignoring those extra timer triggers? Are there any error bits set when you "overdrive" a DAC like this?
Good afternoon Team,I am working on a project where I need to interface two SPI peripherals with an ST microcontroller (STM32G070RBT6).One peripheral (ADS124S06) operates in SPI Mode 1 (CPOL=0, CPHA=1), and the other (64128L FC BW-RGB Display) in SPI Mode 0 (CPOL=0, CPHA=0).Both peripherals must operate concurrently to ensure real-time data visualization.Is it possible to use a single SPI interface for both peripherals, even though they require different modes?If yes, what is the best way to handle this? ---Should I reconfigure the SPI mode dynamically before communicating with each device?Are there any potential timing or synchronization issues to consider?Thank you in advance for your support!
Dear all,I'm working on an custom hardware project using the STM32G0B1 MCU running ThreadX. My goal is to use/port the USBPD stack for both source as sink device, but I'm failing to do so partly because the stack provided is closed source.The CubeMX skeleton code generated for my project does not offer a working solution and all example code nor documentation available is not targeting ThreadX.Also I'm somewhat confused about which PD stack to use since X-CUBE-USB-PD is no longer recommended? Then what would be the alternative stack to use?Does anyone have practical experience, can provide meaningful documentation or example code porting USBPD to ThreadX? I would be forever thankful.Thanks and looking forward to your replies.With regards,Peter
Hi. I have a NUCLEO-N657X0-Q board with MB1854B. Yes, exactly nucleo, not discovery one. Im trying to recreate RTSP example fron discovery board. As netxduo from cubemx is kinda buggy, i manually added it along with other necessary middlewares from github repo. After configuring all peripherals according to VENC RTSP example for disco board on video side and UDP ECHO Server example for nucleo board, i copied application files from VENC RTSP example.Application starts but fails to get IP by dhcp. I have tripple-checked all the things. ETH configuration and driver are correct for my board and my PHY(lan8742). ETH is inited without errors, memories for descriptors and buffers are marked as non-cached in MPU. Pin assignment also correct. Netxduo creates DHCP packets and descriptors for them. Then _nx_driver_packet_send is triggered. But i checked with my oscilloscope TX lines on the RMII interface, and there are no activity. I also checked, UDP Echo exam
As the title says, I've got a (circular) buffer of uint16_t values that I want to send to the DAC every time the timer updates. It seems like it's 95% working, in that if I manually trigger the DAC:for (int i = 0; i < 10000; ++i) { LL_DAC_TrigSWConversion(DAC1, LL_DAC_CHANNEL_1); HAL_Delay(1); }I can see my waveform on the output pin. But when I try to have the DMA send the values to the DAC, the output never changes.One complication is that I need to run in two modes - in one mode I'm taking the ADC input, processing it, and sending that to the DAC, in the other mode (I'm calling "inject" mode) the ADC is ignored and the DAC values come from my memory buffer.The code to switch between modes looks like this:if (inject && !Inject) { // Turn on inject mode // HAL_DAC_Start_DMA(&hdac1, DAC_CHANNEL_1, (uint32_t*)Transfer, 4096, DAC_ALIGN_12B_R); LL_DMA_DisableChannel(DMA1, LL_DMA_CHANNEL_3); while (LL_DMA_IsEnabledChannel(DMA1, LL_DMA_CHANNEL_3)); // Wait till of
Hi as part of my project I am trying to integrate the mentioned parts in subject to control modbus eth relay over tcpip.What I have done so far.1. Integrated Lan chip driver to stm32 library and initalization done.2. Integrated LwIP stack from online resources and confirmed LwIP integration succeeded. (Since i'm using STM32H563RGT6 MCU and it doesnt have inbuilt LwIP stack with in it).3. Initially tried to establish a connection with my PC and try a ping test.4. I'm facing ARP Resolution initally but somehow it resolved and now i can find my MCU ip and mac address on my PC, but still ping is not reachable.5. My POV is that if its capable of handling etherent packets then i can start work on with modbus packets to trigger the relay module.Pls help me with this case...
Hello, I’m trying to drive LEDs using all four PWM channels of TIM8 on a NUCLEO‑H755ZI, but I’m running into this issue:CH1 (PC6) and CH2 (PC7): When I measure with a multimeter, I see the expected voltage fluctuations/average corresponding to the configured frequency and duty cycle.CH3 (PC8) and CH4 (PC9): I’ve removed the LEDs and measure the pins directly with a multimeter; they always read 0 V. I’m attaching the project archive, which includes the CubeMX .ioc file, tim.c , gpio.c , the driver layer, and all HAL settings. I’d appreciate any suggestions or insights you might have. Thanks in advance!
Hello,From my understanding in FreeRTOS, there is a defined highest priority one should set for interrupts whose ISRs may call RTOS APIs (configMAX_SYSCALL_INTERRUPT_PRIORITY).For the same reasons, I would expect ThreadX to have a similar limitation, and to that extent I have found other ST forums posts suggesting one should set lower priorities for any interrupts whose ISRs may call RTOS APIs, but I can't find any documentation that explicitly states what the highest safe/allowable priority is, similar to FreeRTOS.How do I know what's the highest interrupt priority I can safely set in such cases? Is there any documentation from ThreadX that I'm missing, because I can't seem to find any mention of this.For context, I am using a U5 series MCU and I want to call queue related APIs in my CAN Rx callback.
Good day folks!I trust you are well.Do you know where I can find the example that was used to take the VENC power measurements as outlined on this Wiki page ?I can't seem to find it under the Applications and Examples in the STM32CubeN6 v1.2.0 Specifically I want to see how the part was configured to support the 1080p resolution.Warm regards
Hi, gents, I have some need to use SPI slave mode instead of working SPI master mode. I'm tranferring 22 16-bit words from Infineon slave board at 6Mhz clock rate, once per 100 ns, and have 4-line interface including CS line. Due to noisy lines I prefer to reset communication before each 22x16 bit transfer. The picture is attached - the 4th line represents CS signal, the 2nd line - data sent from STM32, line 3 is zero as zeros are sent. After some attempts to write the code I came to solution, when I'm attaching a low-priority EXTI interrupt to SPI5 NSS pin (PF6 GPIO pin), and this interrupt has the following code (this code worked OK for master mode):if (GPIO_Pin == GPIO_PIN_6) { if (hspi5.State != HAL_SPI_STATE_READY) { HAL_SPI_DMAStop(&hspi5); } HAL_StatusTypeDef td = HAL_SPI_TransmitReceive_DMA(&hspi5,(uint8_t*)spi2CAT, (uint8_t*)CAT2spi, CAT_PACK_SIZE*(sizeof(int32_t)/2)); tdd = td; SPI_cnt++;
Hello,It took few days to find what is wrong with network, and why I can't get it to work, finally I found what libraries have wrong definitions for heth and eth_handle in file nx_stm32_eth_config.h:extern ETH_HandleTypeDef heth; #define eth_handle hethFor N6 MCU correct definition is heth1 defined in main.c, and still, even if you replace heth to heth1 you will not get ethernet to work, I am not sure why, only one way how I get it to work is to replace all heth and eth_handle variables to heth1 in nx_stm32_eth_config.h file !But the worst moment is then you regenerate code from cubeMX all the replacements is gone and network will not work again.And for STM team - dont change structures in examples, include IOC files, because cubeMX generates code totally differently, you are not only causing problems for users, but you are also struggling to solve customer issues yourself.
Hello everyone, I'm currently working on a FOTA (Firmware Over-The-Air) system for my STM32-based project, and I’d love to get your insights or validation from the community regarding the architecture I'm considering. My Goal: To ensure safe firmware updates and enable a rollback mechanism in case something goes wrong during or after the update (e.g., power failure, invalid firmware, etc.). My Current Design: I’ve divided the Flash memory into three main sections: Region Description Bootloader Located at 0x08000000 — always runs first. Handles firmware updates and boot decision logic. Update Space A dedicated Flash section (e.g., at 0x08020000) where the new firmware is written and validated before execution. Application The main app firmware runs from here (e.g., 0x08080000). Update Workflow I'm Considering: The new firmware is received via UART/Wi-Fi and written directly to the update space in Flash. Once fully received, I compute the CRC on the update spa
Hello,I am developing a RAM-based bootloader on STM32H5, to update my firmware application.Application and bootloader resides on different flash areas, and the bootloader code is copied into RAM at startup.[0x8000000 - 0x801FFFF] bootloader[0x8020000 - 0x803FFFF] reserved[0x8040000 - 0x80FFFFF] application First, the bootloader erases all the application sectors.Then the bootloader receives code fragments via fieldbus, and program the flash memory 16 bytes (flash-word) at time, at correctly aligned addresses:int16_t HW_FLASH_Program(uint32_t addr, int32_t len, uint8_t *buff_p) { HAL_StatusTypeDef status; uint8_t flash_word[FLASH_WORD_LEN]; uint32_t aligned_addr; uint32_t offset; uint32_t chunk; HAL_FLASH_Unlock(); while (len > 0) { // back-align the address to 16 bytes aligned_addr = addr & ~(FLASH_WORD_LEN - 1); if ((addr == aligned_addr) && (len >= FLASH_WORD_LEN)) { status = HAL_FLASH_Program(FLASH_TYPEPROGRAM_QUADWORD, addr,
Hi everyone,I have successfully deployed the VENC_SDCARD example on the board and can see its feed on my laptop. Now, I want to record it at 480x480 resolution instead of the default 800x480 provided in the example.I have modified the buffer size, DCMIPP, LTDC configurations, and made a few additional changes. I’m attaching my main.c and stm32n6570_discovery_lcd.c files for your reference.The following is my camera feed.and these are the debug statements in the uart terminal.which looks fine to me with no errors.However, after recording in microSD card and decoding using the ffmpeg command provided in the project's README, I get the following error:kartikkhandewal@atl-hpzg14-99:~$ ffmpeg -f h264 -framerate 30 -i dump.bin -vf "fps=30" -c:v libx264 -preset veryfast -crf 23 output_fixed.mp4 ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdev
I am trying to run a loopback test with 2 i2c's on the same board. The onboard leds need to light up on successful transmission and reception, the problem is the leds light up when in debug mode, going line by line, but not in stand#define I2C1_ADD (0x15<<1) #define I2C2_ADD (0x42<<1) uint8_t I2C1_tx='1'; uint8_t I2C2_tx='2'; uint8_t I2C1_rx,I2C2_rx; HAL_I2C_Slave_Receive_IT(&hi2c2,&I2C2_rx,sizeof(I2C1_tx)); HAL_Delay(100); HAL_I2C_Master_Transmit(&hi2c1,I2C2_ADD,&I2C1_tx,sizeof(I2C1_tx),1000); HAL_I2C_Slave_Receive_IT(&hi2c1,&I2C1_rx,sizeof(I2C2_tx)); HAL_Delay(100); HAL_I2C_Master_Transmit(&hi2c2,I2C1_ADD,&I2C2_tx,sizeof(I2C2_tx),1000); while(1) { if(I2C2_rx==I2C1_tx) { HAL_GPIO_WritePin(GPIOG,GPIO_PIN_13,SET); HAL_Delay(100); } if(I2C1_rx==I2C2_tx) { HAL_GPIO_WritePin(GPIOG,GPIO_PIN_14,SET); HAL_Delay(500); } }alone. Can someone plz suggest what might be wrong.
Hello,I’m trying to measure temperature using NTC sensors on four different ADC channels of my STM32 Nucleo‑H7 board. I could previously connect potentiometers to the same pins and get flawless ADC readings with the same code and CubeMX settings. I only added a function to convert NTC readings to temperature and didn’t change any other configuration.I connected the NTCs to PA6, PA7, PC4, and PC5. In my loop, I call HAL_ADC_Start(), then four times HAL_ADC_PollForConversion() and HAL_ADC_GetValue() to retrieve the raw ADC values. When I measure the sensor output directly with a multimeter, I see about 1.65 V, but the ADC reads ~0.03 V, resulting in completely unrealistic temperatures.I never had this issue with potentiometers on the same pins and code. Why am I getting such low readings with the NTCs? Is my channel assignment wrong, the pin mode incorrect, or could hardware jumpers/shielding be affecting it?Has anyone experienced something similar or have suggestions? Thanks!
Split from this thread as it has been solved, and this is a new question: How to access eMMC through OTG on STM32H750B-DK kit.?
Hi Team,we are currently developing a product using the STM32U5 series. In our previous version, we used the STM32U5A5VJT6Q, and for size optimization, we have migrated to the STM32U5A5QJI6Q. Both MCUs are functionally similar, and we have updated the pin configurations accordingly. We are successfully reading data from a radar sensor using the new MCU. However, we are facing an issue where the RTOS thread does not stop properly, and the record number reaches its maximum count. Upon comparing the old and new firmware, we noticed that the Configure the Systick function is present in the old version but missing in the new one. We suspect that the absence of this function might be causing the RTOS timing issues. We also found a similar unresolved query on the ST Community forum from 2018 regarding CubeMX and SysTick behavior(CubeMX and SysTick - STMicroelectronics Community). Could you please confirm: If so, what is the recommend
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.