Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Dear community,I have a NUCLEO-H7A3ZI-Q board with CAN, USART, USB Device and 4 analog inputs. My application is structured using the Azure RTOS, but for ADC testing purposes I am not calling MX_ThreadX_Init() anymore. With the AZRTOS initiated is the same ADC behavior.The example at https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects/NUCLEO-H7A3ZI-Q/Examples/ADC/ADC_DMA_Transfer works, but they only use 1 channel. The board and at least ADC_Channel11 works.I attached my IOC file, but basically I am using ADC2 (also tried with ADC1) in continuous conversion, DMA circular mode.I also attached the main.c file. The gist of it:ALIGN_32BYTES (static uint16_t ADC_VAL[4]);void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc){if (hadc == &hadc2) { ADCfinished = 1; // Set the flag to indicate conversion is complete}}// in main()...if (HAL_ADC_Start_DMA(&hadc2, (uint32_t *) ADC_VAL, 4) != HAL_OK){Error_Handler();}while (1){if (ADCfinished) { // pri
Hello everyone, I seem to be having issues flashing some the sample binaries found in these two repositories. I am using the NUCLEO-N657X0-Q board with the B-CAMS-IMX camera module. With either set of binaries I tried the following steps:1. Open STM32CubeProgrammer and connect to the board using ST-LINK over USB (Boot jumpers in the depicted position)2. Enable the MX25UM51245G_STM32N6570-NUCLEO external loader for the STM32N6570-NUCLEO board3. Browse to the first hex file to flash under the "Erasing & Programming" tab4. Flash each hex file in the order specified in the project's README5. Move the BOOT1 jumper from position 2 to position 16. Power Off/Power on by unplugging the board from USB From what I understand, the board should now behave like a USB webcam when connecting it to a computer though the non-STLINK USB port. Unfortunately, when trying this, my computer doesn't even recognize that device has been connected. (The corresponding light
Dear ST Community, I am working on an Ethernet TCP/IP project using the Nucleo-F746ZG development board with the LWIP stack, without any RTOS. I have based my implementation on the tcp_echoclient example driver file. The project builds successfully, and the application runs in debug mode, but it does not work in release mode. I have compared the map files for both release and debug modes but found no significant differences. Additionally, I am facing issues with MPU configuration while using the LWIP stack. Specifically, I need clarification on: The correct SRAM1 and SRAM2 addresses for the LWIP RAM heap pointer The appropriate addresses for Rx and Tx DMA descriptors in the linker script Whether all these addresses need to be explicitly configured in both the MPU settings and the linker script file Project Details: Development Board: Nucleo-F746ZG Ethernet Stack: LWIP RTOS Middleware: No TCP Client: tcp_echoclient Issues: Application runs in debug mode but not in release mode, MPU a
Hello, I'm facing some weird problem that I can't solve myself. I'm trying to get to work a TCP client using LwIP. Now the weird part: Everything works just fine in debug mode when I run the program. Connection is being established, and communication works as intended. But when I run the program without debug mode, I get ERR_RTE error. I searched the internet and couldn't find an answer to my problem. I suppose the code is fine due to the fact it works in debug mode. Program generates error in tcp_connect function at netif = ip_route part. Here is the code: uint8_t TCP_ClientInit() { struct tcp_pcb *tpcb = {0}; err_t res = 0; tpcb = tcp_new(); if(tpcb != 0) { ip_addr_t sourceIPAddr; IP_ADDR4(&sourceIPAddr, 192, 168, 0, 111); res = tcp_bind(tpcb, &sourceIPAddr, 1500); ip_addr_t destIPADDR; IP_ADDR4(&destIPADDR, 192, 168, 0, 15); res = tcp_connect(tpcb, &destIPADDR, 1400, tcp_client_connected); // this returns error ERR_RTE } else { return HAL_ERROR; } if(re
I have a Nucleo F746ZG board and I've implemented a small UDP echo server in LwIP standalone mode. (No RTOS)If I hit 'debug' and as soon as the code stops on the first instruction hit 'continue' then it works perfectly.If however I just run the code, (no debugging) or reset the board it does not work. It sits in a loop patiently waiting for a DHCP address. I know this because I use the three LEDs to show status. Here is my main loop code: int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* Enable the CPU Cache */ /* Enable I-Cache---------------------------------------------------------*/ SCB_EnableICache(); /* Enable D-Cache---------------------------------------------------------*/ SCB_EnableDCache(); /* 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 sys
I'm attempting to use I2S to drive the WM8978 for audio recording (the SAI pins are already occupied, so please don't suggest switching to SAI). I've ported the well-tested WM8978 driver code from the F4 series and configured I2S DMA to receive data. However, I haven't been able to receive audio data—there's only clean background noise. I've tested the waveforms at the I2S interface, and here's how I've configured I2S in my code:<i2s config> hi2s3.Instance = SPI3; hi2s3.Init.Mode = I2S_MODE_MASTER_RX; hi2s3.Init.Standard = I2S_STANDARD_PCM_SHORT;//I2S_STANDARD_PHILIPS; hi2s3.Init.DataFormat = I2S_DATAFORMAT_16B; hi2s3.Init.MCLKOutput = I2S_MCLKOUTPUT_ENABLE; hi2s3.Init.AudioFreq = I2S_AUDIOFREQ_8K; hi2s3.Init.CPOL = I2S_CPOL_LOW; hi2s3.Init.FirstBit = I2S_FIRSTBIT_MSB; hi2s3.Init.WSInversion = I2S_WS_INVERSION_DISABLE; hi2s3.Init.Data24BitAlignment = I2S_DATA_24BIT_ALIGNMENT_RIGHT; hi2s3.Init.MasterKeepIOState = I2S_MASTER_KEEP_IO_STATE_DISABLE; <wm8978 config>
I am on an H573 and trying to rd/wr a file on a fat32-formatted USB memory stick using the mass storage controller. To jump right into the problem (details further below), I am trying to understand what to do about this block when I am running in standalone mode. This snip comes from the example code which is in RTOS mode. I want standalone mode. --Background--As a starting point, I grabbed the Ux_MSC_Host example, and got that working with no difficulties on the H573 dev kit MB1677. That demo uses FileX, UsbX, ThreadX, and some power delivery peripherals. Then I started some changes:I now have hardware that does not have power delivery. There is a 5v rail turned on and powering the memory stick.For various reasons I do not want ThreadX enabled; so: I setup FileX and UsbX, and added some short snips in main.c, to finish initialization and loop on _ux_host_stack_tasks_run.With this, I am able to enumerate and get into the ux_host_event_callback. But... When
I’m currently working with the STM32F746NGH6 Discovery Kit and trying to interface it with the MT25QL128 NOR Flash via the QUADSPI interface, with the goal of creating an external flash loader. I’m using the official STMicroelectronics driver from GitHub: https://github.com/STMicroelectronics/stm32-external-loader/tree/896df94da5fa6dc3532d302c8f942f40bdb22bd1/QSPI_Drivers/MT25QL128AMT25QL128A QSPI Driver – ST GitHub I’ve tried using this code without any changes. When I run my project, the CSP_QUADSPI_Init() function always returns HAL_ERROR.As a result, the flash operations like erase, write, and memory-mapped access do not execute. I’ve confirmed this by adding debug messages through UART – the initialization fails right at the start. #define SECTORS_COUNT 100 #define MEMORY_SECTOR_SIZE 4096 // or as per your flash config uint8_t buffer_test[MEMORY_SECTOR_SIZE]; uint32_t var = 0; unsigned char DisplayBuffer[100]; if (CSP_QUADSPI_Init() != HAL_OK) { sprintf
how i am config ethernet in the stm32h753xi6 board ?
Hello,I'm working on implementing USB UVC on the STM32N6570-DK board. I generated a project using STM32CubeMX only for FSBL and added the following files manually from the ST USBX example project1 . ux_device_video.c and .h2 . ux_device_descriptors .c and .h3 . app_usbx_device .c and .h4 . app_azure_rtos.c and .hAll files were taken from this example:https://github.com/STMicroelectronics/STM32CubeN6/tree/main/Projects/STM32N6570-DK/Applications/USBX/Ux_Device_Video/Appli However, I did not use USBPD/UCPD in my CubeMX configuration. The ST example uses both USBPD and UCPD and also includes a separate FSBL and Application.Issue:When I flash the my project to the STM32N6570-DK board, the USB device is not enumerating as a UVC device it does not appear in the Windows Device Manager at all.I previously tested a similar setup on an STM32U5 device, and it worked — the UVC device was properly enumerated.Questions:Is UCPD/USBPD required for USB UVC to work on the STM32N6570-DK board?Could
Hello,I'm here on H753, external clock, CPU clock configured to 400MHz. Setup code is generated by CubeMx.If I execute a HAL_Delay() takes twice the time as expected, e.g. 2ms instead 1ms. I checked via GPIO toggle with a scope.The MCO output is correct, so I guess the CPU clock is correct.The system core clock variable is calculated/set to 400MHz after system clock initialization.I remember I watched the same problem on another M7 chip, the SAME70.I fixed it by patching the SYSTICK setup (HAL_SYSTICK_Config) but I'd like to know what is the problem here.It seems to me, the SYSTICK is fed by 200MHz, not 400MHz as suggested in the CubeMx clock tree.Does anybody have experienced this or can share information regarding SYSTICK?Thanks,Jochen
Hello, I am looking at how to abort the MemX_IT functions. Looking through HAL_I2C_Master_Abort_IT, it seems like that only works for the Master API functions and not the mem functions. Are there any HAL functions for Mem Abort?
Hello,I'm trying to run the Ux_Host_VIDEO example from STM32CubeN6 on the STM32N6570-DK board, but UVC camera streaming does not work. The USB device is detected, but no video stream starts. Test Environment:Board: STM32N6570-DKExample: Ux_Host_VIDEO (from STM32CubeN6 package)IDE: STM32CubeIDE 1.18.1Camera models tested: Logitech C270Connection: USB-C OTG (HS) port using USB-A adapter USB host stack detects the device and logs: **** USB OTG HS in HS VIDEO Host ****USB Host Video library started.Starting VIDEO ApplicationConnect your VIDEO DeviceUSB Video Device InsertedPID: 0x825VID: 0x46dUSB Video Host App...Video Device is ready... No streaming happens after that.Function _ux_host_class_video_alternate_setting_locate() filters out most alternate settings.The condition: if (payload_size >= max_payload_size) causes only a few alternate settings (e.g., >= 7) to be selected, but those don’t work either.Questions:Has anyone successfully tested this exa
Hello everyone. I'm developing Ethernet on NuceloF746ZG board. I'm listening to the UDP on port 1001,where there is datagram incoming every 2ms, but my callback function gets called 96 times, before it stops, and resumes for next 96 times, and so on.This is happening with lwIP and Mongoose.I followed example code, which in the end worked the same. Changing any parameter from increasing Descriptors number, to RxBuffer didn't have impact.I tracked that HAL_ETH_ReadData also gets called 98 times and hangs until it repeats itself. Bellow are attached layout and configurations.I suspect something with ETH_DMA default setup or memory alignment but wasn't unable to track it so far. Any help will be welcomed.
Working on bidirectional communication between CM4 and CM7 on the STM32H747I-DISCO using FreeRTOS stream buffers (CoreMessageBuffer). One-way communication works fine (either CM4 → CM7 or CM7 → CM4), but both directions at the same time do not work as expected.What Works:CM4 → CM7: Data is sent and received correctly.CM7 → CM4: Works fine when used independently.Current Issue:When both directions are enabled simultaneously, it fails to receive data in both the direction.Memory Section Mapping:Configured dedicated sections for each direction in both CM4 and CM7 linker files:.ld/* CM4 → CM7 */ .xCoreMessageBuffer_section_CM4_to_CM7 : { *(.xCoreMessageBuffer_section_CM4_to_CM7) } > RAM_D3_Z1 .xStreamBufferStruct_section_CM4_to_CM7 : { *(.xStreamBufferStruct_section_CM4_to_CM7) } > RAM_D3_Z2 .ucStorageBuffer_section_CM4_to_CM7 : { *(.ucStorageBuffer_section_CM4_to_CM7) } > RAM_D3_Z3 /* CM7 → CM4 */ .xCoreMessageBuffer_section_CM7_to_CM4 : { *(.xCoreMessageBuffer_section
tima 的pwm输出正确,但是timb的pwm一个周期出现无法reset的情况
I am developing a USB power delivery solution involving the STM32G0B1. I have already followed the tutorials for creating a simple DRP application on a Nucleo devkit and they work as expected.To my understanding there are two paths that we can take; the one is based on FreeRTOS (which comes as a CubeMX software package), while the other is to use a bare-metal flavour of the application with no RTOS.We have already our own special version of FreeRTOS internally in my company, so, in order to use this, I grabbed the do-while loop from USBPD_DPM_Run() that is executed when no RTOS is in place, and I created a FreeRTOS task that runs it. I ended up with the following snippet:while(true) { // Scheduler stuff uint8_t port = 0; uint32_t current_time = HAL_GetTick(); uint32_t next_delay = 0xFF; // Max. delay for (port = 0; port <= USBPD_PORT_COUNT; port++) { if ((current_time - DPM_Sleep_start[port]) < DPM_Sleep_time[port]) { uint32_t port_delay = DPM_Sleep_time[port
I can't find Try.SRC or Try.SNK features for DRP devices in ST's USB C Power Delivery Stack (USBPD Core). Did I miss something?If it is not in the stack yet. Is ST planning to integrate this feature? What timeline are we looking at?Is it easy to implement? I guess I would just need to define Rp or Rd values after initial connection, but will that work with the rest of the stack or will it result in a mess?Has anyone tried or even achieved it? Is there a sample implementation?
Environment:Board: STM32N6570-DKNetwork: RJ-45 Ethernet cable connected to a router, IP obtained via DHCP: 192.168.10.41Client: VLC 3.0.21 (64-bit) on Windows 10Stream URL: rtsp://192.168.10.41:554/streamSymptoms:VLC can successfully open the RTSP stream and display video.The video is very blurry, especially during motion, where details are hard to distinguish.The frame rate is very low (VLC statistics show high frame loss and decoding frame rate below 10 fps).Tried So Far:Increased network caching in VLC to 1000 ms.Questions:Why does VLC show blurry and low frame rate video when playing the same RTSP stream? Is it due to a low default bitrate or misconfigured encoding parameters?In the NetX Duo RTSP example, how can we correctly set H.264 bitrate, IDR (keyframe) interval, and RTCP minimum report interval to ensure clear image quality with minimal frame drops?What other common factors could cause blurry video and low frame rat
Hello everyone! I'm working on a project using an STM32U575 microcontroller, and I need to manage an SD card (read, write, etc.) via SDIO in 1-bit mode, but without using FreeRTOS. I noticed that FatFs is not natively supported for this MCU in STM32CubeMX, and the recommended alternative is FileX, which is tightly integrated with FreeRTOS. However, due to project constraints, I cannot use an RTOS. So I'm trying to manually integrate FatFs into the project, but I'm running into some difficulties with the integration and compatibility. I was wondering: Has anyone already done this kind of integration? Is it possible to use FileX in standalone mode, without FreeRTOS? Do you have any examples, documentation, or code references for using FatFs or FileX standalone on STM32U5 series? Any help, advice, or shared experience would be greatly appreciated. Thank you in advance and have a great evening! Stefano
Hi,Im trying to configure SDMMC 4 wide bus with FATFS for SD card.Im not able to see any DMA options or Platform setting to set SD detect GPIO pin.am I missing something? I have refered through most of the documentation and tutorials online but with this MCU there is no options for DMA or Platform settings menu in .ioc configuration.Could you please help me with a procedure to setup SDMMC and FATFS for this MCU?Thanks
Hi,I'm currently using an STM32G0B0CET6 and encountering an issue with writing a uint32_t variable to EEPROM using Write_U32_Variable(). The function works correctly during task initialization and in normal bare metal while loop too, but it fails when I try to save the variable at runtime (EE_WRITE_ERROR).This code was previously working without issues on an STM32G0B0KET6. I have configured the EEPROM emulation with START_PAGE_ADDRESS set to 0x08040000U and NB_OF_VARIABLES defined as 781.Could you help review or suggest changes to ensure compatibility with STM32G0B0CET6?void DaQ(void *argument) { /* USER CODE BEGIN DaQ */ Write_U32_Variable(__OPERATING_MODE, 12); // Working /* Infinite loop */ for(;;) { Write_U32_Variable(__OPERATING_MODE, 14); // Non-working osDelay(30000); } /* USER CODE END DaQ */ } bool Write_U32_Variable(uint32_t variable_id, uint32_t value){ /* Declaring 8-bit unsigned integer to store the EEPROM read/Write Status */ bool return_variable = true; u
I am using two STM32H503 boards. One is programmed as an I3C controller, the other as an I3C target. My goal is to have the target send an IBI on the bus and the controller will receive the IBI and then immediately issue a pended read -- there will be no stop condition on the bus after receipt of the MDB of the IBI, the controller will issue a repeated start and then perform the read. The target will issue the IBI and then be ready to immediately respond with the data to transmit. So, I'm assuming I will need to pend the write on the target before issuing the IBI.I am looking at the controller diagram for IBI on figure 670 on page 2175 of RM0481 Rev 2. There is the following note with 2 asterisks :Repeated start (Sr) if there is a pending transfer to execute and if I3C_DEVRi.SUSP = 0, else stop (P) in push-pull Is there any information or example on how to pend an I3C read to happen immediately after the IBI with no stop -- just a restart? Also,
I am connecting a TCP/IP stack to the HAL_ETH driver of an STM32F7xx. I am using https://github.com/STMicroelectronics/STM32CubeF7/blob/master/Projects/STM32F767ZI-Nucleo/Applications/LwIP/LwIP_HTTP_Server_Netconn_RTOS/Src/ethernetif.c as a starting point. I see that low_level_output() calls HAL_ETH_ReleaseTxPacket() only if the ethernet driver runs out of DMA descriptors: do { if(HAL_ETH_Transmit_IT(&EthHandle, &TxConfig) == HAL_OK) { errval = ERR_OK; } else { if(HAL_ETH_GetError(&EthHandle) & HAL_ETH_ERROR_BUSY) { /* Wait for descriptors to become available */ osSemaphoreWait( TxPktSemaphore, ETHIF_TX_TIMEOUT); HAL_ETH_ReleaseTxPacket(&EthHandle); errval = ERR_BUF; } else { /* Other error */ pbuf_free(p); errval = ERR_IF; } } }while(errval == ERR_BUF); It seems like HAL_ETH_ReleaseTxPacket() will then deallocate all completed buffers and block if none of the scheduled buffers has been completed yet. So far so good. But:I
Hi everyone,I'm building a watchdog application on the STM32 NUCLEO-U385RG-Q using the Arduino IDE and the IWatchdog library. Since the library doesn’t support early interrupt callbacks, I modified it by adding some LL code (afterLL_IWDG_SetReloadCounter()) inside IWatchdogClass::set() as shown below. However, the early interrupt doesn’t trigger. Am I missing something, like NVIC config or enabling the interrupt line? LL_IWDG_SetEwiTime(IWDG, (uint32_t)EWITimeout); LL_IWDG_EnableIT_EWI(IWDG); Arduino Code#include <IWatchdog.h> extern "C"{ #include <stm32u3xx_ll_iwdg.h> #include <stm32u3xx.h> } extern "C" void IWDG_IRQHandler (void){ Serial.println("Wake up Interrupt"); } void setup(){ Serial.begin(115200); __enable_irq(); // Enables global interrupts HAL_NVIC_SetPriority(IWDG_IRQn, 0, 0); HAL_NVIC_EnableIRQ(IWDG_IRQn); IWatchdog.begin(10000000); }After further debugging, I found that EWI timeout is not being set if EWI interrupt is enabled and when&nb
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.