Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hi all,My MX_SDMMC1_SD_Init() is failing and dropping into Error_Handler() on a custom STM32U575RGT6 board.I traced it down to SD_PowerON() failing — it returns HAL_SD_ERROR_UNSUPPORTED_FEATURE. Digging deeper, this happens because one of the internal response-check calls (SDMMC_GetCmdResp1() / GetCmdResp2() / GetCmdResp3()) is returning SDMMC_ERROR_CMD_RSP_TIMEOUT (the CTIMEOUT flag gets set) — basically the card isn't responding to one of the commands sent during power-on/init.i have checked HAL_SD_InitCard() clock divider formula where HAL correctly computes ClockDiv = 21 for 16 MHz kernel clock also measured SDMMC_CK on oscilloscope and getting 381.7 kHz which is within spec (≤400 kHz)we have external pull ups at all pins of sdmmc plus when i run on this fun SDMMC_CmdAppCommand i can see activity on CMD line but i didnt get any response on that line.the clock i’m giving is HSE PLL1P to SDMMC clock mux which is 16Mhz final
Hello guys. I’m currently trying to implement a CI/CD pipeline on my project, using a dedicated RPi device (Raspbian) as a test-bed. I use a python script to generate the cmake.txt file and then the arm libraries and ninja to build the .bin file and the programmer cli to flash it onto my device. The thing is that my approach works for now, but trying to include external packages like CMSIS dsp, or user provided libraries is such a huge pain. It works for now that the package is a very specific one, but this might change in the future, with the inclusion of new packs/libraries.So my question is, what is the best way -- Generate the cmakelist file that also includes the external packs/librarie. Is there a possibility to use an extension on Vs code server installed on my RPi ? -- Link said packages/libraries. I currently have a copy of a specific version of the Board FW files where most of the middleware files are, my imported libraries and the external CMSIS packs. Any advice would be we
In testing the LoRaWAN_End_Node_LBM application supplied with STM32CubeWL-1.5.0 release I found that the output power is substantially lower than the same test setup with the LoRaWAN_End_Node application supplied with STM32CubeWL-1.4.0. This testing was conducted only using the US915 region setting.First I found that the EIRP was being defined as 16 dBm in Middlewares/Third_Party/LoRaWAN/smtc_modem_core/lr1mac/src/smtc_real/src/region_us_915_defs.h when it should be 24 dBm.#if defined( LR11XX ) || defined( SX1262 ) || defined( SX1268 ) // region is 30 dBm but radio is 22 dBm ERP (+2 to EIRP) #define TX_POWER_EIRP_US_915 (24) // define in dbm #else // region is 30 dBm but radio is 14 dBm ERP (+2 to EIRP) #define TX_POWER_EIRP_US_915 (16) // define in dbm // TODO must be checked, SX126x dependent for the max power #endifSince the project compiles with the preprocessor symbol -DSX126X the #if condition fails and the maximum transmit power is capped at 14 dBm ERP rather tha
I am working on an STM32H7-based project where I continuously poll sensor data over SPI in DMA mode. Everything works as expected for the first few hours, but occasionally the SPI bus freezes and triggers a timeout error (HAL_SPI_ERROR_TIMEOUT).Resetting the SPI peripheral manually recovers the communication, but I want to identify the root cause instead of using a soft-reset workaround.Has anyone encountered similar bus lockup issues with STM32H7 SPI DMA implementation? Any tips on proper flag clearing or clearing the FIFO buffer safely would be greatly appreciated!
Hello there, I’m working on a device that in its normal operation uses the MSC.But I want my clients to also be able to update the device via USB using DFU.#define USBD_PID_FS 57105#define USBD_PRODUCT_STRING_FS "STM32 DownLoad Firmware Update"#define USBD_CONFIGURATION_STRING_FS "DFU Config"#define USBD_INTERFACE_STRING_FS "DFU Interface"#define USBD_PID_FS 22314#define USBD_PRODUCT_STRING_FS "STM32 Mass Storage"#define USBD_CONFIGURATION_STRING_FS "MSC Config"#define USBD_INTERFACE_STRING_FS "MSC Interface"I found these differences and made a work around, CubeProgrammer is detecting a DFU device when a button is pressed:void MX_USB_DEVICE_Init(void){ /* USER CODE BEGIN USB_DEVICE_Init_PreTreatment */ //check to enter DFU mode if(HAL_GPIO_ReadPin(USR_BUT_ENTER_GPIO_Port, USR_BUT_ENTER_Pin) == GPIO_PIN_RESET){ if (USBD_Init(&hUsbDeviceFS, &DFU_Desc, DEVICE_FS) != USBD_OK) { Error_Handler(); } if (USBD_RegisterClass(&hUsbDeviceFS, &U
Hi,I'm working on a data-logging application using the STM32U575VGT6Q. I'm evaluating filesystem options for this.I have a few questions for the community/ST team:Is LittleFS officially supported on the STM32U575 series (or any STM32U5 platform)? Is there any official ST support, reference implementation, or roadmap for LittleFS on STM32U5, or on any STM32 series in general? I'm targeting an external OCTOSPI flash chip . Is there any official or community GitHub repo, example project, or app note demonstrating LittleFS's using OCTOSPI HAL driver on STM32U5? If anyone has done this integration themselves, could you share a reference implementation or point me to one? For an append-heavy, sequential data-logging use case on external NOR flash, which filesystem would you recommend between LittleFS, FatFS, and FileX+LevelX on this platform, and why?Any pointers — official documentation, GitHub repos, forum threads, or app notes — would be greatly appreciated.Thanks in advance.
Hi all,I have this demo board. I copied the BSP demo code to my own empty project to understand and learn how the LCD code works. I copied the code from the BSP demo function by function but I moved the code to my files (filenames and project tree folders) so it makes more sense to me. I'm at the point where the demo draws rectangles on the screen and the demo runs. I copied the touch panel stuff but it is disabled because it was getting stuck in the init function. I'll deal with the touch panel later.I can not get the function that draws the rectangles on the LCD to work more than once when I program the board with my project. If I try to debug and step thru the code it actually works. I traced the part where it "hangs" by adding a line to toggle the green LED in the board. The part where it hangs is in the Polling For DMA transfer function: (void)HAL_DMA2D_PollForTransfer(&hlcd_dma2d, 50);BTW I'm new to STM32U5G9J, never used it before. I read the reference manual for the MCU and
I want progrma the STM32C071RBT6 for to get a virtual COM port.I’m using NUCLEO-C071RB board and this are the settings with Cube MX: I add some instructions into the main like this: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 clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_CRC_Init(); MX_USB_PCD_Init(); MX_USBX_Device_Init(); _ux_dcd_stm32_initialize(0, (ULONG)&hpcd_USB_DRD_FS); if (HAL_PCD_Start(&hpcd_USB_DRD_FS) != HAL_OK) { Error_Handler(); } /* USER CODE BEGIN 2 */ /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE *
Hi,I'm trying to bring up an IMX219 (Raspberry Pi Camera Module v2) on the “x-cube-n6-camera-capture” reference project for nucleo657x0q, I first tried this under Zephyr and got working capture, but only at reduced resolution. I've since moved to writing a native driver for “stm32-mw-camera” instead, using “imx335.c” “cmw_imx335.c” as a structural reference template but only at the code/flow level since IMX335's actual register map isn't in any public datasheet I could find. For register values, PLL chain, and gain formula I relied entirely on the official Sony IMX219 datasheet instead, since the two sensors don't share a register layout.My questions are:1. Is there any official guidance for integrating a third-party sensor into `stm32-mw-camera` — driver/BSP side?2. Beyond the lane count and PHY bitrate, is there anything else specific to porting from a 4-lane sensor (IMX335) to a 2-lane one (IMX219) that I should watch out for? If writing a custom driver isn't the recommended path h
Hi, Following the original discussion here, this topic is split into a separate issue to remain aligned with Community guidelines and better visibility.DFU mode This processor can program the Option Bytes over DFU DFU ModeThis Processor is totally misdesignedIt exposes the Flash memory 3 timesFor me this looks like a severe bug.If you have a STM32G0B1 with read and write protection there is NO WAY over DFU get rid of these protections.
I’m trying to run a fork of the STM32N6-GettingStarted-ObjectDetection project for the STM32N6570-DK on my own board.My board has the same clock configuration, memory interface, and LCD interface as the STM32N6570-DK. However, instead of a CSI camera, I’m using an 8-bit parallel camera interface.The frames come from a custom FPGA source with the following parameters:75 MHz clock at 8 bit width bus YUV422 1280 × 768 30 fps Embedded synchronization ITU656My changes to the original project are:Added GPIO initialization for the 8-bit parallel camera interface. Changed the DCMIPP configuration from CSI to parallel mode:const DCMIPP_EmbeddedSyncCodesTypeDef syncСodes = { .FrameStartCode = 0xAB, /* frame SAV*/ .LineStartCode = 0x80, /* line SAV */ .LineEndCode = 0x9D, /* frame EAV */ .FrameEndCode = 0xB6 /* line EAV */};const DCMIPP_ParallelConfTypeDef pParallelConfig = { .Format = DCMIPP_FORMAT_YUV422, .VSPolarity = DCMIPP_VSPOLARITY_LOW, .HSPolarity = DCMIPP_
Hello everyone, I'd like to use the LevelX API with FreeRTOS on an STM32H5 microcontroller. I know that LevelX is typically used with AzureRTOS, but I'd like to know if ST provides any guidance on integrating it with FreeRTOS or if anyone has any suggestions on how I can do this. Thanks for your help.
BOARD: STM32H743IITXACTICLE FOLLOWED: https://community.st.com/t5/stm32-mcus/how-to-implement-a-usb-device-composite-in-stm32h5/ta-p/708078Hello everyone,I was trying to use USB CDC+MSC in composite mode. After following the article mentioned above, i was able to build the project. But after running i was able to only get MSC (as shown in pc) and getting the CDC port with windows error 10.Few things i have changed, in usbd_desc.c updated these lines 0xEF, /* bDeviceClass */ 0x02, /* bDeviceSubClass */ 0x01, /* bDeviceProtocol */ Also i have updated CDC_IN_EP, CDC_OUT_EP, CDC_CMD_EP so it should not match MSC_EPIN_ADDR and MSC_EPOUT_ADDR #ifndef CDC_IN_EP #define CDC_IN_EP 0x82U /* EP1 for data IN */ #endif /* CDC_IN_EP */ #ifndef CDC_OUT_EP #define CDC_OUT_EP 0x02U /* EP1 for data OUT */ #endif /* CDC_OUT_EP */ #ifndef CDC_CMD_EP #define CDC_CMD_EP 0x83U /* EP2 for CDC commands */ #endif /* CDC_CMD_EP */ #ifndef MSC_EPIN_ADDR #define MSC_EP
Part Number: STM32F427VIT6Environment: Custom PCB (not an eval/dev board), native SDIO/SDMMC1 peripheral, 4-bit bus, FatFs (ChaN's ff.c) on top of ST's HAL (stm32f4xx_hal_sd.c). STM32CubeIDE 2.2.0, GNU Arm Embedded toolchain 14.3.rel1 (arm-none-eabi-gcc), STM32CubeProgrammer for flashing/SWD debug, bare-metal HAL (no RTOS). SDIO clock tested from 400kHz up to ~24MHz; same result throughout.Schematics / hardware note: This is a custom PCB, so a board-level cause can't be fully excluded, a scope check on the 3.3V rail during a write burst is still pending, and I'm happy to attach the relevant SDMMC1/power schematic on request. That said, a pure PCB signal-integrity/trace defect looks unlikely specifically: DAT0-3 are bidirectional and reads over those same physical traces are 100% reliable, every write's CRC check passes cleanly, the failure is fully deterministic rather than marginal/intermittent, and it's unchanged across the full 400kHz-24MHz clock range tested, none of that fits a ti
Hi.I'm trying out new STM32N6 Nucleo board. It has cmera interfaces, so I wanted to try some examples with the camera.My usual routine for quickstarting some new STM32 product was to download CubeMX package for it, go to Repository folder -> Projects -> [board] -> Applications or Examples, and run an exaple project. But I didn't find any example neather for Nucleo nor other boards.Where can I find camera examples for NUCLEO-N657 board?Thanks.
I have an application that uses internal flash for logging. Unfortunately, after exiting stop3 subsequent writes to flash fail. Here’s my exit code -- the names of the routines should give a general idea. I don’t really have a clue what changed and the reference manual is notably sparse on details about the various stop/standby/shutdown modes SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk)); __DSB(); __WFI(); __ISB(); CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk)); PWR->APCR &= ~PWR_APCR_APC; palSetLine(LINE_testpin); chSysLock(); tagPowerRestoreClocksAfterStop3(); tagPowerPostStop3WakeEventI(); chSysUnlock(); // Ensure Flash is awake and not stuck in low-power mode FLASH->ACR &= ~(FLASH_ACR_SLEEP_PD); __DSB();
Hi,Could you please share example for using IIS2MDCTR via SAI on STM32U385.Thanks
As the title suggests, I see in debug mode that audio is captured from I2S_RX, but it is not transmitted on the transducer (I cannot hear any audio coming from I2S_RX with my hear). And the problem is that with the same hardware wiring it works on the other boards (including H7S3L8), but not on this specifically. I’ve tried to place dma buffer in RAM D2 and I’ve disabled D cache, ut it does not solve anything. Is the board I’ve ordered broken? I upload the code below
Board: STM32N6570-DK Sensor: Sony IMX219 (Raspberry Pi Camera Module 2 / NoIR), custom driver, connected via a 15-pin-to-22-pin adapter cable into the board's camera connector (normally used for the MB1854/IMX335 module)SummaryI've written a from-scratch IMX219 driver (I2C register map transcribed from the Linux kernel's imx219.c) as an additive sensor option alongside the working IMX335 path. I2C control, power sequencing, and CSI-2 D-PHY link all come up healthy. DCMIPP's own status registers report that PIPE1 is continuously and successfully capturing new frames. But the actual pixel data written to memory is frozen — bit-for-bit identical — and does not respond to real scene changes. I'm looking for insight into what could produce this specific disconnect.Configuration2 CSI-2 lanes, D-PHY bitrate bucket DCMIPP_CSI_PHY_BT_900 (900 Mbps bucket, closest available to the computed 912 Mbps for this PLL config) Sensor PLL: VTPXCK_DIV=5, PREPLLCK_VT_DIV=3, PLL_VT_MPY=57, OPSYCK_DIV=1, PRE
Hi,I am using the STM32H745I-DISCO board and trying to boot an application from the external QSPI flash (MT25QL512ABB).For this purpose, I created two separate projects: Bootloader Project Initializes the QSPI flash. Configures the QSPI in Memory-Mapped mode. Jumps to the application stored in the external QSPI flash. Application Project Modified the linker script (.ld file) to change the application start address from 0x08000000 to 0x90000000. Added the following statements in CM7/Common/Src/system_stm32h7xx.c (around lines 295–296) inside SystemInit(): As a basic test, the application code is only trying to blink the LED connected to GPIO Pin 13 after booting from the QSPI flash. RCC->CFGR = 0; SCB->VTOR = QSPI_BASE;After building the application, I generated the .bin file and programmed it into the QSPI flash using STM32CubeProgrammer.When I read back the contents from address 0x90000000 using CubeProgrammer, I can see valid data programmed in the fla
Based on discussion here, conclusion is, that given in 'L45x/'L46x there's no DAC1_CH2, and in 'L41x/'L42x no DAC at all, these are unavailable for inputs selectable for COMP for these sub-families of the low-end 'L4xx family group handled collectively by RM0394. Description in stm32l4xx_hal_comp.c does not tell these completely, and there are also references to 'L43x/'L44x having some exceptions, which based on RM/DS doesn't appear to be the case: Also, macros in stm32l4xx_ll_comp.c don't take the missing DAC channels into account, and they should. Can these be looked at, please. Thanks, JW
I am attempting to exist from a Shutdown mode using the WKUP6 pin (PB5) on an STM32G0B1CEU.This is my shutdown code.HAL_SuspendTick();__HAL_RCC_PWR_CLK_ENABLE();HAL_PWREx_EnableGPIOPullUp(PWR_GPIO_B, PWR_GPIO_BIT_5);HAL_PWREx_EnablePullUpPullDownConfig(); // sets the APC bit in PWR_CR3HAL_PWREx_EnablePORMonitorSampling();HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN6_LOW);// Do reads of registers to ensure they were written(void)PWR->CR3;(void)PWR->CR4;/* Clear all related wakeup flags*/__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF);HAL_PWREx_EnterSHUTDOWNMode();This seems to do almost exactly what I would expect it to do.PB5 goes high.Power consumption drops.However, it never wakes up. I have a wire connected to PB5, which I am measuring with a scope, and confirm that it is going high. I am them shorting that wire to ground and confirm that it goes low. The system doesn’t wake up. I know it’s not immediately going back to sleep because right now there is no automated way for it to enter sleep m
Hi everyone,I'm working on Azure RTOS USBX CDC ACM on an STM32F429ZIT6. The USB device is detected successfully by Windows, and a COM port is created, but I'm unable to transmit or receive any data.EnvironmentMCU: STM32F429ZIT6 STM32CubeIDE: 1.19 STM32CubeF4: 1.28.3 Azure RTOS USBX (X-CUBE-AZRTOS-F4)ProblemThe USB device enumerates successfully:Device Manager detects the USB CDC device. A COM port is created. No data transfer occurs. _ux_device_class_cdc_acm_activate() is never called. The CDC ACM class never becomes active.While debugging, I found that execution reaches: UINT _ux_device_stack_interface_start(UX_SLAVE_INTERFACE *interface)where the following assignment is made: class_command.ux_slave_class_command_class = interface->ux_slave_interface_descriptor.bInterfaceClass;Later, USBX calls: _ux_device_class_cdc_acm_entry(&class_command);During the UX_SLAVE_CLASS_COMMAND_QUERY request, the following check is performed: if (command->ux_slave_class_command_class == UX
Hello,Is there any chance ST could provide examples or guidance on interfacing a CSI (MIPI) camera with Raspberry Pi Camera Module 2 NoIR cameras?From my initial research, it seems the CSI connector uses the same pin layout as Raspberry Pi cameras. However, available examples are quite limited, making it challenging to implement this on my own — especially compared to the simplicity of working with DCMI.Any documentation, sample code, or community insights would be greatly appreciated!Thank you.With best regards,Linas
Hello @ST Community @ST MICROCONTOLLER I have purchase NUCELO-H563ZI board.Purpose: I need to read and write pendrive sector using only pure HAL HCD driver (Baremetal Code only) (No FILEX, USBx, ThreadX, FreeRTOS)Following is my Hardware Connection: I am using external USB Type A Female Breakout board. Not using internal CN13 TypeC USB connector.PA11 : D-MinusPA12 : D-PLUSVCC : 5VGND : Board GroundI have attached file which can read and write the sector.While submitting request for “Get Descriptor” command. Code is stuck during USB_EnumerateMSC » USB_GetDescriptor » “USB_ControlTransfer” » “USB_SubmitTransfer” >> “HAL_HCD_HC_SubmitRequest” stuck in “USB_WaitForURB>>HAL_HCD_HC_GetURBState” function.I can observe that while submitting “HAL_HCD_HC_SubmitRequest” request on channel 0 HAL Drive respond on channel 1 instead of channel 0. ch[0].urbState = USB_IDEL while ch[1].urbState = USB_DONE.Also i have also observe that “HCD_HC_OUT_IRQHandler(hhcd, (uint8_t)i);” API “uint8
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.