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
I am currently using the STM32U585 MCU on a custom board and am trying to get the MCU to function as a DRP device in the USB-C PD protocol. Although currently I am just trying to get the device to work as a SNK (with DRP capability enabled). The project I am implementing this in is using ThreadX as the RTOS.I have followed multiple tutorials for getting USB-C power delivery implemented on ST MCUs and have implemented the needed changes in the CubeMX .ioc file and have also made the necessary changes in the code listed in AN5418.I have also referenced plenty of example projects including: DemoUCPD, USB-PD_Consumer_1port, USBPD_DRP_UX_DRD_HID, USBPD_SNK, and USBPD_SNK_UX_Device_HID_CDC_ACM.One thing that is worth noting is our custom PCBs do not have the TCPP IC on our board, contrary to a lot of the examples. Also, a lot of examples also seem to use FreeRTOS, but the rest of our project has been using ThreadX, so didn't want to make the switch.Here is what I have found so far, usin
Hello everyone,I'm working on a project that involves UART communication between an STM32f429 and an nRF5340DK, with the nRF5340 acting as the UART transmitter and the STM32 as the receiver. However, I've been facing issues where the data received on the STM32 side appears to be out of sync, even though I’ve ensured that the baud rate and configuration match between both devices. Here are the details and what I've checked so far:Hardware SetupMicrocontrollers: nRF5340DK (Nordic Semiconductor) and STM32 (STMicroelectronics).Connections: Direct UART lines (TX from nRF5340 to RX on STM32, and RX from nRF5340 to TX on STM32 for debugging, if needed).UART Configuration:Baud Rate: 115200Data Bits: 8Stop Bits: 1Parity: NoneFlow Control: Disabled (enabled it to see if it makes any diffrence but no diffrence observed)The STM32 receives data from the nRF5340DK, but the received data is frequently out of sync. Sometimes, it appears that characters are missing, or the data shifts unpredictably, le
Posted on February 28, 2018 at 12:19Hi,I've been playing around with FatFs for about 1 mounth now. I succefully used SDMMC and SPI protocol to save and read data from an SD card.I order to improve the system (it's a improvement for the project) We decided to add an UDB Mass Storage Key. (approx 8Giga)I found this : https://community.st.com/message/92492 And it describe exaclty my error.I'm able to mount the USB stick but I couldn't f_open() it. most of my code is a copy paste of the example provided by ST.I copy what i made at the end of the message. if some of you have or had the same issue could you provide me some help. or in other case explain me more precisely what Fehrs.Kai describes in the post i link at the begining.thanks in advanceedit : forget to say that i m working with an STM32H743zi on a nucleo board------if(FATFS_LinkDriver(&USBH_Driver, '') ==0) { MX_USB_HOST_Init(); while(1) { /* USB Host Background task */ MX_USB_HOST_Pr
Dear all, I just came across something strange. I debugged into the function HAL_InitTick() to better understand how the OS tick (SysTick) is managed if FreeRTOS is used. I'm using TIM16 for the SysTick of the OS. At the beginning of HAL_InitTick() the function HAL_RCC_GetPCLK2Freq() is called. The return value is used to set the systick timer (in my case TIM16 on a STM32L432 device). My clock configuration for my device is set for PCLK2 = 80MHz. However, the function HAL_RCC_GetPCLK2Freq() returns 40.000.000. So half of the actual frequency. In the following the prescaler is set to 3 and the period to 999. So for my understanding the timer period until it will reset to 0 and raise an interrupt will be ((40.000.000/3)*1000) *(1/40.000.000). So this gives me a totally wrong value that certainly is not the case (I'm actually sure for other reasons that my device runs at 80MHz instead of 40MHz). Here is how it looks like just before entering HAL_TIM_Base_Init().An
I have an optimized SPI Slave DMA setup which is driven by the chip select interrupt. It looks something like: int main(void) { // Initialize SPI SLAVE, SPI_DATASIZE_8BIT, SPI_DIRECTION_2LINES HAL_SPI_TransmitReceive_DMA(hspi, (uint8_t *)&spi->txBuffer[spi->sendFrameIdx], (uint8_t *)&spi->rxBuffer, SPI_FRAME_SIZE); while (1) { // possibly generate data if (new_data) { spinlock(spi->txLock); // Append data to the fill buffer unlock(); } } } Then the interrupt code looks something like: static void handleTransferStart(SPI_HandleTypeDef *hspi) { if (spinTryLock(&spi->txLock)) { if (sendBufferIsEmpty && fillBufferHasData) { // Swap send and fill buffers. There is data to send but it's not in the current buffer const uint8_t *txBuffer = (uint8_t *)&spi->txBuffer[spi->sendFrameIdx]; const DMA_HandleTypeDef *hdma = hspi->hdmatx; __HAL_DMA_DISABLE(hdma); // Write the first three bytes directly to the SPI TX
We are migrating a project from H750 to H733 and I have run into an issue with our custom bootloader.We have our own External Loader, Bootloader and Application. Works fine on 750, but I have had to remake the projects for a move to the H733 micro.We are using external flash to fit our large application, in Octo SPI XIP, similar to the old device.The bootloader seems to work correctly, loading the app into the XIP or using what is there it jumps to the app code. This is done by: SCB->VTOR = APPLICATION_ADDRESS; __set_MSP(*(__IO uint32_t *)APPLICATION_ADDRESS); All seems to work as expected, what is not working is the APPLICATION_ADDRESS which is OCTOSPI2_BASE for us.The application is built to use that address as the start of it's flash.I can see in the debugger that code has been placed there.But the first address if used as the stack pointer results in a memory access error,it is way out of range with the memory space defined.My linker script for the
Hi, I am trying to make the MCU the host where a USB can be connected, and the MCU can read/write to the USB. I configured my IOC /CubeMX to use the USB with FATFS. The USB USE OS (RTOS) is automatically enabled.However, the issue is that once the USB is plugged in, it reaches HOST_USER_CONNECTION then goes straight to HOST_USER_UNRECOVERED_ERROR and keeps looping on this. I've attached the file for file handling where my case statements are. I've tried configuring all the buffers from CubeMX whether it be USB data buffers, max size configuration, USBH process stack size, sector size, etc. I've also attached the callback I'm using to handle the USB.
I have spent over a week trying to get USB to work with my board, and have had no luck. As soon as the device detects the USB, the usb goes straight into a HOST_USER_UNRECOVERED_ERROR. I have received almost no assistance from STM32 regarding this, even though I have made posts about it. Its like they give you 1 response then never reply. I am at a point where I'm not even expecting the help, but I just need to know if what I'm attempting to do is even possible, because I found out for some reason CMSIS_OS2 does not even work with the USB library.
My goal is to display text on the TFT LCD using stm32F756. The display I have is just the screen, no controller or gram. So I have configured the LTDC and was able to display a sample image which I stored in the flash. Now, the internal SRAM is not sufficient for the framebuffer, and I would like to implement CLUT to reduce the SRAM consumption. I have gone through the reference manual of the mcu. I can configure the pixel format of the LTDC layer from cubemx. But I don't see any way to configure the CLUT register. I can do that and the clut enabling manually I guess. My query are the followings -1. The CLUT register contains address and rgb values. What is this address? Is it the address of the CLUT or the index value of the CLUT for that pixel? and in the RGB fields, do I have to manually write the RGB values for that pixel from the CLUT?2. If I have only one color for all the fonts, do I still need to have a CLUT or can I just put the RGB values in the CLUT register? Is it possible
Hello,I'm beginner in STM32 and would need help with HAL callback function usage.When I've started to use STM32s after PICs, one of the reasons why I was happy that the timer module encoder receiver function works really well, robust. I did used other interrupts, but somehow I have not used other timer interrupts ... until now. And now I'm stuck.I try to use an STM32G474 with an I2C oled on, encoder on timer 4, some spi peripherials and want to measure frequency on timer 5. My problem is, with HAL, how can I separate the two actions? Both encoder and time measurement calls the HAL_TIM_IC_CaptureCallback. Both works fine ... as long as there is no interrupt coming in from the other. At the moment the function looks like what I copy below. Can you please help how to separate the 2 actions, how to refer in in(**) to one or the other or any other, but with using HAL.Thanks!!JG void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim){// If the Interrupt is triggered by 1st Channe
I want to initialize the STM32H573 ETH module using the STM32CubeMX code generator (see ioc file attached). It should run in MII mode using an external transceiver.I kept the configuration unchanged, however it always jumps to ErrorHandler, because HAL_ETH_Init returns HAL_ERROR on timeout of ETH_DMAMR_SWR at the following routine: SET_BIT(heth->Instance->DMAMR, ETH_DMAMR_SWR); /* Get tick */ tickstart = HAL_GetTick(); /* Wait for software reset */ while (READ_BIT(heth->Instance->DMAMR, ETH_DMAMR_SWR) > 0U) { if (((HAL_GetTick() - tickstart) > ETH_SWRESET_TIMEOUT)) { /* Set Error Code */ heth->ErrorCode = HAL_ETH_ERROR_TIMEOUT; /* Set State as Error */ heth->gState = HAL_ETH_STATE_ERROR; /* Return Error */ return HAL_ERROR; } }From what I've read on this forum, the ETH somehow needs an external clock input from the transceiver. However, ETH_REF_CLK is only defined in RMII mode, but I want MII mode with RX and TX clocks. Does it st
Hi, I use STM32CubeMX 6.10.0 and I have a STM32H7 CPU.The LPTIM is a frequency counter that can give an ISR when thecounter reached a specified value; after reaching this value it startsagain from zero (ARR mode), or it continues towards the max valueon 16 bits and then starts again from zero (CMP mode)My question is: can I configure from CubeMX this LPTIM in CMP mode?To me it seems there is no settings for this, whatever I do it's still in ARR mode ..the solution would be to make manual code changes ?
I am a beginner in using stm32f439zit6 eval board. I can ping the board by setting a static IP through host (my laptop). I don't have any idea about how to write a code to transmit data from host to board. Can anyone guide me to do this?
HelloA few days ago, I went through the SDMMC registers using stm32l4r9-discovery.I am using the "June 2021 RM0432 Rev 9" and haven't found a more recent datasheet for it.Using stm32cubeide (1.17.0) (window->show view->)SFRs panel, the bits shown in SDMMC1 STA don't match with the datasheet ones in 54.10.11 SDMMC_STAR section as follow. The IDMA labels are missing too in SFRs.In 54.10.17 (p. 2030/3000), the IDMABNDT attribute is defined for the [12:5] bits (8-bit long value).On the bit table, the 16th bit is shown as "rw" which is false as the [31:13] are specified as "reserved, must be kept at reset value". (In some stm32 boards, the sdmmc IDMABNDT is defined on [5:16] bits so it just might be a copy-paste error).My main concerns about this register are the differences between the datasheet and HAL function.The datasheet specifies a constant bit offset 5 for IDMABNDT, but in the HAL function, the IDMABSIZE is set depending on the BLOCKSIZE (constant 512 bytes) which is unclear/c
Hello everyone,I'm working on a project for which I designed a custom board. It consists of the following components.STM32H7R3L8H6H MCUArm® Cortex®-M7 32-bit 600 MHz MCU, 64 KB flash, 620 KB RAM, Ethernet, 2x USB, 2x FD-CAN, advanced graphics, 2x12-bit ADCsMX25UW25645GXDI00-T1.8V 256M-BIT [x 1/x 8] Read-While-Write Octal SPI MemoryAPS256XXN-OBR-BG1.8V 256M-BIT Double-Data-Rate Octal SPI PSRAM with x8/x16 interfaceEMMC08G-MV28-01J108G-BYTE eMMC chipLAN8742A-CZ-TRMII/RMII 10/100 Ethernet Transceiver with HP Auto-MDIX and flexPWR® TechnologyL6364Qdual channel transceiver IC for SIO and IO-Link sensor applicationsRC-SPIRIT2-xxxRC-SPIRIT2-915 module based on STMicroelectronics S2-LP transceiver Here are some pictures of the board: I chose this MBU because it's a potent and flexible device with many possibilities. The downside is that it is relatively new and not commonly used. During my work on this project, I encountered many challenges and obstacles. The investment of count
Hello Forum,I would appreciate some advice regarding bootloaders. Apologies in advance as this is mostly new to me. I have been researching the pre-programmed ST System Bootloader and OpenBootLoader (OBL) to try and figure out whether they are appropriate for firmware update in our product. Our product will most likely contain multiple STM32U5 MCUs connected together on a CAN bus. Firmware update will be performed from a Windows PC either connected to the same CAN bus or via USB to the 'main' MCU. The main 'MCU' is likely to have a 64MB filesystem available to it.Assuming we decide to use the ST SystemBootloader then these questions come to mind:I guess the general approach is - get the MCU running the SystemBootLoader, Update the firmware, Re-boot to new firmware.What's the usual way to get the system to boot to the SystemBootLoader? I have read that this is possible using 'boot option bytes' but what set's them? In AN2606 it talks about how to activate the Bootloader on Pag
Whenever i am trying to post data i am facing this error this is making my system reboot everytime. I am using STM32F417VETX controller. Assertion "detected mem overflow in pool TCPIP_MSG_INPKT" failed at line 109 in ../Middlewares/Third_Party/LwIP/src/core/mem.cAssertion "detected mem underflow in pool TCPIP_MSG_INPKT" failed at line 120 in ../Middlewares/Third_Party/LwIP/src/core/mem.c
Hi. I am working with DFU by DfuSe Demo(v3.0.6) and auto-generated code from CubeMX for STM32F072. My goal - control DFU state for choosing the best moment to reboot device. From app notes and DFU specification I found out, that state change (dfuDNLOAD-IDLE -> dfuMANIFEST-SYNC) happens after last command DNLOAD with zero wlength. But in Keil debug and UART output( that was implemented by me) I see, that DfuSe Demo doesn't send this command and the command order looks like : ........ - process of firmware uploadingDFU_GETSTATUS DFU_DNLOAD - this is last package with firmwareDFU_GETSTATUS DFU_GETSTATUS DFU_GETSTATUS DFU_GETSTATUS DFU_ABORT DFU_GETSTATUS With "Verify" I had the same situation - DFU_ABORT command resets the state to dfuIDLE.Maybe anyone had same problems or can give a piece of advice?Update: But, in general the update and verify processes always are successful.
I have an STM32H735G-DK and a sample CAN application that is working fine. I am now trying to use the CANFD ROM bootloader in system memory but cannot get any response from it. All the jumpers and solder bridges on the DK are at their default configuration.I have a Waveshare dual CANFD hat for a raspberry pi connected to the FDCAN1 pins (CN18). My test application works great with this setup, I can send and receive both CAN and CANFD messages all day long without issue. I am absolutely confident that there is no hardware issue at play here because the same hardware with my CAN application running in Flash works. Tested with bitrates from 125k to 1M, and CANFD data switching to 4M.I have set the boot switch (SW1) from the normal "0 - Flash" to "1 - SYS MEM", and looking at both AN2606 as well as AN5405, it looks like I should be able to set the CAN bitrate to 500kbps and issue a standard CAN message with ID=0x0 to get a response (Section 3.1 in AN5405).I do note that Section 2 sta
I have a question about X-CUBE-STL library on STM32H723ZG. We want to use it with a bootloader that resides in the first 128K flash sector. We want to reserve some data in the flash (firmware version and a signarure). Is there somewhere an example linker file which would do that? The problem is, that when using STM32CubeProgrammer to generate the CRCs for flash test, it always overwrites the last section completely with the CRCs. If I put my needed section to the flash before the CRCs, program ends in Hard Fault as it is somehow loaded incorrectly. I tried generating the CRCs for smaller flash memory (end address not 0x8010000 but 0x800f000), but this also does not work as the programmer overwrites the .elf such that the total flash size is smaller and I also end in hard fault.Any ideas how to resolve this?
Hello STM32 Community,I am currently working with the STM32L476RG microcontroller and am facing challenges in receiving data within the callback function during USART transmission. Both the TX and RX of the UART channel are declared in "normal" DMA mode, and global interrupts are enabled. My code is structured as follows: Main function of STM32CubeIDE:txByte = '0';HAL_UART_Transmit_DMA(&huart1, &txByte, 1);Callback functions of STM32CubeIDE:void HAL_UART_TxCpltCallback (UART_HandleTypeDef *huart){HAL_UART_Receive_DMA(&huart1, rxData, 500 * 4);} void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart){count = count + 1;if(count == 1){LED_Toggle();} Python code on my desktop:binary_data1 = b''.join(struct.pack('<I', data) for data in step_position_data[0:500])while True: if ser.in_waiting > 0: byte = ser.read(1) if (byte == '0'):
I am using the STM32H735G-DK development kit to evaluate the LiveTune audio kit capabilities.When connecting to the dev board it shows several audio input source but does not show one for the Line Level input on connector CN11.How do I use the Line Level Input with the LiveTune software?Only options shown areSysIn-MicroPDMSysIn-MicrophonesSysIn-USB
Dear STM Community,I hope this message finds you well.I am currently working on a project that involves integrating SPI NOR Flash (MT25TL01GB) with FATFS and USB MSC on STM32F429. Despite my efforts, I have encountered some challenges and would greatly appreciate any guidance or support from the community.If anyone has experience with this integration or can provide any resources, examples, or advice, it would be immensely helpful.Thank you in advance for your assistance.Best regards, [Your Name]
Hi ST Community, I am currently working with the STM32H7S7DK development board and am configuring the LAN LWIP stack using RMII for Ethernet communication. However, when I run the code, the system encounters a HardFault. I am using STM32CubeMX for code configuration and STM32CubeIDE as the debugging environment. I would appreciate any assistance or guidance regarding this issue. If anyone has a basic project setup for configuring LAN LWIP with RMII on the STM32H7S7DK, it would be extremely helpful if you could share it with me. This would allow me to better understand what might be causing the HardFault. Thank you in advance for your help! Best regards, Vijay Kushwahvijaykushwah1112@gmail.com Edited by ST moderator: moved to the right destination
Hi,I am trying to use internal DMA configuration on STM32F415RGT6. Couldn't find the relevant support for enabling the dma and also watching off the dma transmit and receive flag as an Endpoint mode. The STM is operating as an Endpoint device. I am trying to send BULK IN. Existing doesn't have the internal DMA enabled. It is waiting for the entire Data to get transmitted. I need to use DMA for USB to perform parallel data send and resume other operations we have in our application.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.