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
This is the follow-up to my 2023 thread, which is now closed for replies:https://community.st.com/stm32cubeide-mcus-28/azurertos-netxduo-unable-to-download-16k-or-larger-image-using-web-http-client-secure-124990Short version: the stall is in the ST NetX Ethernet glue driver (`nx_stm32_eth_driver.c`), not in NetX Duo, and not a packet-pool sizing problem. The fix is about 40 lines and still applies to the current `STMicroelectronics/stm32-mw-netxduo` main branch, which has the same driver code. I have filed it with ST as a bug with the full write-up and patch: https://github.com/STMicroelectronics/stm32-mw-netxduo/issues/1 **Symptom (from the original thread)**HTTPS downloads of 16 KB or more via `nx_web_http_client` + NetX Secure stalled on every attempt on F417, F429 and H723. Plain HTTP downloaded multi-MB files fine with the same pool. After a stall the socket stayed ESTABLISHED and the pool showed fewer free packets than expected, which I wrongly reported as "free_packets corrupted
I have been writing some code to recover from the NMI after reading unwritten OTP addresses but I found a bit of a snag when checking that the Address listed in FLASH_ECCDETR is what I would expect after a read.The Table 42 of the H503 reference manual (RM0492 Rev 2) lists a minimum ADDR_ECC offset of 0x0600. I was a little unsure what exactly this meant but `HAL_FLASHEx_GetEccInfo()` clearly runs:// FLASH_ADDRESS_OFFSET_OTP is defined as 0x600 as you would expect herepData->Address = (FLASH_OTP_BASE + ((addr_reg - FLASH_ADDRESS_OFFSET_OTP) * 4U)) & 0xFFFFFFFFU;Seems simple enough then - the number is just which OTP word triggered the error minus 0x600.Except the actual offset I am seeing in the address field is 0x200 instead of 0x600.Reading an unwritten OTP at 0x08FFF010 gives me an ADDR_ECC of 0x204, reading 0x08FFF020 gives me 0x208, and so on...Is this an error in the Reference Manual and HAL? Should the listed value be 0x200 or am I missing something here? Thanks!
Hi, I am wondering if anyone has had any experience using the STM32N6 onboard H264 encoder? I am trying to write a business case for using this MCU, which claims it can broadcast H264 video at 720p & Audio at a stable 30fps over LAN without any noticeable drops in performance? The only solutions I have found so far have been dedicated SoC.
Hello ST Community,I am working with the STM32U535RET6 and need clarification on the interaction between the IWDG Window feature and Early Wake-up Interrupt (EWI).I tested the following configurations:1. Window enabled, EWI disabledThe Window feature works as expected:Early refresh → IWDG reset Late/no refresh → IWDG reset2. EWI enabled, Window disabledWhen only EWI is enabled, the EWI interrupt occurs when the counter reaches the configured EWIT value.In the ISR, the HAL code acknowledges the EWI by setting EWIC.According to RM0456, writing EWIC = 1 clears EWIF and also reloads the IWDG counter with RL[11:0].However, in my observation, the EWI ISR is called only once, and I do not observe the expected counter reload after the EWI acknowledgement.3. EWI and Window enabled togetherWhen both features are enabled, I observe different behavior.For example, with EWI configured for approximately 2 seconds, the EWI occurs repeatedly at approximately every 2 seconds. The IWDG counter appears t
Hello everyone,I'm developing an application using the STM32H563 with TrustZone enabled. Online tutorials first show configuring the fuse bits using the STMCubeProgrammer software:TZENSECWM1_STRTSECWM1_ENDSECWM2_STRTSECWM2_ENDThen, the application is installed in the STMCubeIDE, where it is saved and executed correctly.However, if the developer tries to install the application without going through the first step, the code is unable to exit the safe zone, resulting in a hard fault error. This is because the IDE, when TrustZone is enabled, assumes that all FLASH memory is in the safe zone.I would like to change these fuse bits without using STMCubeProgrammer. I believe it's possible, but I haven't found any information where the result is satisfactory. Could someone help me?
Hello STM32 Community,I am currently working on a USB Flash Drive interface using STM32G0B1RET6 with USB Host and FatFs.The USB Flash Drive is working correctly. When I plug in a USB Pendrive, my STM32 can detect it, mount the filesystem, and successfully create/write files to the Pendrive.Now I would like to display/check the following information:Total USB Flash Drive storage Used storage Free/available storage Detect whether the USB is almost fullMy current code is:static void USBH_UserProcess(USBH_HandleTypeDef *phost, uint8_t id){ switch (id) { case HOST_USER_CLASS_ACTIVE: Appli_state = APPLICATION_READY; USB_Detect_flag = 1; // USB is plugged Mount_USB(); HAL_GPIO_WritePin(GPIOC, LED_RED_Pin, GPIO_PIN_RESET); /* Check USB free space */ if (usb_space_result == FR_OK) { displayText16x16_DMA(20, 190, "USB HAS SPACE",
Subject: X-CUBE-CLASSB-L4 (STL) — Fault Injection Method for Flash/CPU/RAM Self-Tests on STM32L451CETI am applying X-CUBE-CLASSB-L4 (Self-Test Library, STL) on an STM32L451CET MCU to implement CPU/Flash/RAM self-tests for IEC 60730-1 Class B certification.Main issue: No matter what method I try, the Flash test never passes (always reports a failure / never completes successfully under normal conditions).Certification requirement: Our certification body requires us to demonstrate both the normal (pass) case and the fault (failure) case for each test, specifically by actually altering real values during test execution:CPU test: by actually changing register values during the test Flash test: by changing the CRC value, or modifying Flash memory contents while the test is running RAM test: by modifying RAM contents while the test is runningI understand that ST's recommended method is to use STL_ArtifFailingConfig to perform fault injection. However, this only simulates a failing configurat
Hi,I'm working with an STM32N6570-DK and need the microSD slot (CN13, SDMMC2) to run at 1.8V signaling instead of the 3.3V default. The device I'm connecting only supports 1.8V, and the target speed is modest, around 25 MHz.What's the correct procedure to make this switch on this board?So far I've driven SD_SEL (PO5) high to flip U32, but CN13 pin 3 still measures 3.3V. AN5967 (Getting started with hardware development for STM32N6) section 12.4 points to PWR_SVMCR2.VDDIO5VRSEL together with OTP124 bit 13 (HSLV_VDDIO5), which currently reads 0 on my board.Two things I'm unsure about: Is burning HSLV_VDDIO5 actually required for 1.8V operation, or only to reach the datasheet frequencies? Does burning it permanently prevent the slot from working with ordinary 3.3V SD cards?
Hello, I’m working of a TM32F769 board the content of the 4 KB backup SRAM (BKPSRAM,0x40024000) is lost after a hard power cycle (VDD removed and re-applied),although: - VBAT is supplied by a 3 V lithium coin cell (Renata, CR1225-type), - the backup regulator is enabled (PWR_CSR1.BRE = 1) and ready (PWR_CSR1.BRR = 1) before power-off, and BRE is still set at the next cold boot, - the rest of the backup domain is retained: RCC_BDCR keeps its value (LSE on/ready, RTCSEL = LSE, RTCEN = 1) and the RTC keeps running, - HAL_PWREx_EnableBkUpReg() returns HAL_OK, - BKPSRAM content IS retained across system resets (NRST / IWDG) while VDD stays present. The test I have performed: 1. Flash and run the firmware once (writes 0xDEADBEEF to BKPSRAM word 0). 2. Disconnect the ST-LINK cable from the board (to avoid back-powering through SWD pins). 3. Remove all board power (VDD). The coin cell stays connected to VBAT. 4. Wait for 5 min. 5. Power the board up without the debugger and
In RM0490 Rev 6, Reference Manual for the STM32C0, the ADC Software Calibration Process is specified as follows: Software calibration procedure1. Ensure that ADEN = 0, AUTOFF = 0, ADVREGEN = 1, and DMAEN = 0.2. Set ADCAL = 1.3. Wait until ADCAL = 0 (or until EOCAL = 1). This can be handled by interrupt if theinterrupt is enabled by setting the EOCALIE bit in the ADC_IER register.4. The calibration factor minus one can then be read from bits 6:0 of the ADC_DR orADC_CALFACT registers. The resulting calibration factor must be incremented by oneand written back to the ADC_CALFACT register.5. To reduce the noise effect of the calibration factor extraction, the software can makethe average of eight calibration factor values. This step is optional but recommendedfor better accuracy.The averaging procedure is as followsa) Obtain eight incremented calibration factor values (perform eight times step 2 tostep 4).b) Calculate the average of these eight values and round it up to the nearest integer
Here is my main and jump to bootloader :int main(void){ HAL_Init(); SystemPower_Config(); SystemClock_Config(); HAL_Delay(500); // Catch bootloader constantly resetting jump_to_bootloader(); while (1) { HAL_Delay(50); }}#define BOOTLOADER_ADDR (0x0BF90000UL)HAL_StatusTypeDef jump_to_bootloader(void){ __disable_irq(); HAL_RCC_DeInit(); // Must be run before disabling systick because it depends on it HAL_DeInit(); SysTick->CTRL = 0U; // Disable systick SysTick->LOAD = 0U; SysTick->VAL = 0U; int count = sizeof(NVIC->ICER)/sizeof(NVIC->ICER[0]); for (int i = 0; i < count; i++) { // Clear pending interrupts NVIC->ICER[i]=0xFFFFFFFFUL; NVIC->ICPR[i]=0xFFFFFFFFUL; } void (*jump_to_bootloader_fptr)(void); jump_to_bootloader_fptr = (void (*)(void)) (*((uint32_t *) ((BOOTLOADER_ADDR + 4)))); __enable_irq(); __set_MSP(*(uint32_t *)BOOTLOADER_ADDR); jump_to_bootloader_fptr(); return HAL_ERROR; // Should never get there because of jump}
Dear forum,I am trying to setup a simple application to sample an ADC channel with DMA and stream it via UDP to a Windows PC, so here’s what I did:I started from the sample project “Nx_UDP_Echo_Client”, provided by ST in FW pack; I configured the ADC peripheral to sample pin PA1 as in the sample project “ADC_SingleConversion_TriggerTimer_DMA”, and this is ok; I configured the GPDMA channel 0 in circular mode to copy ADC.DR into a buffer, following this and this; I put the DMA buffer in a dedicated memory region (AHBSRAM1), as suggested here; I configured the buffer memory region as NON CACHEABLE in MPU configuration, as suggested here; Finally I configured the RISAF in order to let the GPDMA have access to the buffer, as suggested here.But still, when I try to activate the transfer with the HAL command HAL_ADC_Start_DMA, I get a “User setting error” (USEF bit in GPDMA_C0SR register) and the GPDMA channel is deactivated. Can you please help me in the debug?The project, which is attached
Hi forum,I’m tasked to implement firmware update ability for an STM32-based application. Basically, I’m using this tutorial and change it to work on a NUCLEO G431RB board. In the end, we’ll have a bootloader and two application slots in the STM’s flash.The situation now is this: Bootloader starts up, waits for a moment, checks for a condition (button pressed or not) and then transfers control to either application 0 or application 1. Both applications don’t do anything useful yet, they just differ in how they blink the one LED I’m able to manipulate easily.Startup works, transfer works but application 1 doesn’t blink at all. Reason is that its HAL_GetTick() value doesn’t change. In bootloader, it does. In application 0, it does also. And if I flash application 1 onto flash address 0x08000000 all alone without the other two, it works.And it also works if I change the marked line to initialize variable to zero.#define NumberOfFlashes 3static int _millisecondsUntilToggle = 5; // marked
Hi everyone, I have developed a custom pcb board and I want to use the usb and a uSD card. I am not really familiar with pcb designing. My guidance was some youtube videos in general, like the Phil’s Lab for the USB + SD MSC (The link, so there is some understanding on the code I have added to the usb app). The USB works. The SD only worked once somehow, while I was stepping the code in the debugging process. I could not do it again. I have tried every possible configuration. The only thing I get is the following from the terminal: [28067.786253] usb 3-4: new full-speed USB device number 86 using xhci_hcd[28067.913272] usb 3-4: New USB device found, idVendor=0483, idProduct=572a, bcdDevice= 2.00[28067.913281] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3[28067.913283] usb 3-4: Product: STM32 Mass Storage[28067.913286] usb 3-4: Manufacturer: STMicroelectronics[28067.913288] usb 3-4: SerialNumber: 395834673434[28067.916167] usb-storage 3-4:1.0: USB Mass Storage device
Background info:I am looking at ditching Microchip and moving to STM32 H5 or H7.My application requires networking and support for HTTP server, SNTP client, SNMP V2 & V3 agent and SMTP client with TLS etcI am looking at H5/H7 primarily because of the larger RAM to support a TFT display of 320x240 or possibly 480x320. I only need 16 bit color. Now the question:I am evaluating my choices for a TCP/IP stack. The “free” contenders appear to be LWIP and Azure (NetX) and I have seen some not free offerings such as CyloneTCP and Mongoose.I suspect that any of them can be made to work with enough effort but in the interest of not wasting company resources I thought it prudent to see who has had successes and frustrations with the offerings that I have been exploring.Yes. I am the guy who asks how deep the water is before I jump in….
Hello everyone, I have the following use case: I want to receive raw data via Ethernet, which works fine, but I have a problem: When I send 100 bytes, I only receive 14 bytes in my software on the MCU (STM32H7S3L8). I was able to fix this by settingAutomaticPadCRCStrip to DISABLE. Now I receive 104 bytes, which is also not the desired behavior. After a little research, I found out that the 4 bytes are CRC, so I continued searching. After some searching, I found the CRCStripTypePacket property and set it to ENABLE, but unfortunately this property has no effect. What do I need to do to get my 100 bytes but not the CRC? Do I need to set something else? Is this a bug? Please help me, I'm stuck.Thanksstm32h7rsxx-hal-driver 1.2.1Best regards,Paul B
My board does not have the default firmware anymore and I do not have a backup of it either. I have the source code and the HAL driver and have tried for hours to get the code to compile. I get many errors for various HAL header files and the source does not include a HAL config file. Is it possible to get the compiled default firmware as it is for various other Discovery boards?
Hello everyone,I am working on Ethernet communication using the STM32H750B-DK with STM32CubeIDE and LwIP. I am using the onboard LAN8742 Ethernet PHY and a direct Ethernet connection between the PC and the board. LwIP is configured with NO_SYS = 1, and I am continuously calling MX_LWIP_Process() in the main loop. When I check the Ethernet traffic in Wireshark, the PC continuously sends ARP requests asking for the STM32 MAC address, but the STM32 does not send an ARP reply. While debugging the gnetif structure, I see PHYLinkState = 0, speed = 0, and duplex = 0. I also checked the STM32H750B-DK documentation and found that the onboard Ethernet PHY is connected through MII. My CubeMX project was initially configured for RMII, so I changed the Ethernet configuration to MII. I am also checking the Ethernet DMA/LwIP memory configuration and moved the Ethernet descriptor and RX buffer sections to D2 SRAM using the linker script. However, I still cannot get a ping response from the board.Curre
Hello,We are currently working on STM32C542CCT6 from the STM32C5 series and developing custom Flash and Data Flash drivers.Issue 1 – Hard Fault when accessing FLASH_SIZEWhile executing code generated by STM32Cube, the following check causes the system to enter the Hard Fault handler:if (FLASH_ADDR < (FLASH_BASE + FLASH_SIZE)) /* Main User Flash */The FLASH_SIZE macro reads the value from the device information area. However, when the code attempts to access FLASH_SIZE, the system immediately enters the Hard Fault handler.If we manually hardcode the flash size value, the code works correctly.Our questions are:Is there any specific register configuration or initialization required before accessing FLASH_SIZE on this device?Is this region restricted due to Trust Zone or privileged access on STM32C5 devices?Issue 2 – NMI when reading Data FlashWe have enabled Data Flash by setting: EDATA_EN = 1We are trying to read from the Data Flash base address:0x09000000using a pointer-bas
Environment - Device: STM32H562ZI- Reference manual: RM0481 Rev 5- HAL: STM32Cube H5 HAL Driver V1.5.0- Peripherals: GPDMA used for SPI slave Tx/Rx. SPI in slave mode, normal (non-circular) transfers, no linked-list. Summary On our SPI slave DMA path, the DMA channel becomes permanently stuck after an SPI error, and SPI communication never recovers until the device is power-cycled. The cause is that `GPDMA_CxCR.SUSP` gets written to a channel that has **already completed its transfer and stopped** (EN=0, IDLEF=1). In that state `GPDMA_CxSR.SUSPF` is never set, so `GPDMA_CxCR.RESET` is never written and **SUSP stays set**. Setting `EN=1` afterwards suspends the channel immediately after start, and the driver can no longer escape that state. Observed register sequence (Tx channel, real measurements) ```1) Block transfer completes. Hardware clears EN.CxCR = 0x00805D00 (EN=0, SUSP=0, SUSPIE=0)CxSR = 0x00000001 (IDLEF=1) 2) An SPI error occurs right after this point.SPI ErrorCode = 0x84 (UD
Hello,I am using an STM32H7S3 with STM32CubeH7RS HAL [V1.2.1]. SPI5 drives a display over 3-wire SPI with 9-bit frames (the 9th bit carries D/C).With USE_FULL_ASSERT enabled, HAL_SPI_Init() triggers an assert in stm32h7rsxx_hal_spi.c (line 259 in the current GitHub version):if (IS_SPI_LIMITED_INSTANCE(hspi->Instance)){ assert_param(IS_SPI_LIMITED_DATASIZE(hspi->Init.DataSize)); assert_param(IS_SPI_LIMITED_FIFOTHRESHOLD(hspi->Init.FifoThreshold));}In stm32h7rsxx_hal_spi.h, the macro only accepts 8-bit and 16-bit:#define IS_SPI_LIMITED_DATASIZE(DATASIZE) (((DATASIZE) == SPI_DATASIZE_16BIT) || \ ((DATASIZE) == SPI_DATASIZE_8BIT))However:1. RM0477 [rev 10], section 55.3, Table 578 states that for SPI4 and SPI5 the data and CRC size is "configurable from 4 to 16 bits".2. The HAL itself is inconsistent. A few lines below the assert, the runtime check in HAL_SPI_Init() only rejects sizes above 16 bits for limited instances:if ((IS_SPI_LIM
I am using an STM32H755, and attempting to send 35 bytes of data over SPI.The data is copied into the TXDR, one byte at a time, but then only the first two bytes are send. The TSIZE is set to 35 and the CTSIZE counts down from 35 to 33, and then the TXDR bit goes high and no further data is sent. Could anyone suggest any reason why this may be happenning? Thanks
On STM32H733, the HAL provides __HAL_DBGMCU_FREEZE_FDCAN() in stm32h7xx_hal.h but it is conditionally compiled:#if defined(DBGMCU_APB1HFZ1_DBG_FDCAN)#define __HAL_DBGMCU_FREEZE_FDCAN() (DBGMCU->APB1HFZ1 |= (DBGMCU_APB1HFZ1_DBG_FDCAN))#endifDBGMCU_APB1HFZ1_DBG_FDCAN is not defined in stm32h733xx.h, so the macro does not exist at compile time and calling it gives:error: implicit declaration of function '__HAL_DBGMCU_FREEZE_FDCAN'Questions:Is FDCAN freeze during debug halt supported on STM32H733? If yes, why is DBGMCU_APB1HFZ1_DBG_FDCAN missing from stm32h733xx.h — is this a bug in the device header? What is the correct bit position to use as a workaround via direct register write? I need to pause the FDCAN peripheral during debugging, that is my goal. Thanks you very much for helping me out.
I configured ADC1 to be triggered by TIM2_CH2 and TIM2 compare channel 2 on STM32F429 with CubeMX, and enabled their interrupt, TIM2 CC2 ISR was run but ADC EOC ISR not run. I tested both by LED and by debug in CubeIDE, both results were the same. When debug in CubeIDE, after TIM2 CC2 ISR was run, STRT=0 and EOC=0 in ADC1 SR, which indicated that ADC1 was not triggered. However, if I configured ADC1 to be triggered by TIM2_TRGO and TIM2 trigger output from Update event, ADC1 was triggered.My settings in CubeMX:CubeMX and CubeIDE project files:
I'm working on an STM32H743-based project driving a parallel LCD through LTDC, with the framebuffer sitting in external SDRAM via FMC. I keep running into intermittent display corruption that I suspect is cache-related, since the M7 core has D-Cache enabled by default.What's the recommended approach for setting up the MPU region for the framebuffer — mark the whole SDRAM region as non-cacheable, or is it better to keep caching enabled and handle cache maintenance manually (SCB_CleanDCache_by_Addr) around framebuffer writes? Curious what's worked best for people running LTDC + SDRAM at higher resolutions/refresh rates without a performance hit.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.