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
Hello, I am using STM32L073RBT6 controller. I want to use standby mode in my battery operated instrument. I want to use single tactile button to enter and exit standby mode. Is it possible to do?? What if I allocate another nearby pin as GPIO interrupt and short it to SYSTEM_WAKEUP pin and use it to enter in the standby mode? Thank you so much in advance for the help. Have a great day ahead!
Hi here is my code. I just started to learn stm32 codding and ı want to send analog signal I obtained with the help of ibus protocol. But hercules program has random letters.I know what I did might be completely ridicilous but I wanted to try my luck. /* Includes ------------------------------------------------------------------*/#include "main.h" /* Private includes ----------------------------------------------------------*//* USER CODE BEGIN Includes */ /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*//* USER CODE BEGIN PTD */ /* USER CODE END PTD */ /* Private define ------------------------------------------------------------*//* USER CODE BEGIN PD */ /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*//* USER CODE BEGIN PM */ /* USER CODE END PM */ /* Private variables -----------------------------------
Hi Sir,I am reviewing the application schematic of the STUSB1600 in a dual-role Type-C design. I understand that when STUSB1600 operates as a Source, the output current can be configured through the CC_CAPABILITY_CTRL register.However, I did not see an explicit current limiting component in the provided schematic. I would like to ask whether ST has any recommended external circuit solutions to further enforce current limitation, such as a preferred power switch or current limiting IC that is compatible with this setup.Additionally, I would like to confirm: if we only configure the CC_CAPABILITY_CTRL register without any external current limiting components, would the actual output current still exceed the configured 1.5A limit in certain conditions? If so, could you provide a reference circuit diagram or recommendations for suitable current limiting components that ensure proper current regulation?
The ADC values remain unchanged even when input signals does change. The C++ code provided below should hopefully clarify the situation, as I am a stuck. Thank you in advance for any help! #include "mbed.h" #include "stm32l4xx_hal.h" //Once the buffer below is filled, transfer it over to the PC #define ADC_BUF_SIZE 1024 // Number of samples in buffer #define SAMPLE_RATE 50000 // Sampling rate in Hz (e.g., 50 kHz) AnalogIn adc_pin(A0); // Use A0 as the analog input pin // ADC and DMA handles ADC_HandleTypeDef hadc1; DMA_HandleTypeDef hdma_adc1; uint16_t adc_buffer[ADC_BUF_SIZE]; // ADC DMA buffer volatile bool buffer_ready = false; // Flag to indicate data is ready void ADC_Init() { __HAL_RCC_ADC_CLK_ENABLE(); // Enable ADC Clock __HAL_RCC_DMA1_CLK_ENABLE(); // Enable DMA Clock hadc1.Instance = ADC1; hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV4; hadc1.Init.Resolution = ADC_RESOLUTION_12B; hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc1.Init.ScanConvMode = DIS
21:56:14 **** Incremental Build of configuration Debug for project H745_Ethernet_PING_CM7 **** make -j8 all make: *** No rule to make target 'C:/Users/STM32CubeIDE/workspace_1.10.1/H745_Ethernet_PING/Middlewares/Third_Party/LwIP/src/core/altcp.c', needed by 'Middlewares/Third_Party/LwIP/altcp.o'. Stop. "make -j8 all" terminated with exit code 2. Build might be incomplete. 21:56:15 Build Failed. 1 errors, 0 warnings. (took 706ms) Hello... i entered this error on H750-DISCO running on Ethernet MII , anyone can pls help, TQ!
I want to use a single Ethernet port to run both a Modbus connection and a BACnet. This will be on a STM32H7 processor and using AZURE RTOS
After hours of struggling, I finally managed to get the I-CACHE working while using XIP from an external Macronix OCTOSPI Flash.The key was enabling memory remapping and writing a proper linker script that used the I-CACHE remapped address space. First, I want to highlight that—aside from AN5212 and the Reference Manual—a clear example is NOT provided. I had to manually modify the linker script (which is not correctly generated by CubeMX), and after hours of frustrating debugging, I discovered that breakpoints set via STLink_GDBServer do not work by default. This issue arises because the following memory definitions XML is hardcoded into the STLink GDB Server: <?xml version="1.0"?> <!DOCTYPE memory-map PUBLIC "+//IDN gnu.org//DTD GDB Memory Map V1.0//EN" "http://sourceware.org/gdb/gdb-memory-map.dtd"> <memory-map> <memory type="ram" start="0x0" length="0x8000000"/> <memory type="flash" start="0x8000000" length="0x400000"> <property name="b
cubemx 6.14.0 FW_H7_V1.12.1sd_diskio.c generated by cubemx, it's not match with the Middlewares\Third_Party\FatFs\src\drivers\sd_diskio_dma_rtos_template_bspv1.c. These are some context in sd_disio.c:/* USER CODE END Header *//* Note: code generation based on sd_diskio_dma_rtos_template_bspv1.c v2.1.4as FreeRTOS is enabled. *//* USER CODE BEGIN firstSection */ In Middlewares/Third_Party/FatFs/src/st_readme.txt:### V2.1.5/18-08-2023 ###============================+ Add LICENSE.md file at the root directory.+ Fix in disk_initialize() function, the "is_initialized" flag to be set 1 after checking the driver's return value.- src\diskio.c+ Fix read/write sector size cast type in USBH_ioctl().- src\drivers\usbh_diskio_template.c- src\drivers\usbh_diskio_dma_template.c+ Fix declaration of the "ret" parameter in SD_read()- src\drivers\sd_diskio_dma_rtos_template_bspv1.c+ Set “ReadStatus” variable to zero before calling BSP_SD_ReadBlocks_DMA()- src\drivers\sd_disk
Hi,I use STM32Cube, STM32CubeIDE and my board is STM32F746. How do I update FATFS? The system is running version 0.12c. This is from 2017.Why do I want to update it?After inserting the SD card, I check the status and if the card is not formatted, I want to format it. I have tried everything I could find on the internet. I am obviously not the only one who has a problem with the SD card in STM32 systems.The command I use is this:res = f_mkfs((TCHAR const*) SDPath, FM_FAT32, 0, work, sizeof(work));Of course, I have tried all possible parameters. I get a response that formatting is OK, but after moving the card to the computer there is no system on the card and I get a RAW response.When the card is formatted in advance, everything works for me.
I have a system that I am migrating from a part with more RAM to the STM32H733. I already have external FLASH set up and operating well but the amount of RAM available for heap is anemic for future growth.The external flash is running on the OCTOSPI in quad-spi mode to save on pins. The goal would be to not add many if any pins for external PSRAM and use chip select to move between the two spaces.It looks from the docs like this is doable, there are examples on other micros in this doc https://www.st.com/resource/en/application_note/an5050-getting-started-with-octospi-hexadecaspi-and-xspi-interface-on-stm32-mcus-stmicroelectronics.pdf and the H733 documentation talks about external Flash options with OCTOSPI.What I am wary of is trying to memory map on both peripherals using the same pins for the heap while executing code out of our external flash. Our application is not super intensive but we do have a display to animate and such so the throughput can't be
Hi, I am using an STM32G0B1CT6 and generated code using the STM32CubeMX to use the USB Host library to interface the CP2112 device. I am able to enumerate and communicate with the device using the interrupt IN/OUT. I am also able to get reports using the USBH_HID_GetReport function. But when I try to set some SMBUS configurations using the USBH_HID_SetReport function, it doesn't work (I'm checking this by reading back the configurations). Additionally, I see that the USBH_HID_SetReport function takes a reportType as argument appart from the reportID. What is the reportType? as a side note, according to AN495 of the CP2112, the configuration I am trying to set should be transmitted as a Feature request with a report ID of 0x06. Any ideas why this function may not work?Thanks
Hello everyone!I am encountering an issue where USB_CoreReset hangs on both the STM32H7S3L8 and STM32H753ZI boards when configuring the USB_OTG_HS port.I understand that this issue has been reported previously, and I have thoroughly reviewed most of the related posts over the past week. However, I have not found a solution that works for my case.Configuration Details:MacOS Sequoia 15.3.1 (Run IOC using: sudo /Applications/STM32CubeIDE.app/Contents/MacOS/STM32CubeIDE)STM32CubeIDE Version: 1.17.0STM32H7S3L8 BoardUSB_OTG_HS enabled in Device modeUSB_HS_REGEN (USB Regulator) enabledUSB OTG HS interrupt enabledClock configuration:HSE = 24 MHz60 MHz clock provided to USB_OTG_HSRCC settings:'CRS SYNC' set to USB_HSNVIC settings:Global interrupt for USB enabledUSB_DEVICE enabled with Communication Device Class (CDC)STM32H753ZI Board (NUCLEO-STM32H753ZI)Configuration is the same as above, except that USB Regulator not enabled (not an option in IOC) Issue Description:When running in debug m
Hi, I am using STM32G0B1CBTX and used the STM32CubeMX to configure USB host with CDC class. When connecting a CDC device, I noticed that it passes the enumeration and configuration but fails to find the interface used. More specifically, it fails the functioninterface = USBH_FindInterface(phost, COMMUNICATION_INTERFACE_CLASS_CODE, ABSTRACT_CONTROL_MODEL, COMMON_AT_COMMAND);at line 158 of the usbh_cdc.c file. Upon deeper inspection, I noticed that the protocol value passed to this function using the macro COMMON_AT_COMMAND is set to 1 while the two interface descriptors I receive from the device both have their interface protocol set to 0. If I manually edit this and use the NO_CLASS_SPECIFIC_PROTOCOL_CODE macro (value = 0), everything works correctly and I can send and receive data. This part of the library should be fixed and no user editing should be needed. So my question is, is their something wrong with the device's descriptors or can the first call to the&nbs
Hello, I'm writing regarding use of the stm32-can-bootloader that is linked on the https://github.com/effenco/stm32-can-bootloader and also is mentioned in the topic https://community.st.com/t5/others-hardware-and-software/serial-programming/td-p/63046 We use this bootloader code for the STM32G0B1CxT and it works fine programming via PD0/PD1 (FDCAN1) interface.We'd like to use it on the PB0, PB12 (FDCAN2) interface but with no success - there's an error on the bus that looks like the programmer can't send data to the PB0, PB12.Configuration for the both FDCANs is the same and they are both enabled to receive during flashing. I'm not sure if it's connected with the limitations mentioned in the manual (screen is attached to the message). Additional details: The initial code is generated by the cubeMXHAL_FDCAN_RxFifo0Callback() is not called for the FDCAN2 in the bootloader modeThe FDCAN2 used in the application code works fineDo these limitat
Hello,Is there any documentation or example on how to setup a STMH7(43) with QSPI and FileX and LevelX? There must be something that is not setup properly. I looked at the Fx_Nor_Write_Read_File project for the STM32H735, but the code and CubeMX settings are completely different from the new project I started with CubeMX.On my custom board, the system comes up. It starts by calling FX_Media_Format, which calls 'FlashErase; it thinks it successfully erased the entire flash (but I have my doubts), it then sets up the semaphores, and start the actual formatting. lx_stm32_qspi_read() runs 3 times and then fails. I would have expect to see "FFFFFFFF"s on all the reads, but it seems to be getting different data.I dropped the clock to 50MHz for this test, but it is unclear if the 1/2 clock shift should be enabled or not, and what should the DMA settings be in CubeMX. It seems to be reading the Device ID and passes that test. Is it a memory cache issue?Any help or sugge
I need a second pair of eyes. I am trying to setup EXTI using the GPIO HAL. But it looks like its doing it wrong. It must be me but I need you to double check to be sure.This is STM32G0 HAL so stm32g0xx_hal_gpio.c /*--------------------- EXTI Mode Configuration ------------------------*/ /* Configure the External Interrupt or event for the current IO */ if ((GPIO_Init->Mode & EXTI_MODE) != 0x00u) { temp = EXTI->EXTICR[position >> 2u]; temp &= ~(0x0FuL << (8u * (position & 0x03u))); temp |= (GPIO_GET_INDEX(GPIOx) << (8u * (position & 0x03u))); EXTI->EXTICR[position >> 2u] = temp; In this code sample the macro GPIO_GET_INDEX is used. It takes the value "GPIO_TypeDef *GPIOx" and this value will enter the function as GPIOB, GPIOA etc. The macro is #if defined(GPIOE) #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0uL :\ ((__GPIOx__) == (GPIOB))? 1uL :\ ((__GPIOx__) == (GPIOC))
Hello,I have just started with STM32 after some projects with AVR MCUs. I have recently noticed a strange behavior with "HAL_UART_Receive_IT" function. Everything works fine for me if the size argument is one, but for other values the overrun flag is set after few receptions.If I for example give the size argument size=5 and send bytes in the chunks of three bytes like:123<send> 123<send> 123<send> 123<send> The overrun occurs somewhere during the fourth chunck. I dont understand why everything works perfectly and I never end up with ORE flag set if the size parameter is one. By looking at the HAL driver the interrupt routine should actually take slghtly longer when the size is one and with size=1 everything works always. Uart baudrate is only 9600. My debug code after initializations is just forever while loop with no content (while(1);) and my uart RX callback code is: char rx_buff[100]; void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) {
I am currently working with the STM32H573I-DK discovery kit and am trying to enable Ethernet connectivity using LWIP in STM32CubeMX and STM32CubeIDE. However, I have noticed that the LWIP option is not available in STM32CubeMX for this board.Could you kindly guide me on how to enable Ethernet functionality with LWIP on the STM32H573I-DK? Is there any recommended procedure or workaround to add Ethernet support if the option is not directly available in STM32CubeMX?Any guidance, reference materials, or example projects would be highly appreciated.How to use the LwIP Ethernet middleware on the STM32H5 series....I already saw this...but so many error
Hi CommunityI can not find the " HAL manual M1785 User manual Description of STM32F0 HAL and low-layer driver" pdf file in the dedicated webpage for this product, which is the following page:https://www.st.com/en/microcontrollers-microprocessors/stm32f0-series/documentation.htmlto find this file I have to google it and the google gives me the link bellow to download the file;https://www.st.com/resource/en/user_manual/um1785-description-of-stm32f0-hal-and-lowlayer-drivers-stmicroelectronics.pdf can some one give me the location of these kind of manuals on the dedicated page of MCUs? thanksArash
STM32L476RE immediately exits STOPMODE2 after entering, even though the HAL_SuspendTick() tick has been called prior to.I have a small C application running on an STM32L476RE and I am using FreeRTOS as an OS. I want to periodically enter into a low power mode on the processor since this is an IoT battery device. I have tried entering the stopmode 2 by way of this code: SEGGER_RTT_printf(0, "Entering STOP2 mode. %lu\r\n", HAL_GetTick()); HAL_SuspendTick(); HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 0x7FFF, RTC_WAKEUPCLOCK_RTCCLK_DIV16); HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI); SEGGER_RTT_printf(0, "Exiting STOP2 mode. %lu\r\n", HAL_GetTick()); HAL_ResumeTick();I have also added a handler for the RTC wakeup ISR.void RTC_WKUP_IRQHandler() { HAL_RTCEx_WakeUpTimerIRQHandler(&hrtc); }Unfortunately, once the code gets to the HAL_PWREx_EnterSTOP2Mode() it returns immediately as if an interrupt had just occurred. I had a breakpoint set in the RTC_WKUP_IRQHandler and it doesn't break t
Meanwhile STM goes with Microsoft AZURE RTOS - ok, fine, feature rich, obvious! But "I miss a feature": open and read a file from the MCU internal flash memory (as a const file content, as array of characters, without a need for a sector based, FAT based, a file system). In the past, on STM MCUs and FW (CubeMX drivers and demos) - it was possible to have web pages for a HTTPD daemon (web server) located in MCU Flash memory and read the file data bytes and send it as browser response. Now, with AZURE RTOS - all seems to be stored on a FAT (sector based) file system. Why so complicated?! Details: I have ported the STM32U575-EV USB_ECM project to a NUCLEO-U575ZI-Q board. It needs the external SD Card! So, I had to put the web page files on external SD Card (with external SD Card adapter for a NUCELO board). I want to get rid of this SD Card and have my web pages sitting in the MCU Flash memory. OK, I understand, AZURE FileX is very flexible, it can also support SDRAM as file system MEDIA,
Hello. I tried to initialize SDRAM (I am using STM32F746 discovery kit), but I try to run it as a separate project just for learning. However I encountered the following problem: when I read data from SDRAM in my case starting from 0xC0000000 address - everything is ok, but writing to the address is shifted, it seems like when I write 16 bit int to 0xC0000002 it actually appears on 0xC0000000 location. Also when I use Memory tool in STM32CubeIDE and try to change 4 bytes in SDRAM region only lower two bytes are changed on 0xC0000000 addres. When I change the next word (0xC0000004) - the changes appear on 0xC0000003-0xC0000006 bytes. I tried the same with 32 bit int variable in stack region - and I can change all 4 bytes. I copied hardware settings from the init STM32F746 discovery project. Here is my init code: FMC_SDRAM_CommandTypeDef Command; /* Step 1 and Step 2 already done in HAL_SDRAM_Init() */ /* Step 3: Configure a clock configuration enable command */ Comm
Hi, I am working on a custom project with the STM32H755ZI (Cortex-M4 core) using the SDMMC peripheral and FatFs to read from SD cards. The SD card is inserted into a slot on my custom PCB, and the SDMMC peripheral is clocked via PLL2, because of this problem :(https://community.st.com/t5/stm32-mcus-embedded-software/stm32h757-sdmmc1-only-works-with-m7-core/td-p/711340) I have tested several SD cards: SanDisk SDXC 64GB Goodram SDXC 64GB Kingston SDHC 32GB EZVIZ SDHC 32GB However, I am running into a blocking issue when calling: fres = f_mount(&SDFatFS, "", 1);The call stalls for approximately 30 seconds in the function SD_read(BYTE lun, BYTE *buff, DWORD sector, UINT count) ( sd_diskio.c), specifically at the line:status = osMessageQueueGet(SDQueueID, (void *)&event, NULL, SD_TIMEOUT); I understand this means the code is waiting for a DMA completion message (READ_CPLT_MSG), but it never arrives within the timeout window. As a result, the f_mount call does
Hello,I'm facing a bizarre issue with USART2 in STM32H7 chip.My H7 is connected to 8 F072 chips via UART. Communication with each chip uses a dedicated UART from 1 to 8.All the data exchanges in both RX and TX work fine during normal operativity of my product even exchanging lots of data. I dont use any RTOS, I set priority in the NVIC table to manage concurrency.-----The problem starts when from the H7 I manage to transmit to the F0s a new version of their software to be installed by a bootloader. Once again during the data transmission and even the copy by the boot everything is fine. At the end of the installation process inside the F0s, when the main application is launched by the boot, that sends 3 bytes of "welcome" to the H7 to confirm the process has completed successfully.For UART 1 and from 3 to 8 the welcome bytes are sent and received correctly. for UART2 I see an overrun error on the RX of the peripheral. Please keep in made that the whole process is repeated 8 times seque
Hello everyone,I’m working on an STM32H747IIT6 based project that uses both Cortex-M7 and Cortex-M4 cores. Under Pinout & Configuration > System Core > Cortex_M7 (and similarly Cortex_M4) in STM32CubeIDE, there are several options such as:CPU I-Cache / CPU D-CacheMPU (Memory Protection Unit)TCM (ITCM / DTCM) EnableBackground Region Privileged AccessMPU Instruction AccessCache and MPU Region SettingsI’d like to understand the best practices for configuring these settings, especially when running multiple middleware components like FreeRTOS, LwIP (Ethernet), USB, I2C, and an SD card interface. Here are some questions I have:Cache Enable/Disable: Under which circumstances should I enable both Instruction Cache and Data Cache? What are the typical pitfalls (e.g., DMA conflicts) when D-Cache is enabled?MPU Configuration: If I plan to use the MPU, how do I decide which memory regions need different cache policies or access permissions? Are there any recommended templates or applica
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.