Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
Hi allFor some reason unknown to me, my PHYSEL bit in GUSBCFG is not setting, and I don't know why static inline void core_initialisation(void) //from page 3403 { // 1. Program OTG_GAHBCFG register: // - Enable global interrupt mask bit (GINTMSK) // - Enable Rx FIFO non-empty interrupt (RXFLVL) // - Set periodic Tx FIFO empty level (PTXFELVL) // Enable global interrupt (GINT) SET_BIT(USB_OTG_HS->GAHBCFG, USB_OTG_GAHBCFG_GINT); // Enable Rx FIFO non-empty interrupt mask SET_BIT(USB_OTG_HS->GAHBCFG, USB_OTG_GAHBCFG_PTXFELVL); // periodic Tx FIFO empty level // Note: RXFLVL interrupt is unmasked in GINTMSK, not GAHBCFG. // 2. Program OTG_GUSBCFG register: // - Set full-speed device mode (FDMOD) // - Select embedded PHY (PHYSEL) // - Set turnaround time (TRDT) MODIFY_REG(USB_OTG_HS->GUSBCFG, USB_OTG_GUSBCFG_FDMOD | USB_OTG_GUSBCFG_PHYSEL | USB_OTG_GUSBCFG_TRDT, USB_OTG_GUSBCFG_FDMOD | USB_OTG_GUSBCFG_PHYSEL | _VAL2FLD(USB_OTG_GUSBCFG_TRDT, 0x09) ); // 3. Un
Dear ST Community,I’m working on a power quality monitoring application and plan to use the ADE9430 for harmonic analysis. I understand that the ADE9430 evaluation board is designed to work with the STM32 NUCLEO-F413ZH, and I intend to use that same MCU.In my setup, I have 24 current transformers (CTs) and would like to perform real-time harmonic analysis on all 24 channels using the ADSW-PQ-CLS library (or an equivalent FFT approach).Given this:Is the STM32F413ZH powerful enough to process harmonic data for 24 channels concurrently or near-real-time?Would you recommend moving to a higher-performance STM32 (e.g., STM32H7 or STM32F7) for this task?Are there any reference designs or benchmarks available for high-channel-count harmonic calculations using STM32?I greatly appreciate any insights or recommendations on MCU suitability or system architecture.Maryam
I am working with the NUCLEO-WL55 board and trying to generate PWM on multiple pins.PWM output works fine on normal channels (e.g., TIM2 CH4 on PB11, TIM17 CH1 on PB9),but I cannot get any PWM signal on TIM1 CH3N (PB15). HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_3);HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4);HAL_TIM_PWM_Start(&htim17, TIM_CHANNEL_1); __HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_3, 200); //ledpin pb15 ch3n__HAL_TIM_SET_COMPARE(&htim2, TIM_CHANNEL_4, 300); //ledpin pb11 ch4__HAL_TIM_SET_COMPARE(&htim17, TIM_CHANNEL_1, 500); //ledpin pb9 ch1 Is there a specific configuration required to enable the complementary output (CH3N) on TIM1?Does CH3N require enabling the complementary outputs or any special polarity settings in CubeMX?Could this be a hardware limitation of the NUCLEO-WL55 board? Any guidance or working example for TIM1 CH3N (PB15) PWM would be appreciated.
Hello, I’m working on a project using the STM32H753 controller, and I have a NOR Flash connected via the FMC interface (BANK1 at address 0x60000000). My goal is to use this NOR Flash memory as a USB Mass Storage Device. I’ve attempted the following approaches: Tried formatting the NOR Flash directly from the host PC — this was unsuccessful. Used FATFS to format the NOR Flash and then connected it to the host PC. The PC detects the filesystem and displays the correct disk size, but I’m unable to create any files on the disk from the host. I’ve searched through the ST forums but couldn’t find any discussions related to using FMC-connected external memories as USB Mass Storage. My questions are: Is it possible to use external memory connected via FMC (like NOR Flash) as a USB Mass Storage device? Can a host PC reliably access and write to memories connected to FMC through USB? Are there any examples or reference projects demonstrating this functionality? Any guidance or suggestions would
Dear ST motor control experts: I am currently debugging a PMSM using MCSDK6.3.2, with the following components: MCU: STM32G473QET6, control board: B-G473E-ZEST1S, power board: STEVEL-LVLP01. However, the motor fails to start. Upon inspection, it was found that the issue is caused by the R3_GetMeasurements() function. After MCI_START == Mci[M1].DirectCommand, the PWM is initiated, and when sampling and saving data for current and voltage, many function addresses change. Specifically, in the function R3_GetMeasurements(), there is a line of code: PWMC_R3_Handle_t * pHandle = (PWMC_R3_Handle_t *)pHdl. Is there a problem here? Because performing a cast on a pointer may cause memory boundary errors. Is this the reason?I hope to receive a reply.Thanks!
Hello I have a nucleo wb05kz programmed with BLE_Power_Consumption example project (STM32Cube_FW_WB0_V1.1.0 package) and i want to measure the current consumption.Following the UM3343, I removed the JP1 and JP2 jumpers and connected my power supply (3.3V) to pin 2 of JP2. I placed a multimeter in series with the power supply to measure the current.The board seems to be working correctly (I can see the advertising using a second Nucleo as a P2P client), however, the current consumption is 2.3mA. There is certainly still something to be done on the hardware side, but I can't figure out what. Could you give me a suggestion?
HelloCan you teach me how to fix the build errors? Best Regards,Jerry
Hello everyone,I use a STM32G473VEH (TFBGA-100 package) and use it as USB PD sink:The device is bus poweredCC1 and DBCC1 are connected (same for CC2 and DBCC2) to provide dead battery functionality (provide 5.1 kOhm pull down on CC)USB C connector pins are directly connected to CC1/DBCC1 and CC2/DBCC2 (no special protection ic is used)When connecting the USB PD supply the CCx line is pulled down and after it is stable for 100ms - 125ms (depending on the power supply) the 5V are provided. When microcontroller is running, the UCPD is requesting 20V and this usually works.Here is a osci screenshot of a working negotiation (C3 is the Vbus voltage, C2 is the CC line voltage): BUT sometimes the negotation fails in the early stage. The USB PD source will not provide 5V.According to the standard the CC line must be stable for > 100ms. Right after connection the voltage falls from 3.3V to 1.65V (due to the Rp/Rd resistors). Then there is a further drop after ~60ms which will appear peri
Hi, I am working on STM32C071 I wrote code to jump to ST bootloader from my application. The code seems to work well, after jump to ST bootloader, I can connect to ST Bootloader by USB, using STM32CubeProgrammer. I can read flash data, option byte.... But if I do erase flash or change anything, STM32CubeProgrammer throws a failed message and exit STM bootloader mode. Below is my jump function: void (*SysMemBootJump)(void); void JumpToBootloader(void){ SysMemBootJump = (void (*)(void)) (*((uint32_t *) ((0x1FFF0000 + 4)))); /* Set the clock to the default state */ HAL_RCC_DeInit(); /* Disable Systick timer */ SysTick->CTRL = 0; SysTick->LOAD = 0; SysTick->VAL = 0; volatile uint32_t msp = *(__IO uint32_t*)(0x1FFF0000); __HAL_RCC_USB_CLK_DISABLE(); /* Disable all interrupts */ __disable_irq(); __set_MSP(msp); SysMemBootJump(); } Below is failed message: The error is "verify flash protection" but there is no flash pro
Any working sample code for stm32wle5cc in the examples?
According to Wikipedia The MODBUS uses the CRC-16-ANSI also known as CRC-16-IBM. The normal hexadecimal algebraic polynomial being 8005 and reversed A001Initial value: 65,535.Example of frame in hexadecimal: 01 04 02 FF FF B8 80(CRC-16-ANSI calculation for the 5 bytes from 01 to FF gives 80B8 which is transmitted least significant byte first).I found some code that does the CRC16 with lookup tables, and it provides the same answer. So I believe the Wiki example is correct. Reading the RM0394 Reference manual it appears it is a pretty simple peripheral. Only a few registers to set up. CRC->DR is the data register.You write to this register and it holds the result. the CRC->IDR is not clear what it is used for. Looks like 8-bit memory. The CRC->INIT has a reset value of FFFFFFFF which is the sme as what I need. The Only register that is not clear is the CRC->CR register. Bit 0 loads the CRC->INIT register value into the CRC->D
I am building a device using a STM32H523RET6 microcontroller on a custom board (self-powered, with VBUS detection). My eventual goal is to operate a USB-CDC interface between the board and a computer for telemetry, but since the only standalone USB example I could find in the STM32CubeH5 examples was HID, I am trying to get a HID interface working first. I do not want to use the RTOS for my device. I have attempted to adapt the code from this example, https://github.com/STMicroelectronics/STM32CubeH5/tree/main/Projects/NUCLEO-H563ZI/Applications/USBX/Ux_Device_HID_Standalone to the H523 device, but the program crashes in the function _ux_device_stack_tasks_run when the function ux_slave_dcd_function is called. As you can see from the stack trace, this is called from the USBX_Device_Process() function which is periodically called. I have been unable to find any detailed information or examples pertaining to USB on the H523 device, so any information or
Hi I just added the STM32 based boards in Arduino IDE, but I cannot find the NUCLEO-H7S3L8 listed.Is it supported? or am I missing something ?
hi iam having nucleoh755 board, in that when i try to flash target is not connecting and when not connecting to cube programmer also, it showing perform discovery using debug authentication. how to do it. please find the image for the error shown. and MCU power supply all are ok.regards,srinath
Dear all,We are currently working with STM32WB05KZ MCU and developing unit tests for our BLE application utilizing the Unity test framework.Specifically we are mocking scenarios such as, low-power mode pairing, and other related BLE functionalities enforcing real security measures.We would greatly appreciate any advice or examples the following:Mocking BLE SDK functions for STM32 (e.g., ble_gap_ ble_gatts_*) using Unity or any other unit test libraries that have been successfully implemented.Injecting mocks for the STM32CubeWB BLE stack (e.g., stubs for CI, advertising, pairing testing low-power in a CI environment—any patterns practices using Unity and mock frameworks.Any repositories or reference code for unit testing for STM32WB0 series.Thank you for support and guidance!
I need to do a 1024 point FFT on the STM32F446RE Eval Board. I try to integrate the CMSIS-DSP Libraries as mentioned in the forum and it creates errors only and I can't even run the program. I need to do a q15 FFT ,but it is not working. Help me to to integrate CMSIS DSP Library with the STM Cube IDE.This is a simple issue and some ones guidance can help me a lot.
I'm working on building an Ethernet infrastructure using LWIP on an STM32H7 series MCU for various purposes. In this setup, I want to avoid using malloc, and instead rely entirely on LWIP’s memory pool system for all memory allocations. Here's the configuration I’m planning to use:MEM_LIBC_MALLOC 0 // Don't use the standard malloc (i.e., disable mem_malloc from libc) MEMP_MEM_MALLOC 1 // Use mem_malloc for allocating MEMP pools MEM_USE_POOLS 1 // Redirect mem_malloc calls to the defined memory pools MEMP_USE_CUSTOM_POOLS 1 // Enable support for user-defined custom pools MEM_USE_POOLS_TRY_BIGGER_POOL 1 // Allow searching for a larger pool if neededIn lwippools.h, I’ll define custom pools with different sizes like this: LWIP_MALLOC_MEMPOOL_START LWIP_MALLOC_MEMPOOL(24, 128) LWIP_MALLOC_MEMPOOL(16, 256) LWIP_MALLOC_MEMPOOL(8, 512) LWIP_MALLOC_MEMPOOL(4, 1024) LWIP_MALLOC_MEMPOOL(4, 1536) LWIP_MALLOC_MEMPOOL_END For RX, I will use the following structure from STM's LWIP exam
Hi,I would like to confirm that STM32WL55 and STM32WLE5 are mutually HW compatible from the point of external circuitry? I.e. can we use either one in a PCB originaly designed for one of them w/o any modifications? (Yes, I checked both datasheets but better to be safe than botching ;))I know that "The STM32WL55 is a Dual core MCU (cortex-M4 and cortex-M0+) but the STM32WLE5 is using only one core (cortex-M4)." so there might be a difference from the FW perspecitve. Thank you
I have tried to measurement the current consumption in standby mode but it is too high. I am using the example "PWR_STANDBY_RTC" listed in AN5315, STM32Cube firmware examples for STM32G4 Series which should work in Nucleo Board G474RE. The values I obtained are in the range of 250 microampers which are quite far from the listed in the datasheet which are around 1.4 [microA]. To measure the current I use a X Nucleo LPM01A. Has anybody worked with that example and obtained the reported values from the datasheet?Does anybody know if it could be a kind of "bug" in the microcontroller?. Please read: https://community.st.com/t5/stm32-mcus-embedded-software/how-to-enter-standby-or-shutdown-mode-on-stm32/m-p/145849Following I attach some images.Thanks in advance!
hey @m.beddi , have you find the solution . i am struck at this too. edit : to reformulate the issue Issue description : I am trying to implement the MSC_Standalone example (USB device mode with SD card) on the STM32469 Discovery board using CubeMX (with USB OTG FS mode). USB initialization appears to work, but the SD card is not recognized or accessible. The program hangs with a timeout error in the SD card command response function SDMMC_GetCmdResp1(), indicating that SD card commands are not completing successfully. I suspect a timing or clock configuration issue, despite trusting CubeMX to handle this. uint32_t SDMMC_GetCmdResp1(SDIO_TypeDef *SDIOx, uint8_t SD_CMD, uint32_t Timeout) { uint32_t response_r1; uint32_t sta_reg; uint32_t count = Timeout * (SystemCoreClock / 8U / 1000U); do { if (count-- == 0U) { return SDMMC_ERROR_TIMEOUT; } sta_reg = SDIOx->STA; } while (((sta_reg & (SDIO_FLAG_CCRCFAIL | SD
I use NUCLEO-H7S3L8 to evaluate our new solution. I want to use GPIO port P to control a few external components.I add some test code into NUCLEO-H7S3L8\Examples\GPIO\GPIO_IOTggle project, like the below snapped code:__HAL_RCC_GPIOP_CLK_ENABLE(); GPIO_InitStruct.Pin = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(GPIOP, &GPIO_InitStruct); HAL_GPIO_WritePin(GPIOP, GPIO_PIN_0, GPIO_PIN_SET); HAL_GPIO_WritePin(GPIOP, GPIO_PIN_1, GPIO_PIN_SET); HAL_GPIO_WritePin(GPIOP, GPIO_PIN_2, GPIO_PIN_SET); HAL_GPIO_WritePin(GPIOP, GPIO_PIN_3, GPIO_PIN_SET);After executed the above code, I halted the core and measured voltage of these pins with a multi-meter.These pins keep LOW voltage.Does it need an additional configuration when we want to use GPIO port M to P in STM32H7RS?Code formatting applied - please see How to insert source code for future ref
I am experimenting with a STM32G431 dev board (breadboard friendly) but eventually the project will use a STM32H723 mcu.I am generating PWM and PWMN signals with dead time using timer 15. I need to generate additional signals based on these two and I would like to configure interrupts on the PWM and PWMN rising and falling edges. I could short the PWM and PWMN pins to adjacent pins and configure those as EXTI inputs. However, in a reply to another thread user @TDK said it is possible to configure a pin as both PWM and EXTI input and thus generate interrupts directly from the PWM signal. This seems like a much better solution but unfortunately I haven't been able to figure out how to do it. In STM32CubeMX if I configure a pin for PWM, then try to configure the same pin as EXTI, the PWM is disabled and the pin is configured just for EXTI. And vice-versa.Is it possible to do what I want? If so, how should I go about it?Thankspaul
Moved from this discussion as it's linked to the embedded software USB and FreeRTOS. My problem has always been that when USB and USART1 are working at the same time, USB as a virtual serial port is not working properly. In my code, two different threads were opened to test, one thread for usart1 and the other thread for the USB virtual serial port. Don't know what's wrong with this?
Hi STM community,We are using the microchip KSZ8091RNA Ethernet transceiver chip with the STM32F207 controller. We have a working firmware that we tested with LAN8740A transceiver chip. Now, in our new design we have used KSZ8091RNA. The issue is1) Link status is always down in register 0x01.2) The pins TXP, TXN, RXP and RXN are not generating expected signals. TXP and TXN are generating the same signals, RXP and RXN are generating same signals. However, TX and RX pins generate differential signals. We are using STM32CubeIDE 1.18.1 and Code configurator STM32CubeMx v6.14.1We have attached oscilloscope screen shots for reference. We have attached driver schematics and layout for your reference. Kindly, help us to resolve this issue.
We are developing with the STM32WLE5JC6, everything works, but now we are trying to reduce current consumption. When using the "End node skeleton", it seems to work, however, we are trying to define our own skeleton, because we neither want the ADC nor the trace system for production.I know that the problem is related to the sequencer, because is entering in the low power mode (through the `UTIL_SEQ_Idle`) before the retransmission has finished, so it just does nothing, I guess that the same happens when a TX is done. Most of the code is a copy-paste from the end node skeleton.I suspect that we need to disable the stop mode while it is joining with the `UTIL_LPM_SetStopMode`, however, I do not know where the code should be placed; in the end node skeleton, it is disabled during the vcom transmission, so it is not very clear that it is actually this the problem, is it?Relevant function implementations are found below.The IDLE definition:/* /Core/Src/sys_app.c */ void UTIL_SEQ_Idle(void)
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.