Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
HelloI'm developing on the NUCLEO-N657X0-Q board using the STM32N657X0H3Q.I'm trying to trigger the ADC when the CCR value on CH2 of TIM1 meets the up counter of TIM1. This triggers the ADC conversion. Once the ADC conversion is complete, a callback function is triggered to store the ADC value in a variable. To verify the callback function's operation, I'm trying to toggle the GPIO.When I debug and observe the waveforms, I see the waveforms on CH1 and CH2 of TIM as designed. However, the problem is that the GPIO toggles aren't observed. When I check the ADC values in debug mode, the g_adc_raw value is stuck around 1290 and the g_adc_mv value is stuck around 566. Connecting the ADC pin to GND doesn't return 0.The STM32n6 example, ADC_SingleConversion_TriggerTimer_DMA, works normally, so there seems to be nothing wrong with the board itself.I plan to control the DC-DC converter, so I need to read the value for each ADC conversion and run the controller, so I don't think DMA is necessar
Вітаю. Створив DC-DC перетворювач на мікроконтролері G4 серії. У я кості регулятора використовую апаратний FMAC, current mode. Моє питання стосується перерегулювання рівня вихідної напруги при старті перетворювача. На борту маю апаратну кнопку вимкнення живлення, а саме фізичне від'єднання акумулятора від перетворювача, а також тактові перемикача для користувача, якими безпосередньо вмикається та вимикається процес перетворення, та налаштування користувачем деяких параметрів. М'який старт програмно не реалізовано. Ситуація наступна, перший пуск перетворювача після увімкнення кнопкою живлення проходить бех перерегулювання, що я можу підтвердити осцилограмами. А ось усі наступні пуски супроводжуються короткотривалим перерегулюванням рівня вихідної напруги. Будьласка, хто має бажання мені допомогти, відгукніться, за запитом надам усю необхідну інформацію. Осцилограми хочу скинути наступним постом.
Hi,I was wondering if there's any reference application or if you have any advice on drivers to capture video from a MIPI CSI-2 image sensor (perhaps Sony or the ST BrightSense image sensors (VB1940 (active) or VD1940 (preview) match the 5.1 MP dimensioning of the STM32N6) with STM32N6x7 or STM32N6x5 μCs?The aim would be to waken up the STM32N6 in response to an external digital input, record video from a MIPI CSI-2 image sensor to SD or eMMC then return to sleep mode.I'd be happy to consider bare metal, Zephyr or FreeRTOS - whatever you recommend.Thank you very much for your help and all the best for 2025!Will
Dear ST Community,I'm experiencing an issue with USBX Host implementation on STM32H573RIT6 where disconnect events stop working after enabling Host Controllers FS in CubeMX.Problem DescriptionEnvironment:MCU: STM32H573RIT6 (Custom board)Middleware: Azure RTOS USBX + FileX (MSC Host)VBUS: External constant 5V supply (no USBPD/VBUS sensing used)Connection detection: DP pin basedCubeMX: UX Host FS + Host Controllers FS enabledHAL setting: hhcd_USB_DRD_FS.Init.vbus_sensing_enable = DISABLEBehavior:Before USBX activation: Both HAL_HCD_Connect_Callback() and HAL_HCD_Disconnect_Callback() work perfectly with USB memory stick connect/disconnectAfter USBX Host Controllers FS activation:Initial USB memory connection: HAL_HCD_Connect_Callback() works fineUSB memory removal/reconnection: No HAL_HCD_Connect_Callback() and HAL_HCD_Disconnect_Callback() calledQuestions/RequestsHow to maintain HAL HCD callbacks when using USBX Host Controller
After more debugging, the jump function works correctly (PC reaches 0x080208xx, SP and RST are valid), but the app never sends any UART message after jump — even with SystemClock_Config() completely commented out and only HAL_Init() + MX_UART_Init() remaining. The bootloader resets the clock to HSI before jumping. SCB->VTOR is set in SystemInit(). Linker is at 0x08020000. The app works perfectly when flashed directly at 0x08000000 via ST-Link. Something is killing the app immediately after the bootloader jumps but we can't figure out what — any ideas?this is the project : https://github.com/said-sketch/Flashing-by-UART---STM32-Bootloader/tree/main
use stm32h743 with eth and a LTE moderm.OS theadx and netxduo ....eth works well I can't find where to congfig ppp, How to select serial port ,and so on.I search the forum and find no answer.
求助篇!使用主控芯片STM32F405RGT6 在操作flash后 复位指令不起作用 这是什么问题呢?////////////////////以下是代码段/////////////////////////////*注释以下语句就可以自动复位成功*/Translation:I'm using STM32F405RGT6 microcontroller, the reset command doesn't work after flash operation. What could be the problem?HAL_FLASH_Unlock(); if (HAL_FLASH_Program(TYPEPROGRAM_WORD, FWR_ADDR, 0) != HAL_OK) { printf("Clear OTA flag error\n"); } else { HAL_Delay(10); uint32_t flag_sttus = HAL_FLASH_GetError; if(flag_sttus & HAL_FLASH_ERROR_PGA) { printf("flash_err!\r\n"); } printf("Clear OTA flag\n"); } HAL_FLASH_Lock();请各位大佬看看是什么情况 感谢!!!!Translation:Could someone please take a look and tell me what's going on? Thanks
To follow up this thread, CTS signal on USB CDC - STMicroelectronics Community I'm experiencing a similar issue. USBser.sys have some problem 1. Only DTR Break can control alone you can set DTR is 1 or 0, but RTS have change,RTS only change with DTR. 2. CDC Serial State I have test this code, it send from Endpoint 81h successfully, but PC USB Host have no message CDC_IN_Buf[0] = 0xA1; /* bmRequestType 0xA1 (10100001B) */ CDC_IN_Buf[1] = 0x20; /* 0x21 (SERIAL_STATE) */ CDC_IN_Buf[2] = 0x00; /* wValue LowByte */ CDC_IN_Buf[3] = 0x00; /* wValue HiByte */ CDC_IN_Buf[4] = 0x00; /* wIndex LowByte Default 0 */ CDC_IN_Buf[5] = 0x00; /* wIndex HiByte */ CDC_IN_Buf[6] = 0x02; /* wLength LowByte Serial State Length 0x0002 */ CDC_IN_Buf[7] = 0x00; /* wLength HiByte */ CDC_IN_Buf[8] = 0x14; /* Data LowByte */ CDC_IN_Buf[9] = 0x00; /* Data HiByte */ /* CDC Serial State bit define (USB CDC 1.1 6.3.5 ) bit0 bRxCarrier 0x
Hi everyone,I’m working on an STM32U5G9 using USBX + ThreadX.I was able to make the device work as:MSC onlyCDC-ACM onlyMSC + CDC-ACM simultaneouslyThat part is fine. What I need now is more dynamic behavior: start the device as MSC, and when a button is pressed, stop USB, change the class to CDC-ACM and restart it (long term I’d like to switch arbitrary combinations of classes, but for now switching from MSC to CDC-ACM is the goal.)From what I understand, I must stop USB so the host will re-enumerate using the new device descriptor, and I’m OK with that. However, every approach I tried ends in a HardFault when I restart with the other class. I suspect I’m missing a call or doing things in the wrong order.How I start the device (this works):/* Start device with MSC only (initial boot) */ /* First I insert CLASS_TYPE_MSC is "UserClassInstance" variable in ex_device_descriptors.c (not shown here), then: */ ux_device_stack_initialize(...); /* Register MSC-only */ ux_device_stack_class_regi
I am working with [STM32F439ZI] and I am trying to initialize SDIO in 4-bit mode.I'm following "STM32 – Creating a File System on a SD card" this video for reference.However, SDIO initialization is failing during the power-on phase.The error occurs during HAL_SD_Init()The failure happens inside the power-on initialization sequenceThe function always returns an error statusThe board is currently tested using the DATA3 line only (this is the only difference from a standard setup)Even when I modify the function / test return values, the error still occurs at power-on initializationI changed the function for card detect so that the return status is always "card present".The error occurs inerrorstate = SDMMC_CmdAppCommand(hsd->Instance, 0);if(errorstate != HAL_SD_ERROR_NONE){return HAL_SD_ERROR_UNSUPPORTED_FEATURE;}}This function returns a CRC error.I have attached the hardware changes I did along with the clock config settings and sdio settings. Please help me resolve it.
Using DMA to read 3 ADC channels. IN0, VSENSE & VREFINT all enabled in CUBEMX. First 2 channels read as expected but for VREFINT it seems to always read zero. Am I missing a setting in the CUBEMX?
Dear Sirs, we had a project with the F2 using HAL_I2C_Master_Sequential_Transmit_IT() with Option I2C_FIRST_FRAME and a second HAL_I2C_Master_Sequential_Transmit_IT() with Option I2C_LAST_FRAME.All worked perfect.Using this Software with a F7 did not work. After the first HAL_I2C_Master_Sequential_Transmit_IT() with Option I2C_FIRST_FRAME a STOP-Condition occured and transfer stopped. After hours of debugging through the HAL it turned out that I2C_FIRST_FRAME does notz set the RELOAD bit but I2C_FIRST_AND_NEXT_FRAME does and all workes fine.So my question is: What is the usage of I2C_FIRST_FRAME in a F7 context, becuase it sets AUTOEND and nothing else. So how can be I2C_FIRST_FRAME the correct option for a sequence of frames?best regardsAndy
Hello,I am working on SRM motor development for some application and plan to use the STEVAL-CTM015V1 (1 kW, 400 VDC, 3-phase SRM) evaluation board for in-house testing.I have reviewed UM3174 and DB4559, but I could not find any SRM control firmware or example project for this board.Could someone please clarify:Where can I obtain the SRM firmware / example source code for STM32F303CBT6 used on STEVAL-CTM015V1?Is there a ready-made SRM control algorithm (current chopping, turn-on/off angles, speed loop) provided by ST?How is this board intended to be programmed? (recommended IDE / reference project)Any guidance or pointers to official ST resources would be appreciated.
There is a bug in the above mentioned function in stm32f1xx_hal_flash_ex.c file. The function has a uint32_t type parameter WriteProtectPage which determines the flash page chunks to disable the write protection of. On my F103 MCU it means every bit corresponds to 4 pages (each page is 1 Kbyte, total of 128 Kbyte flash memory). This line then combines the currently write protected pages with WriteProtectPage (0 means protected, 1 means unprotected):WriteProtectPage = (FLASH_OB_GetWRP() | WriteProtectPage); The function then slices WriteProtectPage up into 4 pieces (4 WRP option bytes):WRP0_Data = (uint16_t)(WriteProtectPage & OB_WRP_PAGES0TO31MASK); WRP1_Data = (uint16_t)((WriteProtectPage & OB_WRP_PAGES32TO63MASK) >> 8U); WRP2_Data = (uint16_t)((WriteProtectPage & OB_WRP_PAGES64TO95MASK) >> 16U); WRP3_Data = (uint16_t)((WriteProtectPage & OB_WRP_PAGES96TO127MASK) >> 24U); It then erases the option byte area (r
Hello, when STM32CubeIDE generate code for STM32H523VCT6, VTOR_TABLE_NS_START_ADDR constant contain wrong value:#define VTOR_TABLE_NS_START_ADDR 0x04020000UCorrect value should be #define VTOR_TABLE_NS_START_ADDR 0x08020000U How to reproduce:STM32CubeIDE Version: 1.18.1STM32Cube FW_H5: 1.5.0Start new project -> for commercial part number select STM32H523VCT6 -> enable trust zone -> generate code.Check file main.c under secure directory. Regards,Slavomir Tomascik
The conclusion is that setting filters and interrupts on FIFO0 leads to exception handlingFDCAN1_IT1_IRQHandler.The reason for this behavior is an error in the file. startup_stm32g431cbtx.s ERROR ...word ADC1_2_IRQHandler.word USB_HP_IRQHandler.word USB_LP_IRQHandler.wordh FDCAN1_IT0_IRQHandler.word FDCAN1_IT1_IRQHandler.word EXTI9_5_IRQHandler.word TIM1_BRK_TIM15_IRQHandler .. This is how it should be ... .word ADC1_2_IRQHandler.word USB_HP_IRQHandler.word USB_LP_IRQHandler.word FDCAN1_IT1_IRQHandler.word FDCAN1_IT0_IRQHandler.word EXTI9_5_IRQHandler.word TIM1_BRK_TIM15_IRQHandler ... As an example, the code that I use is for testing so that there are no questions). void CAN_Config(void) { FDCAN_GlobalTypeDef *CAN = FDCAN1; uint32_t *filterRAM = (uint32_t *)RAMBaseFDCAN1; // Включение тактирования для CAN RCC->APB1ENR1 |= RCC_APB1ENR1_FDCANEN; RCC->CCIPR &= ~RCC_CCIPR_FDCANSEL; // PLL "Q" for FDCAN RCC->CCIPR |= (0x1 <<
Hi,programing NBOOT_SEL and WRP in the firmware leads to strange behavior of the MCU. After running the code below and reseting the MCU, I can still debug with CubeIDE to some extent by connecting without downloading the firmware, but I can only see that the MCU is stuck in a hard fault. CubeProgrammer cannot read either flash or option bytes. If I try to reset the option bytes anyway, I lose the connection to the MCU completely and it is no longer recognized by CubeProgrammer.The behavior is not always the same either. On my first attempt, I was able to debug the code several times and see that it works correctly in principle. Resetting the WRP with CubeProgrammer also worked. However, I have now lost my second MCU.I develop a minimal bootstub for STM32C011J6 and therefore do not use the HAL. Is there an error in the code, that can lead to such a behaviour? Thank you in advance for any hints or guidance. typedef struct { volatile uint32_t ACR; uint32_t RESERVED1; vo
As mentioned in the title already, the file core_cm4.h is not contained in the recent version of https://github.com/STMicroelectronics/STM32CubeG4 anymore.Selecting the v1.6.1. in that repo the file is contained. Looks like there was an error genererating the new version.
Dear all,we're creating a camera application and have successfully run and modified some of the demos available. ( State at time of writing: 800x600 30 fps full-frame encoding to SDCard).We have full-frame double-buffering code running but this is consuming extensive memory; from the documentation I saw that there is a hardware-linked mode available chaining DCMIPP and VENC cores. From the code, I see there is one implementation in VENC_USB example.The camera and venc middlewares on github miss the slice aka "HW Handshake mode" so I wonder which code-base is recent and will be supported in the future, especially as CubeMX does not (yet) support VENC configuration.We're trying to go beyond a proof of concept, so I'd like to base our project on a maintained code-base but that is hard to spot, could you give some indications?Many thanks,Simon
Hello STM32 friends!I've previously used USB on an STM32G474RET6, and it was initialized with the function:MX_USB_Device_Init()The goal is to use it as a USB serial port to communicate with my device, and that worked.Now I'm using the STM32U5G7VJT6, and this time, the USB is initialized with the function:MX_USB_OTG_HS_PCD_Init()But this function hangs.I've enabled USB interrupts in the STM32CubeMX, but that doesn't help.I haven't been able to isolate the problem yet, but it's probably something very simple.Is this another new USB library?As requested, I attached my IOC file.What could be the problem?Sincerely, Jack
I'm still working my way around the DMA learning curve. Having found the IOC approach to DMA configuration too confusing, I'm configuring the structs and calling the HAL_DMA_Init(...) method myself.Something I haven't been able to find clearly described is the "TransferAllocatedPort" field of the DMA_InitTypeDef struct. I understand that it's there to specify source/destination port0/port1, but I don't understand the significance of that selection.One blog post I found seems to say that having two ports allows the DMA peripheral to assemble or disassemble transfers when source and destination have differing alignments. Okay, I understand that explanation, but is that a correct explanation?If my source and destination have the same alignment, can (or should) I assign the same port to both? Is there any advantage or disadvantage? Since a "channel" is devoted to a particular path and direction, I wouldn't think the unused port would be useful for anything els
Hello, I am using a NUCLEO-H7A3ZI-Q to send and receive packets over serial. I have a varying payload size, so I am using: HAL_UARTEx_ReceiveToIdle_DMA(&huart3, rx_buffer, 4096); as this searches for an idle at the end of the frame to begin processing this data. To process this data and copy it into a look up table (LUT) capable of being 0-4096 bytes long I have this following script; which comprises two uint8_t into one uint16_t to be represented by a 12-bit DAC, hence the clipping if they exceed 0FFF (4095).This receives and writes perfectly up to 512 bytes of memory (256 uint16_t within the LUT), however above this all remaining values in the LUT are left unpopulated. uint16_t length = 0; void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t size){ if (lut != NULL) { HAL_DAC_Stop_DMA(&hdac1, DAC_CHANNEL_1); free (lut); lut = NULL; } if(rx_buffer[0] == 0XAA) { length = rx_buffer[2] | (rx_buffer[1] <<8); frame_rate = rx_buffer[3
Hello, I am having a issue with HAL_UARTEx_ReceiveToIdle_DMA on a NUCLEO-H7A3ZI-Q, when using the following code:uint8_t rx_buffer [4096]; HAL_UARTEx_ReceiveToIdle_DMA(&huart3, rx_buffer, sizeof(rx_buffer)); void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t size){ /*code*/ } My rx_buffer is only populating the first 512 bytes, with the remaining data remaining as 0.__HAL_DMA_GET_COUNTER(huart3.hdmarx);Provides the incorrect amount of data being passed over serial.I have used serial plotter and CoolTerm to try and send packets but both hit this 512 byte limit.rx_buffer not populated past 512 byteslength correctly calculated as 640 bytes long
Hello,I’m trying to add the JPEG encoder to be able to save images in JPEG format to the SD card.While debugging with LEDs, I noticed that MX_JPEG_Init blocks the program, whereas HPDMA is working correctly.I have added all the necessary files for JPEG, but it doesn’t seem to activate.Interestingly, when I disable MX_JPEG_Init, I can see the images on the screen connected to the board without any issue.I’m wondering if there is a configuration problem with the JPEG or if I’m missing something.For reference, I’m using the STM32N6 Discovery Kit (STM32N6DK750).Thanks for any advice!
I have developed a custom board for STM32F469NIH6 and is loosely based on STM32F469i-DISCO, it uses an external QSPI Flash memory type MT25QL128A as does the DISCO board. For this setup I am using ST supplied external loader MT25QL128A_STM32F469I-DK.stldr which works fine.We have a requirement for a processor with a video codec, so the logical upgrade route is to STM32F769NIH6 to be used with external QSPI flash MT25QL512A. Both of these devices are pin compatible with the above MCU and QSPI, so the plan is to use the same custom PCB.The problem comes in writing an external loader for this combination because.While ST have a loader MT25QL512A_STM32769I-EVAL.stldr, this loader is not working in our setup, probably because of alternative QSPI I/O configuration which would likely be easy to alter in the loader code, however the source code is not in the github repository https://github.com/STMicroelectronics/stm32-external-loaderIs it available elsewhere?UM0892 says that the ST loade
ST Community highlights – April to June 2026
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.