Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
I already posted this topic but I got low engagement.XIP template works on 50Mhz clock for XSPI and it works good. If I bump up the XSPI frequency to 200Mhz without modifying anything else, it fail at BOOT_Application() in FSBL. XSPI setup should remain the same for both 50Mhz and 200Mhz if I’m not mistaken.Dummy cycles are set weirdly also. I print XSPI CLK, PRESCALER and dummy cycles setup before BOOT_Application(). CLK = HAL_RCCEx_GetPeriphCLKFreq(RCC_PERIPHCLK_XSPI2); PRESCALER = (XSPI2->DCR2 & XSPI_DCR2_PRESCALER_Msk) >> XSPI_DCR2_PRESCALER_Pos; printf("FSBL CLK: %lu \r\n", CLK); printf("FSBL PRESCALER: %lu \r\n", PRESCALER); printf("FSBL Dummy: %lu \r\n", XSPI2->TCR); /* USER CODE END BSP */ /* Launch the application */ if (BOOT_OK != BOOT_Application()) { Error_Handler(); }XIP template example works (FSBL prints in FSBL, and Appli prints in APPLI)And when set at 200Mhz, it takes a while (~20s) before reaching BOOT_Application where
Hello everyone,I’m using Nucleo STM32N6 for a project of mine, and I used template XIP to begin with.In template XIP, clock frequency of the XSPI2 is set to 50Mhz without any prescalers, and VDDIO3 is set to 1 (1.8V). That setup works fine for XIP up to 85Mhz clock frequency, but above that at BOOT (00) it fails as soon as it tries to jump to a application. I haven’t been able to resolve this problem. Is it setup, or something with EXT_MEM middleware?In MX25 datasheet it can be seen that frequency heavily depends on dummy cycles, and 86Mhz corresponds to 8 dummy cycles, but on 200Mhz it requires 20. In EXT_MEM setup there is a 8D8D8D case where i go into during setup and it sets object to 20 dummy cycles, but I’m not sure is it successful in actually forcing that setup. Any help would be welcome.
Board: custom STM32N657Z0H3Q (not a Discovery/Nucleo)Flash: Macronix MX25U12835F, 16 MB, Quad (x4), 1.8 V, no DQSTools: STM32CubeProgrammer 2.22.0 and 2.23.0, LinuxWe need to program the external XSPI NOR flash (FSBL + application) using only USB serial boot / DFU, with no ST-LINK connection.This is a product requirement, not a bring-up convenience. On our board, entering development boot requires BOOT1 = 1, and BOOT1 (PA6) is wired as DCMIPP_PIXCLK and actively driven by an on-board FPGA. We cannot reliably force that pin without contending with the FPGA driver. USB serial boot needs only BOOT0 = 1 and BOOT1 = 0, which is the FPGA-idle state, so it is the only strap combination that is safe on this hardware. We attempted to relocate BOOT1 via OTP19 dev_boot_port/dev_boot_pin, and that attempt left the board permanently inaccessible. That is a separate open thread with no resolution so far: https://community.st.com/stm32-mcus-products-25/stm32n657-after-programming-otp19-dev-boot-port-
I’ve got a working graphics system. It does high level operations on a 32 bit virtual image of the display’s resolution. The image is then translated to a 16 bit buffer image (RGB565 for an ILI9341 display). That image is then transferred over SPI to the display. The SPI drivers can be polled, interrupt driven, or DMA driven. Software drivers are used for all of this, and work.Moving to a different processor (U575 from L562), ChromART is available. It could be used for filling the virtual image, translating to the RGB565 image. 2D DMA can be used to transfer modified blocks to the display.Now the problem.The transfer works erratically in some cases. Some data (and I’m using mostly saturated colors) doesn’t transfer well into RGB565 (say 100% blue), it may just end up with black. Other times, the complete color palette is transferred properly.I’m investigating whether or not the repeated restart of the ChromART peripheral is a problem. Mostly what happens is that the mode sho
Hi, During the development of a bare-metal driver for USB CDC (virtual com port) in device mode i noticed an unexpected behaviour when trying to configure the USB Core to do a transmission of a multi packet message. I've got the following code which prepares the transmission over usb for a data array "data" whose size is "dlen" over endpoint number "epNr". "epInBuffers" contain the pointers to the data buffers for each endpoint, "epInBytesTransferred" keep track of how many bytes have already been transmitted and "epInDataCntrs" the total amount of bytes to transmit. __RAMFUNC void prepareUSBTransfer(uint8_t epNr,const uint8_t*data,uint16_t dlen) { USB_OTG_INEndpointTypeDef * inEndpoint = ((USB_OTG_INEndpointTypeDef*)(USB2_OTG_FS_PERIPH_BASE + USB_OTG_IN_ENDPOINT_BASE + epNr*0x20)); uint32_t epCtrl = inEndpoint->DIEPCTL; uint16_t npackets; if(dlen==0) { npackets = 1; USB2_OTG_FS_DEVICE->DIEPEMPMSK &= ~(1UL << epNr); } else { npackets = ((dlen + epInMaxPacket
Hello,I am using an STM32F207VC custom board with Ethernet and LwIP. I am facing an issue related to Ethernet cable connection during power-up.I performed the following tests:Test A: Ethernet cable connected before power ONConnect the Ethernet cable.Power ON the STM32 board.Result:Ping: WorkingTCP server connection: WorkingTest B: Ethernet cable disconnected during power ONDisconnect the Ethernet cable.Power ON the STM32 board.Wait until all STM32, Ethernet, and LwIP initialization is completed.Connect the Ethernet cable.Result:PHY Link Up: DetectedPing: WorkingTCP server connection: Not workingTest C: Cable disconnect and reconnect after normal startupStart the board with the Ethernet cable connected.TCP server works normally.Disconnect the Ethernet cable.Reconnect the Ethernet cable.Result:Ping: WorkingTCP server connection: WorkingThe issue occurs only when the STM32 board is powered ON while the Ethernet cable is disconnected and the cable is connected later.Since ping works and th
Hi ,I am using STM32H573VIT3Q MCU, I need USB so i am using internal PHY. I configured all in cubeMx all other things are working well only problem is with USB. I have tried both Host and Device modes but nothing works. Then i created a test project only for USB in device mode, I have connected the logic analyser on USB pins to see the data , but no single pulse is there if i plug/ unplug the usb cable to PC. I have attached this full project as well for your reference. I have tried GPIO toggle to confirm all connection are ok and well soldered. Here is my circuit diagram of MCU.I have also attached my IOC files. Please help me to solve this error. Thanks
Hello all, Im Currently working with my own Hardware with the L072CZTx on it.I want to use a Terminal over the 2 USB Pins.(USB_DP and USB_DM)I activated the Clocks with 48MHzActivated USBActivated USB_ Device as a Communication Device Class(Virtual Port COM) I got told i should see it in the Device Manager as a Com Port or a unidentified Device.Sadly i can only see my V3set im using to Programm the Controller with (SWD). If very new to Programming with STM32 and if you have any ideas that could fix it i would really appreciate it. Thank you in Advance
The MCU works fine the first time it gets programmed. However, after one power cycle, it freezes completely after an external interrupt happens. Doesn’t even enter the error handler. I have SMPS enabled. Thanks for your help int main(void){ /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* 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 System Power */ SystemPower_Config(); /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_RTC_Init(); MX_UART4_Init(); /* USER CODE BEGIN 2 */ GreenLEDOn(); HAL_Delay(5000); GreenLEDOff(); /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { if(!HAL_GPIO_ReadPin(V_Fu_Trig_GPIO_Port, V_Fu_T
Hi,I am using my own board based on an STM32F207ZG and STM32F2 HAL v1.9.4.I implemented an HID Host using STM32CubeIDE (v1.19.0), simply selecting USB Host and HID class support in CubeMX and generating the code.I was able to read key events from a standard USB desktop keyboard. However, I was not able to read any key events from a USB HID RF tag reader.While debugging usbh_hid.c, I noticed the following: USBH_HID_SetProtocol(phost, 0U); generates a SET_PROTOCOL request with wValue = 0x0001 (Report Protocol)whereas: USBH_HID_SetProtocol(phost, 1U); generates wValue = 0x0000 (Boot Protocol).because this implementation:if (protocol){ phost->Control.setup.b.wValue.w = 0U;}else{ phost->Control.setup.b.wValue.w = 1U;}In other words, the protocol parameter passed to USBH_HID_SetProtocol() is inverted with respect to the value actually transmitted in the USB SET_PROTOCOL request URB.I noticed that the same implementation is still present in STM32F2 HAL v1.9.6.I am not sayi
On STM32F7 OTG_HS with an external ULPI PHY, is there a supported way for firmware to issue an ULPI Extended Register Read/Write transaction?The required ULPI sequences are:Extended read: TX CMD 0xEF extended address byte read returned dataExtended write: TX CMD 0xAF extended address byte data byteThe undocumented PHYCR viewport at USB_OTG_HS + 0x34 used by STM32CubeF7 only appears to support ordinary single register accesses. Can PHYCR issue an extended ULPI transaction?Thanks,Alex
We recently added support for STM32C071 to our free, MIT-licensed MicroPython Debugger for VS Code.The interesting part is that the STM32C071 has only 24 KB of RAM and 128 KB of Flash, yet you can still use source-level debugging directly from VS Code.Set a breakpoint in your MicroPython source, press F5, and debug the code running on the actual STM32 MCU.The debugger supports:Breakpoints Step Over / Step Into / Step Out Variable inspection Watch Call Stack Break on exceptions Continue / PauseGitHub: https://github.com/ghi-electronics/micropython-vsc-extensionVS Code Marketplace: https://marketplace.visualstudio.com/items?itemName=ghielectronics.micropython-debuggerFor testing, I used an STM32C071KBU6 running MicroPython with SPI and PWM on a DUELink Holiday Tree: Holiday Tree | DUELinkHere is example source: micropython-vsc-extension/examples/stm32c07/chrismastree_example at main · ghi-electronics/micropython-vsc-extensionI'm interested in hearing from other STM32 + MicroPython users
We're using an STM32F405 as a USB OTG FS Host and need to communicate with a USB-to-serial adapter that uses the CH341 chip.We could not find any official CH341/CH340 driver or class support in STM32Cube packages or example projects.Questions:Can you confirm whether STM32Cube USB Host middleware officially supports CH341/CH340 devices, in any released package (including X-CUBE expansion packages)? If not supported, is there a recommended reference or guidance from ST for implementing a custom USB Host class driver for vendor-specific USB-to-serial chips like CH341, based on the existing USBH_ClassTypeDef interface used by CDC/MSC/HID? Are there any known limitations on STM32F405 USB OTG FS Host mode we should be aware of when implementing a custom class driver (e.g., control transfer handling, endpoint limits)?
When calling HAL_QSPI_Abort() to disable memory mapped mode, with the memmap timeout active, I find that there is a race condition that can cause the abort to fail when it should not. If the memmap timeout happens after the abort function's check of the busy flag, but before it can write to the abort bit, the TC flag will never be set and the abort function will wait for the configured qspi timeout, then return an error.I am testing this on a STM32F769I-DISCO board.I have found that the following patch will fix the issue: diff --git a/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c b/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c index 8404466..01a06ca 100644 --- a/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c +++ b/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c @@ -2381,19 +2381,19 @@ HAL_StatusTypeDef HAL_QSPI_Abort(QSPI_HandleTypeDef *hqspi) /* Configure QSPI: CR register with Abort request */ SET_BIT(hqspi->Instance->CR, QUADSPI_CR_ABOR
I am using the STM32F746NGH6 controller in my circuit to read external ADC (16bits) and transmits the same through USB. I have configured USB in OTG FS (device) MODE including AUTO detection. Test Set-Up.The USB is always connected and controller is powered on for testing and powered off after testing is completed Earlier observationThis was practiced for about two months and was working ok without any issues Current observationThe same is not able to recognize USB (i.e. auto detection is not happening) Further Analysis 1) On probing the circuit, it was observed that 3V is present at USB V-Bus line always after the board is power on, even without the USB cable connected Please clarify does it cause the issues. If yes, why and how Queries We would like you to clarify the following points about the user operation sequence1) Be the controller power on, when engaging and disengaging USB cable2) There is no need for any sequencing in user operation NOTE:We are in need of fix to avoi
so this is my data acquisition system, i want you to suggest some improvements in it. as the adc + dma ping pong buffer is working fine, but after that the conversion and its transmission via dma+uart ping-pong buffer is so much miserable. there is no synch between these buffers.here is my project:Vishwas1523/dataAcquisitionSystemPS: i am using stm32 nucleo f446re
Hello everyone,Actually I am making a data acquisition system in which my mcu takes analog data from a sensor and stores it in a buffer, and then into a 2nd buffer with the help of DMA in double buffer mode. Now i want to transfer this data via UART to my screen with the help of PuTTY with the same ping-pong architecture. For this i need to convert 12 bit adc value to data suitable for uart (8 bit). which i do with the help of a function without any issue and then store them in different two buffers. now the thing is that i want a system in which when buffer 1 is being filled by adc, buffer two will be transferred by uart and vice versa, now the main problem is that there is no sync between the buffers and the ownership. and it is mostly due to the conversion and size of buffers (uart buffers are twice the size of adc buffers) as i am using double buffer transmission mode in DMA controllers of both adc and uart.So do you think i should use single buffer transmission with circular buffe
Hi ST Community, I’ve connected a MP23DB01HPTR MEM MIC to the STM32N6 Nucleo’s MDF1_SDI3 and MDF1_CCK0 and here is my connection. I am using“ Projects/STM32N6570-DK/Examples/MDF/MDF_AudioRecorder” as a reference and according to the information on Github, the CCK0 should be 2.048 MHz Which I am measuring almost the same frequency on the CCK0 pin of my board : 2.03393 MHz In my project, instead of sending the data to SAI, I am sending the data to USART 1, which I’ve set the BaudRate to 921600. My code has three callback functions:void HAL_MDF_AcqHalfCpltCallback(MDF_HandleTypeDef *hmdf)void HAL_MDF_AcqCpltCallback(MDF_HandleTypeDef *hmdf)void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) The USART 1 is sending the first half of the MDF buffer when the AcqHalfCpltCallback is triggered, and then the second half when the AcqCpltCallback is triggered. on my computer I wrote a python script where it is receiving the audio raw data via serial port and save it into a WAV file. However
I am currently developing a USB Mass Storage application using the STM32H563ZI with the following architecture:PC ← USB ← NUCLEO-H563ZI ← SD CardThe SD Card and USB Device have both been tested separately, and each works correctly on its own.However, after integrating the two, I would like to use USB MSC to expose the SD Card connected to the STM32H563ZI as a removable storage device on the PC. The PC is currently unable to recognize the SD Card properly.I would like to ask if there is any example code or reference project for the STM32H563ZI that demonstrates USB MSC with an SD Card.Thank.
We are trying to bringup an omnivision camera on STM32N6. We are able to capture some data from the camera but unable get a good image but the image has lot of horizontal lines. I would like to some input on the configuration to make sure we are not missing anything on N6 side. uart:~$ ztest run-testcase test_pipeline:test_pipeline_validateRunning TESTSUITE test_pipeline===================================================================START - test_pipeline_validate ╔══════════════════════════════════════════════════════════════╗ ║ PIPELINE VALIDATION: OS05E10 -> CSI-2 -> DCMIPP -> PSRAM ║ ╚══════════════════════════════════════════════════════════════╝ Mode: 2592x1944 DCG 30fps Sensor: 2592x1944, HTS=714, PHY 1452 Mbps/lane ── STEP 1: Sensor I2C communication ── I2C read: ret=0read works here -> PASS ── STEP 2: Configure and start pipe0 ── video_set_format: ret=0 buffer enqueued: 10077696 bytes, ret=0[00:00:23.363,000] <inf> video_osxxxx: MIPI l
Hello STM32 Community,I am currently working on a VoIP project using the STM32H750B-DK and I am trying to integrate PJSIP/PJPROJECT into my STM32 application.My current setup is: MCU/Board: STM32H750B-DK Core: ARM Cortex-M7 RTOS: FreeRTOS Network stack: LwIP Ethernet PHY: LAN8742 IDE: STM32CubeIDE Compiler: ARM GCC VoIP: PJSIP / PJPROJECT Audio: WM8994 codec RTP: Already implemented and tested separately G.711: PCMU implementation is also being integrated Ethernet, LwIP, UDP and RTP communication are already working on my board. I can successfully exchange RTP packets and have been testing the network communication using Wireshark.My current goal is to integrate SIP + RTP using PJSIP, so that the STM32 can eventually register with a SIP server and establish VoIP calls.However, I am facing many compilation, configuration and integration errors while trying to port PJSIP to the STM32H750B-DK. I have tried configuring config_site.h, PJLIB, PJLIB-UTIL, PJSIP and the Fre
Hello!I am facing a problem with the STM32H563VIT6 trying to set up MQTT client. I tried to take STM32H573I-DK\Applications\NetXDuo\Nx_MQTT_Client example as a base example on how to do it, but it has not worked for me. The problem I am facing is that no IP can be acquired and thus the MQTT client will not work. I have set up everything correctly in the netxduo header file (DNS, MQTT broker name).What I am trying to achieve right now is to have the board send simple MQTT packets to my computer (like in the STM32H573I exmaple). The board is connected to the router.I tested a simple MQTT packet sending by doing it from my phone to my computer. Also, connected my phone to the router via an Ethernet cable, and with using the Wi-Fi. In both times, the test was successful, so from that it seems that the problem cannot be in my computer or in the router.When debugging the program the error I receive is from the App_Link_Thread_Entry. Getting this error after calling nx_ip_interface_statu
I’m trying to implement USB mass storage class device standalone(no RTOS) on nucleo board STM32U575ZI-Q, using RAM for memory.I mostly followed these steps :, but skipped the eMMC parts (I’m using RAM). Instead i did like here: https://embetronicx.com/tutorials/microcontrollers/stm32/stm32-usb-device-msc/ , in ux_device_msc.c I defined STORAGE_BLK_NBR, STORAGE_BLK_SIZ, and then used memcpy() inside functions like STORAGE_Read_FS().Someone has done seemingly the same thing already(combining these two things) and it worked: https://github.com/ST-TOMAS-Examples-USB/STM32U385RG_Ux_Device_MSC_Standalone . Are there any adittional steps i’ve missed?Right now, after plugging the USB into my PC, it appears in Device Menager with code 10( device cannot start ). I’ve put a breakpoint on STORAGE_Read_FS() line while debugging, but it never stops there.
Hi,I am using my own board based on an STM32F207ZG with STM32F2 HAL v1.9.4. I implemented a USB HID Host using STM32CubeIDE (v1.19.0), simply enabling USB Host and HID Class support in CubeMX and generating the code.I was able to read keys correctly from a standard USB desktop keyboard. However, I was not able to read from a USB HID RF reader. While debugging the problem, I noticed the following code in `usbh_hid.c`, inside `USBH_HID_Process()`:case HID_IDLE: status = USBH_HID_GetReport(phost, 0x01U, 0U, HID_Handle->pData, (uint8_t)HID_Handle->length); if (status == USBH_OK) { HID_Handle->state = HID_SYNC; }This initial `USBH_HID_GetReport()` therefore has to complete successfully before the state machine proceeds to `HID_SYNC` and eventually reaches `HID_GET_DATA`, where `USBH_InterruptReceiveData()` starts polling the HID interrupt IN endpoint EP1. My question is: What is the intended purpose of this initial `G
I’ve been discovering the different views available in STM32Cube IDE and among them is the Build Analyzer view.In this view I found a section in the RAM called ._user_heap_stack.I searched for it in the linker script and found that it corresponds to the following section : /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */._user_heap_stack :{. = ALIGN(8);PROVIDE ( end = . );PROVIDE ( _end = . );. = . + _Min_Heap_Size;. = . + _Min_Stack_Size;. = ALIGN(8);} >RAMWith _Min_Heap_Size = 0x200; /* required amount of heap */_Min_Stack_Size = 0x400; /* required amount of stack */In Figure 1, one can see that the start address of the ._user_heap_stack is 0x2000 002C. This means that the last address of the stack should be 0x2000 002C + 200 + 400 = 0x2000 062C, with the 8 byte alignment that would make it 0x2000 0630. Figure 1 : Screenshot of the Build Analyzer ViewTo make sure my calculations are correct, I added a variable in the linker script (high
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.