Developer support experience survey - We value your feedback
Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Is it possible to make HAL_ADCEx_EndOfSamplingCallback fire when ADC is running in the dual mode with DMA .More specifically: On a NUCLEO-H723ZG, the ADC is started by HAL_ADCEx_MultiModeStart_DMA() and ADC2 is a slave to ADC1. The ADC conversion is triggered by TIM4 Capture Compare event, and I want to process each ADC value one by one rather than after HAL_ADC_ConvHalfCpltCallback() or HAL_ADC_ConvCpltCallback(). The sampling time is long so plenty of time before consecutive conversions.PM
I've been reading about GPIO and what can be triggered. I see an event can be triggered. Events can be connected to peripherals to have some control without the CPU intervening. I can't find good documentation showing how to connect or effect peripherals. I'm hoping there is a way to trigger a DMA channel to transfer data with a GPIO without a timer in between.Are GPIO events the way to trigger a DMA transfer with an external signal? Interrupts are too slow. Timers can do it but are they necessary?
I need to build an MQTT demo from scratch using STM32CubeIDE where the STM32 board will act as the publisher and Adafruit IO will act as the subscriber. I want to implement this without using FreeRTOS and LwIP, focusing only on publishing the message. I need a step-by-step guide on how to accomplish this.
Dear Team, I need your help for configuring BLE on B-L4S5I-IOT01A board. I got some example BLE in B-L475I-IOT01A.But it is different from that board could you please help me to configure and use Bluetooth via .ioc file.
The motive is to upgrade the firmware of STM32L031xx using the system bootloader. I am facing 2 issues majorly.1. For this I need to go to boot mode and boot from system memory as per my understanding. STM32L031K6T6 is follows pattern 2 for which there are only 2 requirements to boot from system memory – BOOT0 pin must be pulled up and nBOOT1 bit must be set.Boot0 is pulled up in hardware and I am setting the nBOOT1 pin in firmware. Once it’s done and we reset the microcontroller, the target is not available anymore (I am flashing and debugging using ST Link Debugger). Is this an expected behavior? How can I verify if the STM has booted from System Memory? This is the code snippet I am using to Jump to Bootloader section.void JumpToBootloader(void){ HAL_SuspendTick(); /* Clear Interrupt Enable Register & Interrupt Pending Register */ // for (int i=0;i<5;i++) // {  
Dear A.Ziru,Apparently I'm having the same problem as you when trying to receive MIDI data from a USB device (in this case it's a guitar multi-effects pedalboard). How did you solve the problem? Where and how did you defined that MIDI class descriptor?In my case, the USBH lig gets stuck in this while loop:while ((ep_ix < pif->bNumEndpoints) && (ptr < cfg_desc->wTotalLength))I seems that the function inside the while loop:pdesc = USBH_GetNextDesc((uint8_t *)(void *)pdesc, &ptr);never increments the pointers to the end values.I still need to study more the descriptors and the types of intefaces to better understand what is happening.I would appreciate if you could indicate the path you followed to solve the problem.Best regards,Moreto
I'm using TIM1 to write a DMA buffer to the built-in LED. I'm trying to get the Transfer Complete callback to trigger. I've tried setting hdma->XferCpltCallback to a function. I suspect there is an interrupt enable flag I need to set and probably clear.Here's my main.c: /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2024 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------
I've just spent hours trying to get a DMA to trigger and interrupt when transfer is complete. I was using HAL_DMA_Start() instead of HAL_DMA_Start_IT(). I found HAL_DMA_Start_IT() by looking through the source code.Where are the HAL libraries documented?
Hello everyone. I recently purchased a Nucleo STM32H7S3L8 board, and it is giving me problems. I am using STM32CUBEIde to create a usb host and a CDC class. I am using the x-cube-tcpp module, USB_OTH_HS and the problem is that the usb host does not initialize. It stops at the USB_CoreReset function, exactly USBx->GRSTCTL is always 1, it doesn't change. Can anybody help me?
I am using a Riverdi STM32 Embedded Display RVT50HQSNWC00-B and having issues with the FDCAN bus. I am capable of writing to the TxFifo and can communicate with an external device in external loop back mode and normal mode. In external and Internal Loop Back Mode, nothing is written to the RxFifo. I am trying to use the board as a receiver not a transmitter. Are there any examples of FDCAN Rx communication with an external device using the STM32U5A9NJH6Q chip. When using CubeMX, there isn't any options for setting RxFifo elements in FDCAN configuration. Does this mean this board cannot be used a reciever, and only can transmit.
Hi everyone, I want to generate fsdata.c file using perl makefsdata file. Everything works fine, the fsdata.c has been generated but with content different in comparison to default fsdata.c from git repository (https://github.com/lwip-tcpip/lwip/blob/STABLE-2_1_x/src/apps/http/fsdata.c). My self generated fsdata.c file don't work because I see "This page isn’t working" in my web browser (on the IP address corresponding to the LwIP configuration).I have attached the fsdata.c file below (generated by https://github.com/lwip-tcpip/lwip/tree/STABLE-2_1_x/src/apps/http/makefsdata stack).
Dear Community Members, While working on my current STM32F103 project and attempting to integrate the X-CUBE-CLASS-B Library, I've come across a potential issue in the file `stm32fxx_STLstartup.c`. Specifically, it concerns line 351: 351 if (STL_FullRamMarchC(RAM_START, RAM_END, BCKGRND) != SUCCESS) It appears that `STL_FullRamMarchC` returns "1" upon successful testing, while returning "0" upon failure. 91 STL_FullRamMarchC ; find in stm32fxx_STLRamMcMxKEIL.s 92 MOVS R4, #0x1 ; Test success status by default However, `SUCCESS` is defined as 0, causing the error branch to be executed even when the test is successful. I'm wondering if this issue is already known and if STMicroelectronics plans to provide an updated version addressing this bug. I want to ensure that my project work is not compromised by potential errors in the library. Any advice or information you have on this matter would be greatly
Dear community,I have deployed a basic USB PD sink application according to AN5418 on NucleoG0B1RE + SNK1M1 hardware. I have also implemented a USBPD_DPM_RequestMessageRequest() function inside usbpd_dmp_user.c (according to this post), so the user can ask for power profiles in CubeMonitor-UCPDI have also added some custom application code app.c in order to utilize encoder button and segment display. I want the user to choose relevant voltage and current value and make a request for new PPS. Yet the problem is that I am having quite hard time understanding all the different functions and underlying dependencies. Are there some further materials to understand the USBPD lib expect UM2902, and UM2552? I guess my steps are:1. Get the SRC PDOs and limit the user voltage rangeExtract the max and min voltages from following struct: DPM_Ports[PortNum].DPM_ListOfRcvSRCPDO[(IndexSrcPDO - 1)];limit the user to choose from allowed voltage range 2. Build rdo object from user request deta
Hello ST community, I am trying to send values from ADC through USB using "CDC_Transmit_FS()"The code works well but my goal is to transmit ADC values faster! (I have no option to use High Speed USB transmission mode.)The ADC values in the adcbuff are 4 digits integer and "\n" is appended to distinguish each value at the receiving side.e.g) txbuff[] = {'1', '1', '1', '1','\n','2', '2', '2', '2','\n' ... '9', '9', '9', '9','\n'};Is there any better or direct method to send ADC values through USB instead of converting int values to string?Thanks in advance!uint32_t adcbuff[sample];char txbuff[sample*5];char tempbuff[10];while(1){ HAL_ADC_Start_DMA(&hadc2,(uint32_t*)adcbuff, sample); for(i = 0; i < sample; i++) { sprintf (tempbuff, "%d\n", ((adcbuff[i] * 5000) / 0xFFFF)-2000); strcat( txbuff,tempbuff); } CDC_Transmit_FS( (uint8_t*)txbuff, strlen(txbuff))
Hello experts, what am I doing wrong? For days I have been trying to put the LAN interface of my STM32H743ZI board into operation. I just want to send a text to my PC and also be able to receive text from the PC. The board should be the server. Unfortunately I could not find a working example. Also the sample projecthttps://community.st.com/s/article/How-to-create-project-for-STM32H7-with-Ethernet-and-LwIP-stack-workingdoesn't work. In contrast to the example, however, I could not set the “Ethernet interrupt preemption priority�? to 5 because the value cannot be changed in CUBEMX. Furthermore, I did not select “MII�?, but “RMII�?, because according to the manual for this board, the “RMII�? interface is correct.The project starts without an error message, but the debugger stops when calling „MX_LWIP_Init“at the point /* Registers the default network interface */ netif_set_default(&gnetif);I have chosen the following LAN settings:STM32H743 Board IP-Adress:
Hi,We are working on product based on STM32L4S5 based MCU. We implemented the bootloader which are able to boot from base address (binary image starting from base address 0x08022000). Current implementation doesn't have any validation.But due to security reason we have implemented 512 bytes of header at starting at 0x08022000 address and moved application to the address 0x08022200. We made the necessary changes in bootloader like...unsigned long *FLASH_RST_ADDR = (unsigned long*) 0x08022204U;unsigned long *FLASH_MSP_ADDR = (unsigned long*) 0x08022200U; And in application we have changed the linker script and vector table offset valuesMEMORY{RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 640KRAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 64KRAM3 (xrw) : ORIGIN = 0x20040000, LENGTH = 384KFLASH (rx) : ORIGIN = 0x08022200, LENGTH = 400K}#define VECT_TAB_OFFSET 0x08022200U.After adding the header and changing the offset value, we are unable to run the application through bootloader.(Its going t
Hello,We are attempting to implement a ping test on the STM32H753 evaluation board. We need to supply the LAN8742 PHY IC with a clock source via the ETH_MCO pin from the MCU. We've configured the PA8 pin of the MCU to RCC_MCO_1 and set the MCO1 clock to 25 MHz, as shown in Figure 1. This setup should generate a 25 MHz clock signal on the PA8 pin. (Note: We have observed the 25 MHz clock signal on the PA8 pin using a DSO.) Figure 1: MCO1 clockFigure 2: STM32H7x3I-EVAL RevB Ethernet Figure 3: Ethernet related jumpers When we set the JP5 jumper to connect pin 1 and pin 2, the LAN8742 PHY IC receives its clock from the 25 MHz quartz crystal, and the ping test works fine.However, when we move the JP5 jumper to connect pin 2 and pin 3, the LAN8742 PHY IC receives its clock signal from the ETH_MCO pin of the MCU. (Note: The 25 MHz clock signal is observed on the PA8 pin using a DSO.) In this configuration, if ethernet cable is connected to ethernet jack of STM32 evaluation
Hi all,thank you very much for the valuable advices.I am writing to you because I would like to understand how I can convert an existing program without Azure RTOS ThreadX with a program in which I use Azure RTOS ThreadX.For example I would like to add Azure RTOS ThreadX on an existing program that reads a series of values with GPIO, ADC, or by communicating with external components with SPI and I2C and sets digital signals with PWM and GPIO. It also communicates via the serial port with another board.What should I do with CubeMX?Do I take the existing project and add ThreadX in the "Middleware" section and change the timebase source for "SYS" from SysTick to TIM6 in the "System Core" section?Do I need to make further changes in CubeMX?At the code level I will have to use Threads, but how can I structure the program?Currently the commands arrive on the serial port through the interrupt and I insert them into the relevant buffer which is read by a function present in the while(1)
Hello,I've a project with the STM32G030F6 which use the RTC (SYSCLK=64MHz RTCCLK=32768Hz). During the setting of new date/time I enable the INIT mode with: LL_RTC_EnableInitMode (RTC); while (0u == READ_BIT (RTC->ICSR, RTC_ICSR_INITF)) { } The runtime of this while() loop is from 42µs to over 60µs. In the refernce manuel is descripe 61µs.If the measured timing normal? An how can I reduce it?The application use:RTCWakeUp TimerBackUp RegisterThanks for our help,Bernd
Hello,I've a spezial question about the reading of the RTC date/time. In my project are used the STM32G030F6 with SYSCLK=64MHz and RTCCLK=32768Hz. Per reset value the BYPSHAD=0.Now I read the date/time with the follwoing consecutive two lines: const uint32_t time_u32 = READ_BIT (RTC->TR, (RTC_TR_HT | RTC_TR_HU | RTC_TR_MNT | RTC_TR_MNU | RTC_TR_ST | RTC_TR_SU)); const uint32_t date_u32 = READ_BIT (RTC->DR, (RTC_DR_WDU | RTC_DR_MT | RTC_DR_MU | RTC_DR_DT | RTC_DR_DU | RTC_DR_YT | RTC_DR_YU)); I can change it to reduce the runtime to: const uint32_t time_u32 = RTC->TR; const uint32_t date_u32 = RTC->DR; We have don't use any IRQ's during reading the date/time.In the referenzmanual is describe that the shadow register are set every RTCCLK cycle. Also it is describe that when I have a verry fast SYSCLK than is not used a twice read of the date/time to check if it changed during the read.It is not complete clear when the shadow register are refreshed. In the
Hola a todos, soy nuevo en STM32.Mi placa está bloqueada en este estado (ver en la foto): 2 LED en estado rojo continuamente. Busque en Google y descargue una copia de STM32 Cube Programmer, evita las tonterías de IDE/GDBRevisar el manual de la placa, hay diagramas y esquemas. Hay un par de puentes de repuesto conectados al tablero, consulte la parte superior derecha e izquierda.Cortocircuite los pines VDD y BOOT0 con dicho puente. Pone el chip en modo cargador, sin ejecutar su código, eso probablemente esté bloqueando la placa.Apague y encienda, retire y vuelva a aplicar energía a la placa a través del conector.realice los pasos anteriores y no funciona Gracias por tu ayuda !
Dear All,I have a board that uses the STM32U599NJH6Q as MCU and the S26KL128S is attached to the OCTOSPI1 peripheral of the said MCU.I need to be able to erase a sector and/or a page, write data to the device and then be able to read them back.What I am unsure of at the moment is the initialization code. Specifically, I am not sure if I need to use Octo SPI mode or Hyperbus.Currently I am going with Octo SPI and my MX_OCTOSPI1_Init looks like this:void MX_OCTOSPI1_Init(void) { /* USER CODE BEGIN OCTOSPI1_Init 0 */ /* USER CODE END OCTOSPI1_Init 0 */ OSPIM_CfgTypeDef sOspiManagerCfg = {0}; HAL_OSPI_DLYB_CfgTypeDef HAL_OSPI_DLYB_Cfg_Struct = {0}; /* USER CODE BEGIN OCTOSPI1_Init 1 */ /* USER CODE END OCTOSPI1_Init 1 */ hospi1.Instance = OCTOSPI1; hospi1.Init.FifoThreshold = 4; hospi1.Init.DualQuad = HAL_OSPI_DUALQUAD_DISABLE; hospi1.Init.MemoryType = HAL_OSPI_MEMTYPE_MACRONIX; hospi1.Init.DeviceSize = 26; hospi1.Init.ChipSelectHighTime = 2; hospi1.Init.FreeRunningClock
What is the best way to transfer high-speed data (12.288 Mbit/s) from the STM32H723 microcontroller to a PC? I'm controlling a four-channel audio codec (AK4619vn) and need to sample the FFT of the signal received from the ADC on the PC. The STM32 MCU has an Ethernet port.Do I need external memory to ensure continuous transmission without data loss, or is it possible to buffer the data within the MCU? Considering the received data speed is 12.288 Mbit/s.PS: I'm using the SAI1 block to receive the data on two different blocks so two different pins of the SAI1 (SAI1_A, SAI1_B), each handling 6.144 Mbit/s.Thanks in advance!
I am seeing an intermittent error returned by fopen() call resulting in file open failure on the SD Card.Wondering if someone has encountered this error while using STM32Hxxx and what could be the cause of this error.Really appreciate your supportThanks, and Best Regards,Ahsan
Hello everyone,I am experiencing a problem with a firmware based on the LoRaWAN FreeRTOS End Node example (FW Package 1.3.0).The problem is with the FreeRTOS kernel that non-deterministically stops performing context switching. I have already opened a discussion on the FreeRTOS forum where some considerations arose, but at this point I have been advised to continue in this community since the problem would seem to be related to the Pre and Post sleep functions that maneuver the systick when entering and exiting low power. Those functions are custom and written by ST. You can find the discussion here: Context Switching Hangs - Issue - Kernel - FreeRTOS Community ForumsIf the link cannot be posted/opened here, I can arrange to report all the details.Thank you very much
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.