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 currently working on a UART communication protocol using STM32 USART in multiprocessor mode (MME / Address Mark) over RS485. My goal is to receive variable-length data frames only when the address matches, and use DMA + IDLE interrupt to detect the end of each frame.:wrench:Frame format:- First byte: 9-bit address word (MSB = 1)- Followed by N data words (9-bit, MSB = 0):white_heavy_check_mark:Setup:- USART configured in 9-bit data mode (no parity)- MME (multiprocessor mode) enabled- Address match set via ADD[7:0]- DMA reception via `HAL_UARTEx_ReceiveToIdle_DMA(...)`- `__HAL_UART_ENABLE_IT(&huart, UART_IT_IDLE)` enabled- IDLE handling expected in `HAL_UARTEx_RxEventCallback()`:cross_mark:Issue:- When MME is **disabled**, IDLE interrupt works correctly, and the RxEventCallback is triggered on frame end.- When MME is **enabled**, the USART correctly detects the address and wakes up from mute mode, and DMA begins receiving data.- But **IDLE interrupt never triggers
I am verifying USB implementation using Nucleo-H7S3L8.When I executed CDC_Standalone in STM32CubeH7RS using the Debug button and ran the Appli code, the function “HAL_PWREx_EnableUSBVoltageDetector()” in ‘MX_USBPD_Init()’ did not return HAL_OK and an error occurred.Within this function, the “USB regulator ready flag (PWR_CSR2_USB33RDY)” is not set, causing a timeout and resulting in a HAL_ERROR.However, when I stop debugging, disconnect the USB cable, and reconnect it, the COM port appears in the Windows Device Manager.I have not made any changes to the contents of CDC_Standalone.The jumper on JP3 on the board has been changed from STLINK to UCPD.What should I do to properly debug USB on this board?
I'm getting bad overshoot and undershoot spikes on an SD card interface. The spikes are so bad that 1/300 large (2MB) file writes fails, and it's damaging the SD cards so that a card that has been subjected to these spikes will continue to fail after it is moved to a good board. I can knock down the spikes by adding a 33-51 ohm series resistors to the data, clk and cmd lines. With 51 ohms I have done over 50,000 large file writes without errors as long as I use a virgin SD card that hasn't been subjected to the spikes.The boards have traces equalized for length, and one version uses 8 mil wide traces, the other uses 12 mils. Both have overshoots. One of my boards has long 4.5" traces to the card. But I'm also seeing spikes on a shorter version with only 3.2" traces to the card. There are lots of example SDIO schematics online but only 1/10 show series resistors. Application note AN5200 on SDMMC does not mention resistors.When I watch the data lines on a scope, an initial burst of
Previously had issues with TXP flag never clearing for interrupt-driven SPI. Changed some HAL code and got it to work.Moving on the DMA, the first 8 bytes received match the transmit buffer and the 9th byte matches a byte farther into the transmit buffer.I suspect that the entire DMA buffer is transmitted at the start filling the transmit FIFO and bytes are dropped until the FIFO gains an empty slot and data can once again enter the FIFO. This seems consistent with the TXP flag not properly clearing when the transmit FIFO is full. Can anyone tell me what makes the TXP flag not operate?
Hi, I'm trying to compile an STM32U599VJTX build containing the X-CUBE-NFC6 software pack to talk to an ST25R3916B on our prototype board but cannot get it to compile. I get the following errors related to "rfal" files: I believe the platform settings are ok: Any help on the errors would be greatly appreciated. STM32CubeIDE version 1.18.1 STM32CubeMX version 6.14.1 STM32Cube MCU Package for STM32U5 Series 1.7.0 X-CUBE-NFC6 version 3.1.0
I'm seeing "noise" in some objects drawn on the screen. See pic... the yellow circle ("shape") should be solid yellow, but instead includes red-orange horizontal lines. If the circles are rearranged the yellow circle can look correct, but the blue circle may have the lines instead - only lighter blue, not red-orange. Also, the button can include some horizontal lines when showing the "pressed" version. These lines can flicker a bit too.. possibly turning on and off very quickly. What is causing this and what can be done to fix it? There was some improvement when setting the Alpha to 255 (from 127) but problem still exists.Screen is running at RGB565 - don't have enough RAM to run at RGB888. STM32H7a3. No RTOS. Interface is LTDC with DMA2D enabled (but I did try disabling DMA2D). Single layer... what else do you need to know?? Thanks!!
I am looking for a memory map for the stm32wl5moc. I thought I found one before but cannot find it again. It is not in the datasheet. Any suggestions? Thank you.
I have done a PCB Design with microcontroller STM32L071CZT6 as the mcu. PB15 which is a 5V tolerant pin is connected to a source of 4.9 V with a resistor 270 kOhm in between. I measured the voltage at the PB15 pin to be 4.9 V but, when I set it as Digital Input pin with no pull it does not read HIGH. But, I remember the previous batch of boards with the same design had this pin read HIGH by the same firmware.
Hello, I am trying to write some non-blocking motor driver code for a STM32F401Re board. Currently, I am setting the timers to PWM mode and adjusting the ARR to change the PWM frequency using an IRQ handler. This approach is working for TIM3 output, but TIM2 seems to stop outputting after one iteration of the while loop. I've been through the registers and it looks like the CC1IF isn't always being set for TIM2 and I'm not sure why. By adjusting the ARR, shouldn't both timers roll-over after hitting their new max value? I've attached the main file and the A4988 driver file I'm writing. For the A4988 file, the methods in question are A4988_run() and A4988_IRQ_Handler(). Thanks!
I have a STM32H73G-DK developement kit and I want to interface a custom 7" touchscreen/display with it using TouchGFX to create a basic menu structure. I was able to get the display to show static images by following the guide in these youtube videos (from STMicro):https://youtu.be/yiHjOH7zJP0https://youtu.be/XnSg3UJfSFcFollowing these videos I was able to get a static image to display perfectly however I also need to get the touchscreen functionality to work as well. The development kit comes with a smaller display that uses the FT5336 touchscreen controller but my display uses the GT911. One of the steps in the first video is the comment out the touch screen "sampleTouch" code in STM32TouchController.cpp and type in "return true;" as the only code to execute there. This effectively disables the touchscreen functionality, and if you don't do it the whole project will fail and you get gibberish on the screen. Since my screen uses the GT911 I searched for d
Hi,I'm working on a USB Mass Storage Class (MSC) application using the STM32U5 series. I have a working firmware that correctly enumerates as a USB MSC device on STM32U5G9J-DK2 - Windows detects it and loads the built-in USBSTOR.SYS driver as expected. The configurations I've used are similar to the DFU example provided for the same board on STMCube IDE.However, when I flash the code with similar configurations to the STM32U5G9J-DK1, it fails to enumerate properly. In Windows Device Manager, I get: Windows has stopped this device because it has reported problems. (Code 43) The USB device returned an invalid USB device descriptor.How can I fix this?
Hi,I'm currently debugging what I think to be a code issue. I have a custom board with all peripherals physically disconnected and a NUCLEO-U575ZI-Q dev kit. The lowest current I see is about 250uA on both setups, with a sawtooth charge/discharge waveform from what I think is the internal switching regulator (consistent when using other stop mode functions). I've implemented a few examples for entering stop mode, and review any application notes I could find for how to handle it. Stop1 and Stop2 both yield current in the ~200uA range, and Stop3 yields about 35uA. The only way I have found to decrease the current the most were changing the "PWR_CR1_LPMS_X" parameters in the HAL_PWREx_EnterSTOP1Mode function:Original: MODIFY_REG(PWR->CR1, PWR_CR1_LPMS, PWR_CR1_LPMS_0);New 1: MODIFY_REG(PWR->CR1, PWR_CR1_LPMS, PWR_CR1_LPMS_1); -> Gave me <200uA on my custom boardNew 2: MODIFY_REG(PWR->CR1, PWR_CR1_LPMS, PWR_CR1_LPMS_2); -> Gave me 90uA on my custom boardChangin
Hello,we previously used the STM32U5G9J-DK2 discovery kit with FreeRTOS and TouchGFX (with hardware-accelerated Vector Font Rendering, etc) successfully.Now we are trying to bring up a custom STM32U5G7VJ based board. We first created the ioc File with CubeMX, configured all the pins and later on enabled FreeRTOS and TouchGFX middlewares. As far as possible, the settings from the discovery board were replicated (except we now use RGB888 instead of RGB565 and a few different LTDC and OCTOSPI settings)After opening the project template in the TouchGFX editor, a hello world screen was added.However, when building in STM32CubeIDE, the following error occurs in TouchGFX/target/generated/HardwareMJPEGDecoder.cpp: fatal error: jpeg_utils.h: No such file or directoryWhen I compared the HardwareMJPEGDecoder.cpp file between the discovery kit project and our own, I noticed it's different: The one from the discovery kit is around 5 KB larger and it has no #include <jpeg_util
Hello everyone,I'm facing a HardFault issue when jumping from a bootloader to an application on the STM32L476RG.The fault occurs right at the beginning of the application, specifically at the instruction bl __libc_init_array inside the Reset_Handler (from startup_stm32l476xx.s).Memory layout:Bootloader: starts at 0x08000000, size: 12 kBApplication: starts at 0x08004000, max size: 150 kB (currently using ~95%)RAM usage: around 30%Bootloader jump sequence:typedef void (*p_function)(void);static void app_start(boot_t *self) {HAL_DeInit();self->boot.address = *(volatile uint32_t *)(self->address.app + 4);self->boot.jump_to_app = (p_function) self->boot.address;__set_MSP(*(volatile uint32_t *) self->address.app);SCB->VTOR = self->address.app;self->boot.jump_to_app();}Here, self->address.app = 0x08004000.The bootloader reads the application’s initial stack pointer and reset vector from 0x08004000 and 0x08004004, respectively, and then jumps to the reset handler of
Hello,I will need some help to determine if STM32H735G-DK STMOD+ connector Pin 4 SCK/RTS can be configured as a GPIO pin. Not sure which port is mapped to this pin as I will need to control this pin as a GPIO.Thanks.
Hi all,currently iam using the stm32h757 controller.i want to use the FMC on both cores, in SRAM mode with this config: hsram1.Instance = FMC_NORSRAM_DEVICE; hsram1.Extended = FMC_NORSRAM_EXTENDED_DEVICE; /* hsram1.Init */ hsram1.Init.NSBank = FMC_NORSRAM_BANK1; hsram1.Init.DataAddressMux = FMC_DATA_ADDRESS_MUX_DISABLE; hsram1.Init.MemoryType = FMC_MEMORY_TYPE_SRAM; hsram1.Init.MemoryDataWidth = FMC_NORSRAM_MEM_BUS_WIDTH_16; hsram1.Init.BurstAccessMode = FMC_BURST_ACCESS_MODE_DISABLE; hsram1.Init.WaitSignalPolarity = FMC_WAIT_SIGNAL_POLARITY_LOW; hsram1.Init.WaitSignalActive = FMC_WAIT_TIMING_BEFORE_WS; hsram1.Init.WriteOperation = FMC_WRITE_OPERATION_ENABLE; hsram1.Init.WaitSignal = FMC_WAIT_SIGNAL_DISABLE; hsram1.Init.ExtendedMode = FMC_EXTENDED_MODE_DISABLE; hsram1.Init.AsynchronousWait = FMC_ASYNCHRONOUS_WAIT_DISABLE; hsram1.Init.WriteBurst = FMC_WRITE_BURST_DISABLE; hsram1.Init.ContinuousClock = FMC_CONTINUOUS_CLOCK_SYNC_ONLY; hsram1.Init.WriteFifo = FMC_WRITE_FIFO
Board: stm32h753zi nucleoFirmware & CubeMX: latest versionI have configured the adc to continous conversion and DMA output. The initialization fails in main.c in HAL_ADC_INIT. I stepped through the HAL lib and saw that LL_ADC_IsInternalRegulatorEnabled returns the HAL_ERROR.The docstring of this function says /* Verification that ADC voltage regulator is correctly enabled, whether */ /* or not ADC is coming from state reset (if any potential problem of */ /* clocking, voltage regulator would not be enabled). */ if (LL_ADC_IsInternalRegulatorEnabled(hadc->Instance) == 0UL)I do not find any documents online which describe how the clock frequency of the adc should be set up. Could you please give me a hint.
I am looking into making an Avatar widget (image inside a non rectangular container).I looked at some of the the lcd.blitcopy, canvas, circles and painters and getting a bit confused where you could apply a mask to an image to only render a section of it.I am sure this would be a great addition to the shared widget.Right now, I am looking into circles and their painters to figure out the paint() and drawn() operations.
im using STM32H753VIT6 MCU.I'm try to connect device using SWD in STLINK debugger but it will show "Error: Unable to get core ID" this Msgim checked MCU input voltage,im getting 3.3v .input power is oknow how can i debug this issue.SWD pins properly connected Vcc,Swclk,Swdio,Gnd into stlink debugger but why im getting this msg,kindly clarify
I have a brand new Nucleo G474RE board. I see that the default HSE is X3 at 24MHz. The solder bridges and capacitors are OK as per the board documentation, and checked to be physically on the board.But I cannot get HSE to oscilate. The (autogenerated) clock config code times out hereHAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) [...] /* Set the new HSE configuration ---------------------------------------*/ __HAL_RCC_HSE_CONFIG(RCC_OscInitStruct->HSEState); /* Check the HSE State */ if (RCC_OscInitStruct->HSEState != RCC_HSE_OFF) { /* Get Start Tick*/ tickstart = HAL_GetTick(); /* Wait till HSE is ready */ while (READ_BIT(RCC->CR, RCC_CR_HSERDY) == 0U) { if ((HAL_GetTick() - tickstart) > HSE_TIMEOUT_VALUE) { return HAL_TIMEOUT; <--- I end up HERE } } }I also probed pin 5 PF0 and pin 6 PF1 with an osciloscope with a 10X probe and they have no signal (both at 0VDC).My MX configuration regarding the clocks is as follows:
STM32L071CBT6 GPIO PB15 Input Not Responding to 5V Signal from Buck ConverterHello everyone,I'm using the STM32L071CBT6 microcontroller and facing an issue with reading a digital input on GPIO pin PB15.What I'm Trying to Do:I’m using a buck converter with a 5V output to indicate the power status. The 5V output from the buck converter is connected to PB15, which is configured as a digital input on the STM32. Setup:Buck converter 5V output = GPIO PB15Measured with multimeter: PB15 shows 5V when buck converter is ONPB15 is configured in firmware as an input pin (floating or pull-down)Problem:Although PB15 is reading 5V on the pin when measured, the firmware logic that depends on PB15 being HIGH doesn't work. What I’ve Checked:The GPIO pin is correctly configured as inputMeasured 5V directly at PB15Tried enabling internal pull-down or external pull-down resistorNo response or logic change in the code when the 5V signal is appliedWhy does PB15 show 5V physically (confirmed v
Hi, I was trying to test the feature of "Level 2 flash lock" on my custom board. I'm having an unexpected behaviour.My total application consists of a bootloader responsable to load an application via CAN BUS through a custom communication protocol.Now, If I load my application program via CAN (via bootloader), the MCU can not set itself to level2 but remains set to level 1. If I transfer the same application with JTAG, the MCU can set itself to level 2 protection and any attempt to connect to it is correctly disabled. (in level 1 I can still connect by erasing the whole chip content). To give further informations, here is the code responsable to set level 2 protection implemented:FM_ClearFlags(); FM_Unlock(); flashSts = FM_CheckProtectionStatus(); if(flashSts == FM_FLASH_NOT_PROTECTED) // check current protection status { FM_SetOBConfig(); flashSts = FM_CheckProtectionStatus(); } FM_Lock(); void FM_ClearFlags(void) { FLASH->SR |= 0xE0; // clear the errors RDERR P
We are working with a board featuring the STM32L452 microcontroller, configured for ADC readings. On my old board with the same MCU, the Vref (reference voltage for ADC) measures 3.3 V even without flashing any code, which is as expected. However, in the new hardware, Vref is only 0.3 V. The design is identical between both boards.Could anyone please help me understand why this voltage difference is occurring? What steps should I take to diagnose and resolve this issue?
Using a NUCLEO-G491RE and X-NUCLEO-IHM07M1 motor driver, I am trying to implement a Six-Step Commutation BLDC algorithm in a way that i can understand it myself. While researching , i found out that the TIM2 pins can be used simultaneously as Hall sensor triggers. In a way to understand how the interrupt will work, i implemented a very simple counter where the rising edge trigger of a 1kHz pwm signal is checked for trigger. However, i observed that, the polarity selection does not matter and the callback function triggers on both rising and falling edges of a signal. I am sure of this as i also tried with connecting a hall sensor to the pins. In addition, while keeping the other settings the same, i tried the same thing with a configuration where only Channel 1 is selected as Direct Input Compare and observed an expected result. Below are the codes: Callback Function: void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim) { if (htim->Instance == TIM2) { hall_rese
Hello,I read the UID from STM32L031K6P6 and each device returns the same result: 0x14473332, 0x38363437, 0x0.I read the value from the address given in RM0377 (0x1FF8 0050).Is the address given in RM0377 correct?I am attaching screen shots from CubeProgrammer.
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.