Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hi,While configuring STM32U585 controller USBX driver CDC virtual comport device is not showing in device manager. Pl provide sample code for STM32U585VIT6. This is out custom board with a USB port acting as device to the PC.
I am using an STM32H750 custom hardware to interface with an external UART device at 38400 baud. (see STM32_block.png). UART 2 is configured to Asynchronous mode.It is used to transfer the following 31 bytes of data to the external deviceff 03 fe f0 00 1e 80 03 fe 0016 00 12 42 50 00 10 01 00 0000 00 00 00 00 00 20 01 00 8389 UART2 then expects 32 bytes of data from the external deviceff 03 fe f0 00 1f 80 03 fe 0017 00 13 c2 54 20 01 00 00 0000 00 00 00 00 00 10 01 00 00d1 25 The software is base on Zephyr OSBelow, I used async APIs uart_rx_enable and uart_tx for data transmission and reception. Along with a semaphore for timeout purpose.void port1_uart_callback(const struct device *dev, struct uart_event *evt, void *user_data){ switch (evt->type) { case UART_TX_DONE: //LOG_INF("Handle UART_TX_DONE: %d\n", evt->type); k_sem_give(&group_ports
Hello, I'm porting code from L4 to U5. The original code was able to change flash during runtime (erase and program). The L4 Hal lib deactivated caches before flash operation and flushes them afterwards. This isn't done by the U5 Hal lib. I don't need explanation. It is ok for me, if you can confirm, that there is not risk, when cache is enabled during the programming U5.
Split from https://community.st.com/t5/stm32cubeide-mcus/problem-with-file-ioc-quot-not-a-valid-ioc-file-quot/td-p/791325 as this is a new questionBut now, I have another question. The file I use is one of the example on stm32G431RB "DAC_SignalGeneration2" and for this example, the output frequency on Oscillo is 1kHz but for my use, I want to have high frequency for sinusoidal signal on oscilloscope. I try many issu but i don't have what i want. For example, I calculated PSC et ARR corresponding to my frequency i want or double the number of step in tab sinewave or do (programmed a specific tab sinwave at the frequency i want but i stil don't have good result on oscilloscope. And i don't understand the specific roles of each timer (TIM2 & TIM6) in this code.Thank you for you respond
Project: samples/basic/blinky board: stm32h735g_disco I am using the latest Zephyr 4.1 If have a simple project `sample/basic/blinky`. Using the west command to compile the project, flash the board, debug the board with OpenOCD protocol. Everytime I used the debugger (dbg), I am able to step by step the project until I reach the k_msSeep() function. A friend of mine help me to debug it and we were able find that the system breaks as indicated in the picture below. If I don't use the debugger DBG, then the software does not crash... It just work.
Hi. I have worked on a project for a long time but had to swap CPU because of lack of memory. Before my device was STM32h743VG6 and I switched to STM32h743VIT6. Since i couldn´t just swap the CPU in mx without starting a new project, I swaped CPU and imported the files into a new project. It compiled and could run after some changes in the FLASH.ld file. When generating new changes from touchgfx and programming to the flash I got memory issues. Some of them depended on path locations of files which i fixed. But one of them gave me this right before entering MemManage_HandlerNo source available for "<signal handler called>() at 0xffffffe9Somehow I can´t find the address. Any advice on what can be wrong ?
I try to combine the enocer mode of TIM1 with a encoder clock period measument using TIM8. The RM0456 (for U5) mentions this in the end of chapter 54.3.25 under the heading "Encoder clock output". TIM1 works fine and counts up and down according to the encoder signals. Now I want to measure very low speeds where encoder pulses happen only "now and then". My settings: * TIM1 CR2 MMS set to 0b1000: tim_trgo = Ecoder Clock Out* TIM8: Internal clock scaled down to 1Mhz (works fine, it counts as expected)* TIM8 CCMR1 CC1S set to 0b11 = TRC* TIM8 SMCR TS = 0000 = tim_itr0 = TIM1 trgoafter enabling TIM8 and TIM1 I never get an actual capture - somehow the trgo - TSC - CC1 signal chain seems not to work. Does anyone have an idea what I am missing?
I urgently need to get USB High Speed working on USB1 of the STM32N6570-DK. I have attached the .ioc file I am using.I am able to get the GPIO_IOToggle project working on the board. I am able to put breakpoints step through the code.I am using STM32CubeIDE version 1.18.0 (Build: 24413_20250227_1633 (UTC)).As a second step, I need ThreadX working on the board.
Posted on December 03, 2012 at 20:42I am trying to talk to the bootloader in the STM32F100 and having some issues. I can successfully send the 0x7F and get back a 0x79 ACK. Next when i send a Get Command i don't get any response. I am sending two bytes to the micro (0x00 and 0xFF), but get no response. When i send the Get Command again, I get back a NAK. (0x1F). Is the Get command supported by this processor? -David #stm32-uart-bootloader-parity
Hi to all.I'm testing the Nucleo U031R8. To avoid the Package issue i switch also to the old package firmware version (1.0.0), but same error.The example is UART_HyperTerminal_IT and i simple cloned (or compiled directly in the repository), then execute without cars sending on the virtual comm port.The progran stuck in function "UART_CheckIdleState", because the timeout of function "UART_WaitOnFlagUntilTimeout" is set to 0x1FFFFFFU via macro.Is my new board damaged or similar? I've tried to rebuild the project via CubeMX (even in the recent 1.2.0 libs). No way. Thanks.
..
Hello,I would like to enable and disable certain interrupts pertaining to the GPDMAs within my program at times. Particularly the transfer complete interrupt. I would assume that I should be able to simply change the register value with GPDMA2->C0CR &=~GPDMA_C0CR_TCIE; but it appears that im only allowed to reference the SECCGFR, PRIVCFGR, RCFGLOCKR, MISR, and SMISR registers. Why is this the case? What must I do to be able to disable the TCIE interrupt? I have tried to use __HAL_DMA_DISABLE_IT(&hdma_adc2, DMA_IT_TC); which throws a hard fault.Thank you!
Hello everyone,I use the NUCLEO-H743ZI2 board in my project and previously, Before I've used the MBed OS - it works well on this board, just I need to maximize TCP transfer speed as well as QSPI. So I decided to try another RTOS. After reading forums, I decided to try the Azure RTOS and Cube IDE. I chose the Nx_TCP_Echo_Echo_Server example as a starting point. I reconfigured it to use with NUCLEO-H743ZI2, and also I disabled DHCP as I don't need it. Also added plenty of printf functions at different steps in the app_netxduo.c. As result project can be build, and I see next messages in Terminal:The network cable is connected.nx_ip_interface_status_check == NX_SUCCESS.nx_ip_address_set == NX_SUCCESS.nx_tcp_socket_create == NX_SUCCESS .nx_tcp_server_socket_listen == NX_SUCCESS .TCP Server listening on PORT 5000STM32 NX_APP_DEFAULT_IP_ADDRESS: 192.168.0.200Next is the tx_semaphore_getThen I try to ping the board I see the blinking LED on the Ethernet connector of the bo
Hello Everyone, I am currently configuring SPI on the STM32F765ZGT board and using both blocking (polling) and interrupt-based methods for SPI transmission and reception. However, I am encountering an issue where the following condition evaluates to true, resulting in a HAL_BUSY error: if (hspi->State != HAL_SPI_STATE_READY) { errorcode = HAL_BUSY; goto error; } I would appreciate any insights on what might be causing this issue and potential solutions to resolve it. Thank you in advance!
I'm a beginner working with the STM32 Nucleo-L4R5ZI-P board and trying to set up ADC with DMA to sample an audio signal into a buffer. However, my DMA callback functions like HAL_ADC_ConvCpltCallback() and HAL_ADC_ConvHalfCpltCallback() are never being triggered.I’ve set up ADC1 with DMA in circular mode, enabled continuous conversion, and called HAL_ADC_Start_DMA() in main(). The DMA1 Channel1 global interrupt is enabled in NVIC, and __HAL_LINKDMA(&hadc1, DMA_Handle, hdma_adc1); is included in HAL_ADC_MspInit(). The DMA1_Channel1_IRQHandler() is present in stm32l4xx_it.c and calls HAL_DMA_IRQHandler(&hdma_adc1) as expected.I also tried using a timer (TIM2 with TRGO on update event) to trigger the ADC instead of software start, but the callbacks still don’t fire. Checking the DMA CNDTR register during runtime shows that the buffer doesn’t appear to be filling. The callbacks only run if I call them manually, so it seems like the DMA or ADC isn’t being triggered properly.Any help
I have been struggling trying to implement two CDC-ACMs on a NUCLEO-U5A5ZJ board on the USB_OTG_HS bus and am having great difficulty. I have been successful getting them to appear on Device Manager, but I have been unsuccessful getting them to transmit data. It just locks up when I send data, with no error code or failure. I have found out how to do this using the FS USB, but there is no example or documentation for the HS_OTG HAL. Its as if it's missing a FIFO, and I think it has to do with the following section which has essentially no documentation: VOID USBX_APP_Device_Init(VOID) { /* USER CODE BEGIN USB_Device_Init_PreTreatment_0 */ /* USER CODE END USB_Device_Init_PreTreatment_0 */ /* USB_OTG_HS init function */ MX_USB_OTG_HS_PCD_Init(); /* USER CODE BEGIN USB_Device_Init_PreTreatment_1 */ HAL_PCDEx_SetRxFiFo(&hpcd_USB_OTG_HS, 0x200); HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 0, USBD_MAX_EP0_SIZE/4); HAL_PCDEx_SetTxFiFo(&hpcd_U
Hi,I am trying to modify the USBPD_Analyer Demonstration to use a fixed PDO definition in the usbpd_pdo_defs.hEventually I would like to modify it to create a source slave as it is not available in the CubeMonitor-UCPD but to begin with I am just adding the fixed sources already in the code.I have commented out #define _USBPD_PWR_IF_C in usbpd_pwr_if.c to use the definition ofPORT0_PDO_ListSNK[USBPD_MAX_NB_PDO] in the usbpd_pdo_defs.hand I have also added #include "usbpd_pwr_if.h" to the usbpd_pdo_defs.h as the compiler was warning of implicit declarations of PWR_A_50MA, PWR_V_100MV etc.Now when I compile the project I getmultiple definition of PORT0_PDO_ListSNK multiple definition of USBPD_NbPDO in usbpd_dpm_core.o, usbpd_dpm_user.o, bsp_gui.o and gui_api.oI can see that PORT0_PDO_ListSNK is used in these file but don't understand why it thinks there are multiple definitions. I would be grateful if you c
Hi, I am using the STM32CubeMX ver 6.13.0 to generate a USB-PD DRP application. After generating the code following this procedure for custom boards (https://wiki.stmicroelectronics.cn/stm32mcu/wiki/STM32StepByStep:Getting_started_with_USB-Power_Delivery_Dual_Role) I see that the file "usbpd_pwr_if.c" is defining the following macro "#define __USBPD_PWR_IF_C" first thing, than including the necessary header files. One of the header files, "usbpd_pdo_defs.h", is using the __USBPD_PWR_IF_C to check if there is the need to initialize the list of SRC/SNK PDOs or get them as externs. The issue is that even though the __USBPD_PWR_IF_C is defined and the "usbpd_pdo_defs.h" header is included after the definition, the "usbpd_pdo_defs.h" header file is not seeing the definition and is enabling the necessary code as if the macro __USBPD_PWR_IF_C was not defined.Any possible reasons for this behaviour?Thanks
Hello,I am trying to realise my own bootloader on my STM32U575 and have found the following article:https://community.st.com/t5/stm32cubeide-mcus/stm32u575-custom-bootloader-bootloader/td-p/584218Unfortunately this does not work for me. I am using a STM32u575VGT and the following code:Function at main.cstatic void _bootJumpToFirmware() { typedef void (*pFunction)(void); #define APPLICATION_ADDRESS 0x0803C000 pFunction JumpToApplication; JumpToApplication = (pFunction) (*(volatile uint32_t*) (APPLICATION_ADDRESS + 4)); __set_MSP(*(uint32_t*) APPLICATION_ADDRESS); JumpToApplication(); }STM32U575VGTX_FLASH.ld in bootloader project/* Memories definition */ MEMORY { RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 768K SRAM4 (xrw) : ORIGIN = 0x28000000, LENGTH = 16K FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 240K }STM32U575VGTX_FLASH.ld in main project/* Memories definition */ MEMORY { RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 768K SRAM4 (xrw) : ORIGIN = 0x28000000, LENGTH = 16K
HI I m using H743 Nucleo, to write a RTOS program with 2 tasks which gonna access to the same memory location concurrently.. can anyone advise which RTOS method to use ? Tasks ? Semaphore? Message Queue?
I'm a software developer and love electronics, specifically making metal detectors. I'm trying to develop a new Pulse Induction metal detector and I'm using this development board (STM32F407VET6).Although I'm a software developer, I work with high level programming languages like Javascript and Python, so programming in plain C (register manipulation) is not easy for me, but I want to learn, so, I'm building the code with the help of AI (ChatGpt).The code below is supposed to generate 2 pulses with PWM inside a 1ms pulse period. One pulse is 100us (or the metal detector TX pulse) generated to PE13 and another is 500us (for the metal detector power supply charge pump) generated to PA8.I tested the pulse generation with an oscilloscope 100uS/Div and the first pulse is correct (100us) but it appears one time at the start and another at the end of the and it should appear only one time at the start of the period. I tried everything with the IA but I can't solve this problem and don't under
I am really confused about the meaning of the VirtAddVarTab that is filled with number from 1 to NB_OF_VAR. My understanding is that is used to copy from one page to the other when the first is full. Anyway I had to save a structure to EEPROM and reload it from but I am no shure that what i'm doing is correct, even if it is working. My concern is that I'm not using this VirtAddVarTab to refer to the (virtual) eeprom locations. This is my code void WRITE_STRUCT_EEPROM(eeStorage_t eep) { uint8_t LEE[sizeof(eep)]; uint8_t a, i; // MyData = sizeof(eep); a = 1; // dest source nofb memcpy(&LEE, &eep, sizeof(eep)); for (i = 0; i < sizeof(eep); i += 2) { res = EE_WriteVariable(a, LEE[i] | (LEE[i + 1] << 8)); a++; } } eeStorage_t READ_STRUCT_EEPROM(void) { eeStorage_t eep; uint16_t bdata[2]; uint8_t LEE[sizeof(eep)]; uint8_t a, i; a = 0; for (i = 1; i < sizeof(eep)/2+1; i++) { res = EE_ReadVariable(i, &bdata[0]); // res = EE_R
Hello,For my project Im checking on a data request by using DMA and UART Idle interrupt. After a few minutes my while loop just stops executing. The code keeps executing the USART1_IRQHandler and doesn't return to the main code anymore. If Im not using DMA this doesn't happen. Does anyone know how this happens and if it can be fixed?Here a few code snippets:static void MX_USART1_UART_Init(void) { /* USER CODE BEGIN USART1_Init 0 */ /* USER CODE END USART1_Init 0 */ /* USER CODE BEGIN USART1_Init 1 */ /* USER CODE END USART1_Init 1 */ huart1.Instance = USART1; huart1.Init.BaudRate = 230400; huart1.Init.WordLength = UART_WORDLENGTH_8B; huart1.Init.StopBits = UART_STOPBITS_1; huart1.Init.Parity = UART_PARITY_NONE; huart1.Init.Mode = UART_MODE_TX_RX; huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE; huart1.Init.OverSampling = UART_OVERSAMPLING_16; huart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE; huart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT; if (HAL_RS485Ex_Init
I need sample code for FOTA update through UART please as soon as possible share
Hi, while using the SVD (Version 1.8 - but in the 1.9 zip this file still states 1.8) for the H743 I noticed some errors and have patched them for my code generation. Some of them caused me trouble for hours until I noticed that the SVD and the RM did not agree.I'll attach the patches here. I tried to attach the patches here, but .patch is not accepted, renaming it to txt still fails...Fixes for the CAN module: https://pastebin.com/1X0v7iS4Fixes for the TIMER module: https://pastebin.com/rTEP4M3WFixes for the ADC module: https://pastebin.com/ED99CUTBFix for one TIMER interrupt: https://pastebin.com/cvnEj1MW
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.