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 using a STM32H562RG and my project involves timing, for which I am using an external LSE crystal. I know that the STM32H562RG can adjust the LSE drive level. I used STM32CubeMX to generate the code. I noticed this code comment./** Configure LSE drive capability* WARNING: Only applicable if LSE is disabled.*/I don't understand. What should I do? When I used STM32L431 before, there was no such code comment.Because when I set the level to HIGH, the LSE crystal of the STM32H562RG still does not oscillate. I don't know what I am doing wrong. This post has been translated from Chinese to comply with the ST Community guidelines.
Hi ST Team, Currently i am using STM32H523RCT6 mcu for one of my project. In this i am using internal RTC circuit for timing purposes. I am using external LSE crystal for RTC. My requirement is that When LSE crystal is not present in circuit then mcu shift the RTC clock source from LSE to LSI. Please provide me a sample code or routine how to check that LSE is present or not. if LSE not present then shift the RTC clock source from LSE to LSI. Thanks with Regards,DEEPAK
HelloIm stuck getting the Ux_Device_CDC_ACM example working.To reproduce- Get the example Ux_Device_CDC_ACM from the X-CUBE_AZRTOS_H7S3L8 V1.0.0 - I set the Boot_XIP.hex in to the debugger configuration (In the readme both Boot_XIP.hex and Boot_XIP.elf are mentioned but only Boot_XIP.hex exists in STM32Cube_FW_H7RS_V1.1.0\Projects\NUCLEO-H7S3L8\Templates\Template_XIP\Binary ) . And move it to the bottom- I add the MX25UW25645G_STM32H7R38-NUCLEO.stldr as external loaderAfter starting the debugging, the code gets stuck at USB_CoreReset() while waiting for the USBx->GRSTCTL & USB_OTG_GRSTCTL_CSRST to clear. Possible FixesAn other Thread recomends setting __HAL_RCC_SYSCFG_CLK_ENABLE(); in HAL_PCD_MspInit() but this macro does not exist in the stm32h7rsxx_hal_rcc.hRegenerating the code from the .ioc leads to many .LD-Files which lead to compilation errors (size overrunds)I would really appreciate if someone coul
Hi Community,I am working on a CMake project where sprintf is being used. After building the project in the Problems window section, I see one error regarding the float formatting as below.The float formatting support is not enabled, check your MCU Settings from "Project Properties > C/C++ Build > Settings > Tool Settings", or add manually "-u _printf_float" in linker flagsThe flag "-u _printf_float" is added in the target link options and -mfpu=fpv4-sp-d16 and -mfloat-abi=hard is added as CPU parameters. But still showing this problem will it impose any issue while building although the build is not complaining about this.
I am Writing in a W25Q128 flash memory with a Cortex M4 microcontroller and FreeRtos operative system. I created a task to write data in my W25Q128 flash. However I noticed that when writing data in the flash thanks to the function Flash_Write (will post it and every lower level function) at a memory address saved in a variable and then incrementing the variable from one for(;;) iteration to another then the data saving in the flash would not occur as it should. In fact while debugging the code and only doing 1 iteration of the for(;;) loop the data is written multiple times with the address incrementing, when it should only write it once, it's also very disturbing that the address increases before the line is executed Here is an example of the code gg = 100; for(;;){ uint32_t *pointer = ≫ Flash_Write(gg,(uint8_t*)"bang",4); uint32_t temp = *pointer; *pointer = temp + 4; } and here what only 1 ieteration of flash_write (while debugging) saves Wort
Using an stm32f746 disco, I'm trying to get a function to compile to a different memory location using Mbed. so far, as a test, i have this mbed_app.json.. { "target_overrides": { "*": { "target.ld_script": "custom_stm32f746.ld" } } } then this custom_stm32f746.ld... /* Linker script to configure memory regions. */ MEMORY { FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K CUSTOM_SECTION (rx) : ORIGIN = 0x080C0000, LENGTH = 128K } /* Define entry point */ ENTRY(Reset_Handler) /* Section Definitions */ SECTIONS { .text : { *(.text) *(.text.*) } > FLASH .custom_section : { KEEP(*(.custom_section)) } > CUSTOM_SECTION .data : { *(.data) } > RAM AT > FLASH .bss : { *(.bss) } > RAM /* Other sections */ } and this in my main.c.. __attribute__((section(".custom_section"))) void myFunction(void); __attribute__((section(".custom_section"), used)) void myFunction() { printf("This function is at %0xH\n",
I generated a LwIP_HTTP_Server_Netconn_RTOS example project using CUBEMX(with latest 1.17.2 pack), after modify some code, the project work well on my STM32F767IGT board.In order to further develop, I create a new empty project, copy and add the C/C++/s files. and found that FREERTOS have started, but lwip not work, I can not ping device successfully.I have checked the new project, all source code are same with example project. is there any suggestions?Looking forward to your help, thanks.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~work well after modify sct file, so close this thread.
Hi everyone,I'm currently working on an STM32 project using STM32CubeIDE, and I need to implement a way to modify certain parameters, specifically the UART baud rate and some variable values, without having to exit the running application or modify the source code.The idea is to have a simple human interface (either through UART commands, a basic GUI, or even a command line tool) that can change these settings at runtime. Here's what I'm looking for:Ability to modify UART baud rate dynamically from a predefined set of values.Modify some specific variables in the code (e.g., configuration parameters) without recompiling.No need to exit or reset the application while making these changes.If possible, I would prefer to avoid adding heavy libraries that take too much memory.I've looked into using UART commands and CLI-based interfaces but haven't found a clear solution yet. Any suggestions or examples on how to approach this would be greatly appreciated!Thanks in advance for your help!Best
Hello,I am using STM32U535CEU6 for my development.I would like to transition to the bootloader using USB DFU with Boot0 pin kept Low, and the control performed within the application. I executed the following code right after HAL_Init();, but when I tried to connect STM32CubeProgrammer, it displayed "No DFU detected."Where could the problem be?After connecting via J-Link and checking the option bytes, the result was as follows:nBOOT0: Checked (1)nSWBOOT0: Checked (1)NSBOOTADD1: 0x0BF90000The code I tried is as follows:{void (*SysMemBootJump)(void); // Define function pointeruint32_t BootAddr = 0x0BF90000; // Bootloader address// Get the address of the bootloader's reset handlerSysMemBootJump = (void (*)(void)) (*((uint32_t *) (BootAddr + 4)));// Disable interrupts__disable_irq();// Reset all peripheralsHAL_RCC_DeInit();// Set the stack pointer__set_MSP(*(uint32_t *) BootAddr);// Jump to the bootloaderSysMemBootJump();}Any advice please?
My current project is based on STM32H743IIT6 microcontroller with CMSIS RTOS v2, FATFS, USB FS as Mass Storage Host class. Recently, I upgraded to H7 firmware v1.9 after which FATFS API return "FR_DISK_ERR" error frequently. As a workaround, I had to replace these files "stm32h7xx_ll_usb.c", "stm32h7xx_ll_usb.h", "stm32h7xx_hal_hcd.c" and "stm32h7xx_hal_hcd.h" in latest drivers in v1.9 to the once present in earlier version that is H7 firmware v1.8.There are changes in USB link layer drivers & HCD drivers in latest firmware and that seems to be the root cause of these issue. I narrowed down at a place in USB link layer "stm32h7xx_ll_usb.c" to function like "USB_ReadPacket()", "USB_WritePacket()" where in earlier v1.8 read and write from USBx_DFIFO were 32bit word aligned which is NOT the case with latest firmware v1.9. I am not sure if word alignment is the issue here but it has something to do with this USB and HCD drivers cause replacing them with the older version in latest firm
Hello,I'm trying to trigger another timer from a rising edge on PA9. I tried to do this by using input capture from timer1 and generating a trigger out, but there seems to be some configuration issue. Triggering a DMA transfer using channel 2 input capture works just fine, triggering the other timer just using PWM mode channel 2 also works, but for input capture channel 2 to trigger out, nothing happens. The code below works for channel 1: GPIO_InitStruct.Pin = GPIO_PIN_8; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_LOW; GPIO_InitStruct.Alternate = GPIO_AF6_TIM1; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); // Timer 1 Configuration TIM1->CR2 &= ~TIM_CR2_MMS; // Clear MMS bits TIM1->CR2 |= TIM_TRGO_OC1; // use CC1 event for TRGO TIM1->CCMR1 &= ~(TIM_CCMR1_CC1S); // Clear CC1S bits TIM1->CCMR1 |= TIM_CCMR1_CC1S_0; // Set CC1 as input, IC1 mapped on TI1 TIM1->CCER |= TIM_CCER
Hello,I have STM32F767ZI and STM32F429ZI Nucleo board, which I want to configure in TCP Client mode. I have attached .ioc file and tcpclient.c and ethernetif.c files. This files I have downloaded from internet. Now here is my problem when I try to run this code my board is not getting connected to server. For server I am using Hercules software. My board/s are getting from ping response, but not getting connected to server. void tcp_echoclient_connect(void) { ip_addr_t DestIPaddr; /* create new tcp pcb */ echoclient_pcb = tcp_new(); if (echoclient_pcb != NULL) { IP4_ADDR( &DestIPaddr, DEST_IP_ADDR0, DEST_IP_ADDR1, DEST_IP_ADDR2, DEST_IP_ADDR3 ); /* connect to destination address/port */ tcp_connect(echoclient_pcb,&DestIPaddr,DEST_PORT,tcp_echoclient_connected); } } /** * @brief Function called when TCP connection established * tpcb: pointer on the connection contol block * err: when connection correctly established err should be ERR_OK * @r
Dear all,We are pleased to announce the publication of some USB Device composite applications on GitHub:Composite Audio-HIDComposite CDC-HIDComposite CustomHID-CDCComposite Printer-CDCLink to download:GitHub - STMicroelectronics/STM32CubeH7 at dev/usb/composite
This might sound familiar. I'm working on getting FatFS and SDIO-4 bit communication working. My evaluation board is a NUCLEOF411RE. The latest problem I've run into is on line 355 of sd_diskio.c, which it gets to from ff.c, line 5661 (shown below). To summarize, WriteStatus isn't switching away from 0. The only function that can change WriteStatus to anything other than 0 is BSP_SD_WritecpltCallback, so clearly it isn't being called. I looked into it more and saw this post. Tried it, but still getting stuck at the same spot. Anyone have any clue what might be happening?edit: I managed to trace my way back (somewhat) through what appears to be a chain of interrupts that I wasn't able to get into before, and things have just gotten more confusing. So disk_write goes to sd_write, which is where it gets hung up at the end. The SDIO IRQ Handler gets involved and then it's all downhill from there. The problem is that I can't seem to get a breakpoint to stop me where I want it to s
I'm working on a board that has a string of 6 SPI quad FET chips whose outputs I'm trying to PWM in software. The string of FET drivers have a latch signal to transfer the shifted data to the outputs. Because the DMA uses the SPI peripheral's FIFO, I need to generate the latch signal after every 3 bytes DMA'd to the SPI peripheral. It would seem that I need to set the SPI peripheral's FIFO size to 3 bytes and setup a SPI interrupt every time the SPI FIFO has emptied *and* the SPI data register is empty (i.e., after every 3rd byte has been completely shifted out). I don't see a way to set the SPI FIFO size. Since the FIFO size is 32-bits, I could send 4 bytes at a time (with one dummy byte) with the TXEIE (Transmit FIFO ready to be loaded) interrupt bit set, and when that interrupt occurred, if a TX complete interrupt was available I could enable that then to allow me to know when the entire 4-byte sequence was transmitted so that I could synchronously generate the latch signal to the S
eu, eu estou tendo um problema com o meu software ao escrever para o flash. O que está acontecendo? Estou usando o temporizador 4 para alternar LEDs e botões, e até agora tudo bem, mas o problema ocorre quando vou escrever no flash. Quando eu apago, os LEDs começam a piscar, como se o MCU estivesse preso. Ele até grava no flash, mas os LEDs continuam piscando. Estou usando o STM32F103c8. Alguém poderia me ajudar?
I set a breakpoint inside the function:void HAL_COMP_TriggerCallback(COMP_HandleTypeDef *hcomp)I got an interrupt event just after calling the function:HAL_COMP_Start(&hcomp1);I tried to pull-down/pull-up, I tried with all triggers modes but I ever get one false interrupt, how can I avoid it?
Hello everyone, I'm Jun and I live in Japan.The board is a custom board based on BLACK_F407VE, and is for hobby engine control. The crystal oscillator is ABS07-LR-32.768kHz-6 (load capacitance 6pF) recommended by STM.The development environment is Visual Studio Code and PlatformIO. The framework is Arduino.The program was modified from the sample program SimpleRTC in the library that comes with PlatformIO so that the hour and minute can be set. In addition, RTC_CALIB can be output to a port.There are three boards, and a 3V battery is attached to VBAT. Set the time in the RTC, turn off the power, and refer to the RTC one hour later. One board has 0 drift, and the other two boards advance significantly. The power is turned on and off only once each when setting and referencing.NO1:Capacitors on both ends of the crystal are 12pFRTC_CALIB=Average of 1 minute 511.94HzRTC value after 1 hour = 39 seconds aheadNO2:Capacitors on both ends of the crystal are 6pFRTC_CALIB=Average of 1 minute 511.
I'm trying to debug a Zephyr RTOS application on the STM32H573I Discovery board using the STM fork of openocd and the on-board STLink. I'm running the tools on a Mac M1 machine, and building and flashing the code works fine, using the Zephyr west based toolchain and VSCode.But when I start openocd with this config (copied from STMCube IDE): # This is an genericBoard board with a single STM32H573IIKxQ chip# Generated by STM32CubeIDE# Take care that such file, as generated, may be overridden without any early notice. Please have a look to debug launch configuration setup(s)source [find interface/stlink-dap.cfg]set WORKAREASIZE 0x8000transport select "dapdirect_swd"set CHIPNAME STM32H573IIKxQset BOARDNAME genericBoard# Enable debug when in low power modesset ENABLE_LOW_POWER 1# Stop Watchdog counters when haltset STOP_WATCHDOG 1# STlink Debug clock frequencyset CLOCK_FREQ 8000# Reset configuration# use hardware reset, connect under reset# connect_assert_srst needed if low power mode
This is my Environment:Microcontroller: STM32H723ZET6LWIP is used. No RTOS used.I am setting a Static IP address in the *.ioc file. I am setting the same IP address in the TCP Raw Socket Echo Server to Bind the socket. Over that I am running the Modbus Server. DHCP is disabled. I want to change the IP Address at run-time. How is it possible?
I'm unsure whether this is a software issue or wake-up callback is by default not present for UART on STM32U535 microcontroller. The rest of callbacks seems to be in place.
Hello, i am trying to implement Eeprom Emulation on STM32H723 using the code that ST provided in STM32CubeH7-Master for STM32H743 series. In the EE_Init function, first thing that function does is this line of code: PageStatus0 = (*(__IO uint16_t*)PAGE0_BASE_ADDRESS); #define PAGE0_BASE_ADDRESS ((uint32_t)(EEPROM_START_ADDRESS + 0x0000)) when i look at the value of PAGE0_BASE_ADDRESS, it corresponds to 6U+0x000. Is that normal? Doesnt this mean that we are reading from ITCM RAM?
I am trying to run a code that's built using STM32L1x_Peripheral Libs for STM32L151CBUxA MCU.As soon as I run the SystemInit function inside the ResetHandler I am hitting a Hardfault, so I investigated the SystemInit function.Once the Vector Table relocation function is executed in it a HardFault is caused. I am unsure how to debug or resolve this.Please help me debug the code.
Hello community,I'm using USB CDC functionality of STM32F103C8T6 to read file data from FATFS by SPI and transmit it to USB host by CDC_Transmit_FS(). USB MSC mode is not available because I need to send other commands to STM32 via CDC.The file transfer sequence is like below:1. Read 1 KB from the FATFS by f_read() to UserTxBufferFS, which is the USB Tx buffer. It typically took ~6ms each.2. Call CDC_Transmit_FS() to transmit 1 KB from UserTxBufferFS. Busy waits for the previous transfer by checking if it returns USBD_BUSY.3. Repeat until the file ends. There are 2 buffers and next f_read() will load data into UserTxBufferFS_2. And I found something strange. USB CDC transfer is getting slower and slower as the transfer file size increases.The busy-waiting time for the CDC transfer took 0 ms for the first 75 KB, which looks like it just copy data to its internal buffer and finish until the next 6ms f_read() ends.Then, the waiting time starts to increase. if UserTxBufferFS is 1KB, i
I tried several ways without success. When I found "How to enable SIM MFF2 connectivity with P-L496G-CELL02" , I have reprogrammed the kit with some examples and forgot backup the preloaded firmware.If eSIM service is still available, is there a way to activate it without preloaded firmware? or where can I get the preloaded firmware?
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.