Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hello. I'm using a combo of a wba board and a LSM6dsv IMU sensor. I collect sampoles from the imu and then send them to my pc to do some fft there and als odo fft on board using the cmsis dsp libraries. The thing is that my pyrhon spectrum appears to be correct. I'm using a vibrator to make sure about that it [produces the requested frequency and monitor the results with the integrated vibrator's sensor. The python sprectrum appears to match the vibrator's sensor sprectrum whereas the cmsis results appear a lot more noisy and have an almost mirrored in the middle huge harmonic. Lets say than my sensor'f sampling rate is 4 KHz, so im able to do fft on up to 2 KHz event freq. If my vibrator is at 300 Hz i will see a huge harmonic in lets say 1600-1700 hz which gets closer the more i go to 1000 Hz. At 900- 1200 Hz the spectrum appears to be a complete mess and at 1300 HZ and afterwards it is simply beautiful. Here is the mcu code. I do a hanning window and median removal
Hello, I have started evaluation of X-NUCLEO-ESE02A1 shield with NUCLEO-F401RE board, and used STM32CubeMX for project generation according to PDF inside X-CUBE-SAFEA1 package. However, I can't get any demo running, and both these generated demos, as well as my attempt, fail with error code 0x01 which maps to STSAFEA_COMMUNICATION_ERROR. I have tried putting jumpers for I2C lines pullup on the shield, jumpers P4 and P5, but it did not help. Then I read in the product User manual UM3579 about additional RST PIN so I tried also putting a jumper on P3 connector but still nothing. However then I traced it to PB5/D4 PIN which is actually not used and not advised to be initialized in the Getting started document. So my question is: Do I need to use this pin, and if so, how exactly should it be used, to enable communication with STSAFEA110? Everything other, related to I2C, USART, expansion package itself is enabled, project compiles and app shows logs after flashing to Nucleo,
Hello everyone,I'm working with an STM32L562E-DK board and testing the "TrustZoneEnabled" template included in the "STM32Cube_FW_L5_V1.6.0" package. The goal is to run the basic example that transitions from the secure to the unsecured zone, but I'm finding that, after following all the instructions in "README.txt" and compiling the project, the code gets stuck in the next function:static void NonSecure_Init(void) { funcptr_NS NonSecure_ResetHandler; SCB_NS->VTOR = VTOR_TABLE_NS_START_ADDR; /* Set non-secure main stack (MSP_NS) */ __TZ_set_MSP_NS((*(uint32_t *)VTOR_TABLE_NS_START_ADDR)); /* Get non-secure reset handler */ NonSecure_ResetHandler = (funcptr_NS)(*((uint32_t *)((VTOR_TABLE_NS_START_ADDR) + 4U))); /* Start non-secure state software application */ NonSecure_ResetHandler(); } Specifically on the "NonSecure_ResetHandler()"; or it doesn't even execute the no-secure part.Current option bytes configuration (verified with STM32CubeProgrammer):DBANK => Checke
Hello,just updated to STM32Cube FW_H7 V 1.13.0 but it seems it still contains CMSIS RTOS2 V2.1.3.I'm develop with Keil and STM32 IDE but Keil is using V2.3.1 while Cube comes with V2.1.3.In STM32 IDE I got a compile error when I imported source code developed on Keil.E.g. the thread attribute osThreadUnprivileged, introduced in V2.2.0, is missing in V2.1.3.https://arm-software.github.io/CMSIS_6/main/RTOS2/rtos_revisionHistory.html Any progress here? If no, why?Thanks,Jochen
Dear all,I'm working on a project based on STM32F479 and FreeRTOS. In this project the microcontroller is connected via I2C and SPI bus to other devices, such as switch ethernet and spi-uart converter. I run the initialization of these devices before the start of the FreeRTOS scheduler. Startup procedure requires switching some GPIOs and waiting a few milliseconds as described in the devices datasheet. I've manged the waiting part of the initialization using the HAL_Delay function. This project has been generated in 2019 with STM32F4 fw package 1.24.0 and an old version of STM32CubeMX.Recently I've created a new project for the same hardware using fw package 1.28.0 and STM32CubeMX 6.11.1. I noticed that the initialization of TIM6 in stm32f4xx_hal_timebase_tim.c has been updated and HAL_InitTick function is changed (which you can find in the attachment). Now I'm experiencing a strange behaviour. During devices initialization the program remains stuck in the HAL_Delay function. Apparentl
Hello, I have custom STM32N657 board with two USB ports. There is USBX device video class running on USB Port 1 and streaming video - all good here, working well.I would like to get exactly the same functionality on USB port 2 - second USB video device. The STMCubeMX supports only one USB port in device mode - that is also limitation of USBX"Only one USB device controller can be defined at any time to operate in device mode."azure-rtos_rtos-docs/rtos-docs/usbx/usbx-device-stack-2.md at main · azemb-todd/azure-rtos_rtos-docs · GitHub What is the best approach to get second USB port running in USB video class in device mode?
I have Playback set up and running. I also have recording set up as well. It enumerates. It shows up as STM32 Microphone. But it does not capture anything. I notice that playback is not playing sounds either. So I traced it to this: as soon as I have BSP_AUDIO_IN_Init() called, playback doesn't play sounds. I wonder if there's an issue with having both instances be 0? // Initialize Audio Play and Record structures AudioPlayInit.Device = AUDIO_OUT_DEVICE_HEADPHONE; AudioPlayInit.ChannelsNbr = 2; AudioPlayInit.SampleRate = AUDIO_FREQUENCY_48K; AudioPlayInit.BitsPerSample = AUDIO_RESOLUTION_16B; AudioPlayInit.Volume = VOLUME_SPEAKER_DEFAULT; AudioRecordInit.Device = AUDIO_IN_DEVICE_ANALOG_MIC; // Use instance 0 SAI/codec AudioRecordInit.ChannelsNbr = 2; AudioRecordInit.SampleRate = AUDIO_FREQUENCY_48K; AudioRecordInit.BitsPerSample = AUDIO_RESOLUTION_16B; AudioRecordInit.Volume = VOLUME_MICROPHONE_DEFAULT; // Initialize Audio Output Device if(BSP_AUDIO_O
I'm looking to implement USB host functionality on an STM32C071 to connect with a single device that sends/receives serial data over USB so the only class I'm interested in is CDC, but I'm having trouble using USBX (I'm not using RTOS). For now I haven't used and read/write functions, my goal was to start by checking the functionality of the callbacks inside "app_usbx_host.c" which are: device inserted/removed/connected/disconnected, enumeration fail and no USB device found. Each one sets a different flag to be handled inside the main loop. I put a breakpoint inside the USB IRQ and when I connect the USB device it stops execution and confirms the breakpoint has been reached, however none of my flags are ever set,. I suspect the reason might be because I haven't done anything to link the USB peripheral to the USBX stack, if the function responsible for that is ux_host_stack_hcd_register, I have no idea how to use it. The function prototype is:UINT _ux_host_stack_hcd_
Hello ST Community!I've been trying to recreate the DCMIPP_ContinuousMode example with STM32CubeIDE, but have been running into some issues with the IMX335_Probe function, the ID read by the I2C bus never matches the expected define IMX335_CHIP_ID. The original example runs completely fine in the STM32N6570-DK.- AXISRAM3 (0x34200000) is being used as the address for the DCMIPP CSI Pipe.- ISP Middleware does not return any errors in initialization.- All files regarding IMX335 registers and functions match with the original examples. Same for all the BSP drivers.- RIF has been configured for all peripherals involved.- AXISRAM3 has been enabled in the CubeMX configurations, and it's clock has also been enabled.static void IMX335_Probe(uint32_t Resolution, uint32_t PixelFormat) { IMX335_IO_t IOCtx; uint32_t id; /* Configure the camera driver */ IOCtx.Address = CAMERA_IMX335_ADDRESS; IOCtx.Init = BSP_I2C1_Init; IOCtx.DeInit = BSP_I2C1_DeInit; IOCtx.ReadReg = BSP_I2C1_ReadReg16; IOC
Recently, I encountered a tricky problem, I used STM32F405VGT6 this IC, but I found that it could not enter DFU mode normally, after repeated troubleshooting, I found that when the chip was USB probed, HSE was detected and did not vibrate, I also saw a similar article on the forum, I noticed that in the article, changing F405 to F429 can enter DFU mode normally.Further investigation, comparing the difference between the two ICs, it was found that the HSE start-up timeout time of the F405 IC was too short, and the HSE timeout time of the F405 was found from AN2606, and the version of the v3 version was 0.79ms, and the version of the v9 was relatively normal with 96msI want a timeout of 0.79ms, how do I do that? Is there any way to start HSE within 0.79ms of bootloder version v3? I hope the official can give an answer, thank you very much
There are still some typos to fix in the migration docum. for instance:"Atomic" API names - change to "unitary" as was agreedPACKET - > PACKED
Hi Everyone, I one of our project i want to store the logs on NOR flash. I want to use Levelx to take care of NOR flash low level . But as per documents levelx can be used with Filesx, Is there is any way that i can use Levelx with Filex?
Hello, I have a problem reading VBat voltage with ADC3 and DMA in STM32H743VIT6 If i compile with CubeIDE 1.17.0 and FW 1.12.1 my program works as spected, but if i compile with last CubeIDE 2.1.1 and last FW 1.13.0 my program enter in a infinite loop related to DMA and never execute the while(1) loop. Can anybody help me? Thanks in advance. regards Jose. My program is very simple (see below): in main.c: /* USER CODE BEGIN 2 */ HAL_ADC_Start_DMA(&hadc3, &VBat_ChAna, 2); /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { Vbat = 4 * (((VBat_ChAna &0xffff) * 3300) / 0xFFFF);/* Convert the result from 16 bit value to the voltage dimension (mV unit) *//* Vref = 3.3 V.*/ /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ ADC3 configurationADC3 DMA configuration
Hello everyone, I am currently working with the STM32G431CBT6 and designing a custom ESC using the DRV8301 gate driver. My application requires a total of 9 ADC channels: ADC1 → 4 channels ADC2 → 5 channels I configured both ADCs in independent mode with DMA (circular) using STM32CubeMX. Issue Description When I start ADC with DMA using the following function: void ADC_Start_System(void) { // 1. Calibration HAL_ADCEx_Calibration_Start(&hadc1, ADC_SINGLE_ENDED); HAL_ADCEx_Calibration_Start(&hadc2, ADC_SINGLE_ENDED); HAL_Delay(10); // 2. Start ADC1 if (HAL_ADC_Start_DMA(&hadc1, (uint32_t*)adc1_buffer, 4) != HAL_OK) Error_Handler(); // 3. Start ADC2 if (HAL_ADC_Start_DMA(&hadc2, (uint32_t*)adc2_buffer, 5) != HAL_OK) Error_Handler(); } Observed Behavior ADC1 + DMA works perfectly MCU gets stuck when calling: HAL_ADC_Start_DMA(&hadc2, (uint32_t*)adc2_buffer, 5); No error returned, but CPU halts inside HAL (likely waiting on a flag) What I Ha
I have set up a STM32U5 nucleo board with an additional 8M of memory using an APS6404, following the example in AN5050. Initial setup was straightforward, but trying to create a ThreadX thread that uses an array in that section of memory as its stack isn't working -- local variables within the thread are fine, but function calls like printf("foo") or tx_thread_sleep(10) cause a hard fault.This is my first project using a STM32 microcontroller, and think I'm missing some fundamental understanding of how this is supposed to work -- any suggestions for what I've missed / what I should try?------------------ Details about what I'm trying ----------------- After following the steps given in AN5050, I updated my .ld file to create a corresponding memory section:MEMORY { RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 2496K SRAM4 (xrw) : ORIGIN = 0x28000000, LENGTH = 16K FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 4096K OCTOSPI1 (xrw) : ORIGIN = 0x90000000, LENGTH = 8M } SECTIONS { .octospi1 :
Board:B-L4S5I-Iot-01A discovery kitMCU: STM32L4s5Vit6Hello , We have an application in which we are using the USB_OTG interface configured in host-only mode with the USB CDC class. Our requirement is to receive data at a rate of once per second through this interface. However, upon configuring the USB CDC class, the USB_OTG_FS global interrupt gets enabled automatically. In our application, we want to minimize the use of interrupts, as frequent interrupts may impact overall system performance. Therefore, we would prefer a polling-based approach, where data can be read only when required rather than being interrupt-driven. Could you please advise if it is possible to: Disable the USB_OTG_FS global interrupt, and Use the USB CDC host driver in a polling-based manner to retrieve data on demand? Any guidance or recommended approach for achieving this would be highly appreciated. Thank you.
Hi people,i have trouble with writing to the internal eeprom / flash. I can write values one time to the EEPROM and read it correct back from eeprom. When i write next time values to the eeprom and read them, the values changed but are incorrect. I tried many solutions, but know i am perplexed.//EEPROM Funktionen void EEPROM_Unlock(void) { while ((FLASH->SR & FLASH_SR_BSY) != 0) /* Wait for FLASH to be free */ { /* insert timeout test */ } if ((FLASH->PECR & FLASH_PECR_PELOCK) != 0) /* If PELOCK is locked */ { FLASH->PEKEYR = FLASH_PEKEY1; /* Unlock PELOCK */ FLASH->PEKEYR = FLASH_PEKEY2; } //FLASH->PECR = FLASH->PECR | (FLASH_PECR_ERRIE | FLASH_PECR_EOPIE); /* enable flash interrupts */ } // EEPROM lock void EEPROM_Lock(void) { while ((FLASH->SR & FLASH_SR_BSY) != 0) /* Wait for FLASH to be free */ { /* insert timeout test */ } //FLASH->PECR = FLASH->PECR & ~(FLASH_PECR_ERRIE | FLASH_PECR_EOPIE); /* disable flash interr
Hello, everyone on the forum.I am using an STM32H735IG, ThreadX, and FileX to create files on an SD card and write data to them. In each iteration, I open the file using `fx_file_open`, seek to the end of the file using `fx_file_relative_seek`, write data using `fx_file_write`, close the file using `fx_file_close`, and finally flush the media using `fx_media_flush`.When performing this operation, each file write takes about 10 milliseconds. If I want to write multiple files in a short amount of time, should I use multithreading and have each thread write a file? Also, when writing data to a file on a regular basis, is it okay to keep the file open and write the data without calling `Open` and `Close`?How often should I run fx_media_flush? I’d appreciate any advice you can offer.
Could you provide a routine for reading and writing external flash using spi+dma+ interrupt in the STM32F407 standard library?
Hello,The STM32Cube project Template_LRUN is failed on STM32H7S78-DK:STM32H7S78-DK, MB1736-H7S7L8-D01SW is from the latest master of https://github.com/STMicroelectronics/STM32CubeH7RS/tree/main/Projects/STM32H7S78-DK/Templates/Template_LRUNI also double check with the stm32cubeh7rs-v1-3-0.Follow the instructions from readme:Build Template LRUN projects with CubeIDE v2.0.0Use CubeIDE to load Template_LRUN_Boot.elf to internal flashUse CubeProgrammer to program Template_LRUN_Appli.bin to external Nor-Flash and success.Powerup the DK board and no LED is light-on.By tracing the boot program, the MCU is hangup when copy the program from Nor-Flash to PSRAM. Crash happen on exact the copy to the first address in PSRAM. It seems PSRAM is not ready.The error occurs at: https://github.com/STMicroelectronics/stm32-mw-extmem-mgr/blob/5c92d55af712b20030853a8ac7ddf87ab9eb1adf/psram/stm32_psram_driver.c#L138 /* Execute the command sequence */ for (uint8_t command_index = 0u; command_index < Psra
Hello everyone,If you've ever tried running Azure RTOS with an HTTP server, an FTP server, multiple TCP sockets, and a handful of threads on a standard NUCLEO-144 board, you know exactly where this is going.You hit the memory wall.1 MB of internal RAM sounds like a lot — until ThreadX, NetXDuo, and FileX each want their own byte pools, packet pools, and thread stacks. Add an HTTP server for a web interface, an FTP server for remote file access, and you're fighting for every kilobyte before your actual application even starts. And storage? The NUCLEO boards don't have any. If you want to serve a web dashboard or datalog sensor readings, you're out of luck.Then there's the documentation gap. ST provides excellent examples for HTTP servers with NetXDuo. FTP gets reasonable coverage. But WebSockets? Real-time bidirectional communication between a browser and your STM32? Good luck finding an ST example for that. And it's the one thing that turns a static web page into a live control interfa
I've developed my own PCB using an STM32H723ZGT6 microcontroller. I'd like to store data to a microSD card that's onboard, and I've designed it to use SDMMC2 for the better transmission rate. I have no external pullup resistors, but I have enabled the internal pullup resistors (found to be 38kOhms using a multimeter) on each of the data lines and the CMD line. I have ESD protection inline using the EMIF04-1005M8. The bus is configured in 1-bit mode until successful connection is made. Additionally, I've tried two different micro SD cards, a 32GB SanDisk, and an 8GB Gigastone micro SD card. I run into issues in HAL_SD_Init, which is called in the MX_SDMMC2_SD_Init. I've stepped through the code using the ST-Link and have found the issue to be in this loop: while (!__HAL_SD_GET_FLAG(hsd, SDMMC_FLAG_RXOVERR | SDMMC_FLAG_DCRCFAIL | SDMMC_FLAG_DTIMEOUT | SDMMC_FLAG_DATAEND)) { if (__HAL_SD_GET_FLAG(hsd, SDMMC_FLAG_RXFIFOHF)) { for (count = 0U;
Hi everyone!I have generated a code from CubeMX for USB-PD in bare-metal configuration like this: Then I started testing the code and the function USBPD_PE_Init at this line: /* PE SET UP : Port 0 */ CHECK_PE_FUNCTION_CALL(USBPD_PE_Init(_port_index, (USBPD_SettingsTypeDef *)&DPM_Settings[_port_index], &DPM_Params[_port_index], &dpmCallbacks));returned false.I have looked in the assembler window and found out that some members of static const USBPD_PE_Callbacks dpmCallbacks = { USBPD_DPM_SetupNewPower, USBPD_DPM_HardReset, NULL, USBPD_DPM_Notification, USBPD_DPM_ExtendedMessageReceived, USBPD_DPM_GetDataInfo, USBPD_DPM_SetDataInfo, USBPD_DPM_EvaluateRequest, NULL, NULL, // Like this one!!! USBPD_PE_TaskWakeUp, #if defined(_VCONN_SUPPORT) USBPD_DPM_EvaluateVconnSwap, USBPD_DPM_PE_VconnPwr, #else NULL, NULL, #endif /* _VCONN_SUPPORT */ USBPD_DPM_EnterErrorRecovery, USBPD_DPM_EvaluateDataRoleSwap, USBPD_DPM_IsPowerReady };are not a
Hello,As a lot of people here, i'm trying to implement USB in standalone mode (bare metal, no OS used).I'm using NUCLEO-STM32WBA65RI board.CubeDE 1.19CubeMX 6.15.0 still can't make it work. I'm looking for help. I checked a lot of forum posts, a lot of github pages.I based myself on :https://github.com/STMicroelectronics/x-cube-azrtos-h7/blob/dev/usbx/Projects/NUCLEO-H723ZG/Applications/USBX/Ux_Device_CDC_ACM_Standalone/USBX/App/app_usbx_device.cand tried to implement the AzureRTOS USBX standalone versionHere is my Cube MX configuration :Clock USB :I only used X-CUBE-AZRTOS-WB and desactivated USBX : Using buffer <10*1024 would rise a memory error flag in ux_device_stack_initialize() : The rest is default configuration. Then USB_OTG_HS : Device_Only and :Then i generated the code,I added : if(MX_USBX_Device_Init() != HAL_OK) { for(;;); }And inside of it : /* USER CODE BEGIN MX_USBX_Device_Init1 */ USBX_APP_Device_Init(); /* USER CODE END MX_USBX_Device_Init1 */A
Hello everyone!I am using stm32n6570-dk. My project has only FSBL and was generated using STM32CubeMX. I was able to run it in debug mode without issues. The code does not execute when flashed to external flash memory. I had to comment out "MX_ICACHE_Init();" for the code to run from external memory. I thought there may be a configuration issue from my side. So I ran the "Starter project" provided by STM located at "STM32CubeN6\Projects\STM32N6570-DK\Templates_Board". This code also runs fine in debug mode. It does not work when flashed to external memory without commenting out "MX_ICACHE_Init();".I expect the example code to work without modifications. I figured out that the program does not reach the error handler and gets stuck in HAL_ICACHE_ConfigAssociativityMode(). This is when flashed to external memory.if (HAL_ICACHE_ConfigAssociativityMode(ICACHE_1WAY) != HAL_OK){Error_Handler();}Within HAL_ICACHE_ConfigAssociativityMode() it gets stuck in READ_B
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.