Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hello,AN4879 Rev 6 - April 2023 does not mention STM32G0 and STM32G4 USB functionality, also the series has been release since some time. Explaining similarities and differences to the other series wooul be usefull
Hello everyone.I have some problems with the configuration of the OV5640 camera module and I need your help.https://github.com/STMicroelectronics/stm32-ov5640I am using the OV5640 library created by STM above. I have a card that I have drawn and with this card I get the image from the OV5640 camera and save it to the uSD card via SDRAM. But before I get the image, I am currently working on the configuration of the camera. I have never dealt with DCMI before and I do not know how to use the library written by STM. I do the configuration with I2C but when I use any function in the library, STM enters the hardfault handlerI think the problem is that I do not define which I2C I configure the camera with anywhere. The processor I use is STM32H743ZIT6 and I am trying to make the configuration using I2C1.I2C_HandleTypeDef hi2c1;HAL_I2C_Mem_Read(&hi2c1, DevAddress, MemAddress, MemAddSize, pData, Size, Timeout)For example, in this function, reading is done by sending the hi2c1 handle to the
STM32H723 get stuck after a successful USB DFU download / reset in the HAL_Delay() in MX_USB_DEVICE_Init(); I can fix it by moving MX_IWDG1_Init(); before MX_USB_DEVICE_Init(); so the watchdog resets the device, but is there a way so this does not happen ? We don't see it after a power cycle but have seen it during development when reloading the debugger
Hi folks,I have started a very basic PSSI project with CubeMX with the STM32H533R. I send 10 bytes of data to the PSSI in 8 bit mode without any additional control lines (RDY and DE switched off). In the beginning I thought everything works well. I have reached the HAL_PSSI_TxCpltCallback() function, indicating that the whole buffer was send out. I also placed a debug pin before calling the dma transmitt function and clear it in the HAL_PSSI_TxCpltCallback() to measure the transmit delay and the tx time by varying the data length to be send from 10byte to 20byte, and I can see the difference in time on the debig pin with an oscilloscope. BUT the only problem I have is that there is absolut no data output on any of the 8 GPIOs. Everything seems to be correct (clock, alternate pin function, drive level,...)Can anybode see a problem in my code: void HAL_PSSI_TxCpltCallback(PSSI_HandleTypeDef *hpssi) { HAL_GPIO_WritePin(GPIOC, GPIO_PIN_4, GPIO_PIN_SET); PS
..
I am working with a CAN bus over a STM32 Board. I don't think the hardware is important in my question. I have tried to use the HAL_FDCAN_GetRxMessage function to get a message from a device explorer where you can easily send a message via CAN. I run into an error when trying to receive a message. Inside the function when DataLength from the RxHeader structure is being set the value does not actually change. None of them do actually, the RxHeader does not change tat all. I have tried to change the value manually and that did not work either. For some reason it seems to just be constant. I also looked at the calculated value which DataLength should be set to and that is also wrong. I set the length of the message to 8 Byte and the calculation ends up with the value of 5. The calculation is like this: ((*RxAddress & FDCAN_ELEMENT_MASK_DLC) >> 16U). And like I said testing this with a supposed length of 8 it comes out to 5. I tested it with a different message and it just seems
Hello everyone, I am trying to establish a connection between my STM32H745I(Discovery kit) and my computer and the jumpers are set to STLK for programming, and I also have connected the board through LAN to my computer directly. I have set my computer IP static to 192.168.4.26 and I set the IP for the STM32H745 to 192.168.4.187 through LWIP settings(by disabling DHCP and set the static IP), but I cannot ping the STM32 from my computer(always I receive "From 192.168.4.26 icmp_seq=1 Destination Host Unreachable"). Ethernet port on the STM32 has green and orange LEDs on, on the both sides of the port. I have attached screenshots from my ETH and LWIP settings, and if more information is needed to debug the problem, I would be happy to share it! I would be grateful for your guidance, since it is my first ever project with STM32. Thanks in advance!
Issue with FatFs and D-Cache on STM32 (CubeMX Library)I'm having issues using FatFs with D-Cache enabled on an STM32. After searching, I found several posts reporting similar problems, but I haven't seen a clear solution.I’m using the FatFs library that comes with CubeMX, and my goal is to write to a microSD card.The question is: Is there a proper solution to make FatFs work with D-Cache enabled? If not, is there an alternative library that does work with D-Cache?Any insights or recommendations would be greatly appreciated.
Hello, I am trying to record audio data from an ADC to a SD card with a nucleo STM32L552ZET6QU board. To write data into SD card using FatFs I initialised it : "// Open the file system - mount the drivefres = f_mount(&FatFs, "", 1); // 1 = mount nowif (fres != FR_OK) {myprint("f_mount error (%i)\r\n", fres);while(1);}// Statistics from the SD cardDWORD free_clusters, free_sectors, total_sectors;FATFS* getFreeFs;fres = f_getfree("", &free_clusters, &getFreeFs);if (fres != FR_OK) {myprint("f_getfree error (%i)\r\n", fres);while(1);}//Formula comes from ChaN's documentationtotal_sectors = (getFreeFs->n_fatent - 2) * getFreeFs->csize;free_sectors = free_clusters * getFreeFs->csize;myprint("SD card stats:\r\n%10lu KiB total drive space.\r\n%10lu KiB available.\r\n", total_sectors / 2, free_sectors / 2);// Open filefres = f_open(&fil, "record.bin", FA_WRITE | FA_CREATE_ALWAYS);if(fres == FR_OK){myprint("I was able to open 'record.bin' for writing\r\n"
Hi, I would like to know how to disable address acknowledgment in I3C when operating as a target (with an already assigned address) to temporarily hold communication, similar to the OA1EN bit in I2C.Thanks,
Hello,I built and uploaded the BSP example from the H7 MCU package, version 1.12.1, on my STM32H747I-DISCO board. I tried the various demos included in the example and they work but it seems there is an issue with the codec configuration.(I didn't change anything)While testing the analog_audio_record demo (which should record from the input jack and pass the recorded data to the output jack) i plugged in my headphones in the output jack and noticed that there is a lot of noise, regardless of if an input jack is connected or not.Playing a song on max volume from the input jack I could hear it above the noise.While testing the audio_record demo, the microphone was less affected by noise but has a large gain.I stumbled upon this video on youtube: https://youtu.be/O2XaCFsWxSw?si=J-KL4CMG7EA3le86"STM32F7 Discovery : Audio Line-in to Line-out Pass-through" from "PizzaBear Engineering".He points out how some register writes may be inappropriate, like 0x0035 to registers 0x29 and 0x2A, se
Hello, I am using STM32F407 Transmitting some data over UART and Receiving the same data with another in INT on the MCU.The problem is that the receiving side gets only the first byte even when switching sides the receiving side still receives only the first byte. I think that the HAL stops receiving data on all UARTS while transmitting.
Hi,I'm using the STM Cube IDE version 1.15.1 along with NucleoG474RE board. My C application requires the use of memcpy(). The memcpy() function should copy the values from an unsigned char source buffer to the unsigned char destination buffer. This however does not happen. Setting a break point after the memcpy() operation shows that the values in the destination buffer are identical to before the call. I'm not sure I understand why this happens. The issue seems identical to the one below:Problem with memcpy function in new IDE version - STMicroelectronics CommunityI did try enabling the compiler flags as mentioned in the post. A few warnings turned up but nothing related to the line of code corresponding to the memcpy() call.Thank you for your help.
Hello,I'm trying to get an Ethernet ping with NUCLEO-H755ZI-Q to check if everything works. To eliminate any possible errors from my side, and since there are no ready projects for H755, I'm using this project that I've found in this post. I have:opened it with my STM32CubeIde using "Open project from file system" option,checked that pinout for RMII agrees with documentation,physically connected my Nucleo to Ethernet port in my laptop using cable,built the project and ran on the Nucleo board (Run Configuration -> choose configuration for M7 -> Run),opened Windows PowerShell and executed command "ping 192.168.2.120".Every time ping does not work and I get "Request timed out." in response. LEDs are blinking on the board and I can debug it correctly, so I assume the program is running as supposed.What am I supposed to do differently? Do I need to change some network settings on my laptop? Choose different IP address for Nucleo board?
I've already contacted support, so this post is just for community.There's a bug in HAL_SetTickFreq function (stm32f4xx_hal.c)---8<---HAL_StatusTypeDef HAL_SetTickFreq(HAL_TickFreqTypeDef Freq){ HAL_StatusTypeDef status = HAL_OK; assert_param(IS_TICKFREQ(Freq)); if (uwTickFreq != Freq) { uwTickFreq = Freq; /* Apply the new tick Freq */ status = HAL_InitTick(uwTickPrio); } return status;}--->8---If HAL_InitTick fails, the frequency remains unchanged whereas uwTickFreq is changed. E.g. I have stm32f407vgt6 working on 168MHz with 1kHz SysTick . I want to set SysTick to 10Hz, so I call HAL_SetTickFreq( HAL_TICK_FREQ_10HZ ). Eventually SysTick_Config fails because (16800000 - 1) is bigger than SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL). But uwTickFreq is already == HAL_TICK_FREQ_10HZ, so the ticks are now counted incorrectly. HAL_SetTickFreq function should be changed to something like this:---8... if (uwTickFreq
Dear ST I have some question about i2c read functions Currently we use zephyr os (version 3.4.0) the stm32f412RGT used as the host and the host reads a 5-byte value from another mcu used as a slave throughi2c the following problem occurs once every 3 hours after that i2c gets stuck. uint8_t rx_buf[5];rc = i2c_read_dt(&cfg->bus, rx_buf, sizeof(rx_buf)); When the host reads the last byte 0x3f normally, it should send nack instead of ack to slave , but it seems that i2c is stuck because ack is sent to slave . Is there a way to solve this? thanksBRMR.SHIM
HiI am using the evaluation board stm32743And testing the firmware that include freeartos and ethernetIf enabled the "check_for_stack_overflow" in cubeMx freeartos this will resultin vApplicationStackOverflowhook to inhabit.checking sp register when the firmware start(at main) shows that sp = 0x2407ffe8.Once the start and reaches to the first task and the only one the stack pointer sp reigster = 0x24005af0and on the next step vApplicationStackOverflowhook inhabit.for some reason the stack uses a lot of memory right from the start of the first task
Im using the B-U585I-IOT2A board. I want to have continuous audio capture and preprocess the audio into melspectrograms for input into a sound detection model. Im having trouble setting up the microphone. Is it the MDF1 setting in the peripherals? Im not sure how to do it
Hi, I have a problem with the Ethernet on a STM32F777 with CMSIS V2 and LWIP. Firmware package is 1.17.2. The configuration was created with CubeMX. The firmware runs normally until a data packet (ping command from cmd) is received on the Ethernet. Then the firmware gets stuck at the semaphore of the TxCpltCallback.I have attached the call stack as a screenshot.When the data packet arrives, HAL_ETH_IRQHandler() is called and then the function HAL_ETH_RxCpltCallback(). So far everything works. Then the function HAL_ETH_IRQHandler() is called again and in it the function HAL_ETH_TxCpltCallback(). The firmware then stops at the position of the attached screenshot. There is already a similarly described case in the forum, but the solutions described there are already implemented in the current F7 firmware package and it still does not work. [ https://community.st.com/t5/stm32cubemx-mcus/bug-stm32-lwip-ethernet-driver-tx-deadlock/td-p/83219 ] Can someone please help me? Many thanks in advan
Hello everyone,I am working with the NUCLEO-H753ZI and communicating with an IIM42652 accelerometer using SPI with DMA enabled. Below is the relevant part of my code: int main(void) { /* MCU Configuration--------------------------------------------------------*/ HAL_Init(); SystemClock_Config(); /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_DMA_Init(); MX_SPI1_Init(); MX_TIM12_Init(); /* Start Timer 12 PWM */ HAL_TIM_PWM_Start_IT(&htim12, TIM_CHANNEL_2); // Prepare SPI communication txbuffer_dma[0] = REG_WHO_AM_I | 0x80; txbuffer_dma[1] = 0x00; memset(rxbuffer_dma, 0, sizeof(rxbuffer_dma)); // Start SPI communication with DMA HAL_SPI_TransmitReceive_DMA(&hspi1, txbuffer_dma, rxbuffer_dma, 4); /* Main Loop */ while (1) { HAL_GPIO_WritePin(GPIOB, GPIO_PIN_9, GPIO_PIN_SET); HAL_GPIO_WritePin(GPIOB, GPIO_PIN_9, GPIO_PIN_RESET); } } After running this code, I checked the signals using a logic analyzer and observed th
I am trying to stand up a project using an STM32G4 using Zephyr with USB Device Next Networking. I have a similar project up and running on an nRF52. I'm getting the error on my STM32 project that upon system reset, I get a hard fault in z_cstart() -> ... -> statics_init() -> sys_heap_init(). I've isolated this to be a problem when I turn on CONFIG_NET_L2_ETHERNET=y. If I set CONFIG_DEBUG=y I see a similar failure upon the call to z_bss_zero(). From what I can tell, the errors are consistent with an error initializing the soc memory. This is a custom board with a G473CC soc. I've made a custom zephyr dts for this board with #include <st/g4/stm32g473Xc.dtsi> so afaik the memory definitions should be correct. I haven't set any memory protections in the option bytes, is there perhaps a default protection in place that comes from the factory that may be causing an issue?
Hello,on an stm32f429,I trigger an interrupt on PA0 for 1 second andI light an LED on PA3 for a short time, with a timerI count the number of overflows on a 10 Mhz signal onPA5 and store the result in a variable,I'm a beginner with STM32F and I must have forgotten something!!because it doesn't work.Attachment file :Thanks you for your helpSébastien.
I've been attempting to stream audio in via a USB microphone using the USB host functionality on my STM32F411. Unfortunately, it seems as though the audio class has been left unfinished and, although about 50% of the code is there, the other important 50%, that actually streams the input, is missing. I have spent a significant amount of time testing and googling (and frankly using a bit of ChatGPT because I don't have much time to spend digging around in the USB spec) to try and piece together what is missing.I'm at a point where I am receiving data, but the data just seems to be entirely wrong. It does't seem garbled, but it tends to just repeat the same packet data over and over again, and sometimes it doesn't receive anything and the buffer stays filled with zeros.This post was very helpful in laying the base, but I have since expanded on it a little bit. The first important bit I added was to set the microphone to use the highest possible frequency available, which in my case
Hi, I'm creating Boot sw & App sw in one board. which means, 2 independent STM32 Proj. runs in same Flash / RAM. There is an issue when HAL_RCC_GetSysClockFreq() has been called. The first called sw, boot sw, doesn't make any trouble. but the second one, app sw which is jumped in by boot sw, make trouble when do [vmov s15, r3] assembly code. I've already checked Memory Map, Flash.ld, Vector ... etc. So obviously, there is no problem until [vmov s15, r3] will be done by app sw. the first call of [vmov s15, r3] is triggered by [main()] - [SystemClock_Config()] - [HAL_RCC_GetSysClockFreq()]fracn1 = (float_t)(uint32_t)(pllfracen * ((RCC->PLL1FRACR & RCC_PLL1FRACR_PLL1FRACN) >> \ RCC_PLL1FRACR_PLL1FRACN_Pos)); As result of [vmov s15, r3], MSP has been corrupted. Red box is the Stack Pointer, and Blue box is MSP. So blue box area should not be changed by [vmov s15, r3]. But as you can see, the Return Address has been corrupted after&nb
Hi currently i am using STM32H735G-DK board and i need to integrate with azure IOT via ethernet 1. From .Ioc file i have enabled MQTT,msns,dns,dhcp,sntp,cloud and i have added Nx azure related files and azure c sdk and the file structure as attached in the image 2. If have referred an example in the below link and also links attached https://github.com/tdjastrzebski/B-L4S5I-IOT01A_AZURE-RTOShttps://github.com/STMicroelectronics/x-cube-azrtos-h7 3. The examples where all are connected with WIFI is there any example with ethernet connectivity or where i can change the things for ethernet connectivity and azure iot 4. i am using STM32CubeIDE Version: 1.18.0
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.