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
Hello community, I am using STWINKT1B board and trying to implement basic accelerometer datalogging from scratch. I don't want to use HSDatalog because I don't need so many functionnalities.I am using FATFS functions, able to use mount, mkfs, mkdir, open and write functions to create this file DATA/data_000.TXT.When I add the f_stat (after mount and mkfs) function with the path "DATA/data_000.TXT" and restart the board, I always get a FR_NO_FILE error. If I put the SD card in my laptop I can see the file in DATA/data_000.TXT:Here is my code:Any idea about what could cause the issue ?Thank you
Hi people, I'm trying to use the flash crc but is not working as expected. If I pass the end address with offset 3 or 7 the result of crc calc will be always the same, 0xba4bbbf0. What the problem here? FLASH_CRCInitTypeDef flash_crc_init = { .TypeCRC = FLASH_CRC_ADDR, .BurstSize = FLASH_CRC_BURST_SIZE_4, .Bank = FLASH_BANK_2, .Sector = FLASH_SECTOR_0, .NbSectors = 1, .CRCStartAddr = FLASH_BANK2_BASE, .CRCEndAddr = FLASH_BANK2_BASE + 7 }; uint32_t flash_crc_result = 0; if(HAL_FLASHEx_Unlock_Bank2() == HAL_OK) { HAL_StatusTypeDef hal_status = HAL_FLASHEx_ComputeCRC(&flash_crc_init, flash_crc_result); } The address has this values:
Hi, I'm developing an application, which require ADC channel changes when an analog watchdog interrupt triggers. Now in my IRQ routine, I'm having issues with consistent interrupts triggering, blocking my code outside of the ISR intended to change my channels and run my application. Is there any way to stop this from happening ? I've tried __disable_irq(); with no luck. And utilizing __enable_irq(); as well. What I want to do is, prevent all the other interrupts occuring while I am in the ISR, control the flow of the code. I can't use scan mode scanning multiple channels or the DMA, this is the only way for my application to work. Thanks,
Hi Community,I am working in a freeRTOS environment where one of the threads parses the serial data from the UART. A protocol is defined to decode the hex stream received from another device. HAL_UART_RxCpltCallback is configured to receive one byte at a time and is filled in an array that houses a sufficient amount of data (no overflow). But sometimes a byte is getting missed out which is a mid byte.To troubleshoot this issue set the RX FIFO threshold to generate an interrupt if the FIFO is full. However, whenever a byte is missed it does not trigger a HAL_UARTEx_RxFifoFullCallback (still figuring out how to get this work no interrupt is being generated even if I set the threshold to UART_RXFIFO_THRESHOLD_1_8).Core: STM32G491Clock: 170MHz (HSE + PLL)Here is the program flow: uint8_t rx_data; for (;;) { /* This is added for the synchronization to disable ISR being called */ HAL_UART_AbortReceive(&huart1); /* 1. Check for the stream ending \r\n * 2. De
Hi,my app works fine when I use the internal clock but if I switch to external clock I obtain HAL_TIMEOUT from function HAL_RCC_OscConfig().The external clock board schematic is:Clock configuration is:The main.c is: /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2023 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 ------------------------------------------------------------------*/ #include "main.h" #include "adc.h" #in
Hello Support Team.Good Day.We have chosen the STM32G484VET controller for our product.According to the firmware architecture, we intend to create two separate partitions, one for safety-critical (non-upgradable area) and the other for non-safety-critical (Upgradable area)When we will go to certification that time we will only certify the safety-critical code.So can you provide me guidance for code separation for safety and non-safety code?If you have any examples of the same STM32G4 series, please share them with us.Thank you, Hiren R. Thumar.
Hello,I am developing a USB Type C chargerThe development environment is as follows HardwareNUCLEO-G071RB (tested on rev C)X-NUCLEO-DRP1M1 shield Softwarex-cube-tcppDRP1M1_DRP When this board is connected to a Windows tablet, the CAD task(USBPD_CAD_Task) stops working.UCPD monitor updates will also stop When connected to an Android tablet, the CAD task does not stop working.UCPD monitors will not stop updating I also attach a screenshot. Below is the log when the USB cable is plugged in. Best Regards-----------------------------------------------------------------DEBUG312660-- BSP_USBPD_PWR_SetRole : SRC --454DEBUG313100-- BSP_USBPD_PWR_SetRole : SNK --455DEBUG313500-- BSP_USBPD_PWR_SetRole : SRC --456DEBUG313940-- BSP_USBPD_PWR_SetRole : SNK --457DEBUG314340-- BSP_USBPD_PWR_SetRole : SRC --458DEBUG314780-- BSP_USBPD_PWR_SetRole : SNK --459DEBUG314810-- BSP_USBPD_PWR_VBUSInit --460DEBUG314810-- BSP_USBPD_PWR_SetPowerMode --461DEBUG314810--
Has anyone written a driver for the DP83822 PHY ?I have tried to use the DP83848 driver. I am able to pass the DP83848_Init(&DP83848); in the ethernetif.c but then when it comes to check the list status, then I get a link down status. The LEDs on my Ethernet port are not lit up. /* Initialize the DP83848 ETH PHY */DP83848_Init(&DP83848);if (hal_eth_init_status == HAL_OK){PHYLinkState = DP83848_GetLinkState(&DP83848);/* Get link state */if(PHYLinkState <= DP83848_STATUS_LINK_DOWN). {netif_set_link_down(netif); // => Goes there.....netif_set_down(netif);}Also is there a way to add a custom PHY to CubeIDE ?
Hi,I have created two tasks. Task A and Task B. Task A has higher priority. Task receives data through UART and enques this data into queue. Then, Task A is blocked for 1 second. Task B comes into picture and dequeues the data from queue. I send 8 bytes of data, I can see that Task A writes to buff array when I send message through via serial terminal on UART.I send buff array to the queue, then I enqueue the data from queue and write it into buff2 array. When I read the buff2 array I only see the first byte of buff array. Please see below serial terminal output. /* 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 f
Hi Community, 1) I have to demodulated a continuous bitstream of 201bit (1ms per bit) sent by a host to my stm32F401RE. Which peripheral would you suggest to use?2) If I have to transmitt and receive custom serial data in half duplex with clock in Tx and Rx clock for sampling, which peripheral you suggest to use? In this case datarate is 1Mbps.Thanks
Hello everybody,is there an STM document/webinar/tutorial explaining the FOTA strategies for STM32G0 MCUs with dual-bank Flash mem (even with a custom bootloader ) ?Thanks.
Hello,I am trying to implement a FileX SRAM disk (using STM32H723) and getting a error FX_NOT_IMPLEMENTED from _fx_media_open().Tracing into the code, I find that the variable _fx_version_id[] is not set because FX_SYSTEM_INIT is not defined in fx_port.h. Searching the code, I see FX_SYSTEM_INIT defined in file fx_system_initialize.c, but that is local to that file.How/where should FX_SYSTEM_INIT be #defined so that _fx_version_id[] gets set correctly?Thank you,Mark
I would like to use plain sockets in my non OS STM32 application. LwIP provides plain sockets. I have used them in ESP32 applications where they work well.LwIP sockets are not an option in CubeMX as far as I can tell. One can manually enable sockets by changing LWIP_SOCKETS from 0 to 1 in Inc/lwipopts.h. However, when I do this I get the build errors in the attached file.STM has test for sockets in their github code: https://github.com/STMicroelectronics/stm32_mw_lwip/blob/master/test/sockets/sockets_stresstest.cHas anyone used LwIP's plain sockets in an STM32 application ? If so, how did you get it to build ?Thanks
Hello ST Community,I'm currently facing a challenging issue with my STM32L476RET6 where I'm unable to erase a specific page in the flash memory. Despite the HAL_FLASHEx_Erase() function returning HAL_OK, indicating the erase operation was supposedly successful, the bytes at the specified memory location are not set to 0xFF as expected. I've confirmed this by checking the memory location with STM32CubeProgrammer.Environment:MCU: STM32L476RET6IDE: STM32CubeIDEOS: Windows 10 Here's the function where I'm encountering the issue: HAL_StatusTypeDef set_update_flag(void) { // Unlock the Flash to enable the flash control register access HAL_StatusTypeDef status = HAL_FLASH_Unlock(); if (status != HAL_OK) { // Unlock failed, handle accordingly return status; } // Define the page and bank for the erase operation FLASH_EraseInitTypeDef EraseInitStruct; uint32_t PageError = 0; EraseInitStruct.TypeErase = FLASH_TYPEERASE_PAGES; EraseInitStruct.Banks = FLASH_BANK_1; EraseInitS
Hello guys Im new here, sorry if I posted to wrong post.Im trying to program stm32f401ccu6 with existing .bin file. I tried via ST-LINK V2 (clone) and Im getting ''('' where serial numbers should be. When connected via USB C the board get connect to CubeProgrammer and when I start programing the .bin file It gets disconnected 1 image connected via ST-LINKV22 image connected via USB C
Posted on March 11, 2016 at 10:16As a start, I am an owner of an STM32F469I-Discovery board. When I tried out the USB Host applications that came with STM32CubeF4, whether it was ''HID_RTOS'' or ''HID_Standalone'', I could not input a single thing with my USB wired keyboards even though they were all enumerated successfully and I tried 3 different keyboards. On the other hand, the USB mouse I had with me worked as intended by the examples provided. While I will admit that all 3 of the keyboards I tried are not your typical brand stuff (e.g. Logitech, Microsoft etc.) but some generic Chinese devices, they all work perfectly fine on Windows/Linux machines which leads to me to believe that it is very likely a software problem. As a matter of fact, I tried the same examples from STM32CubeF4 v1.10.00 and v1.11.00 and they both produced the same results which is not surprising since they are no changes as far as I could tell. However, I cannot fully dismiss that it is not a hardware probl
What is the fastest way to transfer data from an MCU to a PC?I have an stm32h723zg that I want to use to transfer 40Mbits/sec data to a PC, but I am not sure what is the way to achieve this I tried USB CDC but got only 0.5Mbits/sec due to the limitation of the serial terminalI am thinking I can use a QSPI to USB FTDI chip or ethernet which would be better? or what is the best way to do this?has anyone been able to reach this data rate before?
Im currently porting a CPU performance benchmark from ESP32 to STM32 that uses FreeRTOS. Im unable to make it work due to some errors that continue appearing that might suggest there is a stack overflow, but increasing the stack size doesn´t help.Debugger console error:set *(int *)0xE000EDFC=*(int *)0xE000EDFC|0x7F0set *(unsigned int *)0xe0042008&=~0x1800The project is composed of main.c, dhrystone.c and whetstone.c. I have added the FreeRTOSconfig.h file. Now the benchmark codes whetstone.c and dhrystone.c initialiced as tasks. Both codes return information as such: xTaskNotifyGive( taskHandle ); vTaskDelete( NULL );
Hi,I have configured STM32 as a server using tcp_echoserver example. I'm receiving data through tcp_echoserver_revc() function.I'm receiving packets in this way: #INIT*When STM32 receive X packets (Around 14), it stops receiving data and TCP connection disconnects from PC. However, STM32 still working normally (except lwip part). It can't receive or send any packet.All configuration is by default, IP fixed.This is a capture from wireshark. 192.168.1.40 is the IP of STM32. When STM32 fails, black lines appear.As I say, it is all by default. I have only modified tcp_echoserver.c file. I write below functions that belongs to that file.
Hi folks, this is my first post here on this forum and I expect to find an answer to this issue I currently have.Just so you know, my current hardware setup involves an STM32L152RET6 MCU on our custom board which we have been able program using a Nucleo board in ST LINK mode.The problem is that I haven´t been able to set the BOR level using the STM32CubeProgrammer software and also tried to set the BOR through our firmware using some code I found somewhere on this forum involving HAL_FLASHEx_OBGetConfig, HAL_FLASHEx_OBProgram and HAL_FLASH_OB_Launch functions. Results were the same for both methods: The MCU restarts after OB Launch and gets stuck un lockup mode with no ability to flash any firmware .bin or mass erase the MCU.When reading option bytes register in STM32CubeProgrammer an error appears saying that I have to check memory protection. RDP was set to AA before trying to set the BOR value. After setting the BOR level value the STM32CubeProgrammer shows "0"
I'm using FATfs file system on external flash (16MB) using STM32F767, I'm able to create/ read/ write/ close files.I've created 4 files: sequence of handing files and sector no assigned to them are as,Created/ Write File1 - sector 8Created/ Write File2 - sector 9Created/ Write File3 - sector 10unlink File2Created/ Write File4 - sector 11before creating File 4 I've deleted File 2 using f_unlink("0:/FILE2.TXT"); function, now I expect if I create File4 then sector no 9 should be assigned to this file as it is free sector after File2 is deleted. Is there any way to reused the free sector after deleting files.if(f_open(&MyFile, "0:/FILE1.TXT", FA_READ | FA_CREATE_ALWAYS | FA_WRITE) != FR_OK)//FA_CREATE_ALWAYS | FA_WRITE { /* 'STM32.TXT' file Open for write Error */ Error_Handler(); } else { /* Write data to the text file */ res = f_write(&MyFile, wtext, sizeof(wtext), (void *)&byteswritten); if((byteswritten == 0) || (res != FR_OK)) { /* 'STM32.TXT'
Dear STM Community,I hope this message finds you well. I am currently facing an issue while attempting to write and read data in the flash memory of an STM32F091RC using STM Cube IDE.Specifically, while the write operation executes correctly, I encounter difficulties during the read operation. Upon reading the data, I notice that in addition to the expected data I have written, there is also unwanted junk data present (the junk data consistently appears as the number 2). I have confirmed this inconsistency through UART.To ensure data integrity, I perform a flash memory erase operation before each write operation. However, despite this precaution, the issue persists.I kindly request your assistance and expertise in resolving this matter. Attached, please find my code and the output for your reference.Thank you very much for your time and support. #include "main.h"#include "stm32f0xx_hal.h" #define FLASH_START_ADDRESS ((uint32_t)0x0800F000)#define FLASH_END_ADDRESS&
HiI am using STM32H753VIT6 together with LAN8742A.I have some questions regarding the setup.1. My schematic for the LAN8742A is shown in the picture below. I plan to use the PHY to generate the clock. To my knowledge this requires a pulldown resistor on INTSEL which is done with R420.nRST is connected to nRST on the MCU and a button is connected to pull it low if needed.When I power on my board I would expect an output on the REFCLKO (pin 14). But this pin is constantly low?2. I have also tried to make a project to make a project with ETH and LWIP, but that does not make any difference and there is no output on REFCLKO (pin 14).In the datasheet for LAN8742A, it is stated that after power-on, nRST need to be asserted. I am a little unsure if this is handle in software when it is setup by STM32CUBE?Hope somebody have some inputs or even better a solution :)Thank you!
Dear All,on my STM32F board, i have the uart rx pin not connected/floating. Due to too many noise interrupts, I have configured UART in tx mode only and disabled RX interrupts. Is this fine? Or should the internal pull up be enabled for the RX pin?
Hello everyone,I'm having issues with programming a STM32F429IIT using USB DFU. Im able to program it without issue with a STLinkv3 and the hardware is fully working. The issue is strictly when using ST-Prog, the firmware download will reach 54% and then fail. The device seems to working as indented even though it failed to complete the programming. I believe the issue is that the externally mapped SRAM (FMC) is included in the ELF & Hex file and the programming utility tries to program it but fails. The external SRAM is only used as a display buffer so i'm not interested in filling it with data during the programming stage.I'm not completely sure if this is the case and even less sure of how to fix it while still keeping the external SRAM memory region in the linker script.Any help is appreciated :)Linker script/* Memories definition */ MEMORY { CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192K FLASH (rx) : ORIGIN =
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.