Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hello everyone,I create a project for the board STEVAL MKBOXPRO STM32U585. When i run it, there is an error in the initialisation of SDMMC1 with the initial generation of the function : static void MX_SDMMC1_SD_Init(void){hsd1.Instance = SDMMC1;hsd1.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING;hsd1.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE;hsd1.Init.BusWide = SDMMC_BUS_WIDE_4B;hsd1.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE;hsd1.Init.ClockDiv = 8;if (HAL_SD_Init(&hsd1) != HAL_OK){Error_Handler();}} So it goes in the Error_Handler() function. I tried to debug it and i found that the error is in the function called "SDMMC_GetCmdResp1" which return SDMMC_ERROR_CMD_RSP_TIMEOUT.I tried to find a solution on ST forum but i don't think the problem has been really solved. I see things like it can be the delay, so i tried to put some but nothing changed.Here a part of the function SDMMC_GetCmdResp1 :uint32_t SDMMC_GetCmdResp1(SDMMC_TypeDef *SDMMCx,
Good day,I recently made a post about getting my SPI to a certain speed. Ive managed to get the core down but found out that HAL is way too slow for what I need. I thus switched to low-level drivers. Now using LL instead of hal, Im trying to do a simple transmit receive to my 24 bit SPI. While HAL used to work, I'm doing something wrong. me and my collegue can't put our fniger on it. Anyone here think they might be able to help figure it out? Code is added below. many thanks in advance!Board is the STM32 H755ZIQ. Also before this comes up, yes I will likely have to do this through DMA eventually. This will have to do for now though.static void MX_SPI1_Init(void) { /* USER CODE BEGIN SPI1_Init 0 */ /* USER CODE END SPI1_Init 0 */ LL_SPI_InitTypeDef SPI_InitStruct = {0}; LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; /** Initializes the peripherals clock */ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SPI1; Pe
I've been trying to get a new project up and running on a custom H743 board, using AzureRTOS for the first time. This board has both USB ports, with FS set up as a device and HS set up as a host, with an external PHY. I have had this same hardware successfully running different firmware with ST's older drivers, and both ports work.It seems like the code doesn't handle having both device and host ports active, even though CubeMX allows you to set it up that way. I run into some issues with both host and device drivers calling _ux_system_initialize, and that seems to trash some of the host's data structures when called by the device's driver code.Either I'm missing something, or the code simply doesn't work for this configuration. I hope it's the former. Are there any code examples of running host and device on the same system?
We are having a bear of a time getting the USB2514 to work properly with the STM327H73 both with the USB2514 built into our board and also with the STM327H73 connected to a EVB-USB2514BCQFM36 eval board. Looking for suggestions for resolving this issue, suggestions sample github code anything really.We have a custom board with a STM327H73 USB port is connected to the USB eval board. System is running Azure RTOS 6.1 and USBX.USBX is initialized USBX stack as a HUB, CDC ACM host classes registered (HID and Storage host classes also but not used for this test)Here's the symptom.Boot the system with a CDC ACM serial port connected, CDC ACM port is recognized and works as expectedif step one did not have a CDC ACM serial port connected connect it after booting. CDC ACM port works as expecteddisconnect the CDC ACM port, port disconnects as expected.From this point on the USB2514 hub will not recognize anything being plugged into any of the 4 portsFor grins the
Originally a comment on the How to redirect the printf function to a UART for debug messages Knowledge Base article.Moved to main forum for better visibility & discussion Hello @ST AME Support NF ,I have tried example code...\Repository\STM32Cube_FW_F7_V1.17.2\Projects\STM32F746ZG-Nucleo\Examples\UART\UART_PrintfIn ST CubeIDE and MDK-ARM it's working fine but in IAR(EWARM) IDE it's not working.I tried to implement _write function but it's not triggered whenever i call printf.Please guide me to implement this in IAR IDE.
Hello,This is assuming STM32G0 with SPI configured as slave. I'm looking for a way to detect if a ongoing SPI transfer is happening. Not at the byte level but at the bit level.So I can detect if some incomplete byte is pending in the RX buffer (due to a faulty clock signal).Is there a simple way / bit for that in the SPI registers? Maybe I don't use the correct phrasing but I could not find anything about it. BSY is for a multi-byte transfer afaik. Also, can someone confirm that when the CS is toggled, it does trash the incomplete byte received and start clean for next byte to be received. That would make sense. Much appreciated, thank you,
Hello ST Community, I am trying to set up SPI communication between two STM32 microcontrollers (two NUCLEO-F401RE boards); one as an SPI master and the other as an SPI slave. For now, I am only trying to transmit only one byte (0x61). For this I am using STM32’s HAL Library, and its functions HAL_SPI_Transmit_IT() and HAL_SPI_Receive_IT.On the slave, the HAL_SPI_RxCpltCallback() and the code inside it (setting a flag) are being executed, meaning that the slave is attempting to receive data sent by the master. However, the data in the SPI receive buffer is always 0x00 (serial terminal shown below; displaying "0" for every SPI receive interrupt occurrence). Termite serial terminal outputting "0" upon every occurance of SPI receive interrupt I need to have the master and the slave operating in Full-Duplex Master and Full-Duplex Slave modes respectively (both with interrupts), however, when setting them in Transmit Only Master and Receive Only Slave, and disabling interrupts
Hello ST community, I am using STM32U585AIIQ6 micro controller I wanted a .c files to be as a static library i am using tx_thread_sleep one function of my .c files if those files are are included as a source file in my project the tx_thread_sleep is working out well but when I am using static library i am facing issue like no other thread is acquiring the CPU and moving into IDLE thread. I tried to change the priority but then also it doesn't worked out.Kindly please help me out as quick as possible I have delivery date in 2 days. Thank you Venkat sai
Hi all, I was able to make the qdec on timer1 run and read pulses from an external encoder. Now I wanna generate an interrupt after let's say 100 pulses. That interrupt should toggle a led I mean the timer has interrupts, but i don't know how to use them in Zephyr. That is my timerconfig in the devicetree: tim: &timers1 { compatible = "st,stm32-timers"; reg = <0x40012c00 0x400>; clocks = <&rcc STM32_CLOCK(APB2, 11U)>; resets = <&rctl STM32_RESET(APB2, 11U)>; interrupts = <44 0>; interrupt-names = "cc"; st,prescaler = <0>; status = "okay"; qdec: qdec { compatible = "st,stm32-qdec"; status = "okay"; pinctrl-0 = <&tim1_ch1_pe9 &tim1_ch2_pe11>; pinctrl-names = "default"; st,input-polarity-inverted; st,input-filter-level = <15>; // FDIV32_N8-->15: Fs = F_clk/32, N=8 st,counts-per-revolution = <700>; st,encoder-mode = <1>; //??????? }; }; Code to read the pulses: const struct de
I do not know if this is appropriate place to ask but I will try. We are integrating the STM STL library and we cannot get the flash test to be successful.This, this, this nor this helped. I believe we are generating the checksums correctly, we tried either post-build step as recommended in the user manual or running the script separately in the CMD. We can see that the CRCs are written in the memory the same way they are written in the .elf. StlFlashStatus is being set to STL_FAILED every time.Our MCU is STM32H723ZG with 1 MB of flash. Therefore in the configuration, ROM start address is set to 0x08000000UL and ROM end address is set to 0x080FFFFFUL. We are trying flow similar to the default examples, either single test or multiple tests. ROM start address is set to 0x08000000U, even when trying to check 1 flash section, StlFlashStatus is set to STL_FAILED.Unfortunately we do not have Nucleo H743ZI to test the example project
Hello, I know that STM doesn't manage AZ-RTOS, so this is more of an informational post to help others. In one of my projects, I'm using an STM32H7R3L8H7H MPU, on which I found this behavior very cumbersome. Some settings for my board are stored in a JSON file, which is read at the beginning of the main NetXDuo task. // reading DCU settings from disk _ReadStatus = Read_DCU_Settings_From_Disk(); if (_ReadStatus == ACCESSING_FILE_OK) { _IP_ChangeStatus = Change_IP_And_Port(); if (_IP_ChangeStatus != NX_SUCCESS) { // doing something here later... } } The function Read_DCU_Settings_From_Disk() reads and parses the JSON file, and the function Change_IP_And_Port() modifies the actual settings. The Change_IP_And_Port() looks like this: UINT Change_IP_And_Port(void) { UINT status; // Set the new IP address status = nx_ip_interface_address_set(&IpInstance, 0, dcu_def.network_settings.ip_addr, dcu_def.network_settings.nw_mask); if (status != NX_SUCCESS) { return
Hi,I am considering using the STM32N6 series for my next development.Are there plans to make "X-CUBE-STL" supports STM32N6 series in the near future?
i have the nucleo-h753 evolution board , and i want to activate the ethernet port to perform udp client .i want the implementation without FREERTOS i followed the steps described in the link below :https://community.st.com/s/article/How-to-create-project-for-STM32H7-with-Ethernet-and-LwIP-stack-workingand i added the code in main.c so i can do a ping to the boardi see if i put a breakpoint beside ethernetif_input(&gnetif); sys_check_timeouts();that the debger hits the breakpoint so the hardware is configured correctlybut still i dont see that the board is replying to my ping requestis there an example or did some one managed to to get the ethernet to work on the board i will be glad for help
I am trying to write my own I2C driver but I have been having an issue that after sending the start condition both SCL and SDA lines go low and stay that way. After some painful debugging I realize that the I2C event interrupt handler is not being called, which I rely upon to write to the data register.I tried to set pending the interrupt manually and the handler was invoked and a byte got send through, so I know that for some reason the hardware is just not pending it. I don't know why that is. Can anyone help?
Hello,I am trying to use this code to save a 332 byte (83 double word) long data to the STM32L496 flash memory. For some unknown reason, every second time I call the function, I encounter a PGAERR. The third time it works fine, but the fourth time it fails again, and so on.#define FP_ADDRESS 0x080FF000 #define FP_PAGE 510 void Diag_SavePVD() { __disable_irq(); /* 0. Erase error flags */ if (FLASH->SR & (FLASH_SR_PGSERR | FLASH_SR_PROGERR | FLASH_SR_WRPERR)) FLASH->SR |=(FLASH_SR_PGSERR | FLASH_SR_PROGERR | FLASH_SR_WRPERR); /* 1. Flash Unlock */ FLASH->KEYR = 0x45670123; FLASH->KEYR = 0xCDEF89AB; /* 2. Flash page erase */ while (FLASH->SR & FLASH_SR_BSY); FLASH->CR &= ~FLASH_CR_PG; FLASH->CR |= FLASH_CR_PER | ((FP_ADDRESS >= 0x08100000) ? FLASH_CR_BKER : 0); FLASH->CR &= ~FLASH_CR_PNB_Msk; FLASH->CR |= (FP_PAGE << FLASH_CR_PNB_Pos); FLASH->CR |= FLASH_CR_STRT; while (FLASH->SR & FLASH_SR_BSY); FLASH-&
Hello Forum Members, I need a project for a HTTP Client functionality for STM32F767ZI Nucleo board using NetX Duo or a reference. Please guide me on the same. I could make the default example for TCP client from ST Microelectronics. But not sure how can I implement the HTTP client on top of that. Please guide me on the same or provide me if you have one. This project is very important and little urgent for me. I will be using this to get the snapshots from a surveillance camera or a PC web camera. Thanks
These's a very strange bug in current verion of STM32G4 HAL library(STM32Cube_FW_G4_V1.6.1) and it took me 2 days to find a workaround.The problem is:When normal power on, everything is fine.When compiler optimization set to -o1, everything is fine.But if I set complier optimization to -o3, and perform a software reset(__NVIC_SystemReset()), after reset, the HAL function "HAL_SPI_TransmitReceive_DMA" will fail on "HAL_DMA_Start_IT" line.Since my optimization is set to -o3, I can't dig deeper to find out what exactly happens. And my workaround is individually set stm32g4xx_hal_dma.c file to compile under -o1.After doing so the problem disappears.My IDE is uVision V5.41, and ARM Compiler version is V6.22.
I want to transfer a buffer and receive a buffer of data using a full duplex SPI port with DMA on a STM32H7S3L8H (on the NUCLEO-H7S3L8). My problem is I am not able to modify the transfer buffer and have the modified version sent. I only need to modify the 1st two bytes. Here's the code:void ade9430_read_it(SPI_HandleTypeDef *hspi, uint16_t reg_addr, uint8_t *reg_data) { //int ret = HAL_OK; //gTxData[0] = reg_addr >> 4; //gTxData[1] = ADE9430_SPI_READ | reg_addr << 4; uint16_t Size; //in bytes if (reg_addr >= 0x800) { static uint8_t gTxDmaData[60] = {0}; //{0x80, 0x18}; Size = 30; //debug test gTxDmaData[0] = reg_addr >> 4; gTxDmaData[1] = ADE9430_SPI_READ | reg_addr << 4; HAL_SPI_TransmitReceive_DMA(hspi, (uint8_t *)gTxDmaData, reg_data, Size); //debug DMA test }Here is the resulting SPI activity:Based on the reg_addr being passed the first two values should of been 0x80, 0x18.Setting a breakpoint on line 14 and looking at the gTxDma
I am trying to implement an IWDG in my program, which will save the value of the specified register to EEPROM before resetting. The STM32 I'm using is STM32H563. But I found that my program is not working (cannot save data to EEPROM before resetting).I politely request your help or to provide a simple example of IWDG using HAL_SWDG_Registercallbacks.Many thanks. :) void IWDG_EarlyWakeupCallback(IWDG_HandleTypeDef *hiwdg) { uint8_t arr[1] = {0xAA}; // if (imageAbortedFlag) { if (getCurrentRunningImage() == 0x01) { pRAMbootctrl->image_A_tasks_aborted_count++; } else if (getCurrentRunningImage() == 0x10) { pRAMbootctrl->image_B_tasks_aborted_count++; } MemoryStoreData(EEPROM_MSATABLE_UP03_INDEX, UPE6_128, 1, arr); jump_to_IMAGE(BOOTLOADER_START_ADDRESS); } } void MX_IWDG_Init(void) { hiwdg.Instance = IWDG; hiwdg.Init.Prescaler = IWDG_PRESCALER_8; hiwdg.Init.Window = IWDG_WINDOW_DISABLE; hiwdg.Init.Reload = 0x0FFF; // ?TBD hiwdg.Init.EWI = 0; // ?? 0x0FFE if (HA
I have a NUCLEO-C092RC board. When I connect to a terminal and start the board I get: Demo mode launchtest sw version SW V-0.2.0- Loopback L1(L) -> L3 ==> FAILEDI have looked around and haven't found what the 'failure' is. I would also like to see the code for the demo (haven't found that either). I would assume that I just don't where to look. Regards & thanks...
Hi,Context : STM32F777, FreeRTOS, Cmsis V2, LWIP, Sockets, TCP, UDPOnly one task is used to open, listen, poll, accept, send, receive, and close sockets. Since STM32CubeIDE 1.7.0 and the new version of ethernetif.c, modifying "low_level_output", we have a problem when sending packets of about 400 bytes or more.In that case, the client will not receive all data. The old version called HAL_ETH_Transmit_IT, and then waited for the semaphore from HAL_ETH_TxCpltCallback(). The new version calls HAL_ETH_Transmit_IT, and returns immediatly.The next call will fail, waits for the semaphore, then releases the previous packet, then retries...It works well for small packets, but fails with bigger ones for unknown reasons... A modification that work for us, is to move the call to HAL_ETH_ReleaseTxPacket in HAL_ETH_TxCpltCallback.With this modification, we never fall in HAL_ETH_ERROR_BUSY... What do you think? Regards,Fred.
Hi, I had to recently work on an application that makes use of the UART, and encountered some issues in the HAL (most recent version provided by CubeMX):1) Hal bug?Drivers/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_uart.c, Line 3825:3831if (!(IS_LPUART_INSTANCE(huart->Instance))) { /* Check that USART RTOEN bit is set */ if (READ_BIT(huart->Instance->CR2, USART_CR2_RTOEN) != 0U) { /* Enable the UART Receiver Timeout Interrupt */ ATOMIC_CLEAR_BIT(huart->Instance->CR1, USART_CR1_RTOIE); } } According to the reference manual, USART_CR1_RTOIE must be set in CR1 in order to enable the interrupt, here it's cleared. 2) If one performs a HAL_UART_Transmit() and in case an error interrupt is fired on the peripheral tries to call HAL_UART_Abort(), a buffer overflow can occur and undesired data is pushed the UART-TX.In the abort function "huart->TxXferCount" is set to 0, whereas in the transmit loop the HAL directly decrements that sha
Hi,I'm having an issue implementing USB device composite functionality on my Nucleo-H753ZI board. I've been following the tutorial series at https://community.st.com/t5/stm32-mcus/how-to-implement-the-usb-device-composite-class-in-stm32-using/ta-p/645017 to set up a composite device using USB_OTG_FS in device-only mode.I've also examined and tried implementing the example code from the official ST repository at https://github.com/STMicroelectronics/x-cube-azrtos-h7/ but I still couldn't solve the issue. USB_OTG_FS: Clock Configuration:Usbx:
I was recently working on STM32H563ZI nucleo board like connecting peripherals like LTE module, I2C sensors like MPU6050, LCD display, SPI modules like W25Q flash storage, USB and some analog module like potentiometer. As per normal coding of individual peripherals resources were available but for smooth integration of all the peripherals i was planning to use DMA for reducing the load for smooth operation. But i didn't get any clear documentation or resources of using GPDMA (present in STM32H563ZI) for I2C, SPI and UART. As i was planning to use FreeRTOS instead of Azure RTOS (ThreadX) because how to implement it as in this microcontroller there is USBX which works on ThreadX. I followed the resources on Youtube from official STMicroelecronics channel, followed the same but the code was not working as expected.I was going through reference manual the peripheral was USB, that means it can be used without RTOSI need help in resources for GPDMA for I2C
Hello,I'm working on a custom board with a STM32L451 and an emmc (THGBMNG5D1LBAIL - 4gb). At initialization (using the HAL generated init functions), I get the CID and CSD but not the ExtCSD. I get a CRC error (in polled mode as well as in DMA mode). Since it is at the initialization, I cannot change a lot of settings...(main clock is at 80Mhz but at lower clock value I get the same issue) I've seen that I need to set "half-word" in the DMA settings in order to have a same alignment as in polled mode...But obviously doesn't help since I get the same error in both cases... (with or without misalignment)Do you have any idea on what direction I could look at? Thanks a lot! clock config:SDMMC settings:
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.