Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
There seems to be a bug when using the USBX hub class. Sometimes it works, but most often it does not. The problem appears to be with file: ux_host_stack_enum_thread_entry.c. The code: VOID _ux_host_stack_enum_thread_entry(ULONG input) { UX_PARAMETER_NOT_USED(input); /* Loop forever waiting for changes signaled through the semaphore. */ while (1) { /* Wait for the semaphore to be put by the root hub or a regular hub. */ _ux_host_semaphore_get_norc(&_ux_system_host -> ux_system_host_enum_semaphore, UX_WAIT_FOREVER); #if UX_MAX_DEVICES > 1 /* We try the hub first. For this we look into the USBX project structure to see if there is at least one hub. */ if (_ux_system_host -> ux_system_host_enum_hub_function != UX_NULL) { /* Yes, there is a HUB function, call it! */ _ux_system_host -> ux_system_host_enum_hub_function(); } #endif /* The signal may be also coming from the root hub, call the root hub handler. */ _ux_host
Hello, I have a problem with communication between my PC and MCU. I have connected my project according to this diagram (with external 12MHz oscillator): I attempted to connecting the 1,5k GPIO pin (PA10) to control the pull up. Then I connected a 1,5K resistore to 3V3.Additionally, I experimented with connecting the VBUS with resistor devider (33k and 82k) to the PA9 and then I tried to connecting VBUS directly to PA9.Furthermore, I installing the STM32 Virtual COM Port Driver on win7 32bit and win10 (win8 64bit). Both have the same result: Same result: DeviceFailedEnumeration : Unknown Device.Do you have any idea why this enumeration issue is occurring? Thank you very much. SincerelyRadek
I have set up a STM32F103 as a I2C master. I have found that calling the function HAL_I2C_Mem_Read sometimes disables all interrupts for more than 140us. Needless to say this causes significant problems with the timing of other external interrupts. The section of code that does this is: __disable_irq(); /* Read data from DR */ *hi2c->pBuffPtr = (uint8_t)hi2c->Instance->DR; /* Increment Buffer pointer */ hi2c->pBuffPtr++; /* Update counter */ hi2c->XferSize--; hi2c->XferCount--; /* Wait until BTF flag is set */ count = I2C_TIMEOUT_FLAG * (SystemCoreClock / 25U / 1000U); do { count--; if (count == 0U) { hi2c->PreviousState = I2C_STATE_NONE; hi2c->State = HAL_I2C_STATE_READY; hi2c->Mode = HAL_I2C_MODE_NONE; hi2c->ErrorCode |= HAL_I2C_ERROR_TIMEOUT; /* Re-enable IRQs */ __enable_irq(); /* Process Unlocked */ __HAL_UNLOCK(hi2c); return HAL_ERROR; } } while (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BTF) == RESET); /*
I've been trying to connect the modem for weeks (Not the truphone sim, a removable one). I would like to connect by talking with the modem directly (through the AT commands), however I have also tried the X-Cube-Cellular.Some AT commands don't work neither with X-Cube-Cellular, nor the code where i speak directly with the modem through USART 3. These commands are in the documentation, yet they don't work. Could you help me? I don't know if there is any way to update de modem, to know all AT commands in the documentation? Could you help me with the steps to connect a removable sim (not truphone) with or without X-Cube-Cellular?
Hi,the application gets stuck on the Error_Handler() in the piece of code below in main.c hdsi.Instance = DSI; hdsi.Init.AutomaticClockLaneControl = DSI_AUTO_CLK_LANE_CTRL_DISABLE; hdsi.Init.TXEscapeCkdiv = 4; hdsi.Init.NumberOfLanes = DSI_TWO_DATA_LANES; hdsi.Init.PHYFrequencyRange = DSI_DPHY_FRANGE_80MHZ_100MHZ; hdsi.Init.PHYLowPowerOffset = PHY_LP_OFFSSET_0_CLKP; PLLInit.PLLNDIV = 32; PLLInit.PLLIDF = DSI_PLL_IN_DIV1; PLLInit.PLLODF = DSI_PLL_OUT_DIV2; PLLInit.PLLVCORange = DSI_DPHY_VCO_FRANGE_500MHZ_800MHZ; PLLInit.PLLChargePump = DSI_PLL_CHARGE_PUMP_2000HZ_4400HZ; PLLInit.PLLTuning = DSI_PLL_LOOP_FILTER_2000HZ_4400HZ; if (HAL_DSI_Init(&hdsi, &PLLInit) != HAL_OK) { Error_Handler(); } I just noticed that DSI lane clock is set to 32MHz - screenshot below - from the HSE (8MHz crystal) which seems too low. To what frequency (in the clock diagram page) do I set the two DSI clocks (DSI TXCLKESC and DSI lane byte clock)? How i
Hi,Is it possible to use the Prolific USBX library without ThreadX Core? In STM32CubeMX, when I deselect ThreadX Core, the Prolific USBX option is no longer available. However, I can generate the USBX CDC-ACM library without enabling ThreadX.Could you provide some information on this? I couldn’t find any relevant details in my searches.I am using STM32H563.Thanks!
Hi I'm bit lost and I couldn't find the link to the svd file. Is it somewhere in here https://www.st.com/en/microcontrollers-microprocessors/stm32g051f6.html#tools-software? If I search for svd I get zero result. Which link is it that takes me directly to the svd file?
Hello,I would like to request a feature to be added to the STM32 HAL.Would it be possible to be able to add a custom user context when registering peripheral callbacks.Example: HAL_StatusTypeDef HAL_SPI_RegisterCallback(SPI_HandleTypeDef *hspi, HAL_SPI_CallbackIDTypeDef CallbackID, pSPI_CallbackTypeDef pCallback, void* UserContext); And then as callback function: typedef void (*pSPI_CallbackTypeDef)(SPI_HandleTypeDef *hspi, void* UserContext); I really miss this feature and have had to code around it for god knows how many times.I have added it myself to the SPI driver, but if I regenerate its all gone ofc.So it would be real nice if this could be added to drivers. Thx,Alexander
Hi there!I'm working on a project wherein I'm trying to play an audio file in reverse. I'm using freeRTOS, fatFS, and a 4-wire SDIO setup, and am doing this little file read dance where I:f_lseek() to the end of a filecalculate how many bytes I want to readf_lseek() backwardsdo the read()goto 2 Then, later, I reverse my audio samples. I'm experiencing some odd behavior that I don't understand, however. To try to wrap my head around it, I toggle a GPIO each time I start the above cycle. I would expect - when probing this GPIO with a scope - to see a reasonably constant square wave period that would help me understand how long the whole operation takes. What I see, however, is something different: I see a few high/low cycles, then a period of what looks like inactivity, then another section of high/low cycles:I'm still coming up to speed with my understanding of fatFS, but I'm curious what might cause these 'pauses'?I understand that what I'm doing - constantly seeking bac
Hi!https://community.st.com/s/question/0D53W00001AO4MFSA1/bl462ecell1-the-modem-doesnt-respond-to-some-at-commandsand https://community.st.com/s/question/0D53W00000j7Em9SAE/bl462ecell1-not-connecting-to-truphone demonstrate, that we need an AT command manual, even with the inbuilt eSIM, let alone for a local non-Truephone SIM. Just to head off the answer that we don't need an AT command manual, and save everyone's time.The board user manual mentions, that documentation from Murata is available using the code printed on the insert card in the package.This only gives access to the files for the 1SE module documentation on Murata's page, and that doesn't include AT command manual. Th code doesn't work to access the manuals section for 1SC (which is the module used internally on 1SE), which does have AT command specification.Where can I find the relevant documentation? If I need to set stuff like at at%setacfg=radiom.config.preferred_rat_list,"NBIOT"I need a manual to see what the valid ar
Hi,Setup:https://github.com/Open-CMSIS-Pack/STM32U5xx_DFP/blob/main/CMSIS/Debug/STM32U535_545_575_585_59x_5Ax.dbgconfCompiler: ARM Keil MDKv5 version 5.41When using Embedded Trace (Sync Trace with 4-bit) and the Debug Description file (.dbgconf Configuration File) from the STM32U5A5 DFP v3.0.0 pack is enabled, the processor enter debug mode, but no trace data is send from processor. The SWD debugger works correctly and it is possible to step through the code, breakpoints, etc.Once in debug mode, a breakpoint is placed on the code, and the GPIOE_MODER register is read back as 0xFFFFFFFF, which indicates that the .dbgconf file is somehow incorrect. The Log Sequence shows that the .dbgconf file is read and executed but the trace signals are not enabled.If the GPIO_MODER register is changed manually (selecting the alternate function mode for PE2, PE3, PE4, PE5 and PE6), the Trace signals are enabled (seen on the oscilloscope) and the Trace data is read correctly in uVision.Do you have an u
I'm new to ST and am evaluating if the STM32G0 family is a good fit for us. The idea of using the HAL driver interface is appealing as it would allow migration to other chips in the larger STM32 family without code changes.I'm working on making a little I2C client example using the interrupt interface. In other vendor drivers for this sort of stuff, you can often supply a context pointer to these callbacks to inject user data without the need for hard coding access to global scoped symbols. Am I just missing how to do this with the HAL, or are global symbols the only way? If it is, it will make writing abstrated and testable code a lot more boilerplaty and challenging.
Hi:I want TIM1 of STM32H503 to output PWM output.What I need is:* the counter works in up/down counting mode* Set channel 1 to active level on match (TIMx_CNT match TIMx_CCR1) when the the counter is counting up* Set channel 1 to ainctive on match (TIMx_CNT match TIMx_CCR1) when the the counter is counting down But neither PWM mode nor Output Compare mode satisfy my requirement. * PWM mode (OC3M[3:0] = 0110b or 0111b): channel 1 is active/inactive as long as TIMx_CNT<TIMx_CCR1 else inactive. It means the comparator is always working. Instead my need is set/clear the channel1 only when TIMx_CNT match TIMx_CCR1.* Output Compare mode (OC3M[3:0] = 0001b or 0010b): Set channel 1 to active/inactive level on match. This mode seem more suitable for my case. But unfortunately it doesn't cover all my requirement: I want the Output Mode Controller take different action on counting up and counting down,&n
Hello,When a task has completed, does azRtos do any garbage collection? (ie remove the task and recoup the memory pools)? - OR - is it something the user has to do (even for system threads)?If it is the latter and I have to take out the garbage, do you have an example of that (a task that monitors, deletes tasks and recovers pool memory)?
On our STM32H7S7I8 we have the MCE interface working on XSPI1 and XSPI2MCE3 should be connected to the FMC interface, we run a NAND flash on this peripheral. We also want to encrypt the data on this device. There is communication with this device using the provided hal library. In the documentation, it is stated that either Memory Mapped / DMA needs to be used for reading / writing when using MCE. In the HAL device there is no DMA interface for NAND flash (stm32h7rsxx_hal_nand.h). When implementing my DMA functions I can successfully read / write data.When I enable the MCE I can still perform read / write requests however:When I write the data this doesn't seems to get encrypted.When I read the data this seems to be decrypted, and when I disable MCE the original data is retrieved WriteBuffToNAND( a ) // using DMA ReadNANDToBuff ( b ) // using DMA // a == bEnableMCE() WriteBuffToNAND( a ) // using DMA ReadNANDToBuff ( b ) // using DMA DisableMCE(); ReadNANDToBuff ( c ) // us
Hi, I am using the STM32G0B1CBTX with STM32CubeMX ver 6.13.0 to produce a USB-PD DRP application. So far, I managed to implement a USB 2.0 Host as this is also needed. When trying to add the USB-PD DRP following ST-s tutorial BUT omitting the inclusion of the OS, I get a hard fault immediately after running the firmware. Moreover, I need to use the USB-PD library without the OS.1. I tried to check what is causing the hard fault but I cannot find any documentation on how to view the hard fault status or any reference to hard fault registers. Can someone point me to any documentation. 2. Are there any references on how to implement the USB-PD with out the use of an OS? Thanks
STM32C031G4I am trying to adjust the RTC time in an EXTI interrupt routine (its a button press, it should e.g. add an hour).The RTC is setup using HAL, it succesfully inits with the preset values. After Initialization everything works, the RTC is counting and I can read the time, the initial HAL_RTC_SetTime works. When the button is pressed, the current time is read, modified and then set. However i cannot re-enter the initialization mode to change the RTC time registers with HAL_RTC_SetTime. RTC_EnterInitMode fails with HAL_TIMEOUT. I verified that the RTCAPBEN is set. I did a full SFR register dump diff comparing the initial state and the state when its called from the EXTI interrupt. I could not find a problematic difference. These are the functions that I call to change or read the time:HAL_StatusTypeDef SetTime(RTC_TimeTypeDef *sTime,uint32_t Format) { if (HAL_RTC_SetTime(lrtc, sTime, Format) == HAL_OK) return HAL_OK; return HAL_ERROR; } HAL_StatusTypeDef
Hello, I am working on C + Assembly and encountering an issue.I am working on a simple program on an STM32F3 (Cortex-M4) that calls an assembly function (assembly_main) from main() in a loop. However, assembly_main()executes only once and does not return back to main() as expected. The only way to make it work continuously is by forcing an unconditional branch, which is not what I want.I suspect the issue is related to stack pointer (SP) corruption or an incorrect return address being stored while executing main(), which prevents assembly_main() from properly returning.QuestionsI assume the system starts execution from Reset_Handler, jumps to main(), and then calls assembly_main()? Is this the correct flow?However, something goes wrong when trying to return from assembly_main(). Why does bx lr fail to return back to main()?It seems that LR (Link Register) is not holding a valid return address.Is my stack pointer (SP) being overwritten?Any insights or debugging pointers would be gr
Hi,I am Shantanu Ganar, Firmware Engineer in REFU DRIVE INDIA Pvt.Ltd located in PUNE.We are planning to work with STM32 MCU for our upcoming project and therefore we would like to know more about X-CUBE-STL library, its cost, procedure for purchase, etc. Thank you!
Hello, I have setup the following parameters to run ETHERNET Using STM32H750B-DK Board and I am getting void MemManage_Handler(void) Error.
Hello, I flashed my stm32h573 with a program to set it to standby mode, but didn't setup the wakeup pin and it has a 5 sec wdg timeout. The error I am having is that it "can't connect to the target" to flash it with different code or to erase the flash 🥲🫠I "think" it's not able to connect because it doesn't have enough time to connect due to the watchdog. As it does a system reset every 5 seconds.Any recommendation on how I can get it to connect or erase the flash?is there any way to save this board?!?I have tried: all gave me the same error of can't connect to target1. stm32cubeide debug2. Keil erase flash3. j-flash lite to erase chip I am going to try the stm32cubeprogrammer later today, after I download it. **** edit ****This is the error message I receive from stm32cubeprogrammer when I try to connect the dev board
Hello. I have a problem with my code. I's supposed to send to the computer "00 82 00 00 01 01", however it sends "00 82 00 00 00 00". It can happen that the last four bytes are garbled. I've tested by printing pretty much up to the HAL functions, yet all of the test come out good. I don't know what's wrong here. Please help. Here's the code, it's as minimal as I could've made it: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. * ************************************************************************
I'm working with an STM32H753 MCU and trying to receive messages from a PC via UART to implement a simple state machine. The idea is that the MCU should switch to different states based on the received message.Initially, I attempted to use fgets(message, sizeof(message), stdin);, but the buffer named message seems to be empty after receiving, and I get nothing when printing it using printf("\r\nThe sentence is: %s", message);. Is this the correct way to do so?
STM32CubeG0 git repository points to temporary branch in submodules.Here the repository cbtl08gp053 is on tag v1.0.1 which is not part of main branch.
Hello,I'm new to this community and I'm trying to learn from different examples that are available online. I have STM32G474E-EVAL1 board and I want to include the sd card in one of my projects. So I founded the FatFs_uSD_Standalone Example that was originally for the STM32G474E-EVAL board. I was able to compile it successfully and tried to run it in the debug mode on my EVAL1 board but it fails in the 'SD_GoIdleState(void)' function. Is there any particular reason that the code wouldn't run properly on my EVAL1 board ? I've checked that the sd connector does receive 3.3 V.Thanks in advance
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.