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
Currently, I am working on an STM32L432 microcontroller, emitting a 20 kHz sine wave. The code is relatively simple, although I am getting a slightly different frequency. I have been looking for solutions and found an embedded software package called RC-CALIB as a relatively cheap solution to this.However, I cannot load the package on my CUBE IDE, even though the software was downloaded directly from the STM website. The latest version is from 2015.Thanks for your time.
How can I combine SD card and USB initialization in an STM32 project?Individually, both SD card and USB initialization work correctly. However, when combined, only the mount operation succeeds, and the process fails when opening a file. Testing each peripheral separately after generating both configurations also fails.What could be causing this, and how can I make both functionalities work simultaneously?Below is the code refer it: /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2024 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * **************************
Hi all,I know similar issues have been discussed before but I have not been able to find another post with the same issue. I am trying to use a CRC32 calculation to validate my flash memory, I am using KEIL IDE and the STM32L071CBT.This has been my current approach, enabling the HEX file generation on KEIL IDE and using a batch file (used with my after-build option in KEIL) with the following code:.\bin\srec_cat .\Device\OutputHexFile.hex -intel -crop 0x08000000 0x0801FFFC -fill 0xFF 0x08000000 0x0801FFFC -crc32-l-e 0x0801FFFC -o .\Device\OutputHexFile_CRC.hex -intelFrom my understanding this should calculate the CRC32 (Little-Endian) and place the value at the address 0x0801FFFC. I use the HAL peripheral, HAL_CRC_Calculate in my code to calculate the CRC-32 little-endian value:#define ROM_START (uint8_t*)(0x08000000) #define ROM_END (uint8_t*)(0x0801FFFB) #define CHECKSUM (uint8_t*)(0x0801FFFC) #define ROM_LEN (uint32_t)(ROM_END - ROM_START + 1u) #define ROM_LEN_WORD
Hello,I want to use external SDRAM as the LTDC framebuffer with the STM32F746 microcontroller. I can write and read the desired data to/from the SDRAM without any issues. However, when I activate the LTDC, during the SDRAM initialization and configuration settings, I suddenly encounter a "target is not responding" error. After this, the microcontroller becomes completely unresponsive. The only way to recover it is to set it to boot mode and erase the entire flash memory.What could be the problem here?I appreciate your help.Thank you. ---
Hey there!Can we allocate the USB classes dynamically?Like, first we Initialize the USB Device stack, just register the CDC class and add its interface and start the USB Device Core (which pulls up the D+ line)This we need to do (atleast registering one class) for Host (PC) to recognize our device as USB Composite device with some functionality (Com port)Then, when USB is inserted, I'll add a 5s delay and then register another class., let's say USB MSC and register its storage. Will it work? If yes, can anyone say the flow of coding?I'm using classic stm32 usb library for STM32U0 series MCUCurrently I'm doing like this:-> In main.cbool isUsbInterrupt = false;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_Co
I have a working project that simply writes to a a file on an SD card (Using STM32H7B3I-DK, Not Using RTOS).When I add it to a touchgfx project, f_mount() and f_open() return NO_FILE_SYSTEM. This happens even after f_mkfs() returns FR_OK. I have the following parameters:Freertos - task : stack 512 (words) Priority : osPriorityRealtimeProject manage - linker settings Minimum Heap Size : 0x1000Project manage - linker settings Maximum Heap Size : 0x1000FATFS - SDMMC instance : SDMMC1 Use DMA template - EnabledSDMMC1 - Use clock divide factor : 2There is no DMA Settings tab in SDMMC1, is this an issue?EDIT: I have tried it with just RTOS and FATFS and It works... The issue occurs when touchgfx is in the project
I'm having an issue when using the DMA with SPI. I'm using the SPI for a 320x240 LCD and want the DMA to help with blocking while transferring large amounts of data with touchGFX.I'm able to paint the screen one color just using the SPI but when I try to use the hdmatx I can't get it to complete and hangs on waiting for the DMA state to be READY (see below).... void ST7789v_Fill_Color(uint16_t color) { uint16_t i; ST7789v_SetWindow(0, 0, ST7789_WIDTH - 1, ST7789_HEIGHT - 1); CS_L(); uint32_t size = ST7789_WIDTH * ST7789_HEIGHT * 2; uint16_t chunk_size; uint16_t buffer[size/2]; uint8_t *buf; memset(buffer, color, sizeof(buffer)); if (size > 0) { DC_H(); LCD_WR_REG(ST7789_CMD_RAMWR); while (size > 0) { buf = (uint8_t *)buffer; chunk_size = size > 8192 ? 8192 : size; if (DMA_MIN_SIZE <= size) { if (HAL_SPI_Transmit_DMA(&hspi3, buf, chunk_size ) != HAL_OK) { Error_Handler(); } while (hspi3.hdmatx->State != HAL_DMA_STATE_READY); } e
Hi:I now have a STM32cubeIDE project now successfully sending FDCAN messages to PCAN View running on my laptop. I'm now trying to add the emotas CANopen FD single line software stack to send CANopen messages. I can not get my program to build without errors now. I've been instructed to copy the emotas cofdlib_sl & cofddrv_sl folders from the emotas sw distribution to my project. I tried a zillion iterations of files from those folders. Has anyone out there used the emotas CANopen FD stack for any STM32CubeIDE project (preferable for H7)?Thanks,Kenny
The documentation for HAL_ADCEx_MultiModeStart_DMA clearly states that the length parameter is in bytes. /** * @brief Enable ADC, start MultiMode conversion and transfer regular results through DMA. * @note Multimode must have been previously configured using * HAL_ADCEx_MultiModeConfigChannel() function. * Interruptions enabled in this function: * overrun, DMA half transfer, DMA transfer complete. * Each of these interruptions has its dedicated callback function. * @note State field of Slave ADC handle is not updated in this configuration: * user should not rely on it for information related to Slave regular * conversions. * @PAram hadc ADC handle of ADC master (handle of ADC slave must not be used) * @PAram pData Destination Buffer address. * @PAram Length Length of data to be transferred from ADC peripheral to memory (in bytes). * @retval HAL status */ HAL_StatusTypeDef HAL_ADCEx_MultiModeStart_DMA(ADC_HandleTypeDef *hadc, uint32_t *pData, uint32_t Length) {Howeve
Hi I have a STM32L433 running at 16MHz and having a strange issue. I have setup the rtc and within the Systimer interupt I display the current time (the systimer is 1KHz and every 1000 ticks I get the second , at this point I read the clock and display on the terminal). The time is accurate , even after a few hours its still perfect. Now if I set the wakup timer to interupt every 5 seconds, it loses some ticks after the interupt. Below is a snapshot of the terminal app. Every second the time is displayed, and at the point of ****** TIMER 5 secs ****** , this is when I set the wakeup timer. As you can see it always displays the same time twice right after the timer set . After a few timer interupts, the time is a few seconds out.My code is as follows:1.The inisialisation routine: void InitRTC(void) { if(RTC->BKP1R!=0x1954) { if((PWR->CR1 & PWR_CR1_DBP) ==0) { PWR->CR1 |= PWR_CR1_DBP; while((PWR->CR1 & PWR_CR1_DBP)==0);
Hi to all.I'm starting a new project where we use the STM32H7S3V8H, and with the code generated with the STM32CubeMX (see IOC file attached) it compiles perfectly the Boot code but the Application code allways fail with the following error message:"cc1: error: target CPU does not support ARMv8-M Security Extensions"We don't have idea what we must do in the IOC to change this situation. Anyone knows why this error is happend? Any clue? Thanks in advance.Isidre Solé
This question is about the operation of HAL_SPI_TransmitReceive_DMA.When HAL_SPI_TransmitReceive_DMA(&hspi1 ...) is being transmitted (assumed SPI communication_A) and HAL_SPI_TransmitReceive_DMA(&hspi1 ...) is called (assumed SPI communication_B) SPI communication_A will be canceled and SPI communication_B will be executed? Or is SPI communication_B executed after SPI communication_A is completed?
Hi all, I have just released subj. I have tried to contribute it to SQLite directly or to create a CubeMX package but seems that nobody interested, so I have created a standalone repository. I have used STM32H753I-EVAL2 to develop and test it and the repo contains the test project as well (well, mostly the test project ;) so I think it fits this forum. Project uses no external memory but just MCU, SD-card and UART for debug output. Regards,Dmitry
Hello,I am newbie and i have project with STM32F407G-DISC1 and PMOD I2S2. It generates two RNG values at start and with buttons switches digital filter correspoding to RNG value and shows it on LED in binary. Digital filter length and coefficients are in included h.It works now with two filters. But i want to have 16 total filters. How i can optimise that?There are global arrays with size based on filter choosen by RNG. I read that declaring global array size in main requires malloc. Another possibility is having array of functions that calculated samples, so in callback instead of 16 ifs, there will be 2 ifs.#include "main.h" #include "filter_coef.h" I2S_HandleTypeDef hi2s2; DMA_HandleTypeDef hdma_i2s2_ext_rx; DMA_HandleTypeDef hdma_spi2_tx; uint16_t mode=0; uint16_t fa=0; uint32_t f1=0; uint32_t f2=0; uint16_t rxBuf[8]; uint16_t txBuf[8]; RNG_HandleTypeDef hrng; void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_RNG_Init(void); static void MX_DMA_Init(
hi im using stm32g474vet6 timer2 which is 32bit in input capture mode for finding frequency and width.i can't able to measure more than 400khz frequency. i want to measure 4mhz to 400khz signal, which is 400khz frequency signal and its width will vary from 10 to 100 percent with respect to time. what should be the prescalar and period value for measuring 4mhz signal in mcu timer. below is the code attached for frequency calculation:if(htim == &htim2){if(htim->Channel == HAL_TIM_ACTIVE_CHANNEL_1){if(capture == 0){ PWM_OFF_fault();t1 = HAL_TIM_ReadCapturedValue(&htim2,TIM_CHANNEL_1);capture = 1;TimeElapsedFor.ALM =1;}else{t2 = HAL_TIM_ReadCapturedValue(&htim2,TIM_CHANNEL_1);if(t2>t1){period = t2-t1;}else if (t1>t2){period = (4294967295-t1) + t2;}float systemclock = 170000000;frequency = systemclock/(period*170); TIM2->CNT =0; capture = 0;} i can't able to measure more than 400khz, can someone suggest any solution
Hi, I have an http web server running on a STM32U575. The system is reachable via USB over RNDIS. How can I teach the server DNS? I have tried to use the mDNS module without success. What is the cheapest solution so that the user only has to enter the servername in the browser without knowing the IP? BR
hey,I went through all possible data sheets I could find did all the required things but my Nucleo still won’t be programmed with uart.I have put boot0 on VDD pin next to it. For confirmation I also put PB2 (nboot1) on ground next to it.I tried powering the nucleo through both the USB as well as an external supply (E5V) and switched to e5v.I reset the controller to try programming.I connected my Rx, Tx and Ground of my UART to usb (which I checked with the nucleo by programming a UART program through st link and it works)I am using St flash which says there was no communication and stm32 programmer says it timed out for the com porti even checked that there was no read or write protection enabled and nboot1 option bits are correct by connecting to stm32 programmer through STlinkwhat am I missing?
Hello,I am currently working with I2C communication using the Nucleo-L452RE board. I am encountering an issue where:The master device indicates that the slave is busy receiving.Simultaneously, the slave device indicates that the master is busy receiving.I have double-checked the configuration for both devices and ensured that the pull-up resistors are correctly connected. Despite this, the communication remains stuck in a busy state.Here are some additional details about my setup:Microcontroller: STM32L452REI2C Role: Master (Nucleo-L452RE), Slave (Nucleo-L452RE)Pull-Up Resistors: [Specify values, e.g., 4.7 kΩ]I would appreciate any insights or suggestions to resolve this issue. If more details or specific configurations are required, please let me know.Thank you in advance for your help!
Dear,We using the STM32H7B0 (100pins) When we sending to the USB port with the function CDC_Transmit_HS() he returns always USBD_BUSY after 1408 bytes.We had found a article that says that the the value 0x174 isn't correct (see code below)See: https://community.st.com/t5/stm32-mcus-embedded-software/problem-with-stm32h747-hs-usb-dma/td-p/165459When we change it to 0x100 for the HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 1, xxx) than it works.Why is this value incorrect?Where we can change this value in STM32cubeMX?Or doing we something else incorrect? /* USER CODE BEGIN TxRx_HS_Configuration */ HAL_PCDEx_SetRxFiFo(&hpcd_USB_OTG_HS, 0x200); HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 0, 0x80); HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 1, 0x174); /* USER CODE END TxRx_HS_Configuration */
In a project I created with STM32H723ZGT6, I am using the Wiznet W5500 Ethernet I/O Library. I decided to proceed with ThreadX and NetXDuo for my project. The issue is that I couldn't find an Ethernet driver for W5500 that works with NetXDuo. Where can I find an Ethernet driver example for W5500?
Hi, I worked for last three weeks STM32H743iik6 project with SD card .SD card with SPI interface but I got FR_NOT_READY error.I have checked hardware connection.same code work in stm32f and stm32 l series.I don't know reason for stm32h series not working.please any one have code stm32h series please send me.
hello!i'm trying to make a project with the board SNK1M1 coupled with the NUCLEO-G071RB using azure ThreadX instead of FreeRTOS.i'm able to replicate the example provided here:https://wiki.st.com/stm32mcu/wiki/STM32StepByStep:Getting_started_with_USB-Power_Delivery_Sink#Configure_UCPD_monitor_firmware_responder_for_debugor the video on youtube:https://www.youtube.com/watch?v=cbdFHmMOMwkand all work fine like in the videoBUTif i change the Rtos with azure ThreadX nothing work anymore!the code is compiled without problem, it seems to run (no hardfault error) but i can't find the board in the cube monitor UCPD there is some additional step to use azure threadX instead FreeRTOS?there is a tutorial of how to use with threadX? thank you in advance!
Hello STI have a project where I need to start and stop the UART during runtime, and I have noticed a possible bug in the stm32f3xx_hal_uart.c file.The issue is that when initializing the UART to use the UART_ADVFEATURE_TXINVERT_INIT parameter, the Tx pin goes high for a very short time (~10us). I suspected that it was because the inversion of the pin took place after the UART was started, and i did some digging in the HAL code. By setting the breakpoints as above, i concluded that the signal that was on the Tx pin was high after UART_SetConfig was called, and it went low again after UART_AdvFeatureConfig was called. This seems to me that the pin goes high (UART Idle), before the inversion takes place (UART idle low after inversion).The Tx pin viewed under an oscilloscope where the code is initializing and deinitializing the UART every ~100ms, resulted in a consistent voltage spike. I tried to confirm my suspicion by swapping the order the two functions were called, so the invers
The net effect of this bug is that the reference code (including the Templates for LRUN and XIP) never actually enable the Memory Protection Unit regions.See: stm32h7rsxx_hal_cortex.c Line 532 I believe the second "Disable the Region" should have been an "Enable the Region", and called SET_BIT(MPU->RASR, MPU_RASR_ENABLE_Msk). Without this, the result after a call to HAL_MPU_ConfigRegion is a disabled region, requiring a second call to HAL_MPU_EnableRegion(). Note that there are no calls to this function in the H7RS reference code or templates. As a result, these regions are never enabled.I discovered this issue when a region I marked as non-cachable was being cached despite the region specifically declaring it as NOT_CACHABLE.
Sorry for asking an obvious question...LWIP documentation describes a udp_pcb as "Creates a new UDP pcb which can be used for UDP communication."https://lwip.fandom.com/wiki/Raw/UDPWhen connecting to multiple devices with an IP address each using UDP protocol with LWIP, is it expected that you allocate a udp_pcb struct per connected device? Or try and re-use a single UDP protocol control block. E.g. One Device connecting to 5 other devices:therefore create five udp_pcb objects?or re-use one udp_pcb but send to different IP addresses? Thanks in advance.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.