Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
We noticed that the Overcurrent warning appears even when Overcurrent Protection is disabled. Could this be related to the missing feedback capacitors C38 and C42 on the OPAMPs for current sensing? Thank you for your support.Best regardsPelino
Hello,I am trying to communicate with an SDI-12 sensor through my custom STM32L4 pcb. The communication that I am trying to achieve is from a 3.3V microcontroller. Thus, I used the SN74LVC1G240DBVT buffer to convert my UART to SDI-12 data one wire, and also I had a MOSFET which converts my 3.3V of the pin to 5V (I have checked that the hardware wiring and voltages working as expected). For my UART protocol, I have this configurations: static void MX_UART5_Init(void) { /* USER CODE BEGIN UART5_Init 0 */ /* USER CODE END UART5_Init 0 */ /* USER CODE BEGIN UART5_Init 1 */ /* USER CODE END UART5_Init 1 */ huart5.Instance = UART5; huart5.Init.BaudRate = 1200; huart5.Init.WordLength = UART_WORDLENGTH_8B; // Including parity huart5.Init.StopBits = UART_STOPBITS_1; huart5.Init.Parity = UART_PARITY_EVEN; huart5.Init.Mode = UART_MODE_TX_RX; huart5.Init.HwFlowCtl = UART_HWCONTROL_NONE; huart5.Init.OverSampling = UART_OVERSAMPLING_16; huart5.Init.OneBitSampling = UART_ONE_BIT
There have been a few posts on this forum with the same issue, but it seems the root cause is different to this post or (probably) this one.I am using an Stm32f446re Nucleo, and trying to output a waveform from dac2 using dma and tim6. What I have tried so far: Trigger is set to Timer 6 Trigger Out event. DMA is configured in Circular Mode. I'm calling HAL_DAC_Start_DMA(...) Tried changing the data width to half word and word, neither worked. Callback functions are correctly named and defined in main.c: void HAL_DAC_ConvCpltCallbackCh2(DAC_HandleTypeDef *hdac) { HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_8); } void HAL_DAC_ConvHalfCpltCallbackCh2(DAC_HandleTypeDef *hdac) { HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, 1); } I want to be able to set a flag variable to start processing the next buffer. I will paste the rest of my code, it includes a (buggy) sine wave table but I can fix that once the callbacks are handled properly. It is just something to sen
Hi there ! here i'm for another question, are a day i'm go crazy with the SPI interface . I try to comunicate with MC33HB2000EX 10 A H-bridge, SPI programmable brushed DC motor driver. The datasheet write that: So i configure my SPI : and when i send data with uint16_t spiData=0x2000;uint16_t spiRxData = 0x0000; i reset the CS pin HAL_SPI_TransmitReceive_IT(&hspi1,(uint8_t*)&spiData,(uint8_t*)&spiRxData,1); i wait the callback function and i set the CS pin no one data come out from MISO and i put on my analaizer and i don't understand why the clock start to logic high and no from logic low i don't know if is the real problem I hope someone can help me Thank you Sergio
Environment:STM32F407VGTX USB HID mouse, Full SpeedProblem:Hi, I’m using a STM32F407VGTX board. I send a USB remote wakeup signal to the host and then try to receive a resume signal from the host. The STM32 board can wake up the host (bringing it to the login screen), but it cannot trigger the USB_OTG_GINTSTS_WKUINT interrupt. I have already configured my STM32 board as a HID mouse. However, if I use a real mouse instead, it can wake up the host and successfully trigger the USB_OTG_GINTSTS_WKUINT interrupt. Is there any suggestion or workaround for this problem? void usb_remote_wakeup() { if (hUsbDeviceFS.dev_remote_wakeup == 1) { __HAL_PCD_UNGATE_PHYCLOCK(&hpcd_USB_OTG_FS); HAL_PCD_ActivateRemoteWakeup(&hpcd_USB_OTG_FS); HAL_Delay(5); HAL_PCD_DeActivateRemoteWakeup(&hpcd_USB_OTG_FS); } }
I'm using Seeed Studio's Wio E5 board, LoRaWAN 1.0.3 and the repository Seeed Studio Wio E5 LoRa as the base of my source code. I want my device to force a rejoin only when NVM context is not restored (e.g., after a reset or memory clear), and to resume using the previous session if the NVM context is successfully restored. I have already set LORAWAN_FORCE_REJOIN_AT_BOOT to false and CONTEXT_MANAGEMENT_ENABLED to true, and I noticed that even if NVM data is restored successfuly the device rejoins (which is wrong).
Hi everyone, I’m working on an audio project with an STM32H743ZIT6 and a MEMS microphone (MP34DT05-A). Audio is captured via DFSDM + DMA, and the DMA callback (HAL_DFSDM_FilterRegConvCpltCallback) fires reliably with fresh PCM audio samples. At the moment, I am transferring the audio data to the USB Audio IN endpoint directly inside the DFSDM callback using: USBD_LL_Transmit(pdev, AUDIO_IN_EP, buffer, packet_size); To avoid overlapping transmissions, I set a busy flag until the DataIn callback (from the USB stack) fires. Only then do I allow the next USB packet to be sent. This works in the sense that nothing crashes, but the actual audio stream never “starts” on the PC (e.g., in Audacity the recording stays silent and no data seems to flow).So now I am unsure whether my current design is fundamentally flawed. What is the correct way to link DFSDM audio → USB IN endpoint? Is it recommended to send directly from the DFSDM callback (as I do now) or push the data int
Hello everyone, I would like to ask if it is possible (and if so, how) to make both m4 and m7 get an interrupt made by the user button in in the nucleo board, since the only Pin Context Assignment options on CubeMX is either m4 or m7. Do I have to do it "manually" by writing the code to register the interrupt on the other mcu? Thanks in advance!
Hello,I am trying to figure out how to configure internal voltage monitoring use the internal tamper detection to clear the RTC when an undervoltage condition occurs. My understanding is that you have to enable the backup regulator and enable monitoring like this.SET_BIT (PWR->CR1, PWR_CR1_DBP); HAL_PWREx_EnableBkUpReg(); HAL_PWREx_EnableMonitoring();But how do I set up the tamper detection. There appears to be an inconsistency between the RM and the SFR view of the RTC registers in CubeIDE. The register at offset 0x40 in the RM is called RTC_TAFCR (pg. 1980) while in CubeIDE it is called RTC_TAMPCR and they have differnt bit definitions. Which of these is correct (thye can't both be)? I believe the internal detection is included in Tamper 3, but how do I configure that.Without working tamper detection the data is preserved in the RTC at least down to 0.4V but it stops getting updated at a much higher voltage, resulting in losing time when the device is powered on again, but no way
Hi,i am working on STM32cubeIDE for STM32G071RB nucleo-64 dev board with windows 11.i have a ST-LINK/V2-1 programming and debugging tool is integrated into the Nucleo as shown below image.To power the board, I connect the STM32 Nucleo-64 board to my laptop with a USB Type-A to Micro-B cable through the USB connector (CN2). As a result, the PWR green LED (LD3) lights up and the COM LED (LD1) blinks.I checked the jumper position on the board, STLK (CN4) on [1-2], [3-4], PWR (JP2) on [1-2], IDD (JP3) ON.I installed stsw-link0009 USB driver for ST-Link/V2-1 to make this connection successful.But, still No ST-Link is visible in Device manager, image is attached below. kindly support me to fix this issue and looking forward for your response.ThanksBest RegardsSachin chhaleria
Hi, I want to get synchronized samples from 4 microphones connected via I2S2 and I2S3. First I set one as master and other as slave and just connect Clock and Word Select, but I have only 0 values on slave interface. Is it possible to do it this way? Or there is another better one? I am using STM32H533
Hi all.I'm working on a project where my MCU (STM32H755) communicate with a device via UART at 921600 Bauds.Here some details about the environment:The device sends constantly, each second, a log at 921600 Bauds. The MCU sends at same speed some commands to the device, the device will answer after that the command is executed and continue to sends out log. There isn't any synchronization mechanism for communication (no clock signal or CTS/RTS is used), plus, there isn't any difference or special character that will allow me to differentiate between command answer and log, so I must take everything I receive in a window of time and parse it at upper level (not relevant for this question), and, finally, to manage the communication I tried with FIFO enabled and disabled (but result seems to not change)What I do to manage the communication is the following:1a: Flush Read data register (but is this sufficient in case of FIFO enabled?)2a: Enable DMA via HAL_UART_RECEIVE_DMA API3a: Enabl
Hi all,I am using STM32G030F6P6 and trying to read ADC channel 11 and channel 16 using DMA.ADC works correctly in polling and interrupt mode.When I enable DMA, the ADC values in the buffer remain 0 all the time.DMA does not trigger at EOC, and DMA transfer never happens.I have been trying for 1 week, and I cannot understand what is wrong.What I have done:Configured ADC correctly (calibration, sequence, sampling time, etc.)Configured DMA correctly (channel, source/destination, size, circular mode)Enabled ADC DMA request (DMAEN)Enabled DMAMUX (for STM32G0 series)But still no data is transferred and buffer remains 0. #include "stm32g030xx.h" #include "gpio.h" volatile uint32_t adc_value[2] = {0},adc_buff = 0, adc_index = 0; void delay_ms(uint32_t ms) { SysTick->LOAD = 64000 - 1; // 64MHz ? 1ms SysTick->VAL = 0; SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk; for(uint32_t i = 0; i < ms; i++) { while(!(SysTick->CTRL & SysTick_CTRL_COUN
HiI'd like to do a memory-to-memory transfer, where I take a 8x12 px rectangle and copy it into a framebuffer. My display is 256x64px and it uses a grayscale 4 bpp format. My framebuffer size is 8192 bytes, and the rectangle that I need to copy is 48 bytes big. I'm confused whether I should use L4 or L8 because L8 seems more straightforward for my byte ordered graphics.I set my screen byte width to 128, and I used L8. My output image looks garbage, as if the alignment was off (bad stride maybe). What is suspicious is that the garbage image is 4 lines tall, which could mean that the stride is calculated with 2 bytes instead of 1. Based on the RM0468 I think in no PFC mode it only uses the foreground and if I use L8 as hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_L8; (which btw. couldn't be set with CubeMX) it could increment the address correctly. In addition, if I'm copying a 256x64px image to the frame buffer, it is working properly. void write_framebuffer(
Hello Everyone, I’m having trouble understanding how to get the STSW-WMBUS-GUI (GUI for wireless M-Bus stack evaluation of ST Sub-1GHz devices) to work with the STEVAL-FKI868V2 mounted on a NUCLEO-L053R8? https://www.st.com/en/embedded-software/stsw-wmbus-gui.html Does anyone have or know the details to get this to work?Thank you.
Im trying to drive 3.5 inch TFT LCD with STM32H743 using FMC. My setup is : ChipSelect: NE1 Memory Type: LCD Interface LCD Register Select: A18 Data: 8 Bits My timing settings are (FMC Clock: 10Mhz): Address setup time in FMC clock: 3 Data setup time in FMC clock: 2 Bus Turn around time in FMC clock: 2 Here are the parts of code: #define FMC_BASE ((uint32_t)0x60000000) #define LCD_CMD (*((volatile uint32_t *)(FMC_BASE))) #define LCD_DATA (*((volatile uint32_t *)(FMC_BASE | (1 << 18)))) When I try to write a data, as shown in the attachment, my logic analyzer shows me multiple WR event occured and shows some weird signals on data line (D0-D3). I do not understand where I did wrong...
Attempting to blink an LED using output compare function of a timer, but I've not been able to get signal or toggling to happen on the pin.I'm using TIM5 channel 3, because I'm planning on using SPI1 eventually (I need to use a clock source separate from SPI1, which is on APB2) and the TIM5 associated alternate function GPIO on PA2 is in a convenient location.Meter on the pin indicates a floating pin signal (not going high or low), and LED visually indicates same (no dim light or other visual indication of rapid toggling).The pin itself is fine as normal GPIO: setting same pin as GPIO (not alternate function for TIM5), I'm able to blink "manually" via software. It seems to just be using that pin as TIM5 that causes problems.Here's the CubeMX setup:My understanding from the datasheet is that TIM5 is on APB1:APB1 timer clocks set to 10.5MHz:...so TIM_CLK/CKD/((PSC + 1)*(ARR + 1))= 10500000 / 4 / ((43749 + 1) * (59 + 1))= 1 Hz (should be blinking once per second)
Hi!I want my ESP32F411CE Blackpill to operate as an SPI slave device. The Master is not my creation, it is an already existing hardware, and my task is to emulate some Slave.Well, almost SPI. Here is what happening: Master sets CS line high, and reads 3 byte from the Slave on MISO line. Then it sets CS line low, and sends one byte on MOSI line. CLK frequency is 1MHz, SPI Mode2. I know it is not a proper SPI communication, so there is a transistor added that inverts the CS line. So the MCU doesn't see this in the image above, but the CS line inverted. It is a win-win, because it make the second short clock signal skipped, and that is exactly my intention.I don't care what Master sends, I only want to send that 3 bytes. This is all I want to do! For the first step I created a code, that sends the same 3 bytes, so I can see whan is happening on the oscilloscope / logic analyzer. These three bytes are: volatile uint8_t buttonsOutSPI[3] = { 0xAA, 0xAA, 0xAA };ORvolatile uint8
Hi Everybody!At this time I would like to use two EVAL6498L board for a DC brushed motor, (H-bridge setup).Selected mosfet is: IRFZ34NPBF.Selected PWM frequency: 20kHz width the STM32G431 MCU.The PWM signals are generated on the GPIOs, and I’ve verified that they reach the driver’s HIN and LIN pins. The low-side MOSFETs switch correctly, but the high-side MOSFETs won’t turn on. The bootstrap capacitors are charged to about 12 V (measured directly across the capacitor leads). The control table is the following:TIM1 chDriver InputForwardRevers1A LINForced HighForced Low2A HINForced LowPWM3B LINForced LowForced High4B HINPWMForced Lowhttps://www.st.com/resource/en/data_brief/eval6498l.pdfAdded R4 and R7 with 10 Ω resistors.What am I doing wrong?
Hi, I would like to develop an application using ADC + TIMER + DMA. My base code doesn’t work, and I don’t understand why. To debug, I introduce the variable "toto". This value of this variable doesn't change. I use STM32CubeIDEv1.19.Best regardsThomas- H
Originally a comment on the "Using CAN (bxCAN) in Normal mode with STM32 microcontrollers (Part 2)" Knowledge Base article.Moved to the forum for better visibility & discussion.Hi,I just using STM32CubeIDE for 2 or 3 days. I am doing a test with a Nucleo-L476RG and CAN bus. With you help, your sample, I make my board talking with other board of mine.Just a question, maybe a *** one, where can I gather informations about CAN_TxHeaderTypeDef, uint32_t RTR or uint32_t IDE... and so mutch other symbols? Is there a documentation about?Best Regards,Maurice.
Hi team, I am working with the STM32H7S78-DK board and implementing TLS 1.3 using WolfSSL on the client side. Project setup: Board: STM32H7S78-DK TLS library: WolfSSL (TLS 1.3 enabled) Network: TCP client socket Server: OpenSSL TLS 1.3 server Certificates: Public and private keys generated and configured issue: I am able to create the TCP client socket successfully, but when I attempt to establish a secure TLS connection with the OpenSSL server, the handshake fails. Handshake error: -308 1)What does the WolfSSL handshake error -308 indicate during a TLS 1.3 connection? 2)What are the possible causes of this error when communicating with an OpenSSL TLS 1.3 server? Any suggestions, references, or troubleshooting steps to resolve this issue would be very helpful. Thank you for your support. thanks & regards, Karthik.
I generated project with CubeIDE for Nucleo F411RE board with defaults.Now I want to create my own function void LED_blink(int blink_num);So, I created ledfunc.h and ledfunc.c files.This is my ledfunc.h file: #ifndef INC_LEDFUNC_H_ #define INC_LEDFUNC_H_ void LED_blink(int led_number_blink); #endif /* INC_LEDFUNC_H_ */and this if my ledfunc.c file: void LED_blink(int led_number_blink) { for (int i = 0; i < led_number_blink; i++) { HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_SET); HAL_Delay(100); HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_RESET); HAL_Delay(100); } }and I want to use LED_blink(2) function in main.c( which was generated by CubeIDE )When I try to build code, I'm getting errors LD2_GPIO_Port undefinedYes, those defined in main.hWhere (in which file ) I need to include #include "main.h" ?I need proper way where to add #includeEdited to apply source code formatting - please see How to insert source code for future reference.
We use a an STM32L4R9-DISCO board to start SW development on a project.We run own OS on the board and integrating the HAL/BSP modules for the board (e.g. STM32CubeL4\Drivers\BSP\STM32L4R9I-Discovery\stm32l4r9i_discovery_io) is not feasible for us.I have basic I2C running (ack from the MFX) but no reaction to any commands, using the registers defined in mfxstm32l152.hI therefore need basic documentation of the MFX_V3 I2C communication for setting up port directions, getting and setting ports.rgds Tage
I created standard project in CubeIDE for Nucleo 411RE ( with default settings)I found some code (which interfaces 4x4 keypad) and try to repeat it with HALI setup pins PC0,PC1,PC2,PC3 with Input mode and Pull-up.PC4,PC5,PC6,PC7 as Output and GPIO output level - High all this based on my understanding code I try to repeat ( below )Did I do correct repeating with HAL ? ( As I understand CubeIDE will generate GPIOs the same way as function ?void keypad_init(void) { /*Enable clock access to GPIOC*/ RCC->AHB1ENR|=RCC_AHB1ENR_GPIOCEN; /*Set PC0 to PC3 as input*/ GPIOC->MODER &= ~(GPIO_MODER_MODE0|GPIO_MODER_MODE1|GPIO_MODER_MODE2|GPIO_MODER_MODE3); /* Activate internal pullup resistor for PC0 to PC3*/ GPIOC->PUPDR|=GPIO_PUPDR_PUPD0_0|GPIO_PUPDR_PUPD1_0|GPIO_PUPDR_PUPD2_0|GPIO_PUPDR_PUPD3_0; /*Set PC4 to PC7 as output*/ GPIOC->MODER |= GPIO_MODER_MODE4_0|GPIO_MODER_MODE5_0|GPIO_MODER_MODE6_0|GPIO_MODER_MODE7_0; GPIOC->MODER &=~( GPIO_MODER_MODE4_1|GP
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.