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
I have been working on a STM32L496VGT6 using a 2GB sd card. I have the interface set to 4bit bus, no flow control and a clock divider of 4. I have a demo application that uses SDMMC, FreeRtos and FatFs and works perfectly. When i move the exact firmware to my real application with several tasks and other interrupt driven communication, I can still communicate in a READ only fashion, but as I try to implement simple writes, they always fail with the following error SDMMC_ERROR_TX_UNDERRUN. I have read several threads that suggest solutions, and I believe it is because the SDCard wants data prior to the DMA being ready, but I have not found any solution that works. I have increased the clock divide, increased the DMA priority from high to very high, but nothing seems to work. I would appreciate any suggestions.I am using STMCubeIde STM32Cube FW_L4 V1.18.0, FatFS R0.12c and FreeRtos 10.3.1 with CMSIS V2.00
Hi, I am trying to use the ADC on an STM32G030 for the first time using the low-layer drivers. The terminology of the driver documentation has me baffled as it has nothing in common with the '030 Reference Manual (I have to say the Description of STM32G0 HAL and low-layer drivers manual is really horrible documentation, no function index, no way to find a function). Anyway, I want to do something really simple, I have 4 channels I want to convert after a trigger, either software or hardware. I used CubeMx to generate some code but it still doesn't make sense. What are "Ranks"? This term is neither defined or has any reference in the '030 Reference manual. I have looked for some kind of example using the low-layer drivers and so far have come up empty. Can someone point me to some documentation then is understandable to describe what these low-layer driver calls are referring to? Thanks.
I am currently developing on a custom board based on the STM32U5 microcontroller with the MX25UM512 NOR flash memory. I am following the example provided by the STM32CubeU5 SDK. The example works correctly when I first run it (so data is written correctly), but after I reset the board, the code does not pass through the "if" condition as explained by the comments. nor_ospi_status = fx_file_create(&nor_ospi_flash_disk, "STM32.TXT"); /* Check the create nor_xspi_status. */ if (nor_xspi_status != FX_SUCCESS) { /* Check for an already created nor_xspi_status. This is expected on the second pass of this loop! */ if (nor_xspi_status != FX_ALREADY_CREATED) { /* Create error, call error handler. */ Error_Handler(); } } I have already ensured that the memory is not formatted at every time: I have disabled the defines LX_STM32_OSPI_INIT and LX_STM32_OSPI_ERASE. Additionally, if I skip the fx_file_create operation during the second run, the fx_file_open funct
How can energy harvesting technology be applied to the STM32 Nucleo F302R8 board? My goal is to convert the thermal energy generated during motor operation into electrical energy, thereby reducing energy losses.
Hello,I have to implement a USB CDC device that uses flow control. After a few research it seems to be possible to send a notification SERIAL_STATE that holds the signal DSR in its bitmap.Also, I have found topics on this platform trying to answer this question:Notification SERIAL_STATE on VCP STM32F1052. I'm trying to send signals DSR and DCD through the structure and command endpoint, see example USBD_StatusTypeDef USBD_LL_SOF(USBD_HandleTypeDef *pdev) { static uint8_t Buf[0xA]; Buf[0] = 0xA1; Buf[1] = 0x20; Buf[2] = 0; Buf[3] = 0; BufCTS signal on USB CDCSend SERIAL_STATE with STM32CubeMX USB CDC driverNone of which are helpful, #2 and #3 are closed without an answer, #1 and #4 seems to use the same code which does not work for me yet.Based on example from #4, here is my code:// usbd_cdc_if.h typedef union { uint8_t val; struct{ unsigned dcd :1; unsigned dsr :1; unsigned break_err :1; unsigned ri :1; unsigned frame_err :1; unsigned parity_err :1; unsigned overrun_err :1;
STM32 ST-LINK Utility support TCP IP to upgrade our chip using hex file framework
Hi, I am writing a driver for the AD5262 digital potentiometer, which uses SPI type serial but requires a 9 bit data format. I would much rather use the HAL SPI library (which has worked on similar AD family pots) and not use bitbanging. However the pot is not responsive to my messages, when I've tried a variety of methods to format this data. Here is my driver code:extern SPI_HandleTypeDef hspi2; static void delay(void) {static volatile int x = 0;for (int i = 0; i < 100; i++) {x += 1;}} void ad5262_init(void) {HAL_GPIO_WritePin(CS_DP_GPIO_Port, CS_DP_Pin, GPIO_PIN_SET);} static uint8_t pot_targets[2];static uint8_t pot_vals[2]; static void ad5262_write_spi(uint8_t pot, uint8_t val){uint8_t spi_block[2];spi_block[0] = (pot << 7) | (val >> 1);spi_block[1] = val << 7;// spi_block[0] = pot;// spi_block[1] = val; HAL_StatusTypeDef res; delay();HAL_GPIO_WritePin(CS_DP_GPIO_Port, CS_DP_Pin, GPIO_PIN_RESET);delay(); res = HAL_SPI_Tr
Hey,I use STM32H745ZI, I want to create an area for shared memory between the cores, I chose AXI SRAM because I need access as fast as possible for the M7 core.The shared memory is intended solely for shared information between the cores.I have two questions about it:1. I read about the different settings that are defined in MX for a shared memory area and this is how I decided to define:Is there anything that can improve memory access speed? Is anything recommended to be done differently for my purpose? 2. I did a test of the main while rate through the STM32CubeMonitor for two different situations:The first: in the main while there is an if(variable) condition, the condition is on a local variable (I checked and it was created in AXI SRAM).The second: in the main while there is an if(variable) condition, the condition is on a variable that is in the area that is defined as shared memory (in AXI SRAM).The results in STM32CubeMonitor show that the first situation is much faster th
On STM32F401 or any STM32,how can I read back the status of IWDG, ensuring that's it's running, as a safety measure?As I know direct counter value is not accessible, that would be ideal to see that it's not stuck. How to detect if LSI (thus IWDG) stopped running? As I found HAL/registers are mostly write only, not intended to be read back. Do I need to write this firstIWDG_KEY_ENABLE 0x0000CCCCubeforeIWDG_KEY_WRITE_ACCESS_ENABLE 0x00005555u? // the allowed labels on this website are not really useful/specific enough.
Hi all,I'm new on STM32H747XI-Disc0. I ve started learn step-by-step everything from basics. So, I'm sorry for my basic questions...According to my tutorial timeline, today I ve started to learn UART communication. I tried to type a small example :- I assigned PI12 GPIO output to CM7 (LED_M7, I gave an alias) and PI14 GPIO output to CM4 (LED_M4, I gave an alias).- These LEDs blink on according to their small duties.This example :on CM7 : char data_transmit[100]; void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) { //The following line is canceled, because of fast interaction. //But I tested this callback function, and works good and expected. //HAL_UART_Transmit_IT(&huart1, (uint8_t *)data_transmit, sizeof(data_transmit)); } ... int main(void) { //I used this for transfering my command to related char array strcpy(data_transmit,"LIGHT_LED_M4\r\n"); /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ HAL_UART_Transmit_IT(&
Hi ST Community,I'm using the B-L475E-IOT01A card and I have a problem. As soon as I run my code in Debug mode, I get the HardFault Handler (SIGTRAP) error. I want to use the HTS221 temperature sensor and I'm using the BSP for this sensor (hts211.h). This error appears when the function enters HTS221_init -> HTS221_Initialize -> hts221_power_on_set -> hts221_read_reg -> ctx->read_reg which are in the hts221.c and hts221_reg.c files. Here's my code and the variable declaration:(I'm stuck line 116)Thank you in advance for your help.
I'm looking for an OTA feature using IAP method on STM32H563 using USART communication. I wanted to know, if there is any IAP library available in C for the same along with the documentation, which I can make use of.Regards,
Hi everyone,I am using an STM32h7 to program an STM32L151 using the system bootloader through usart.When I ask for the supported commands, I get that the erase command is between them but, surprisingly, when I try to use it I get a nack.Then I read that some MCUs do not support the erase command and so my first question is: does the STM32L151 support the erase (or extended erase) command?Then I tried to erase the flash enabling and then disabling the RDP level 1, that is working but, after this operation, I find also the option bytes changed respect to the default (I read {0xffff0000, 0xffff0000, 0xffff0000, 0xffff0000, 0xffff0000} instead of {0xFF5500AA, 0xff0700F8, 0xffff0000, 0xffff0000, 0xffff0000} at address 0x1FF80000).So at the moment my firmware update process is working but, instead of sending a single erase command I have to:- set RDP level 1- restart the uP- set RDP level 0- restart the uP- re-write default option bytes- restart the uPMy second question is: am I do
is it possible to configure external voltage reference in stm32l496vgtx? this feature is there belongs to this board.
Hello forum members,I am working on a project where I need to establish communication between a GUI and an STM32H745 microcontroller over USB. Specifically, I want to send a memory mapping address along with corresponding data from the GUI to the STM32H745. The STM32H745 will then use this information to update variables in its memory space.I am looking for guidance on the best practices and considerations for implementing this communication. Here are some specific questions:Memory Address Transmission:How can I safely transmit a memory mapping address from the GUI to the STM32H745 over USB?Are there any security concerns or best practices that I should be aware of when sending memory addresses?Data Serialization:What is the recommended method for serializing the memory address and data before transmission over USB?Are there existing protocols or libraries that can assist in this serialization process?STM32H745 Implementation:On the STM32H745 side, how can I efficiently receive and int
..
i try to send a .txt file(1KB) from tera term pro(transfer>xmodem>send>select file with CRC) and i want to received the file on stm32f429zi controller. but , tera term monitor was blank and i check with stm-side also in live expression but no values received ....i will attach the and photos. please check((void process_xmodem_packet(uint8_t *packet, uint16_t packet_size) {// Assuming you have implemented xmodem_verify_packet and xmodem_calculate_crc functionsif (xmodem_verify_packet(packet, packet_size)) { } else {// Packet is invalid, handle error (e.g., request packet retransmission)// ...}} void send_ack(void) { HAL_UART_Transmit(&huart2, (uint8_t *)"\x06", 1, HAL_MAX_DELAY);} void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) {static xmodem_packet_t xmodem_packet;static uint16_t packet_index = 0; // Process Xmodem packetif (rx_buffer[0] == SOH) {// Start of Header, begin a new packetpacket_index = 0;} else if (rx_buffer[0] == EOT) {//
Hello everyone,I'm using LWIP and MQTT on STM32H743 with FreeRTOS in STM32CubeIDE 1.13.2 and Package FW_H7 V1.11.0.I setup the project according to this guide.With this I can connect to a broker and publish messages.During development of my application I came accross some issues with memory management faults.I reduced the application to only one task sending the same message periodically to ensure the fault is not on my part of the programm.Also in this setup the following fault still occurs:Memory Management Fault - Data access violation (DACCVIOL)in tcp_out.c tcp_output() method when trying to acces "useg->tcphdr->segno"Can anyone help me with this issue.Thanks.
Hi everyone!It's my first post and I'm trying to make something with the SPI but I met the problems. Even if I configure the interface (hopefully correctly), I can't communicate with any SPI device. I bought BMP280 as a simple sensor to communicate with. What I'm trying to do is to read DevID. It should be done by writing 0xD0 and then reading a byte (expected 0x58).But it's not working at all. Using logic-level analyzer I have noticed something weird - bytes sent by SPI are delayed by about half a period of the signal. About, because it's not equal between the next attempts... I have set CPOL=CPHA=0 on both STM32H7 and the analyzer. If I change one side to CPOL=0 && CPHA=1 then I get the expected data (decoded) but only sometimes and only on the MOSI (0xD0 sent). The screens below show both situations.CPOL=CPHA=0 BothCPOL=0 CPOHA=1 One sideI have checked connections, I have checked the sensor (with the different MCU, not STM), and I have checked different pin configu
Hi!I have bought BL462E-Cell1. I need the documents of Murata Type1SC which is the key component of the discovery kit BL462E-Cell1. From the registration code printed on the sheet with BL462E-cell cannot give me the access to the documents of Murata Type1SC.I need the at command and MQQT command two files which are listed in Murata Type1SC. Could you please give me a correct registration code which I can use to access to the document of Type1Sc.
Hello. I use the NUCLEO-G071RB together with the STM32CubeIDE (Ver. 1.14.0) and STM32CubeMX (Ver. 6.10.0). I completed the first prototype phase and ported the code to a custom board with a STM32G0 MCU.I used an external ST-LINK/V2 debugger to write the code to the custom board. The ST-LINK LEDs are flashing so I believe that connection is working.However, the next step is to program a SWD connection from the custom board (MCU) to the external ST-LINK/V2. for debugging purposes.Question: is the CMSIS-DAP interface library the best solution, or is a HAL library driver available for the SWD link? Ideally a SWD code example is available. Please advise. Thank you.
Hi .. I am using this function to erase some sectors on the flash bool FLASH_EraseSectors(uint32_t starting_sector , uint8_t number_of_sectors) { FLASH_EraseInitTypeDef erase_init; uint32_t page_error; /* Erase the user Flash area */ erase_init.Banks = FLASH_BANK_1; erase_init.TypeErase = FLASH_TYPEERASE_SECTORS; erase_init.NbSectors = number_of_sectors; erase_init.Sector = starting_sector; erase_init.VoltageRange = FLASH_VOLTAGE_RANGE_3; /* Unlock the Flash to enable the flash control register access *************/ FLASH_Unlock(); if (HAL_FLASHEx_Erase(&erase_init, &page_error) != HAL_OK) { FLASH_Lock(); return false; } if (HAL_FLASHEx_Erase(&erase_init, &page_error) == HAL_OK) { FLASH_Lock(); return true; } }I would like to erase some sectors without breaking the 2 tasks running... The point is that it seems to destroy the tasks... Is there a safe way to delete the sectors in flash during a task execution in FREER
Hi, Is there an example of an open bootloader for the STM32F4xx series? I've attempted to adapt an open bootloader example from the STM32C0xx series to create an example for the STM32F411, but I'm encountering numerous errors due to differences in the HAL (Hardware Abstraction Layer) and LL (Low-Level) libraries between the two microcontroller families.Thank you in advance
Hello, I am trying to find LL functions parallel to those in HAL library that support Flash programming and it looks like there is not support in LL for r/w flash. As HAL library is not an option for me, I am wondering if it is possible <writing directly to registers> achieve this goal, not so easy for me though.Any help/suggestion in how to go about it would be greatly appreciated
HI All,I have created a project to integrate sd card with STM32G474RE nucleo board while using SPI interface. After running the project I am able to initialize the sd card properly but while mounting the sd card, I am getting one error like: "FR_DISK_ERR".I am usung STMCubeide to do the configuration and followed some tutorial to setup my fatfs library.I am attatching my project here for the reference.Please have a look on it and help me rectify the issue.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.