Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hi,Do we have sample code demonstrating continuous conversions for U545 ADC1 with GPDMA using "Standard Request Mode". The sample code should use two or more channels - say IN1, IN2. I am migrating a project from F105/F405 and am a little overwhelmed by the setting options to be configured with U545.The ADC_DMA_Transfer example at STM32Cube\Repository\STM32Cube_FW_U5_V1.8.0\Projects\NUCLEO-U575ZI-Q\Examples\ADC\ADC_DMA_Transfer uses Linked-List Mode and only demonstrates a single ADC channel. Thanks.
Post edited by ST moderator to be inline with the community rules for the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code. Hi All, MCU is STM32H563. I attempted to jump from the Secure App directly to the System Bootloader so that I could program the OBK file without pulling BOOT0 high.However, using the method below, the jump never succeeds — the MCU keeps resetting continuously. Sometimes it resets immediately, and sometimes it reaches the reset vector of the system bootloader and then resets again. static void JumpToBootloader(void) { funcptr_NS NonSecure_ResetHandler; __disable_irq(); // Disable interrupts SysTick->CTRL = 0; SysTick->LOAD = 0; SysTick->VAL = 0; HAL_RCC_DeInit(); // Reset clock configuration for (int i = 0; i < sizeof(NVIC->ICER) / sizeof(NVIC->ICER[0]); i++) { NVIC->ICER[i] = 0xFFFFFFFF; NVIC->ICPR[i] = 0xFFFFFFFF; } __DSB(); __ISB(); SCB_NS->VTOR = BOOTLOADE
Hello,I have a question about the flash memory map in the Secure project.I’m using the following application as an example:STM32Cube_FW_H5_V1.5.1\Projects\NUCLEO-H563ZI\Applications\ROT\OEMiROT_Appli_TrustZone\STM32CubeIDEIn the memory map, two flash regions are shown: - FLASH: 0x0c018400 - 0x0c01dfff - FLASH_NSC: 0x0c01c000 - 0x0c01c3ffQuestion:Should the FLASH_NSC region overlap the FLASH area, or should it be placed after the FLASH region?If it should overlap, what is the purpose of doing that? In this example, it overlaps.Thank You.
Hi, I am trying to move to STM32H750 from STM32F407. To start with I have tried making simple LED blink project and it seems to work.Then I add SDMMC1 and suddenly it started hanging on exiting `static void MX_GPIO_Init(void)`. Any ideas why? Do I need some kind of other initialization or what could be wrong? /* Identify card operating voltage */ errorstate = SD_PowerON(hsd); if (errorstate != HAL_SD_ERROR_NONE) { hsd->State = HAL_SD_STATE_READY; hsd->ErrorCode |= errorstate; return HAL_ERROR; }it seems to return error here0x10000000U#define SDMMC_ERROR_UNSUPPORTED_FEATURE ((uint32_t)0x10000000U) /*!< Error when feature is not insupported */what does that mean and how to fix it?
Hello, I am new to programming the NUCLEO-H563ZI. I am interested in the low-power STOP MODE function. I have watched an STM32 video tutorial for a different core. Everything works fine except for this function __HAL_RCC_PWR_CLK_ENABLE(); ../Core/Src/main.c:98:3: warning: implicit declaration of function ‘__HAL_RCC_PWR_CLK_ENABLE’ [-Wimplicit-function-declaration] 98 | __HAL_RCC_PWR_CLK_ENABLE(); | ^~~~~~~~~~~~~~~~~~~~~~~~ What is causing this error? Thank you for your help.
Hi everyone,I’m trying to get the LwIP examples from the stm32-hotspot GitHub (this one: https://github.com/stm32-hotspot/STM32H7-LwIP-Examples) running on my NUCLEO-H723ZG, but I’m hitting a wall.The README is actually great and super clear, which is why I’m surprised I can’t get it to work. I’ve built the project and flashed it to the board, and I have it connected directly to my laptop via Ethernet.The docs say the IP should be 192.168.1.10, but when I try to ping it, I get nothing. I also took a look at the code and it looked like the IP might be set to 192.168.1.1 instead, so I tried pinging that too, still no luck.Am I missing something basic here? Is it enough to just build and flash the code, or do I need to tweak some jumpers on the Nucleo or change my laptop's manual IP settings to be on the same subnet?I’d really appreciate it if someone who has used this repo could point me in the right direction.Thanks!mpek29
Good morning,I would like to implement Fatfs to communicate with a sd card in the core M4 and with a usb mass storage device in the core M7. In Cube Mx environment I'm able to initialize what I need, obtaining a fatfs M4 initialized to communicate with sd card and a fatfs M7 initialized to communicate with a usb mass storage device. Pratically this solution doesn't work (The devices are not recognized: the sd card is correctly mounted just one time and then it is not recognized while the usb is never recognized) but, when I keep everything together in the same core, fatfs M7 (usb mass storage+sd card) works perfectly. Could you tell me If it's possible to implement fatfs in the following way: fatfs M4 (sd card) and fatfs M7 (usb mass storage)? And considering that I need to create files inside sd card and write data to them in core m4 and sending these files from sd to usb in m7, are there some variables (like sd file path etc) that I need eventually to put in shared memory ?Let m
Dear all I am trying to follow the exmaple https://github.com/STMicroelectronics/STM32CubeH5/tree/e6985112c824fce355638ef4e7113b1bc671f999/Projects/NUCLEO-H503RB/Examples/SPI/SPI_FullDuplex_ComDMA_Slave project with STM32H563 on my own target board, I copied most of the code/DMA setup form the example and got it working, however, my requirement is more complicated than the example, the example only receives and reply 1 message after a button press, but my application needs it to be able to receive/reply messages periodically, i.e. master keep sending fixed length of message and expect slave to reply with same length of message at a fixed period. For now, after I copied example, it runs receives/replies 1 message, which I see the data on bus , but then it ends up with busy state and never recovers even wait for a long time, could anyone help please? Also, the about the DMA setting, does it needs to be in circular mode? I am sort of new to STM32 and DMA. Any suggestion is appre
Hello,I am trying to communicate with an SDI-12 sensor through my custom STM32L4 pcb. The communication that I am trying to achieve is from a 3.3V microcontroller. Thus, I used the SN74LVC1G240DBVT buffer to convert my UART to SDI-12 data one wire, and also I had a MOSFET which converts my 3.3V of the pin to 5V (I have checked that the hardware wiring and voltages working as expected). For my UART protocol, I have this configurations: static void MX_UART5_Init(void) { /* USER CODE BEGIN UART5_Init 0 */ /* USER CODE END UART5_Init 0 */ /* USER CODE BEGIN UART5_Init 1 */ /* USER CODE END UART5_Init 1 */ huart5.Instance = UART5; huart5.Init.BaudRate = 1200; huart5.Init.WordLength = UART_WORDLENGTH_8B; // Including parity huart5.Init.StopBits = UART_STOPBITS_1; huart5.Init.Parity = UART_PARITY_EVEN; huart5.Init.Mode = UART_MODE_TX_RX; huart5.Init.HwFlowCtl = UART_HWCONTROL_NONE; huart5.Init.OverSampling = UART_OVERSAMPLING_16; huart5.Init.OneBitSampling = UART_ONE_BIT
There have been a few posts on this forum with the same issue, but it seems the root cause is different to this post or (probably) this one.I am using an Stm32f446re Nucleo, and trying to output a waveform from dac2 using dma and tim6. What I have tried so far: Trigger is set to Timer 6 Trigger Out event. DMA is configured in Circular Mode. I'm calling HAL_DAC_Start_DMA(...) Tried changing the data width to half word and word, neither worked. Callback functions are correctly named and defined in main.c: void HAL_DAC_ConvCpltCallbackCh2(DAC_HandleTypeDef *hdac) { HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_8); } void HAL_DAC_ConvHalfCpltCallbackCh2(DAC_HandleTypeDef *hdac) { HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, 1); } I want to be able to set a flag variable to start processing the next buffer. I will paste the rest of my code, it includes a (buggy) sine wave table but I can fix that once the callbacks are handled properly. It is just something to sen
Environment:STM32F407VGTX USB HID mouse, Full SpeedProblem:Hi, I’m using a STM32F407VGTX board. I send a USB remote wakeup signal to the host and then try to receive a resume signal from the host. The STM32 board can wake up the host (bringing it to the login screen), but it cannot trigger the USB_OTG_GINTSTS_WKUINT interrupt. I have already configured my STM32 board as a HID mouse. However, if I use a real mouse instead, it can wake up the host and successfully trigger the USB_OTG_GINTSTS_WKUINT interrupt. Is there any suggestion or workaround for this problem? void usb_remote_wakeup() { if (hUsbDeviceFS.dev_remote_wakeup == 1) { __HAL_PCD_UNGATE_PHYCLOCK(&hpcd_USB_OTG_FS); HAL_PCD_ActivateRemoteWakeup(&hpcd_USB_OTG_FS); HAL_Delay(5); HAL_PCD_DeActivateRemoteWakeup(&hpcd_USB_OTG_FS); } }
Hi everyone, I’m working on an audio project with an STM32H743ZIT6 and a MEMS microphone (MP34DT05-A). Audio is captured via DFSDM + DMA, and the DMA callback (HAL_DFSDM_FilterRegConvCpltCallback) fires reliably with fresh PCM audio samples. At the moment, I am transferring the audio data to the USB Audio IN endpoint directly inside the DFSDM callback using: USBD_LL_Transmit(pdev, AUDIO_IN_EP, buffer, packet_size); To avoid overlapping transmissions, I set a busy flag until the DataIn callback (from the USB stack) fires. Only then do I allow the next USB packet to be sent. This works in the sense that nothing crashes, but the actual audio stream never “starts” on the PC (e.g., in Audacity the recording stays silent and no data seems to flow).So now I am unsure whether my current design is fundamentally flawed. What is the correct way to link DFSDM audio → USB IN endpoint? Is it recommended to send directly from the DFSDM callback (as I do now) or push the data int
Hi, I want to get synchronized samples from 4 microphones connected via I2S2 and I2S3. First I set one as master and other as slave and just connect Clock and Word Select, but I have only 0 values on slave interface. Is it possible to do it this way? Or there is another better one? I am using STM32H533
HiI'd like to do a memory-to-memory transfer, where I take a 8x12 px rectangle and copy it into a framebuffer. My display is 256x64px and it uses a grayscale 4 bpp format. My framebuffer size is 8192 bytes, and the rectangle that I need to copy is 48 bytes big. I'm confused whether I should use L4 or L8 because L8 seems more straightforward for my byte ordered graphics.I set my screen byte width to 128, and I used L8. My output image looks garbage, as if the alignment was off (bad stride maybe). What is suspicious is that the garbage image is 4 lines tall, which could mean that the stride is calculated with 2 bytes instead of 1. Based on the RM0468 I think in no PFC mode it only uses the foreground and if I use L8 as hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_L8; (which btw. couldn't be set with CubeMX) it could increment the address correctly. In addition, if I'm copying a 256x64px image to the frame buffer, it is working properly. void write_framebuffer(
Hi, I would like to develop an application using ADC + TIMER + DMA. My base code doesn’t work, and I don’t understand why. To debug, I introduce the variable "toto". This value of this variable doesn't change. I use STM32CubeIDEv1.19.Best regardsThomas- H
Originally a comment on the "Using CAN (bxCAN) in Normal mode with STM32 microcontrollers (Part 2)" Knowledge Base article.Moved to the forum for better visibility & discussion.Hi,I just using STM32CubeIDE for 2 or 3 days. I am doing a test with a Nucleo-L476RG and CAN bus. With you help, your sample, I make my board talking with other board of mine.Just a question, maybe a *** one, where can I gather informations about CAN_TxHeaderTypeDef, uint32_t RTR or uint32_t IDE... and so mutch other symbols? Is there a documentation about?Best Regards,Maurice.
Hi team, I am working with the STM32H7S78-DK board and implementing TLS 1.3 using WolfSSL on the client side. Project setup: Board: STM32H7S78-DK TLS library: WolfSSL (TLS 1.3 enabled) Network: TCP client socket Server: OpenSSL TLS 1.3 server Certificates: Public and private keys generated and configured issue: I am able to create the TCP client socket successfully, but when I attempt to establish a secure TLS connection with the OpenSSL server, the handshake fails. Handshake error: -308 1)What does the WolfSSL handshake error -308 indicate during a TLS 1.3 connection? 2)What are the possible causes of this error when communicating with an OpenSSL TLS 1.3 server? Any suggestions, references, or troubleshooting steps to resolve this issue would be very helpful. Thank you for your support. thanks & regards, Karthik.
I generated project with CubeIDE for Nucleo F411RE board with defaults.Now I want to create my own function void LED_blink(int blink_num);So, I created ledfunc.h and ledfunc.c files.This is my ledfunc.h file: #ifndef INC_LEDFUNC_H_ #define INC_LEDFUNC_H_ void LED_blink(int led_number_blink); #endif /* INC_LEDFUNC_H_ */and this if my ledfunc.c file: void LED_blink(int led_number_blink) { for (int i = 0; i < led_number_blink; i++) { HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_SET); HAL_Delay(100); HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_RESET); HAL_Delay(100); } }and I want to use LED_blink(2) function in main.c( which was generated by CubeIDE )When I try to build code, I'm getting errors LD2_GPIO_Port undefinedYes, those defined in main.hWhere (in which file ) I need to include #include "main.h" ?I need proper way where to add #includeEdited to apply source code formatting - please see How to insert source code for future reference.
Hi!I have the following code:uint32_t currentTicks; do { currentTicks = handle->controlData.ticks; // controlData.ticks is volatile // copy a lot of data from handle->controlData ... } while(currentTicks != handle->controlData.ticks);handle->controlData.ticks (and the other data fields) are regularly updated, triggered by an interrupt, which could happen during copying of this data. The idea is that if the while check is false, just copy all the data again, since during the previous copying of said data new data must have arrived and the copied data would therefore be inconsistent.We are running on an STM32H7 and the data is in DTCMRAMFor this to work, is a Memory barrier instruction required or could there be any other pitfalls?
My hardware design has finalized STM32H563 MCU (from ST Microelectronics) to interface 5-port managed Ethernet Switch (KSZ8795 from Microchip). I'm tried to use orix board library code but unable to make it run.I have following questions,1. Is KSZ8795 intended to work with Microcontrollers as opposed to microprocessor which used Linux/Windows as a de-facto OS.2. Is KSZ8795 compatible with STM32H563 MCU?3. Is KSZ8795 driver port available for FreeRTOS?
Hello, I am making a new project by importing the .ioc file of example code "Ux_Device_CDC_ACM" of STM32U5G-DK2. All the .c files of USB_stack and Azure_RTOS are also copied from the example project. Both, example project and My project, look same. My project builds also successfully. But no COM/ACM port is being formed after loading the project to STM32U5G-DK1 whereas, COMM port is being formed with Example project. What can be the reason ? Please help. NOTE: USB Device mode Example project in repository is provided for STM32U5G-DK2 and not for DK1. So. we are trying to make a USB Device code by referring to this DK2 example. With regard, Sudarshan Chaudhary
Hello,I am trying to get the audio data from ADF1. Therefore I use the GPDMA as shown in this example: https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/STM32U575I-EV/Examples/MDF/ADF_AudioRecorder. I am developing on a B-U585I-IOT02A.My problem is, that I seem to receive only 0x7FFF. I am not sure I do not receive valid or realistic values. Unlike in the example I want to put the received data in a TX_Queue later and handle them in another task.Please find my code attached below. I would be very grateful for hints and suggestions.Thank You!K.S. MDF_HandleTypeDef AdfHandle0; MDF_FilterConfigTypeDef AdfFilterConfig0; DMA_HandleTypeDef handle_GPDMA1_Channel10; MDF_DmaConfigTypeDef DMAConfig; int16_t RecBuff[REC_BUFF_SIZE * 2U]; volatile uint32_t DmaRecHalfBuffCplt = 0; volatile uint32_t DmaRecBuffCplt = 0; extern DMA_QListTypeDef ADFQueue; void SystemClock_Config(void); static void SystemPower_Config(void); static void MX_GPIO_Init(void); static void MX_G
Hi,STM32G484 is running well with FreeRTOS.The only thing left is to transfer the USB communication into the RTOS-task.Is it possible to redirect the function pointer, which is used now, to another function?Greetings,ErX
Hello,I am using an STM32H743 microcontroller. UART8 is configured at a baud rate of 460800 with DMA enabled. The UART output is logged by a USB logger which creates a FAT32 text file.The transmitted data contains mixed data types such as integers, characters, strings, floats, and doubles. To combine the data, I format it into a string using snprintf.I am facing a strange issue:When I format the string using a comma after the first integer, and the second integer variable is zero, the value recorded in the USB log becomes 8 instead of 0.When I replace the comma with a semicolon, the value is recorded correctly as 0.Additional observations:This issue only occurs when the data is generated by the STM32.If the same formatted data is sent from a computer or another hardware source, the issue does not occur.If I log the STM32 UART output directly on a computer terminal, the data is correct.The problem only appears when using the USB logger with STM32 UART DMA output.Could you please advise
I have a bunch of following warnings:c:/programs/ARMtools/EmbeddedBSPs/arm-eabi/com.sysprogs.arm.stm32/STM32F1xxxx/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_gpio.h: In function 'void LL_GPIO_SetPinMode(GPIO_TypeDef*, uint32_t, uint32_t)': c:/programs/ARMtools/EmbeddedBSPs/arm-eabi/com.sysprogs.arm.stm32/STM32F1xxxx/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_gpio.h:343:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 343 | register uint32_t *pReg = (uint32_t *)((uint32_t)((uint32_t)(&GPIOx->CRL) + (Pin >> 24))); |in several LL headers.Can this please be fixed in some suitable way? One way to do that might be to replace the 'register' specifier by a macro, which would be defined based on the __cplusplus standard preprocessor macro and its value. A simple version would be to add#if __cplusplus >= 201703L #define register #endifto each header where this occurs, but I am not a C++/build-environment specialist so don't know whether thi
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.