Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
Hi everyone, I'm stuck on the transition from my low-power mode versus my power consumption.I already have a “sleep.c” code that is capable of putting the device to sleep at 2uA power consumption (which is my goal, everything's fine here).This code exits the low-power mode on RTC alarm. I now wanted to introduce another piece of “run.c” code.“run.c” and “sleep.c” can switch to each other via a soft reset (this logic works fine).But when I run “run.c” once and switch to “sleep.c”, my current consumption in STANDBY is now ~4mA.My clocks in RUN: HSI16MHz, LSI32kHz, PLL64MHz, SYS=PLL64MHzMy clocks in SLEEP: HSI16MHz, LSI32kHz, SYS=HSI16MHz After some research, I noticed that if I align all configurations to HSI16MHz, LSI32kHz, PLL64MHz, SYS=PLL64MHz, I still have a current consumption of ~4mA.But if I align all configurations to HSI16MHz, LSI32kHz, SYS=HSI16MHz, then I reach my goal of ~2uA. I would like to use the PLL anyway in RUN and not in SLEEP for project reasons.It seems that the PL
Hello, I'm using STM32L471 and Micron MT25QL NOR Flash with single SPI interface. MT25 is also connected with other MCU (NRF52) using the same lines. I'm trying to write STM firmware in BOOT0 serial bootloader controlled by NRF using STM's USART3. The firmware is stored in MT25, NRF reads it using SPI, and transfers it to STM using UART.The problem is that when STM booted in bootloader mode, it seems that STM initializes SPI interface with Push-Pull configuration on MISO line. This behavior causes a collision between MISO signal of STM and MT25, the signal level goes intermediate level about 2.0V, and the result is NRF reads FFh.So my questions are:Is there a way to disable STM SPI in bootloader mode?To solve this, I'm considering that NRF keeps STM in reset state while NRF is reading 4KB (e.g.,) from MT25 , then let STM boot with BOOT0=H and write firmware data on its internal flash, repeat it until all firmware is written. Is there any possibility of problems when resetting and
Hi everyone, I couldn't find the application note on STM32WB0 MCU hardware development. Can I refer to AN5290 which is for STM32WB instead of the STM32WB0. If so, is there anything I would need to pay attention to for the STM32WB0 series? Or should I reference from the NUCLEO-WB07CC's schematics instead? Thank you for your time and help!
Hi everyone, I'm using STM32G474 with dual-bank Flash enabled (nDBANK = 0) and booting from Bank2 (BFB2 = 1). I'm implementing OTA firmware update by writing to the inactive bank while executing from the active one. The update from Bank1 → Bank2 works fine. But in the second update cycle, when running from Bank2 and trying to write to Bank1 (starting at address 0x08000000), HAL_FLASH_Program() always fails on the first double-word. I have: Verified that Write Protection is disabled (checked in STM32CubeProgrammer) Unlocked Flash properly Erased the target pages beforehand No PCROP or secure area configured on Bank1 Flash error flag is HAL_FLASH_ERROR_WRITE_PROTECTION sometimes (even though WRP is not set) I found some similar cases reported online (e.g. this one) where users mentioned that writing to Bank1 from Bank2 fails silently. Is there an undocumented silicon limitation on STM32G4 when programming Bank1 from Bank2? I would appreciate any official clarification or work
Hi, what is the best way to wake from Low Power Sleep when an Encoder is rotated?I have TIM2 setup in encoder mode and it works when in Low Power Run. I just want to switch back from LP Sleep to LP Run when it's turned. Looking in stm32l4xx_hal_tim.c I have not been able get a solution.This did not work://Wake up from Encodervoid HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim){if (htim->Instance == TIM2){LowPowerSleepToRun();}}I have TIM2 global interrupt set in CubeMX.I have buttons that do this via EXTI, so the LowPowerSleepToRun function works.If you can keep the reply to HAL and CubeMX solutions I would appreciate it.Thanks in advance, Lance.
Hello,I'm having an issue with the STM32L4A6(1Mb) and the dual-bank.First of all, I tried with the NUCLEO-L476 and a simple blink led. It worked fine.Now, my project is based on a STM32L4A6, but the firmware doesn't start in BANK2.For simplicity, I did the same program blink led as for the STM32L476This is what I implemented in SystemInit():VECT_TAB_OFFSET is 0x80000void SystemInit(void) { #if defined(USER_VECT_TAB_ADDRESS) /* Configure the Vector Table location -------------------------------------*/ FLASH_OBProgramInitTypeDef FLASH_OBProgramInit = {0}; //Read all options bits HAL_FLASHEx_OBGetConfig(&FLASH_OBProgramInit); //Check the BFB2 bit if (FLASH_OBProgramInit.USERConfig & FLASH_OPTR_BFB2) SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; else SCB->VTOR = VECT_TAB_BASE_ADDRESS; #endif /* FPU settings ------------------------------------------------------------*/ #if (__FPU_PRESENT == 1) && (__FPU_USED == 1) SCB->CPACR |= ((3
I am using an STM32H747i-Disco board for a time critical application. I would like to periodically output simple text messages to the display.but I don't want to use an RTOS, so TouchGFX is not an option. In LCD.c there appear to be no functions to simply display text at a location on the screen.Do such functions exist? If so where?
Hi, Im new to STM32 and Im writing a bare metal spi library however for some reason when I try to change the SSM bit in code it doesnt seem to work. Im able to change the SSM bit in debug mode. void SPI_Enable(SPI_Com* spi) { SPI1_CLK_EN; //Reset the whole CR1 register if someone decides to enable it using different options //First disable SPI spi->spiReg->SPI_CR1 &= ~(1 << 6); spi->spiReg->SPI_CR1 = 0; //CPOL and CPHA spi->spiReg->SPI_CR1 |= (spi->spiConfig.CPHA); spi->spiReg->SPI_CR1 |= (spi->spiConfig.CPOL << 1); //Master, Slave mode spi->spiReg->SPI_CR1 |= (spi->spiConfig.masterMode << 2); //Set baud rate spi->spiReg->SPI_CR1 |= (spi->spiConfig.baudRate << 3); //MSB or LSB first spi->spiReg->SPI_CR1 |= (spi->spiConfig.isLSB << 7); //Data format spi->spiReg->SPI_CR1 |= (spi->spiConfig.dataFormat << 11); //Software Slave SSM and SSI bits //spi->
Hello All,I have received a PCB which is used in a battery pack that i am working on. Unfortunately the CM does not communicate any more and the last he told me was that they did not flash the devices. The PCB has basic functionalities like displaying battery power via LED lighting, charging battery and discharging and couple of WIFI, BT modules that are connected to the MCU - STM32G0B1CEU6N microcontroller (MCU) Upon looking at the schematic - the PCB has SWD and JTAG.I tried connecting the PCB via ST-LINK-V2 to STM32Programmer but the software does not detect at all.I checked the SWDIO, SWCLK, NRST, GND wiring (made sure they are all correct by checking continuity) gave VDD power input to the 3.3 V input on ST-LINK-V2 but no luck. What i would like to understand is that could this be an RDP issue? where RDP level 1 is blocked and i need to connect via JTAG to enter the MCU and be able to flash it?Thanks for the help..
Hi,I'm trying to program one custom board with STM32G0B1RET using original STLINK V3 and STLINK V2 without succes.My schematic is very simple as you can see on the image: And the response all time is: Not STM32 target found.. if I use SWD port. If I use JTAG the response is: ST-LINK error (DEV_UNKNOWN_MCU_TARGET)I've revised all the connections, voltages (both on the board and STLINK-V2), capacitors, lowered freq.,etc without success.Also I've tried with Hot plug, Hardware Reset, Power down, Under reset, etc. The log is like this:22:03:41 : ST-LINK SN : 0672FF48557085496709551722:03:41 : ST-LINK FW : V2J46M3222:03:41 : Board : NUCLEO-G0B1RE22:03:41 : Voltage : 0.02V22:03:41 : Error: Unable to get core ID22:03:41 : Error: ST-LINK error (DEV_UNKNOWN_MCU_TARGET)What can be the problem?I've 25 years designing electronics and is not my first board with STM32 devices (the previous one works perfectly) but I've finish all my arsenal of knowledge!Thanks.
I have designed an L476 into a simple controller (BMS) and am trying to use the opamp and ADC and comparators to read the current, and implement a hardware fast overcurrent protection.The opamp is working fine in PGA mode G16. I can see as I inject 20A across the current sensors, the stm pin goes up and down in voltage on my oscilloscope.The ADC is set up in scan mode, with 14 conversions, and the rest of the channels read fine; I am reading lots of thermistors and input/output voltages and such like.The opamp channel is simply returning noise between 475 and 493 counts irrespective of the current I inject (20A injected results in about 100mV shift in the opamp signal)I have replicated this on a very simple sketch: /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_ADC1_Init(); MX_OPAMP2_Init(); MX_TIM3_Init(); /* USER CODE BEGIN 2 */ HAL_OPAMP_Start(&hopamp2); HAL_ADCEx_Calibration_Start(&hadc1, ADC_SINGLE_ENDED); HAL_Delay(100); HAL_TIM_PWM_Start(&ht
Dear ST Support,I am using the Nucleo-H753ZI development board (MB1364, STM32H753ZIT6) and have a question regarding the use of pins PF11, PF12, PF13, and PF14 as ADC inputs.According to the UM2407 User Manual, these pins are stated as not usable for ADC input on this board. However, when reviewing the schematic (MB1364-H753ZI-C01), these pins appear to be free of any conflicting components or functions, and they are shown as connected to ADC-capable channels on the STM32H753ZIT6 (e.g., ADC1_INP2, ADC1_INP6, etc.).Could you please clarify the following:Are PF11–PF14 officially supported for ADC input on the Nucleo-H753ZI (MB1364)?If not, what is the reason for the restriction in UM2407 — is it due to silicon limitations, board layout, or other design constraints?Is there a specific board revision or condition under which these pins can be used safely as ADC inputs?I would appreciate your guidance, as I need to use as many ADC inputs as possible for my application, and these pins would
I'm trying to understand an issue I am having with chaining decryption, using the shared key out of the SAES and have distilled the problem to the following example:I am attempting to encrypt and decrypt large blocks of data (65536 bytes). I can encrypt and decrypt the entire block in one fell swoop with one call to Encrypt and one call to Decrypt. I can encrypt and decrypt the entire block in small chunks with repeated calls to Encrypt and Decrypt back to back (En, De, En, De, ...). However if I encrypt the entire block in chunks then decrypt the entire block in chunks (En, En, En, ... De, De De, ...), I get bad data as my decrypted text.I'm trying to understand what I am setting up incorrectly for the decrypted data to be bad. I'm using a STM32H7S78-DK board, although any STM32H7Sxxx could be used in this example. I am using a clean CRYP_SAES_SharedKey_Appli project. I have added the following code to the project. Any help on this problem would be greatly appreciated:uint8_t pla
I'm trying to program a virgin SYM32G0B1 with the code I've developed and successfully run on the NUCLEO-G0B1RE/NUG0B1RE$AU2 development board. I'm using the STM32CibeProgrammer 2.20.0 software and an FTDI cable (TTL-232RG-VIP-WE with the Vcc line connected to the 3.3 Vdc rail) connected to LPUART1 on port PC0/PC1. I have the BOOT0 signal (PA14) tied to ground.Having no success with my new hardware, I decided to try the development kit as a sanity check, so changed JP2 to use E5V and connected a 5-volt supply. The dev board runs just fine with that. I connected the FTDI cable to PC0/PC1 on CN10, and shorted PA14 on CN7 to ground. Unfortunately, I also cannot program that MCU. The programmer's log shows:16:41:26 : RTS low16:41:26 : DTR Low16:41:26 : Serial Port COM6 is successfully opened.16:41:26 : Port configuration: parity = even, baudrate = 115200, data-bit = 8, stop-bit = 1.0, flow-control = off16:41:30 : Timeout error occured while waiting for acknowledgement.16:41:30 : Error: Act
For some reason I am unable to connect to my custom STF32F405RGT6 board via SWD or JTAG.I originally had my board wired as this table below:ST-LINK/V2ST-LINK/V2My BoardMy BoardPin NumberConnector CN3MCU PinMCU Pin1Target VCC 2Target VCC VCC3TRST 4GND GND5TDIPA15TDI6GND GND7TMS_SWDIOPA13TMS8GND GND9TCK_SWCLKPA14TCK10GND GND11Not connected 12GND 13TDO_SWOPB3TDO14GND 15NRST7nRST16GND 17Not connected 18GND 19VDD 20GND This is from the ST-LinkV2 documentation Table 4: https://www.st.com/resource/en/user_manual/um1075-stlinkv2-incircuit-debuggerprogrammer-for-stm8-and-stm32-stmicroelectronics.pdfI have tried both SWD and JTAG with all possible reset methods through the CubeProgrammer and IDEDebug configuration:My schematics look like this: I have 3V3, 3V3A up and measured as 3.26V on my multimeter, and VCAP is at 1.2V.I tried both versions (hi
I am using an STM32G4 microcontroller with UCPD and the USBPD middleware. I was following this tutorial (same as AN5418 https://www.st.com/resource/en/application_note/dm00663511-how-to-build-a-simple-usbpd-sink-application-with-stm32cubemx-stmicroelectronics.pdf:(https://youtu.be/-vsJhNIaHxE?si=3wosMAMXrO40mVZrI, however, have a custom PCB without a TCPP chip, I'm not sure if this makes a difference. I set up everything according to the tutorial and I added the code it requires. Additionally, I added the following code to EvaluateSinkCapabilites: void USBPD_DPM_SNK_EvaluateCapabilities(uint8_t PortNum, uint32_t *PtrRequestData, USBPD_CORE_PDO_Type_TypeDef *PtrPowerObjectType) { /* USER CODE BEGIN USBPD_DPM_SNK_EvaluateCapabilities */ USBPD_SNKRDO_TypeDef rdo; rdo.d32 = 0; /* Prepare the requested pdo */ rdo.FixedVariableRDO.ObjectPosition = 1; rdo.FixedVariableRDO.OperatingCurrentIn10mAunits = 50; rdo.FixedVariableRDO.MaxOperatingCurrent10mAunits = 50; rdo.FixedVariableR
Hello, I just bought a Stlink-v3mods. I was wondering what's the pinout of the cn3 connector. I couldn't find anywhere on the documentation. Thanks.
Hello Folks I'm looking for suggestions / hints on what's the best way to troubleshoot a strange problem we're experiencing.We're running AzureRTOS/ThreadX + NetxDuo (Version 6.1.0) where we have a MQTT Client subscribing to a broker, waiting for a message and then reply back.As Phy, we're using LAN8742A. The problem we're experiencing is that while the application (based on pc) is flooding of messages the STM32F4 board, then it suddenly stuck somewhere on NetX side. The other part of application is correctly running, and in order to troubleshoot better the issue we're experiencing (which is highly replicable) we have: Increased the ip packet pool Increased the RX descriptors Disabled all the other task , just leave NetX ip instance and the task running the mqtt client(wait for message and then reply with a static message saying "Hello"). Force speed from 100MBit down to 10Mbit. None of the previous tries give us a clue on what's happening. The only thing we've noticed is that
Hello,We have ordered STM32G431VBT6 microcontrollers from different sources both online and local but while testing we were getting a voltage drop at source after isolating the whole PCB the issue was found to be localized to the microcontroller. After checking the supply and all the pins we found that the pin 14 that is the NRST pin of the microcontroller is showing a short with the VSS pins of the controller. Thus, after verifying the issue with another controller we got the NRST pin showing short with VSS pin on all controllers thus we ordered from different sources and found that all the controllers were showing the same behavior. We checked online on community forum and the documentation but found no solution. Is there an alternate way to operate with this controller and if not is there an issue with the controller itself
Hello,I am currently testing the MT25QL512ABB flash memory on an STM32H747I-DISCO board.The board has two of these flash chips, and I am attempting to operate them in dual mode.I am using the driver from the official STMicroelectronics repository available at this URL:https://github.com/STMicroelectronics/stm32-mt25ql512abbMy test code is designed to do the following:On the first boot, it writes data to a specific region of the flash.It then immediately reads back the data from that same region to verify that the write operation was successful.After a reboot, the code reads the same flash region again to ensure the data is still correct.The initial write and immediate read-back verification works perfectly. However, after I reboot the board, the subsequent read operation fails. The data read from the flash does not match the data that was originally written.I have already disabled all cache functions, so I don't believe this is a caching issue.I am looking for advice on what could be c
I am reposting this issue because, while debugging, I've determined that the root cause is related to the Erase operation, not the reboot, as I had initially thought in my previous post. Previous post: https://community.st.com/t5/stm32-mcus-products/stm32h7-qspi-flash-incorrect-data-after-reboot-initial-write/m-p/830635#M284116 Board: STM32H747I-DISCODevelopment Environment: STM32CubeIDE 1.19.0Library: https://github.com/STMicroelectronics/stm32-mt25ql512abb My code executes in the following sequence:1. Initialize QSPI and the MT25QL512ABB flash memory.2. Erase a 4K block starting from address 0x0.3. Write 256 bytes (aTxBuffer) to address 0x0.4. Read back the 256 bytes from address 0x0 into aRxBuffer.5. Compare aTxBuffer and aRxBuffer.6. Erase a next 4K block starting from address 0x1000 (4096).7. Read the 256 bytes from address 0x0 again into aRxBuffer.8. Compare aTxBuffer and aRxBuffer. My expectation is that the erase operation in step 6, which targets the 4K blo
Given that STM32WL product line seems to support Wi-Fi 802.11ah (HaLow) bandwidth and modulations. Would one be able to configure the radio to connect to such network?
After updating the i2c library to the latest version, I got a write error. After reverting the library to the previous version, the error went away and the location where the error was returned is:stm32f3xx_hal_i2c.c / I2C_IsErrorOccurred()Line 7255It looks like there's probably something wrong with the acknowledge polling process to know when the write cycle is finished. CubeMX V6.13.0MCU Package STM32F3 Series V1.11.5STM32F334K6TxI2C EEPROM: AT24C16D
I am writing a custom driver for the mt25ql512abb as the one on STM's github doesnt work for my STM32L412KB, I have gotten reading, writing and erasing working but when I try enter memory mapped mode DQ[0-3] on the flash just goes highHere is my function that im using, I am setting the XIP bit on the Volatile configuration register first (i have confirmed this is working) then I enter memory mapped mode, i have set the dummy cycles to 10 on the volatile and non-volatile configuration registers as well. uint8_t CSP_QSPI_EnableMemoryMappedMode(void) { QSPI_CommandTypeDef sCommand; QSPI_MemoryMappedTypeDef sMemMappedCfg; /* Enable Memory-Mapped mode-------------------------------------------------- */ sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE; sCommand.AddressSize = QSPI_ADDRESS_32_BITS; sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE; sCommand.DdrMode = QSPI_DDR_MODE_DISABLE; sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY; sCommand.SI
i am using nucleo-h563zi and want to communicate a W25N01GV is there any code avaible for communication for using external flash memory
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.