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
Dear Members,How can I use HAL_GetTick for time stamp ?Is this right ?or I need something else ?Thankscase PULSE_TRACE_UP: if(sensor_value > prev_sensor_value) { printf("PULSE TRACE_UP\r\n"); currentBeat = HAL_GetTick(); lastBeatThreshold = sensor_value; printf("Sensor value PULSE_TRACE_UP %f\r\n",sensor_value); }
If anyone Work on project that interfacing Can transceiver TJA1050 with STM32F412RET6 , if yes i hope anyone send Example code that work and clock configurations ,, the loopback mode work correctly .. but in normal mode problems start ... and operating voltages of TJA
Hello,I'm writing this post because I'm facing an issue with generating a PWM signal on TIM3 for a buzzer application using the STM32L476RET microcontroller. Based on the buzzer's datasheet, it requires a 4,000 Hz square wave with a 50% duty cycle. I’ve connected the buzzer to the PC6 pin, which should work as TIM3_CH1 when configured to AF2, according to the microcontroller’s documentation.Configuration SummaryMicrocontroller : STM32L476RETClock Source: Internal clock at 16MHzPWM Pin : PC6 (TIM3 Channel 1)In CubeMX, I configured TIM3 Channel 1 for PWM output with these settings:Prescaler: 3Auto-Reload Register (ARR): 999These settings were calculated based on the formula:This results in a 4,000 Hz PWM frequency, as expected: I did this based on microcontroller datasheet: For the 50% duty cycle, I set TIM3->CCR1 = 500 in code.Code for sound GenerationHere is the code I use to start the PWM signal:(Note that HAL_TIM_PWM_Start returns HAL_OK) /** * @functio
Hello,I'm using STM32H743 to send and receive REST API. I'm using FreeRTOS, LWIP and mbedTLS to communicate with server. I have the same application working WELL using STM32F765 with MCAL layer of course modified to STM32F7 but using H7 I can see this error "Unknown Record Type" when fetching input and reading input record. I tried solutions like optimizing cipherSuite but was not useful.
Dear,We using an ADC in our application at 1MspsThe ADC is always running in a circular DMA mode.To start the buffering of the samples we use the Analog watchdog 1. So when the input signal goes outside the analog watchdog thresholds the function "HAL_ADC_LevelOutOfWindowCallback()" is called.This works fine, but now in this callback we give a signal to other code that the buffering of the samples starts and we would disable the analog watchdog 1.Stopping the analog watchdog 1 interrupts does not work for us and he keeps going into callback "HAL_ADC_LevelOutOfWindowCallback".What are we doing wrong to stop the analog watchdog interrupt?btw the ADC and DMA should never stop while disabling the analog watchdogFirst method: (preferred for us, must be very fast) ADC_HandleTypeDef *pAdc = pHdlr->pHdlr_adc; LL_ADC_DisableIT_AWD1(pAdc->Instance); CLEAR_BIT(pAdc->State, HAL_ADC_STATE_AWD1); LL_ADC_ClearFlag_AWD1(pAdc->Instance); LL_ADC_DisableIT_AWD  
Hey I am trying to use CMSIS DSP library to perform FFT of i2s data from a mic but it is showing error after using the FFT functions but is compling if only library is added is there any thing I have missed this is the code: /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "arm_math.h" #include "arm_const_structs.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */ /* USER CODE END PTD */ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */ /* USER CODE END PM */ /* Private variables ------------
I want to implement a firmware upgrade feature. Currently, I am doing it as follows: on the M4 core, I have a bootloader and an application; on the M7 core, there is also a bootloader and an application. The M4 application is located at address 0x08120000, and the M7 application is located at address 0x08020000. I’m not sure if this approach is feasible or if there is a recommended upgrade method. Currently, the jump between the cores does not succeed, and I don’t know why. Are there any specific considerations when performing a jump between dual-core firmwares?
I'm using AL94 library on STM32H7 for USB Composite functionality. The MSC class driver appears practically identical to 'native' MSC Class provided by STM.However, I am having difficulties running even the simple RAM disk example - the drive is correctly recognized by the system, can be formatted, but after formatting, it just stops responding. If I wait a few minutes, the contents of the drive is correctly displayed (??).The same example built for STM32F4 discovery board without USB Composite part works just fine.By comparing the USB traffic logs, I noticed that STM32H7 stops responding after receiving command that is a SCSI read of sector 128 (out of bounds, since only 128 sectors are reported). STM32F4 on the other hand, just stalls the in transfer and continues as nothing has happened...Any idea on what could be going on? The USB analyzer indicates that the SCSI Read command times out on both Out and In transfers. The line indicated below is the result of the last command received
Hello everyone and thank you for your help, I am being using the STM32F746G-Discovery Board for a couple of months first time working on it and I am currently working on a project where I want to transfer firmware to board which have a SD card on it, and the board is working as a mass storage but everyhing is being stored in the SD card and so far I am succeful, but now I wish that once the file is transfered and stored in the SD card to be able to run it and install the firmware onto the board like if it is an update. I am currently using this example as a guide https://github.com/STMicroelectronics/STM32CubeF7/tree/master/Projects/STM32746G-Discovery/Applications/USB_Device/MSC_StandaloneSo if anyone please have the suggestion that can help I appreciated it.Thanks for your help
Hi,I would like to know if I can emulate the STM32H5 (which is ARM cortex-M33) via Qemu. And if so, are there any limitations in emulating different drivers, especially the ADC and PWM within FreeRTOS Kind RegardsHani Akeila
Hello, I was trying to use RTC battery backup on a nucleo F446RET6.The problem was that the battery (CR2032) connected to VBAT tries (and can't) to power all the board.Looking to schematic diagram, I see that VBAT pin is connected to VDD thru SB45.Removing SB45 seems that all is working fine.Is there a reason for SB45 is there?Thanks
Hi, I'm using a STM32H7S78-DK board along with stm32cudeide 1.16.0. I'm loading the example LTDC_ColorKeyring which work fine, here is the issue... I'm trying to implement uart4 connected to the onboard ST-link. If I init MX_UART4_Init() and use HAL_UART_Transmit(), BEFORE MX_LTDC_Init(), it work fine. As soon as the LTDC is init, I cannot use the Uart at all. I don't see any pin conflict here... the uart4_tx is PD1 and is only connect to the VCP of the st-link.I'm evaluating the STM32H7S for business, but if I cannot get those two simple peripheral working together...thats a big flaw
there is nothing on github. there is initialization by SPI before the LTDC works is there a sequence like you initialize it first over SPI then MX_LTDC_Init() or it does not matter I do have the initialization code but I am missing something void SLGDP4571_Int(void) { SPI_WriteComm(0x20); SPI_WriteComm(0x3A); SPI_WriteData(0x70); SPI_WriteComm(0xB1); SPI_WriteData(0x10); SPI_WriteData(0x14); SPI_WriteData(0x06); SPI_WriteComm(0xB2); SPI_WriteData(0x00); SPI_WriteData(0xC8); SPI_WriteComm(0xB3); SPI_WriteData(0x11); SPI_WriteData(0xFF); SPI_WriteComm(0xB4); SPI_WriteData(0x10); SPI_WriteComm(0xB6); SPI_WriteData(0x08); SPI_WriteData(0x18); SPI_WriteData(0x02); SPI_WriteData(0x40); SPI_WriteData(0x10); SPI_WriteComm(0xB7); SPI_WriteData(0x00); SPI_WriteData(0x10); SPI_WriteData(0x01); SPI_WriteComm(0xC3); SPI_WriteData(0x04); SPI_WriteData(0x05); SPI_WriteData(0x04); SPI_WriteData(0x04); SPI_WriteData(0x01); SPI_WriteComm(0xC4); SPI_WriteData(0x22); SPI_WriteData(0
Hello,I'm new about STM32 world. I'have a problem to receive CAN Message with a F767ZI.I tryed te code bellow, it's run and send the message wit ID 0x0CFFA22D correctly but don,t receive any message.I don't have idea where is the problem.Could someone help me?Thank you in advance /* 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'm currently working with the STM32U5G9J-DK2 board, and as a newcomer to this board, I’m finding the USB CDC-ACM setup challenging. I’m using CubeMX 6.6.1 to generate the initial code, intending to send data over USB. However, I'm facing a few issues:Dual USB Ports (ST-Link & Application USB): This board has two USB ports – one for ST-Link (for debugging and programming) and another for application USB. My PC detects the ST-Link port in Device Manager (showing as both a COM port and ST-Link Debug), but the application USB port is not recognized. I assume this port is where the USB CDC communication should be set up, but I’m unsure how to get it detected.Lack of CDC Transmit Function: On other STM32 boards like the H7 series, there’s a CDC_Transmit_HS function that makes sending data relatively straightforward. However, I couldn’t find a similar function in the USB middleware for the STM32U5. I’m unclear on the exact steps for data transmission over CDC-ACM with this board.Data Tra
I am working with a Quadrature Encoder that uses TIM2 (encoder mode). The encoder mode automatically captures an increase in the register htim2.Instance->CNTI am trying to use DMA to fill a buffer with the CNT values however it does not seem to work. I would really appreciate any help!My relevant code: initializations: TIM_HandleTypeDef htim2; TIM_HandleTypeDef htim3; TIM_HandleTypeDef htim16; DMA_HandleTypeDef hdma_tim16_com; int32_t count_buf[COUNT_BUF_CAPACITY]; main: MX_DMA_Init(); MX_TIM2_Init(); MX_TIM16_Init(); HAL_TIM_Base_Start_IT(&htim16); HAL_TIM_Encoder_Start_IT(&htim2, TIM_CHANNEL_ALL); HAL_DMA_Start(&hdma_tim16_com,&htim2.Instance->CNT,count_buf,4); static void MX_DMA_Init(void) { /* DMA controller clock enable */ __HAL_RCC_DMA2_CLK_ENABLE(); /* DMA interrupt init */ /* DMA1_Ch4_7_DMA2_Ch1_5_DMAMUX1_OVR_IRQn interrupt configuration */ HAL_NVIC_SetPriority(DMA1_Ch4_7_DMA2_Ch1_5_DMAMUX1_OVR_IRQn, 0, 0);
Hi guys,I've a problem and I hope you can help me.my project must acquire a ps2 keyobard and a ps2 mouse and must be see with the usb.This is ioc configuration: The first step I tested the firmware only acquire a keyboard and works fine. The PC see the keyboard descriptor and write the character.The next step I tested the firmware only acquire a mouse and works fine. The PC see the mouse descriptor and move the mouse.So I've try to combined the descriptors and the PC see the keyboard and mouse. When I send the report of keyboard I'm able to write the character. But when I send the report of mouse I see an "Abort pipe" and the usb crash. I attached my project so you can see it Thanks.Best, Michael
Hey everyone I have a qn freejoy.hex is 155kb and my stm32c8t6 is only 64kbs and 128kb how did yall get it flashedRefer freejoy and freejoy configurator It gives me an error file size larger than flash size but other people seems to have workaround any guidence would help a lotThanks
Hi, my stm32f103 freeze after osKernelStart() after jump from bootloader but if I flash at that address it run normally.I try with blinking LED simple one but it still freeze too (this one not use RTOS).while (1) { HAL_GPIO_TogglePin(LED_SIGNAL_2_GPIO_Port, LED_SIGNAL_2_Pin); HAL_Delay(500); HAL_GPIO_TogglePin(LED_SIGNAL_3_GPIO_Port, LED_SIGNAL_3_Pin); HAL_Delay(500); /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } I using cmsis-rtos v1 (cmsis-rtos v2 in STM32CubeIDE is got error after update to 1.16.1 so I roll back to v1)Why I know it freeze at there:I put print at before of each task and one before osKernelStart(), only the one before osKernelStart print it, other is no, all task create successfully.I already try:- __disable_irq() but it didn't work- All bootloader clock and application clock is same.My setting:STM32F103RCTX_FLASH.ld:MEMORY { RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 48K FLASH (rx) : ORIGIN = 0x0800C800, LENGTH = 204K }system_stm32f1xx.c:#define VECT_TAB_B
Hi Using the following tools: TouchGFX Designer 4.24.0 CubeIDE 1.16.1 and CubeMx 6.11.0 I have attempted to build a system with ethernet capability. I added the ethernet peripheral, LwIP compiled it without any errors, but the ethernet does not work. The router it is connected to does not "see" the MAC address and fails to assign an IP address. I have DHCP enabled. I bolted Adam Berlinger's code into one of my projects Adams Ethernet and that worked fine, with DHCP but the I cannot get the latest CubeMX build to work. I have used the same board and cable that I used with Adams ethernet code for the new build so it's not the hardware. Is the latest CubeMX build supposed to at least connect to a router and allow a ping test or do I have to do something else. The touchGFX code is working fine. To be quite frank I find the ST Ethernet firmware and builds to be a nightmare. You basically have to be an experienced network engineer first to under
I used this sample code I took somewhere to try out but the ADC is not working on STM32H753. It keeps reading 0. Can anyone help? #include "main.h" #include <stdio.h> #include <stdint.h> #include "uart.h" /* Definition for ADCx clock resources */ #define ADCx ADC1 #define ADCx_CLK_ENABLE() __HAL_RCC_ADC12_CLK_ENABLE() #define ADCx_CHANNEL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() #define ADCx_FORCE_RESET() __HAL_RCC_ADC12_FORCE_RESET() #define ADCx_RELEASE_RESET() __HAL_RCC_ADC12_RELEASE_RESET() /* Definition for ADCx Channel Pin */ #define ADCx_CHANNEL_PIN GPIO_PIN_0 #define ADCx_CHANNEL_GPIO_PORT GPIOA /* Definition for ADCx's Channel */ #define ADCx_CHANNEL ADC_CHANNEL_0 #define SAMPLINGTIME ADC_SAMPLETIME_8CYCLES_5 /* ADC handler declaration */ ADC_HandleTypeDef AdcHandle; /* Variable used to get converted value */ __IO uint16_t uhADCxConvertedValue = 0; void SystemClock_Config(void); static void MPU_Config(void); static void MX_GPIO_Init(void); i
TL;DR: I see that the WUTF bit in RTC ISR register is correctly set after the RTC wake up timer period elapses, but the interrupt service routine is never entered. RTC interrupt is enabled in NVIC though, and the interrupt service routine function name matches the one in the startup file. What's stopping the MCU from entering the interrupt routine? Hello,I am trying to periodically enter an RTC wake up timer interrupt service routine on my NUCLEO-L031K6. I don't actually go to any low power mode yet, so I do not actually "wake up", I just want to respond to the interrupt for now. I managed to do this very easily with HAL driver, but I am completely stumped with the Low-Layer (LL) driver, which is the one I intend to use in my application.This is what I did:1) Set CubeMX: activate RTC clock source, enable internal wake up, set wake up clock to 1 Hz clock, set wake up timer to 2 (just a random value, don't care), output 1 Hz signal to verify on oscilloscope the RTC is running (and I
I would like to point out that I'm fairly new to STM programming and SMT32CubeIDE, but I have a problem to solve that I need help with:I am making a speed controller for a 3-phase BLDC motor, with 6 N-channel mosfets (two for each phase). These mosfets has to be turned on in a specific sequence, and therefore I decided to use a specific timer and channel for each of the 6 mosfets, so that I can control each mosfet individually. (I have printet circuit board, so this is the configuration I am stuck with for now). This is the configuration I have using the NUCLEO STM32G474RE board:U-phase HI-SIDE mosfet = PC_1 (pin) = Timer 1, Channel 2U-phase LO-side mosfet = PC_0 (pin) = Timer 1, Channel 1V-phase HI-SIDE mosfet = PC_2 (pin) = Timer 1, Channel 3V-phase LO-SIDE mosfet = PA_1 (pin) = Timer 2, Channel 2W-phase HI-SIDE mosfet = PC_3 (pin) = Timer 1, Channel 4W-phase LO-SIDE mosfet = PA_0 (pin) = Timer 2, Channel 1Everything will run at 20 kHz, so that is not a problem. My problem is as foll
Hi everyone,I’m trying to display jpg images stored on an SD card using STM32CubeIDE (version 1.16.0) with my STM32F746G microcontroller. I found an example on GitHub that uses LIBJpeg for decoding images, this is the repo: STM32CubeF7/Projects/STM32746G-Discovery/Applications/LibJPEG/LibJPEG_Decoding at fed648c7cc44ef31894f1460acfd0d1d1ff22da1 · STMicroelectronics/STM32CubeF7 I imported this System Workbench project into STM32CubeIDE, but I noticed there’s no .ioc configuration file included which makes it hard for me to figure out how to set up the project from scratch in STM32CubeIDE. Could anyone help me with the setup? I need to know how to configure the SD card interface for reading image files, integrate LIBJpeg for JPG decoding, and set up the display to show the decoded images. If anyone’s done something like this before or has any tips, I’d really appreciate it!
16:19:16 : Can not connect to target!Please select "Connect Under Reset" mode from Target->Settings menu and try again.If you're trying to connect to a low frequency application , please select a lower SWD Frequency mode from Target->Settings menu.16:19:44 : No target connectedHi this the error im facing when try to program using stlinkV2 on a custom boardTried switching to powerdown mode also and also checked the connections of pcb what could be the issue
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.