Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
Hello,I am trying to enable the USB IP DMA mode on an STM32U5A5. Without DMA, I have it working as a USB device and it transmits and receives data without apparent issues. To start using DMA, my understanding is that all I need to do, in CubeMX, is change the "Enable IP DMA" setting for the USB OTG HS peripheral to ENABLED. From there I expect the USB peripheral to take care of itself.Unfortunately, in DMA mode, the device transmits exactly three 512-byte packets and then hangs.In my short test, I request four packets. The fourth one never moves. The PC host receiver never gets the fourth packet. The first three arrive intact. I tried tests where the buffer containing the transmit data is set to either 512 bytes long, 1024 bytes long or 2048 bytes long. Each test moves 3*512 bytes and stops.[After posting the above, I did some additional tests by breaking the data into small chunks, as small as 4 bytes at time. The magic limit of the number of bytes is about 1700. Every permutati
Hi,I am trying to use the AES hardware on the STM32U545 with the STM HAL libraries.I am able to correctly encrypt and tag an number of bytes of plain text. However, whenever I try to decrypt an encrypted message with a length not divisible by 4 I get a tag mismatch but the decrypted plain text is correct.I am using byte size data width for everything and have no header data. From what I can see is that the encryption will work for any arbitrary size, however, the decryption tag is not computed correctly, unless the size is divisible by 4. Is this expected behavior or is this an issue with the HAL? Thanks!
Inside the QSPI_EnableMemoryMappedMode function, the dummy cycles are MT25TL01G_DUMMY_CYCLES_READ_QUAD_DTR - 1.MT25TL01G_DUMMY_CYCLES_READ_QUAD_DTR is defined as 6U.The datasheet for MT25TL01G states that the DTR QUAD INPUT/OUTPUT FAST READ value is 8. Why is MT25TL01G_DUMMY_CYCLES_READ_QUAD_DTR defined as 6?
I have a simple recommendation that would greatly improve your HAL drivers: please add a UserContext field to the handle structures for HAL peripherals (e.g. UART, I2C, SPI). I'll explain.I write compatibility drivers for communication peripherals for each MCU our company works with. That way, no matter which MCU we select for a project, we have a common API for a given peripheral type. We always enable HAL callbacks for peripherals like UART, I2C, and SPI, since this simplifies registering a pre-made library function with the STM32 HAL. Each peripheral instance has an associated runtime data structure; for instance, a UART structure contains a receive FIFO queue and transmit FIFO queue. When my application wants to receive data, it just checks the receive FIFO; the driver I've written handles RX callbacks and stuffs that data into the FIFO.The problem I run into with the STM32 HAL, however, is that when a callback arrives, it is not simple to associate th
When I checked the LE Audio unicast operation of the provided project on the STM32WBA55G-DK1, I noticed a strange behavior.For the peripheral, the PAC settings are Sink 2, Src 1, but when I perform QoS Configuration using the following procedure, the notification for the QoS Config of Sink2 is not notified to the central.1. QoS Config Src 1 -> QoS Configuration Notification 2. QoS Config Sink 1 -> QoS Configuration Notification 3. Qos Config Sink 2 -> No Notification Also, for the central, the PAC settings are Src2, Sink1, but for some reason, QoS Config is not executed for Sink even though the peripheral actually supports Sink.From the above behavior of the peripheral and central, I suspect that the implementation is such that QoS settings cannot be set to more than three EPs, or that it cannot be used properly if there is only one EP for both Sink and Src. As for the UI to be output to the LCD,in the case of the central, it seems that only the sending UI is support
Hello. I have a custom board with F105RCT7. The summary of my problem is the USB interface is not working at all. The computer does not detect anyting. The board is configured as a VCP device. I have a Nucleo-H743ZI-2 board and done some tests with. Now I am doing the exact same tests with my custom board. The fact is that I coppied the USB interface from the schematics of the nucleo board. But later I discovered that there are some differencences between CM7 and CM3 MCUs in terms of HW design. I am sending an SS of the related part of the design. Configuring the MCU as a VPC and transmitting messages over the USB takes only a couple of seconds when you configure everyting in CUBEMX. So I am sure that there is a HW problem. I always worked with CM4 and CM7 MCUs. Even though CM3 is simpler, it is the first time I use it.In the design D+, D- and Vbus pins are corectly connected to the MCU. When I connect the cable, the LED lights up. The board is powered from the USB (so
I am working on a custom dual-boot bootloader for the STM32G0B1CCT6 with the following features:Bootloader located at 0x08000000 (about 20 KB flash).Two application firmware slots:App1 at 0x08005000 (22 KB)App2 at 0x0800A800 (22 KB)On reset, the bootloader checks the CRC of App1 and App2 firmware:If App1 is valid, it jumps to App1.Else if App2 is valid, it jumps to App2.Else it stays in bootloader mode.Firmware updates are sent via FDCAN as .bin files (no special commands, just the binary data).The bootloader receives the firmware, writes it to the free app slot, verifies CRC:If CRC passes, it overwrites the old firmware and jumps to the new app.If CRC fails, it keeps the old firmware and stays in bootloader mode.I want to support multiple firmware updates this way reliably.I have basic HAL code generated from CubeMX for FDCAN and CRC peripherals.My questions:Is my memory layout and CRC validation approach suitable for STM32G0B1CCT6 with 64KB flash?How can I best implement the FDCAN re
I've been working on a custom STM32U595 board which uses ADF1 to read from a digital MEMS microphone and store audio samples in a SRAM4 buffer using the LPDMA. A circular buffer is implemented where LPDMA1 reads samples from ADF1 and generates interrupts when the buffer is half full and full. I then wanted to write the SRAM4 buffer to a SD Card through the SDMMC1 interface. Below is a simple block diagram of what I'm trying to accomplish:I can get everything working really well when using the GPDMA1 and a ram buffer located elsewhere then SRAM4. But I'd like to reduce overall power by utilizing the LPDMA and stop mode 2 while collecting audio samples from the microphone. Then wake up and write the samples to the SD Card using SDMMC and the associated IDMA.However, I was disappointed to discover that LPDMA only works with SRAM4, and the SDMMC peripheral only works with RAM other then SRAM4 (page 133 of user guide). This limitation seemingly makes writing data buffered in SRAM4 to a SD c
Hello.I'm struggling to get a plain STM32L412KBT6 to boot consistently into the user program. I'm working with the PlatformIO environment in VSCode. I've tried both the STM32-Cube, and the Arduino framework with similar results. Here is my platformio.ini:[env:nucleo_l412kb] platform = ststm32 board = nucleo_l412kb framework = arduino upload_protocol = stlinkMy setup consists of a very basic breakout PCB for the MCU:Which is roughly hooked up as follows:Platformio output when uploading using STLinkV2:CURRENT: upload_protocol = stlink Uploading .pio\build\nucleo_l412kb\firmware.elf xPack OpenOCD, x86_64 Open On-Chip Debugger 0.10.0+dev-00378-ge5be992df (2020-06-26-09:29) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html debug_level: 1 srst_only separate srst_nogate srst_open_drain connect_deassert_srst target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x1fff31f8 msp: 0x20001bb0 ** Programming Started ** Warn : Adding
per subject.
Hi,I a using a NUCLEO-H755ZI-Q on STMCubeide 1.18.0i am trying to use the Timer 1 to capture on the rising edge using the analog to digital converter those are my signals the lase one (pink is my signal that i want to capture at this frequency)those are my IOC settings on the input of the ADC I have an analog signal Syncronised on timer one for capturei try using this Tutorial and only obtain those results:Sample 0: 1184Sample 1: 1160Sample 2: 1187Sample 3: 1116Sample 4: 1170Sample 5: 1146Sample 6: 1176Sample 7: 1188Sample 8: 1168Sample 9: 1187(i an not sure that i am my code for this is #define CCDBuffer 6000 volatile uint16_t CCDPixelBuffer[CCDBuffer]; uint16_t ProcessingBuffer[CCDBuffer]; [...] HAL_TIM_PWM_Start(&htim4, TIM_CHANNEL_1); //sh HAL_ADC_Start_DMA(&hadc1, (uint32_t*)CCDPixelBuffer, CCDBuffer); [...] void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc) { // Copier les données du buffer ADC dans le buffer de traitement for (in
I am facing a short circuit issue on my custom board, which uses the STM32F756ZGT6 microcontroller. The enabled peripherals on the board include USB, SD CARD, ETHERNET, UART, SPI, and I2C.This is the second time I have encountered this issue on my custom boards. The short circuit is limited to the microcontroller itself, while all other peripherals on the board continue to function without any issues.I kindly request your assistance in identifying the possible causes and providing guidance to resolve this problem.Thank you for your support.
Hi! I have a STM32U585 board and I'm trying to make a UART loopback test. I tried two different modes:Asynchronous (Full-Duplex) - wire between the TX and RXSingle-Wire (Half-Duplex) - wire looping to itselfBoth worked in similar ways. I successfully was able to handle 1 byte, so this is the code that worked fine/* USER CODE BEGIN PV */ uint8_t tx = 0; uint8_t rx = 0; /* USER CODE END PV */and inside the main function I hadwhile(1) { printf("Sending byte: %d\r\n", tx); HAL_UART_Transmit(&huart3, &tx, 1, HAL_MAX_DELAY); HAL_UART_Receive(&huart3, &rx, 1, HAL_MAX_DELAY); printf("Received byte: %d\r\n", rx); tx++; HAL_Delay(1000); }I could see in the terminal that it was successfully incrementing both tx and rx variables. Now, it all went wrong when I tried to use an array instead of a single byte. This is what I tried:/* USER CODE BEGIN PV */ uint8_t tx[4] = {0x55, 0x12, 0x00, 0xFF}; uint8_t rx[4] = {0}; /* USER CODE END PV */and the main function hadwhile(1)
Hi ST teams,I use STM32G473VET3 on my design. On the datasheet, SPI4 had 3 NSS pins hardware: PE3, PE4 and PE11.If I use other GPIO excluding for the NSS pin function, there are any potential issue?Ex: SPI bus can not work at maximum speed.On my design, I use SPI4 is master and PF2, PF9, PE3, PE4, PE5 for slave chip select function.Thanks.
I have Nucleo-H743ZI, on which two pins are configured for ADC reading { PB0(CH9) & PB1(CH5) }with circular DMA continuous conversion mode, but only PB1 is able to read data when HAL_ADC_Start_DMA(&hadc1, (uint32_t *)ADC_Data, 2); starts reading the data in continuous conversion mode,the configured ADC settings are as follow: static void MX_ADC1_Init(void) { /* USER CODE BEGIN ADC1_Init 0 */ /* USER CODE END ADC1_Init 0 */ ADC_MultiModeTypeDef multimode = {0}; ADC_ChannelConfTypeDef sConfig = {0}; /* USER CODE BEGIN ADC1_Init 1 */ /* USER CODE END ADC1_Init 1 */ /** Common config */ hadc1.Instance = ADC1; hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV32; hadc1.Init.Resolution = ADC_RESOLUTION_12B; hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE; hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV; hadc1.Init.LowPowerAutoWait = DISABLE; hadc1.Init.ContinuousConvMode = ENABLE; hadc1.Init.NbrOfConversion = 2; hadc1.Init.DiscontinuousConvMode = DISABLE; hadc1.Init.ExternalTrigConv = AD
Hi everybody,I'm currently experimenting with an STM32F446. I want to create an HMI.For this, I have a screen (320x240) and a radio module on a boardThe screen is controlled via SPI DMA to download images quickly.The radio module uses two EXTIs to detect the reception of a radio message.When the program starts, and even afterward, I draw images on the screen. But when a message arrives, the EXTI is triggered. If the DMA was transferring data, it crashes.In debug mode, I notice that the program enters an infinite loop without exiting.Do you know why the DMA doesn't finish its task when an EXTI arrives, and especially how I can fix this?I considered turning off the EXTIs during a DMA transfer, but I can't do it.Here is the code that handles the DMA when I draw an image://********************************************************************************************** static void ili9341_Write_Data_DMA(const void *data, uint16_t length) { txComplete = false; HAL_SPI_Transmit_DMA(&hspi1
[VERSION]: 6.3.0[TOOL]: Firmware, ASPEP, Motor Control Protocol Suite[DETAILS]: Cannot send commands and read from MCU over ASPEP other than BEACON and PING[EXPECTED BEHAVIOR]: Emulate Motor Pilot[HOW TO REPRODUCE]: Download script attached, change file type to .py and run I am unable to send/receive commands other than BEACON and PING to the mcu. By using a script that @VOgne.1 posted on 2022-10-15 I had a basis for the logic and got some response from the MCU over a serial port. I've attached the script below named "serialConnectionProtocol.txt". After reading through the documentation (MC_SDK_6.3.0/Documentation/html/md_docs_2_motor_01_control_01_protocol_01_suite.html#connection-procedure) I figured out I need to send 2 BEACON commands to connect to the device, one to get data from the device, the copying that data and sending it back to the device.Now I'd like to send a command or read a value and that's not working. The MCU is not responding to p
I have a nucleo H743ZI board and connect to cube programmer, the programmer can only recoginze it is a H7 based MCU but not a nucleo. If i plug in a F103RB and H745ZI (both are nucleo), the programmer can see it is a nucleo board.is there any way to solve or my H743 is cooked.
I am trying to run the Secure Boot examples from STM32CubeL5 and have everything built, but on step 2 where I run `TFM_SBSFU_Boot\STM32CubeIDE\regression.sh` I am having an error where I cannot program the option bytes.(Another similar thread was with someone who bought a counterfeit part so I'll also mention that I bought the kit from ST.)This is the script output$ ./regression.sh regression script started Regression to RDP 0, enable tz ------------------------------------------------------------------- STM32CubeProgrammer v2.19.0 ------------------------------------------------------------------- ST-LINK SN : 004600313137510B33333639 ST-LINK FW : V3J13M4 Board : STM32L562E-DK Voltage : 3.29V SWD freq : 8000 KHz Connect mode: Hot Plug Reset mode : Software reset Device ID : 0x472 Revision ID : Rev Z Device name : STM32L5xx Flash size : 512 KBytes (default) Device type : MCU Device CPU : Cortex-M33 BL Version : -- UPLOADING OPTION BYTES DATA ... Bank : 0x00 Address : 0x50022
I am wanting to add the STM32WBMMG to my board but it will need to be compatible with an external NFC antenna so I can have cellular communication. Is this possible and how would I go about implementing this?If it is not possible are there other STM modules that are NFC compliant?
I am desiring to place the STM32WB5MMG on a board design that already has a large LoRa Antenna. I am reviewing the datasheet and reading over the design suggestions for placing the module. In particular, I am trying to implement the design with this guidance: Where d is 22 mm and c is 27 mm. I am trying to decide between two different design choices. Option A:Option B:In both options I can satisfy the conductive enclosure requirements above, but I prefer option B since it will be easier to route. However I am concerned about placing one Antenna so close to another antenna. Will my LoRa antenna affect the STM32MMWB5MMG Antenna negatively in the second design?
Subject: Help with USB MSC using USBX + FileX on STM32H573RIT6 (UX_ERROR during host_stack_initialize) Hello ST Community, I'm currently working on a project using the STM32H573RIT6, and I’m relatively new to this STM32H5 series. I’m trying to implement a USB MSC (Mass Storage Class) host using USBX with FileX, and I’m using STM32CubeMX for configuration and STM32CubeIDE for development. Importantly, I’m working without any RTOS – this is a bare-metal (standalone) implementation, so I'm not using ThreadX or any other RTOS. However, I'm encountering an issue during the USBX host stack initialization. Specifically, the function ux_host_stack_initialize() returns UX_ERROR, and based on debugging, it appears to be related to insufficient memory allocation. Here’s what I’ve done so far: Using default USBX and FileX settings in STM32CubeMX. Enabled USB in Host mode and selected the necessary middleware components. No RTOS selected in the project. No changes to heap/memory sizes so fa
I am planning to use the STM32WB05KN as a network coprocessor for a STM32U0. The Nucleo board has both LSE and HSE populated, but since my PCB is space constrained, I would like to use the internal oscillators instead of external and also turn off SMPS. My understanding is that the provided prebuilt DTM firmware would not work without these components and I would need to change these settings:The document this points to (AN5503) describes steps to rebuild the firmware using the BlueNRG GUI but says to use CubeMX for STM32WB0 devices:However, CubeMX does not have support for directly interfacing with WB05xN devices as far as I know. In this case, how can I change the settings? Thank you!
example code : MRSUBG_WakeupRadio_Tx of STM32Cube_FW_WL3_V1.1.0board : NUCLEO-WL33CC1compiler : Keilrunning the code, at first message below will shown on Virtual Com,"STM32WL3 LPAWUR - Transmitter example.Use PUSH Button 2 to send a frame."but after pushing Button 2 on board, no message is shown on Virtual Com?!
Hi all, So to my surprise, I have issues getting a button press to work in a Lora PingPong sequencer example, and I can't find any relevant posts, so ...The part I'm using WLE5.The ping-pong code is working fine, but I wanted to add a button to start sending from one end, and PA0 was my choice. I have setup the gpio, and falling edge interrupt, and everything works as far as to setting the Pending bit in EXTI/PR1/PIF bit 0 when I press the button. But no interrupt happens. I suppose I must have missed something. But what? The code sits in HAL_PWR_EnterSLEEPMode() -> __WFI() So I think my question is what parts could I have missed?My main suspicion is related to HAL_NVIC_SetPriority() and HAL_NVIC_EnableIRQ(), which I don't seem to get a hang on. I have tried different arguments (EXTI0_IRQn, EXTI15_10_IRQn) to them, but it makes no difference. How do know which one to use for a particular gpio? Edit: OK, so now I found that SYSCFG_EXTICR1->EXTI0 selects the int
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.