Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
NUCLEO-F767ZI I'm trying to use the LwIP middleware which I have enabled in MX. First I'm trying to check if an ethernet cable is attached or not. I have setup UART3 to use printf (which works as expected) I've set the callback in lwip.c to print when the cable is removed or plugged in or so I thought but I get no message when I connect or disconnect the cable. The LEDs on the socket light up when the cable is connected, so the board at some level does see the cable. What am I missing here? EDIT:: LWIP_NETIF_LINK_CALLBACK was enabled in MX // In main.c MX_LWIP_Init(); /* USER CODE BEGIN WHILE */ while (1) { MX_LWIP_Process(); /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ // In lwip.c the callback function that is registered in MX_LWIP_Init() static void ethernet_link_status_updated(struct netif *netif) { if (netif_is_up(netif)) { /* USER CODE BEGIN 5 */ printf("Cable connected\r\n"); /* USER CODE END 5 */ } else /* netif is down */ { /* USER C
Hello, I configured a timer in STM32CubeMX2 to use 2 channels (HAL_TIM_CHANNEL_1 and HAL_TIM_CHANNEL_3). After the mx_system_init() I use the following code: hal_tim_handle_t *htim5 = mx_tim5_gethandle(); if (HAL_TIM_OC_StartChannel(htim5, HAL_TIM_CHANNEL_1) != HAL_OK) { return (-1); } if (HAL_TIM_OC_StartChannel(htim5, HAL_TIM_CHANNEL_3) != HAL_OK) { return (-1); } if (HAL_TIM_Start(htim5) != HAL_OK) { return (-1); } The first channel starts as expected, but when I attempt to start the second channel the code causes an assert in HAL_TIM_OC_StartChannel: /* Check and update the channel state */ ASSERT_DBG_STATE(htim->channel_states[channel], HAL_TIM_OC_CHANNEL_STATE_IDLE); Do I need to do anything different? Regards, -Gil
Hi all.I wish disable auto PAD disable CRC append. Send packet use low_level_output(), before call HAL_ETH_Transmit_IT()I set TxConfig.ChecksumCtrl = ETH_CHECKSUM_DISABLE; TxConfig.CRCPadCtrl = ETH_CRC_PAD_DISABLE;but packet allways pad to 60byte,if use TxConfig.CRCPadCtrl = ETH_CRC_PAD_DISABLE;, no packet outputif use TxConfig.CRCPadCtrl = ETH_CRC_INSERT; output fine but have 4byte crcr append.How to do , NO-PAD NO-CRC send packet?
I'm trying to interface with a W25N NAND flash chip on an STM32H7, over QSPI. I've only got consistent output out of the reads, and even then, I notice the system hangs forever and can't accept anymore input after a read. Everything else will hang immediately, even a print statement to the terminal at the top of the function won't appear, and the whole system hangs. From some similar issues I found online, I thought it would be a timing issue, and so I tried to implement a status register check. That's my first function in my excerpt below. However, this function couldn't even run alone without again hanging the system (meaning something else is causing the resets, program, clear, and even status check to hang). What else could be the issue that stops everything from running? Any advice much appreciated. Thanks very much in advance.uint8_t W25N_status(void) { QSPI_CommandTypeDef cmd = {0}; uint8_t status; cmd.InstructionMode = QSPI_INSTRUCTION_1_LINE; cmd.AddressMod
Hello, is it possible to boot FSBL and load application from SD card upon powerup, bypassing onboard flash? I didn't see any clear guides on this procedure.Thank you
@FBL Can you explain me about buffer descriptor table (BDT)? Is it fixed?I have got behavior that I can't explain.Dumping packets on host I got wrong data. Length is ok, but data is wrong.In BDT I wrote correct address and length. Data wrote in pma (adress that is in BDT) is correct.But when I stop in debugging address in BDT is changed. As I think in BDT there is a place for each endpoint (or it is like cyclic buffer?)What I found if I set break point with "if" condition, just before sending address in BDT is OK, and data on host is OK. It seems to me that I am working incorrectly with BDT.
I am coding from the scratch to learn how STM32 works with MIPI-DSI LCD, because I am going to use customized MIPI-DSI LCD. I refer to the official code, but some incorrect content as below:official default code: in main.c , static void MX_LTDC_Init(void):// SETVCOMuint8_t InitParam60[4] = {00, 00, 00, 0xC0};if (HAL_DSI_LongWrite(&hdsi, 0, DSI_DCS_LONG_PKT_WRITE, 4, 0xC7, InitParam60) != HAL_OK){Error_Handler();}BUT, I check HX8379C datasheet (LCD control ), SETVCOM command is (B6h), and there is no 0xC7 command ?so what's this code for? and HX8379C datasheet dosen't mention initial sequence , how do we know that we need to set SETPOWER, SETDISP, Set display cycle timing,.....SET GAMMA,....,then Exit Sleep Mode to let LCD work? I don't use touchgfx now, just want to test if DSIHOST, LTDC work successfully, so I declare a framebuffer[480*480] then in MX_LTDC_Init(), write:pLayerCfg.FBStartAdress = (uint32_t)framebuffer;then using for loop
I am trying to capture data from the LINE_IN (blue jack on board), but I am not receiving the correct input. I evaluated my output at the oscilloscope and noticed that I am not receiving the sinusoid I am injecting; the frequency is correct, but the data appears clipped, as shown in the picture. I tried to reduce the Vpp, but it just started getting noisy instead of giving the correct input.My second test was to record on the sd card, and the problem persisted; I am only getting data above zero and noiseI am using the BSP library stm32h735g_discovery_audio.c, and to get the correct frequency that I was inputting, I modified these values in the BSP_AUDIO_IN_Initmx_config.FrameLength = 64;//changed: prev:128 mx_config.ActiveFrameLength = 32;//changed /An changed the number of slots like this:hsai->SlotInit.SlotNumber = 4; /* WM8994 TDM mode: 4 slots */I also tried to modify these registers from the audio codec directly, but nothing seems to make it work:* Disable mute on IN1L_TO_
Dear community members,STM32H7S78-DK: USBX standalone (CDC ACM + PIMA) works in HS now but PIMA / MTP is not supported in standalone mode in USBXCurrently, it is not possible to use the PIMA/MTP class in USBX in standalone mode (without an RTOS). The MTP implementation depends on Azure RTOS ThreadX, and there is no official support for running it in bare-metal configurations.When attempting to use it in standalone mode, the stack returns:#define UX_FUNCTION_NOT_SUPPORTED 0x54This is also reflected in the official documentation:USBX Getting Started – Bare-metal support matrices
Hello, I configured TIM5 to generate a signal out to a pin using STM32CubeMX2 for a Nucleo-C562RE board. I enabled the EXTI interrupt for the pin in the timer configuration to get EXTI6 interrupts on the falling edge. I also enabled the use of register callbacks for EXTI. The problem that I am having is that I cannot find the function to retrieve hEXTI6 to register the EXTI callback. I looked in the mx_tim5.h/c and in mx_gpio_default.h/c. I had no problem getting the EXTI handles for GPIO EXTI (for example mx_gpio_default_exti7_gethandle()) and getting TIM handles (mx_tim5_gethandle()). To make the code work I had to add mx_gpio_default_exti6_gethandle() prototype to mx_tim5.h and the implementation below to mx_tim5.c: hal_exti_handle_t *mx_gpio_default_exti6_gethandle(void) { return (&hEXTI6); } Maybe the definition/function is there but I cannot find it or maybe there is some additional configuration to be done in STM32CubeMX2. I attached my ioc2
Hey there,I'm currently trying to port a project that I was using successfully on the STM32U5A5, to the STM32N657.The project utilises the PDM2PCM library to convert a PDM audio stream received from a MEMS microphone via the SAI interface of the MCU into PCM audio data. It is based on an example from the STM32U3 MCU firmware package (STM32Cube/Repository/STM32Cube_FW_U3_V1.3.0/Projects/NUCLEO-U385RG-Q/Examples/SAI/SAI_AudioRecord_PDM), parts of which I have incorporated into my own application on the STM32U5A5.I'm now trying to port this project to the STM32N657 on a NUCLEO-N657X0-Q board. I've found the matching PDM2PCM library for the N6's M55 core in the X-CUBE-AUDIO-KIT as mentioned here.Now, when I integrate this library (libPDMFilter_CM55_GCC_wc32.a) into my project and start the debugger of the STM32CubeIDE it starts printing "Target is not responding, retrying..." in the debugging console as soon as the program flow reaches the call to the PDM2PCM_init function of the libr
Hi ST Community, I'm facing a critical and reproducible hardware JPEG encoding issue on the STM32N6. The JPEG encoder only works correctly when the image width is exactly 800 pixels. Any other width I've tested — including 480, 960, and 960x480 — causes the hardware to fail in exactly the same way. Height variations do not affect the outcome; the problem is solely tied to the row width. Environment: MCU: STM32N657xx (STM32N6-DK board) Firmware Package: STM32Cube FW_N6 V1.3.0 IDE: STM32CubeIDE Image Format: RGB565 input → YCbCr 4:2:0 subsampling, Quality 75. Issue Summary:When the image width is 800, JPEG encoding completes successfully and produces a valid compressed JPEG stream. When the width is 480, 960, or any other tested value ≠ 800, the hardware encoder aborts input processing early (after ~14 input chunks for 960 width) and subsequently dumps a massive amount of uncompressed raw data into the output buffer. The output DMA fills
I had some issues configuring H573 with CubeMX.When I configure TIM2 or TIM3 according to the instructions of RMII_PTP_Synchro in CubeMX I cannot enable the RMII PTP functionality.And when looking at RM0481 it seems that the description of the relationship between these two timers and ETH MAC is a bit vague.What configuration is required to enable RMII_PTP_Synchro on H573?
Hi Forum! Previous experiments, but it still could not work, I have no idea how to fix this problem:https://community.st.com/t5/stm32-mcus-embedded-software/hmd-application-stm32f1-with-bno055-via-vcp/td-p/876235 Therefore, I revisited the literature review. I found this paper from meta oculus, they using the HID to transfer the IMU data, so I want to imitate their steps. (using notebookLm to learn it )https://msl.cs.illinois.edu/~lavalle/papers/LavYerKatAnt14.pdf HID read/write tool(software)https://github.com/benbaker76/SimpleHIDWrite Problem: Custom HID could be detected by host, the IMU could send the data at 100Hz, host could send the data to STM32 MCU, but only the first time was successful, the second time will let the HID read/write tool(software) crash, STM32 could send data after receiving the data first time. ----------------------------------------------------------------------------------------------------------------------------------------------------------
Hello ST,I'm trying to communicate the STM32F411RET6 with IMP34DT05 mic, i have enabled the I2S in ioc configuration, i have downloaded and added the library file from https://www.st.com/en/embedded-software/x-cube-memsmic1.html, while building the project getting 15000+errors coming, i'm assuming this library file is incorrect, could you please review as attached and provide Specific working library for this project.Advance Thanks,Sridhar.
Hello ST community, I configured my project in STM32CubeMX 6.17.0 and use STM32CubeIDE 2.1.1 to debug. The goal of the program is to receive a raw ethernet frame.I followed this tutorial, of course I adapted the pins to NUCLEO-N657X0-Q, and I skipped the part with the transmission, I didn't change anything in the HAL_ETH functions. I am sending from the PC (I can see that the frame is sended with wireshark):from scapy.layers.l2 import Ether from scapy.packet import Raw from scapy.sendrecv import sendp #Terminal ipconfig /all dst_mac = "00:80:E1:00:00:00" src_mac = "AA:79:39:37:92:EA" payload = bytes([0x01] * 86) frame = Ether(dst=dst_mac, src=src_mac, type=0x88B5)/Raw(payload) sendp(frame, iface="Intel(R) Ethernet Connection (13) I219-LM", verbose=True)I placed a breakpoint in :void HAL_ETH_RxCpltCallback(ETH_HandleTypeDef * heth) { }This callback should be executed when an Ethernet packet is received, but it never happened.I also tried by defining USE_HAL
This is an improvement request post.STM32 HAL on every family has tons of following code constructs:tickstart = HAL_GetTick(); while (!condition) { if ((HAL_GetTick() - tickstart) > TIMEOUT_VALUE) { return HAL_TIMEOUT; } }When using HAL with (Free)RTOS or interrupt based scheduler, then these while loops delay same priority tasks (until time-slicing kicks in), block everything that has lower preemption priority, waste energy (crucial for battery powered devices) and decrease responsiveness.There are multiple ways to improve it. One of the simplest is to supplement non-critical* loops with optional user-definable yield macros.__weak void HAL_Yield(void) { } tickstart = HAL_GetTick(); while (!condition) { if ((HAL_GetTick() - tickstart) > TIMEOUT_VALUE) { return HAL_TIMEOUT; } HAL_Yield(); }Now user can implement something like this when using CMSIS OS v2 API:#include "cmsis_os2.h" void HAL_Yield(void) { /* Kernel running and call not from ISR? */ if ((osKernelG
Hi everyone, I am currently developing an image capture project using the STM32N657 (Cortex-M55) and have encountered an extremely bizarre DMA2D write issue (a silent failure). Goal: Use DMA2D (M2M_PFC) to convert an RGB565 buffer to RGB888 and write it to CPUAXI_RAM1 (0x34080000). [Problem Description] I wrote a "minimal isolation test" to bypass all camera/GPDMA variables. I forced the CPU to fill the source buffer with pure white (0xFFFFFFFF), and then manually triggered the DMA2D to transfer it to the destination buffer. The Result: The DMA2D finishes successfully. The DMA2D->ISR register reads 0x00000002 (the TCIF Transfer Complete Interrupt Flag is set, and there are NO Transfer Errors). However, the destination buffer remains completely filled with 0x00000000. [Troubleshooting Done] To isolate the issue, I have verified the following, but the problem persists: CPU Read/Write Test (Pass): Before triggering the DMA2D, I forced the CPU to write 0xDEADBEEF to the destinatio
Title edited to clarify this is about CMSIS-RTOSHello, everybody!I don't know where to look for information on which CMSIS versions are supported by specific STM32 microcontrollers. I asked one of the ST employees and STM32 Sidekick about this, and I got no definitive answers.STM software tools confuse me further. For example, STM32CubeMX (6.17.0) allows me to choose CMSISv2 the interface for FreeRTOS in my STM32F769I‑DISCO board project, but LwIP in the same project does not see the operating system used unless I change the CMSIS version to v1 (you can find more details about this specific issue in this thread). I couldn't find any document that would say which interfaces are supported by LwIP either.That's why I would like to ask You, where should I look for information about which CMSIS versions are supported by specific STM MCUs and, ideally, middlewares and software packages?
I configured a nucleato-L152RE LED program using CubeMX6.17+STM32L1 Firmware Package V1.10.6 and found that the program kept restarting automatically. After adding the following code to the SystemInit() function generated by CubeMX, the problem was solved. What is the reason for this? And my other projects never need to include this line of code, such as F103, F411, G431, L051, and so on.SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET;
Dear all,I have a working camera + video encoder solution running with LCD display disabled.I have one preview thread that displays camera data on the LCD, this thread can be suspended and restarted. While the first run looks fine, the output has a green tint from the second start on:First iteration: Second+ iteration: The code is quite straigh-forward, initializing the hw blocks as needed and freeing resources when it is stopped:void ui_thread_func(ULONG arg) { while (1) { run_ui(); // wait until being woken again: tx_thread_suspend(&ui_thread); } } #define FRAME_BASE 0x34050000 #define FRAME_SIZE ( 800 * 480 * 2 ) #define FRAME_0 (FRAME_BASE) #define FRAME_1 (FRAME_BASE + (FRAME_SIZE)) static void run_ui() { /* Initialize camera */ if(BSP_CAMERA_Init(0, CAMERA_R2592x1944, CAMERA_PF_RAW_RGGB10) != BSP_ERROR_NONE){ Error_Handler(); } /* start camera acquisition */ if(BSP_CAMERA_DoubleBufferStart(0, (uint8_t *)(FRAME_0),(uint8_t *)(FRAME_1), CAMERA_MODE
Hello STM Community,I am a beginner working with the STM32H7B3I-EVAL evaluation board based on the STM32H7B3LIH6Q MCU, and I am currently setting up my development environment on Ubuntu 24.04.3 LTS.I installed STM32CubeIDE 1.18.0 using the following installer:st-stm32cubeide_1.18.0_24413_20250227_1633_amd64.sh.zipI am facing a few issues and would really appreciate your guidance.1. Need existing demo codes for STM32H7B3I-EVALI would like to get the existing/demo example codes available for this board, especially the examples related to the firmware version currently flashed on my board, which shows:Firmware Version: V1.0.1Could anyone please guide me on where to find the exact demo code corresponding to the factory-flashed board behavior, if available?I am specifically looking for separate demo examples for:LEDADCGPIOUARTSPII2CTFT/LCDTouchCameraWi-Fiother onboard peripheralsI am using Linux Ubuntu 24.04.3 LTS, so Linux-compatible steps would be very helpful.At the moment, I mainly need
Hello, What HAL2 API can I use to turn on/off the output of a timer? In HAL (ver 1) this could have been done like this:TIMx->CCER &= ~TIM_CCER_CC1E; // Example for Channel 1: ~TIM_CCER_CC1E // or __HAL_TIM_MOE_DISABLE(&htimx); Thank you,-Gil
I've been using a nucleo l476rg with a LIS2DUX12 sensor and I need to use the SPI protocol, but came as a surprise that the MISO line is not working. When it's not getting 0xFF (should be 0x47), gets inconsistent values. Tried changing CPHA, CPOL, prescale and none of that is working.// 1. Tx and Rx arrays uint8_t tx_wakeup[2] = {0x3E, 0x01}; // Register 0x3E, value0x01 (Soft Power-Down) uint8_t tx_whoami[2] = {0x8F, 0x00}; // Read 0x0F (WHO_AM_I) uint8_t rx_buffer[2] = {0x00, 0x00}; char msg[50]; HAL_Delay(100); // Wake up sequence HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_RESET); HAL_SPI_Transmit(&hspi1, tx_wakeup, 2, 100); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_SET); // Read who_am_i HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_RESET); //HAL_SPI_TransmitReceive(&hspi1, tx_whoami, rx_buffer, 2, 100); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_6, GPIO_PIN_SET); // print data sprintf(msg, "WHO_AM_I = 0x%02X\r\n", rx_buffer[1]); HAL_UART_Transmit(&huar
Hello my friends, I hope you are doing great.I am trying to create a custom driver for UART peripheral with CMSIS register header files.I have created a build system using the board files and linkers and make. So far I have been able to make drivers for the GPIO pins.Now I am trying to create my own driver for the UART peripheral via the CMSIS. So far I have created this: int uart_params_init(uart_t *uart){ if (!uart) return -1; // defualt configs: uart->tx_pin = 9; uart->rx_pin = 10; uart->baudrate = 115200; uart->tx_port = GPIOA; uart->rx_port = GPIOA; uart->instance = USART1; uart->tx_af = 1; uart->rx_af = 1; return 0; } int uart_init(uart_t *uart) { if (!uart || !uart->tx_port || !uart->rx_port) return -1; if (uart_initialized) return 0; // Enable GPIO clocks for the port: if (uart->tx_port == GPIOA || uart->rx_port == GPIOA){ RCC->IOPENR |= RCC_IOPENR_GPIOAEN; } else if (uart->tx_port == GPIOB || uart->rx_po
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.