Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
Hello everyone,I’m working on a control unit board based on the STM32F407VETx (LQFP100) microcontroller. During development I noticed that some pins configured as external interrupts (rising edge) were being triggered more often than expected.To better analyze the issue and exclude possible mistakes in my code, I prepared a minimal test project with the following configured pins in IOC:Pin 9 – PC15: GPIO_EXTI15 - INPUT_1Pin 97 – PE0: GPIO_EXTI0 - INPUT_2External crystal/ceramic resonator (HSE)Serial Wire Debug with SysTick as timebase sourceThe only user code added is in gpio.c:/* USER CODE BEGIN 0 */ volatile uint8_t counter_1 = 0; volatile uint8_t counter_2 = 0; /* USER CODE END 0 */ . . . /* USER CODE BEGIN 2 */ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { if(GPIO_Pin == INPUT_1_Pin) { counter_1 = (counter_1 + 1) % 255; } if (GPIO_Pin == INPUT_2_Pin) { counter_2 = (counter_2 + 1) % 255; } } /* USER CODE END 2 */ On my board both PIN9 and PIN97 have the following
I am part of a small team trying to build a small robot as our Hobby. Most of us are without a lot of knowledge on Electronics, so we turn to ChatGPT for most of our development.We started our work on this particular Evolution board. We have used it to test our sensor integration, UART communication, and it has worked fine so far.Yesterday, we tried running our BLDC motor using a motor driver. I am not sure if the connections and code were accurate since we followed ChatGPT's instructions. But after our first test, we haven't been able to flash the board again and keep getting this error.I followed the solution pasted here earlier, but even after connecting BT0 to 3.3v, it doesn't connect in the STM32Programmer, and we are unable to erase the chip. Also, whenever it's connected, the ST Link section and the CN7 part of the board heat up pretty quickly.Any guidance on how we can proceed forward will be much appreciated. We are a group of recent graduates, and we can't afford to keep
Hello,I'm using STM32 for a long time and really enjoy these devices to work with them.But I'm a passionate about aviation and I want to build my own A319/A320/A321/A330 PFD/ND displays.My idea is to use USB or Ethernet to send compressed image from X-Plane 12 to a STM32 MCU.What I'm trying to achieve is to use a small number of devices to show the PFD image on 2 square displays of 800x800 MIPI 4 lanes.I found some IC which can convert LTDC RGB888/RGB666/RGB565 to MIPI 4 lanes (like TC358778XBG).My questions are:1. There are any MCUs with dual phisical LTDC avaiable from STM? In case there is no MCU available, I will use one per display.2. FMC can be used with SDRAM + LCD in the same time? Because I saw the physical lines are shared. Thanks.
A new question moved from this thread. In many examples they use the Vref int for the calculation of the temperature. Do I need it for the C0 also or can it be done without?
Hi STM32 community.I'm working on an embedded system which uses a RK3399 CPU (running Linux, functions as a USB host) and a STM32F302CC (Runing FreeRTOS, functions as a USB device). This runs on a custom motherboard. They communicate with each other through virtual COM ports over USB (using this library https://github.com/IntergatedCircuits/USBDevice).This embedded system has been around and in use for several years and thousands of units are operational. 99,99% of the time (or something like that) everything just works just perfectly. But every now and then, during some special circumstances which have not yet been fully understood (MCU brownout maybe?), some devices will end up in a weird state where the MCU seems to be running, but the USB device (i.e. the STM32F302CC) does not enumerate in Linux on the CPU side. This can be seen in kernel log as something like this (or similar):[81228.001719] usb 7-1.4: new full-speed USB device number 40 using xhci-hcd[81228.06569
Hello everyone,I am currently working on an audio project using the Nucleo-WB55 board and the SGTL5000 codec. I am using the SAI peripheral in I2S mode to transmit and receive audio data, but I am facing an issue when testing a simple loopback setup.My SetupHardwareNucleo-WB55SGTL5000 audio codec (not yet fully connected — initial tests are loopback)SAI SD line of Block A connected directly to SD line of Block B for loopback testingSAI ConfigurationSAI Block A: Master, TransmitSAI Block B: Synchronous Slave, ReceiveI2S standard, 16-bit dataTX and RX audio buffers: 16-bit elements, each with 10 entriesDMA enabled for both TX and RXInterrupts enabledCircular DMA mode used on SAI Block B (receiver)Test ProcedureStart SAI B reception with circular DMA.Start a blocking transmission on SAI A: HAL_SAI_Transmit(hsai_BlockA, buffer, sizeof(buffer), 1000); TX SD line is physically looped back to RX SD line.Issue ObservedIn the RX buffer, only the first half of the data matches the tran
Hello ST Community,I’m currently testing an SGTL5000 audio codec with the STM32WB55 Nucleo board, and I’ve run into an issue where audio only works when analog test mode is enabled. I’m using the Hathor SGTL5000 audio breakout board from PCBWay (project link).System ConfigurationSTM32WB55 Nucleo-BoardSTM32CubeIDE Version: 1.18.1STM32CubeMX Version: 6.14.1SGTL5000 Board: Hathor Breakout (PCBWay project)Connections to SGTL5000:VDDIO, VDDA, VDDD = 1.8V (external LDO)I²C only, pulled up with 4.7 kΩMCLK = 12 MHz from STM32WB55 via SAINo SCLK, LRCLK, or I²S DIN/DOUT connectedMic connected to MIC_L; HP_L/R used for headphone outputGoalTo establish an internal audio path on the SGTL5000:MIC → ADC → DAP (optional) → DAC → Headphoneswithout using I²S (just internal routing).ProblemSGTL5000 only outputs audio when analog test mode is enabled CHIP_ANA_TEST1.TESTMODE = 1; CHIP_ANA_TEST1.TM_SELECT_MIC = 1; CHIP_ANA_TEST1.TM_ADCIN_TOHP = 1; CHIP_ANA_TEST1.HP_HOLD_GND = 0; CHIP_ANA_TEST1.HP_HOLD_G
Recently brought 2 pcs STLINk V3 MODS. downloading all the documents from st site i didnot find right information(whre is SWD,SCLK, pin located in STLINK V3 MODS) so that i can connect to my target bare metal board of STM32F103 Series MCU. Very much time wastage buy doing fake stlink v2 , from authentic source i brought STLINK V3 mods in a hope that i can programe and debug. Help required.No fruitfull video, no fruitfull document available throughout of internet.
Hello,I am using the STM32H747IIT6 microcontroller along with the LAN8742A Ethernet PHY, configured in RMII mode. However, I am facing issues where the Ethernet interface is not working at all in my circuit. It appears there may be multiple bugs or configuration issues affecting the RMII driver.I suspect there are underlying bugs in the RMII driver implementation. I would appreciate any advice or suggestions on how to resolve these issues and get the Ethernet interface up and running as soon as possible.
The audio signal with 24dB gain set is reasonable quality but seems low in the noise. I added a slew filter which helps a lot, but I expected a clearer audio above the noise.The clock going to the mic chip is 1,024 MHz, these are my settings, if anyone has any ideas what might be causing this. Clock and data signals look good, little ringing. /* SETUP USER CODE END I2S3_Init 1 */ hi2s3.Instance = SPI3; hi2s3.Init.Mode = I2S_MODE_MASTER_RX; hi2s3.Init.Standard = I2S_STANDARD_PHILIPS; hi2s3.Init.DataFormat = I2S_DATAFORMAT_16B; hi2s3.Init.MCLKOutput = I2S_MCLKOUTPUT_DISABLE; hi2s3.Init.AudioFreq = I2S_AUDIOFREQ_32K; hi2s3.Init.CPOL = I2S_CPOL_LOW; hi2s3.Init.FirstBit = I2S_FIRSTBIT_MSB; hi2s3.Init.WSInversion = I2S_WS_INVERSION_DISABLE; hi2s3.Init.Data24BitAlignment = I2S_DATA_24BIT_ALIGNMENT_RIGHT; hi2s3.Init.MasterKeepIOState = I2S_MASTER_KEEP_IO_STATE_DISABLE; if (HAL_I2S_Init(&hi2s3) != HAL_OK) END... void MX_PDM2PCM_Init(void) { /* USER CODE BEGIN 2 */
I'm having trouble changing the linker files to take 20 kB of flash from CM0+ for CM4's use on a STM32WL5. Is this possible?
Hi, just bought a STLINK-V3SET to use with EVSPIN32G02Q1S1 evaluation board.It doesn't seem to be able to connect via USB. I've previously recently used STLINK v2ISOL and it worked as expected, so i already had the driver installed and it should be the same driver.Tried different cables, different PCs, different USB ports, reinstalling the driver: to no avail.So what can be the reason here? I'd appreciate any suggestions.
Good morning, if possible, I would like more details about the following PDM2PCM(HP version) library used for converting PDM data to PCM. typedef struct{ uint16_t bit_order// MSB / LSB uint16_t endianness;// big endian / little endian uint32_t high_pass_tap;// hig_pass_tap = alpha*(231-1) #alpha[0:1] uint16_t in_ptr_channels;// number of input PDM channels uint16_t out_ptr_channels;// number of output PCM channels uint32_t pInternalMemory[PDM2PCM_INTERNAL_MEMORY_SIZE];// [default 23] I don't know, I need help here }PDM_Filter_Handler_t; typedef struct{ uint16_t decimation_factor;// decimation factor [16/24/32/48/64/80/96/128] HI_PERF[64/96] do the latter have faster execution times? uint16_t output_samples_number;// I don't know, I need help here... could it be the number of PCM samples or the number of PCM bytes in output? int16_t mic_gain;// gain [-12 dB: +51 dB] int16_t bit_depth;// PCM
Hello, I am using an STM32H723ZG6U and want to output a limited number of phase-shifted pulses on two pins. To do so I currently use TIM1 and TIM8 with PWM generation.TIM1 acts as the master timer having channel 1 in 'PWM Generation CH1' as the first output and channel 2 in 'Output Compare No Output' for the phase-shift. TRGO is configured as 'Output Compare (OC2REF)'. 'One Pulse Mode' is checked for this timer.TIM8 is the slave timer in 'Trigger Mode' with Trigger Source 'ITR0' which connects to TIM1. Channel 1 is configured as 'PWM Generation CH1' for the system's second output. This timer is also in 'One Pulse Mode'.Apart from that both Counter Settings and PWM Generation channels are configured identically to fit my needs. When starting both PWMs for the first time after controller startup everything works as expected (i.e. PWM on TIM1 sends a number of pulses and then stays quiet, same with a phase-shift to TIM1 with PWM on TIM8). Pictures of the configurations are attached.M
Good morning everyone,I need to apply the "Closed" product state to my device using the STM32H573VI.I don't need TrustZone enabled and want to use a password for debug authentication.I wanted to perform the operation via "code" using the HALs, but once I set the state to "Provisioning(0x17)" from "Open(0xED)," my firmware won't boot, and I can't even provision the *.obk file using the STM32CubeProgrammer.bool ProductState::set(states newState) { FLASH_OBProgramInitTypeDef flashOptionBytes= {0}; HAL_StatusTypeDef ret {HAL_ERROR}; if(newState == states::Unknown) { Log::msg("Invalid product state\n"); return false; } Log::msg("Setting product state to %s ...\n", toString(newState).c_str()); HAL_FLASH_Unlock(); HAL_FLASH_OB_Unlock(); flashOptionBytes.OptionType = OPTIONBYTE_PROD_STATE; flashOptionBytes.ProductState = (static_cast<uint32_t>(newState) << FLASH_OPTSR_PRODUCT_STATE_Pos); Log::msg("Program state ...\n"); ret = HAL_FLASHEx_OBProgram(&flashOpt
Hello everyone. How are you?I created a test program based on https://community.st.com/t5/stm32-mcus/how-to-calibrate-the-stm32-s-real-time-clock-rtc/ta-p/744958 I calibrated and compared the signal (512Hz @ PB2) with an oscilloscope, resulting in an error of less than 20 ppm. The RTC worked for 24 hours, and the seconds were the same as my base source (Windows). To me, this indicates that the hardware, crystal, and capacitors are OK.After that, when I entered my application code, the RTC always showed a delay (error > 5000 ppm). My code never use HAL_RTC_SetTime or HAL_RTC_SetDate. Reading from the RTC->CALR register is the same as the calibration value.Regardless of whether the calibration is at -488 or +488 (maximum value), the RTC always lags. I have the feeling that the processor gets busy doing something, and ends up losing some RTC pulse.Unfortunately, I can't post the complete code here, but I can provide some other information:- 1 ISR timer every 1 ms- X-Cube F
Hello everyone,I am currently working on a project using the STM32H755 microcontroller, and I am facing an issue with the program getting stuck in the `Reset_Handler` during debugging. Specifically, the code halts at the instruction `ldr sp, =_estack`, which sets the stack pointer, and does not proceed further.### Project Setup:- **Microcontroller**: STM32H755- **Core**: Only using the Cortex-M7 (CM7) core, with Cortex-M4 (CM4) code generation disabled.- **Debugger**: ST-LINK V3- **IDE**: STM32CubeIDE- **Firmware**: No custom firmware for CM4, only CM7 is active.### Steps Taken:1. I created the project with STM32CubeMX, configured it to use only the CM7 core (CM4 is disabled).2. During debugging, the code reaches `Reset_Handler` but gets stuck at `ldr sp, =_estack`.3. I have tried stepping through the code and confirmed the program halts at the stack pointer initialization.### Possible Causes Considered:- **Dual-Core Synchronization**: Since this is a dual-core MCU, I suspect there mig
Hi, I'm stuck on a problem with setting PWR_CR_VOS on NUCLEO-32 STM32L031K6- I want to select HSI16-PLL as clock source- VDD is 3.3V- FLASH latency is set to 1WSBut I can only set PWR_CR_VOS to RANGE 2 and RANGE 3.RANGE 1 cannot be selected, so I can't set HSI-PLL to 32MHzwhere am I going wrong?Example code:// Set the Flash ACR to use 1 wait-state// and enable the prefetch buffer and pre-read.FLASH->ACR |= (FLASH_ACR_LATENCY | FLASH_ACR_PRFTEN | FLASH_ACR_PRE_READ);//----------------------------------------------------// 1. POWER ENABLE CLOCK and VOLTAGE REGULATOR//----------------------------------------------------// APB2ENR->SYSCFGENRCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN;// APB1ENR->PWREN: Power interface clock enable bit for PWRRCC->APB1ENR |= RCC_APB1ENR_PWREN;// PWR: VOS[11:2] bits (Voltage scaling range selection)// !!! 0x0UL: FORBIDDEN// 0x1UL: 0b01 RANGE 1 1.8V 32MHz// 0x2UL: 0b10 RANGE 2 1.5V 16MHz// 0x3UL: 0b11 RANGE 3 1.2V 4.2MHz// Clear VOS bitsPWR->CR &
Hello everyone, I have a NUCLEO-H723ZG board and I would like to establish Ethernet communication with it. The board already includes a LAN8742 chip as the physical layer. However, in my system there is an external LAN8720 magnetic Ethernet module. At the moment, I can successfully ping the board using the on-board LAN8742 with the LwIP_UDP_Echo_Server application example. What I want to do is disable the on-board LAN8742 and instead use the external LAN8720 for Ethernet communication. I could not find any example where an external PHY is used together with an STM32 board that already has an on-board PHY. First of all, is such a setup actually possible? If it is, can I connect the external LAN8720 to the ETH header pins in RMII mode and make it work by adding the LAN8720 PHY driver? I have seen some discussions stating that this cannot be done without physically removing the LAN8742 chip, possibly due to pin conflicts. Could you please clarify this for me? Is it possible to achieve Eth
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 or a script. Please read this post: How to insert source code. Hi This is something very easy that I am missing or impossible. I am using a nucleo-l476 to drive an RA8875 with a flash memory attached. This is using touch gfx to drive the RA8875 LCD. I am switching in/out of memory mapped mode to rewrite part of the flash memory so I can load different images into the flash memory and touch gfx will load the new images from the nor flash (This all works beautifully). what I am trying to do is have touch gfx load an image to a different part of the nor flash using partitioning. see linker below. MEMORY { RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 32K FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K QSPI_NOR (xrw) : ORIGIN = 0x90000000, LENGTH = 8M QSPI_NOR_P (xrw) : ORIGIN = 0x9
Hi, I am designing a PCB using STM32G0B1RE to be deployed in automotive environment. I need to add ESD protection on its GPIO and ADC pins. I was going through AN5612: ESD protection of STM32 MCUs and MPUs. (Since any specific STM32 family is/are not mentioned in the doc, I think that it should be applicable to all the families.) Under subsection "3.3.4 Other serial interfaces", for I2C-bus ESD protection, the suggested part no. is USBLC6-4. Its electrical characteristics (see attached image) mentions that its V_BR (min) is 6.1V. As per the STM32G0B1RE datasheet, the maximum allowable voltage on any pin is 4.0V to 5.5V (depending on the pin).As per my understanding, V_BR of the ESD diode should be less than the AMR (Absolute Maximum Rating) of the concerned pin. My doubt is that whether the above mentioned ESD diode would be appropriate or are there some other parameters that are needed to be taken into consideration?What is the best approach to select the ESD
HI, how do I read the temperature value of a STM32C071 ADC and convert it into °C using DMA? I cant find any formula in the datasheet. BR Matthias
Question moved from this thread. + 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 and a linker script content. Please read this post: How to insert source code. One more question, if you can help. BSP_TS_GetState(& osc->touchScreen); BSP_TS_Init(ILI9488_TFTHEIGHT, ILI9488_TFTWIDTH); BSP_TS_Init and BSP_TS_GetState are not recognized by IDE versions 1.19 and 1.20. I have to disable them to compile, so the TOUCH doesn't work. C:/Users/Valter/STM32CubeIDE/workspace_1.19.0/Oscillo_STM32G431CBU/Debug/../Core/Src/oscilloscope.c:48:(.text.oscilloscopeInit+0x138): undefined reference to `BSP_TS_Init' C:/Users/Valter/STM32CubeIDE/workspace_1.19.0/Oscillo_STM32G431CBU/Debug/../Core/Src/oscilloscope.c:231:(.text.serveTouchScreen+0x10): undefined reference to `BSP_TS_GetState' I have never used this command before. Thanks
Hello to everyone,I'm using a custom board based over STM32H743XIH6.I'm developing a project that need to use TouchGFX, FreeRTOS and LWIP over ethernet. My first goal it's to be able to PING the card while TouchGFX is running, but i'm having lot of problems (hardfoults) If I enable only TouchGFX + FreeRTOS all run wellIf I enable only LWIP + FreeRTOS I can PING the cardIf I enable all (LWIP-FREERTOS-TouchGFX) I have lot of problems (HardFAULTS).Someone could share a simple project that can use all of them?I'm using a Custom board but i could try to a NUCLEO H743ZI KIT too.Best Regards.Roberto
Hello allDo we knoiw for the example like ( https://support.touchgfx.com/docs/development/scenarios/running-graphics-from-external-ram ) but for the STM32H750B-DK board where the bigger LCD is used?Any comments are more than welcome!Best.
ST Community highlights – April to June 2026
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.