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
The latest RM for STM32L4 I could find mentions the STSPHST bit on page 1702, but makes no mention of how to actually use this bit. Granted, I'm working on a STM32L476 and given table 318, the STSPHST bit is not supported anyways. Nonetheless, I don't find this bit to be defined at all in the CMSIS header file stm32l496xx.h, so what gives? Is this bit deprecated?The only reason why I'm interested in this bit is because I'm trying to perform a control write transfer on the device side. I got to the point where I'm decoding the SETUP request of SET_LINE_CODING for CDC, configuring the default OUT endpoint to receive a single packet, waiting for RXFLVL, popping off the packet status using GRXSTSP, reading in the RX-FIFO data, and then finally popping off the "OUT transfer completed" status word pattern.The weird thing however is that -- shortly after popping off the last word -- RXFLVL then gets set again and it's apparently another "OUT transfer completed" pattern. The only difference be
What is the theoretical maximum data throughput for the 10/100 Ethernet port on an MCU running lightweight IP (lwIP) on baremetal? I am simply looking to receive UDP data and write it directly to local memory as fast as possible. I am using STM32H723, but I imagine that the answer will be similar for different MCU. Thank you.
So I am using STMG030F6P6TR to play raw audio stored in SPI flash using PT8211 DAC and LM4890S amplifier. I have stored 8 Bit unsigned mono RAW data in 8000HZ in spi flash, retrieved it and pushed the data into the DAC as follows:void playSong(uint16_t start_address, uint16_t end_address) {enable_amp; // Buffer to hold the data uint16_t buffer2[512] = {0}; uint8_t temp_buffer[256]; // Read a page from SPI flash memory SPIF_ReadPage(&spif, start_address, temp_buffer, sizeof(temp_buffer), 0); // Process the temporary buffer to fill buffer with gain applied for (uint16_t i = 0; i < 256; i++) { // Apply gain and move 8-bit data to the upper 8 bits of 16-bit int16_t sample = (int16_t)((temp_buffer[i] - 128))<<8; // Set stereo output (same value for both left and right chan
i have compiled opus lib on H5. but i can not decode data. this is my init function and works fine. DecConfigOpus.channels = 2; DecConfigOpus.ms_frame = 20; DecConfigOpus.sample_freq = 48000; uint32_t dec_size = DEC_Opus_getMemorySize(&DecConfigOpus); DecConfigOpus.pInternalMemory = (uint8_t *)malloc(dec_size); int opus_err; if (DEC_Opus_Init(&DecConfigOpus, &opus_err) != OPUS_SUCCESS) { printf("ERROR! DEC_Opus_Init()\r\n"); break; } and in decode function first time return 960 and then -4. int packetSize = 80; // Adjust based on your actual packet size for (int i = 0; i < sizeof(music); i += packetSize) { int x = DEC_Opus_Decode((uint8_t*)&music[i], packetSize, DecConfigOpus.pInternalMemory); if (x < 0) { printf("Error decoding packet at index %d: %d\n", i, x); break; // Exit the loop or handle error as appropriate } else { printf("Decoded packet at index %d, x = %d\n", i, x); } }
Hello,I am using the STM32H7A3ZITQ and have encountered an issue while controlling the MT25QL128ABA1ESESF0IT flash memory during the flash read process. I am operating in QSPI mode. During extended aging evaluations, a 5-second timeout (a busy flag is not cleared) intermittently occurs in the LL_OSPI_Receive() function.Since this issue occurs randomly, I tried to force the conditions to analyze the problem. I discovered that in debug mode, if I set a breakpoint and step over the function, the problem occurs 100% of the time.Interestingly, if I add a variable inside the read function, the issue that occurs 100% of the time disappears. When examining the assembly code, I found that adding a volatile variable generates two additional assembly instructions, leading to a delay that seems to resolve the issue. However, attempting to induce a similar delay using asm("nop") did not resolve the issue.I confirmed that adding a variable resolves the problem. Adding one, two, up to four vari
Hi, I am trying to use the peripherals with their peripherals rather than initializing it with CUBEMX tool. I am only selecting 'Serial Wire' option of Debug mode under System Core -> SYS with CUBEMX. However, when I build my program, it throws the error in the title. I googled it but found nothing helpful. How can I solve this problem?Thx in advance for your helps.
I am new to STM32 and I wanted to create low power and standby power mode for my application,I am using NUCLEO-U575ZI-Q devkit runs on 160MHz high frequency clock and create project with only single GPIO configured as EXTINT to wakeupI have supplied external 5v supply for that I have changed connected jumper to 5V_EXT and removed from 5V_STLKMeasured current 64.75mA.I have used reference from here: https://wiki.stmicroelectronics.cn/stm32mcu/wiki/Getting_started_with_PWR#Sleep_mode ... void HAL_GPIO_EXTI_Rising_Callback(uint16_t GPIO_Pin) { HAL_ResumeTick(); } /* USER CODE END 0 */ /** * @brief The application entry point. * @retval int */ int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the
Hello,I wanted to know some suggestion regarding a project, and adding FOTA support in it.The project is stm32l4 based and it configures the gsm module as a server and one can make request and get response using http protocol.I wanted to update the firmware of the stm32l4 using the mc60 gsm module, Any suggestion(hardware or sotfware) on how can I implement the FOTA.also i wanted to know if i am download the file from server then how to store in mcu, Any firmware package for this.Thankyou.
Hey, I am using a STM32F7676vit6 Controller an try to set up a SAI connection to my audio CODEC now my problem is that the CODEC has two Serial outputs and one serial input. So i configured:SAI1A to be the transmitting master SAI1B is a synchronous Slave which is configured to be in sync with SAI1A. SAI2B is also configured a synchronous Slave and configured to be in sync with SAI1A. I also use DMA on all three channels. Now i receive data on SAI1B and but not on SAI2B (SAI1A works fine). Only wired thing is that after txCpltCallback the SCK and FS do not stop....I really don't know what to try anymore please help ;). I use CubeIDE my sai.c file looks like:/* Includes ------------------------------------------------------------------*/ #include "sai.h" #include "gpio.h" #include "dma.h" /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ SAI_HandleTypeDef hsai_BlockA1; SAI_HandleTypeDef hsai_BlockB1; SAI_HandleTypeDef hsai_BlockB2; DMA_Ha
every time i update the code on the IOC file this message comes up when i refer to the power this option doesn't existI noticed this option is available when the secure zone is disabled
Hi, I'm developing my digitally controlled SMPS using stm32g474 MCU, I found that the arguments of the functions "HAL_HRTIM_UpdateEnable" and "HAL_HRTIM_UpdateDisable" may be wrong, and the code of the two functions are copied as follow:In stm32g4xxhal_hrtim.c /** * @brief Enable the transfer from preload to active registers for one * or several timing units (including master timer). * hhrtim pointer to HAL HRTIM handle * Timers Timer(s) concerned by the register preload enabling command * This parameter can be any combination of the following values: * @arg HRTIM_TIMERUPDATE_MASTER * @arg HRTIM_TIMERUPDATE_A * @arg HRTIM_TIMERUPDATE_B * @arg HRTIM_TIMERUPDATE_C * @arg HRTIM_TIMERUPDATE_D * @arg HRTIM_TIMERUPDATE_E * @arg HRTIM_TIMERUPDATE_E * @retval HAL status */ HAL_StatusTypeDef HAL_HRTIM_UpdateEnable(HRTIM_HandleTypeDef *hhrtim, uint32_t Timers) { /* Check the parameters */ assert_param(IS_HRTIM_TIMERUPDATE(Timers)); /* Process Locked
Hello,I am using an STM32H5 series processor in my project and running Azure RTOS NetX on it. I have enabled the Keep Alive feature as shown in the image below. However, when I checked with Wireshark, I could not see the Keep Alive packets as expected.To assist with troubleshooting, I am sharing the debug values and an image showing that Keep Alive is enabled.Do you think the Keep Alive feature is working correctly? If not, what could be the reason?
Hi!I am working on a project where I have to drive a SD Card. So far I have successfully implemented the initialization and reading data with DMA part. I am not using HAL libraries. The code to write to external flash is shown below. I did everything according to reference manual. void SDIO_MEM_Write_SingleBlock512(uint32_t Address, uint32_t* Buffer) { //Single Block Transfer //uint8_t Result = 0xFF; uint8_t tempCardState; SDIO->DLEN = 512; SDIO->DTIMER = 0xFFFFFFFF; //Configure DMA DMA2->LIFCR |= DMA_LIFCR_CTCIF3 | DMA_LIFCR_CHTIF3 | DMA_LIFCR_CTEIF3 | DMA_LIFCR_CFEIF3; //Clear Interrupt Flag DMA2_Stream3->CR = 0; DMA2_Stream3->CR |= (0b11 << DMA_SxCR_PL_Pos) | DMA_SxCR_MINC | (0b01 << DMA_SxCR_DIR_Pos) | (4 << DMA_SxCR_CHSEL_Pos) | (0b01<<DMA_SxCR_MBURST_Pos) | (0b01<<DMA_SxCR_PBURST_Pos) | (0b10 << DMA_SxCR_MSIZE_Pos) | (0b10 << DMA_SxCR_PSIZE_Pos) | (0b1<<DMA_SxCR_PFCTRL_Pos);
Hi All, Need one help.When I try write to file using fopen / fwrite functions in debug mode I receive likeError: L6200E: Symbol __stdout multiply defined (by stdio_streams.o and my_lib.a) not enough information to list the image mapwhile building the code. and how I can solve it.
Hello,I created a bootloader and the two applications according to the YouTube tutorial (https://www.youtube.com/watch?v=OkUQ3iMmiYQ&list=PLnMKNibPkDnEb1sphpdFJ3bR9dNy7S6mO&index=1). This works so far.The application is started by the bootloader using the go2APP() function. void go2APP(void) { uint32_t JumpAddress; pFunction Jump_To_Application; //check if there is something "installed" in the app FLASH region if (((*(uint32_t*) FLASH_APP2_ADDR) & 0x2FFE0000) == 0x20000000) { HAL_Delay(100); //jump to the application JumpAddress = *(uint32_t *) (FLASH_APP2_ADDR + 4); // Original Jump_To_Application = (pFunction) JumpAddress; //initialize application's stack pointer __set_MSP(*(uint32_t *) FLASH_APP2_ADDR); Jump_To_Application(); } else if (((*(uint32_t*) FLASH_APP1_ADDR) & 0x2FFE0000) == 0x20000000) { HAL_Delay(100); //jump to the application JumpAddress = *(uint32_t *) (FLASH_APP1_ADDR + 4); Jump_To_Application = (pFunction) JumpAddress; //ini
Hello,I am using the stm32h563 processor in my project. I made a TCP Server application using the ethernet connections of this processor and I was able to run it as I wanted. But I saw that it could not connect to another client over the same IP address without breaking the connection with one client. Even though I set the NX_MAX_PHYSICAL_INTERFACES defined value to two, there was no change. Also, in the files I shared, it is said that we can make a tcp server and 2 tcp client connections and open a separate socket for each (1). After some research, I realized that this problem can be solved with lwip + freertos. Below are examples of these solutions. How can I make a similar solution on Azure RTOS Netx side?Our problem with lwip + freertos solved community issue(2) was previously shared and the solution was "By tweaking the options in lwipopts.h, it should be possible to receive more incoming connections: MEMP_NUM_TCP_PCB, MEMP_NUM_TCP_PCB_LISTEN, MEMP_NUM_NUM_NETCONN, etc... " w
I am working on using FreeRTOS for a project, and have implemented printf() debugging by redirecting it to a uart. This works great most of the time, and is very helpful for FreeRTOS debugging, as FreeRTOS_printf() and FreeRTOS_debug_printf() will leverage this functionality.Unfortunately, it seems to cause hard faults frequently, but not in every case. One call that consistently caused a hard fault was FreeRTOS_printf( ( "FreeRTOS_connect: %u to %xip:%u\n", [...]);Another one I had to manually remove wasFreeRTOS_debug_printf( ( "Socket %u -> [%s]:%u State %s->%s\n", [...]);I came across a previous post which seemed to have a similar issue, but it appeared to have been resolved. Is there more configuration that I need to implement to have this work in every case? Or is there something else I am missing? Some more details about my implementation:I am using CubeMX to generate my codeI am using OpenOCD and GCCMy printf implementation uses the following code#ifdef
Hello,As mentioned in the title, the custom board system VDD is 1.85 volt, I wonder if there are anyways that I can setup the PVD to work with such voltage. I follow the example and I only get the interrupt at startup but then cutting power off, obviously I see no other interrupt. HAL_NVIC_SetPriority(PVD_PVM_IRQn, 0, 0); HAL_NVIC_EnableIRQ(PVD_PVM_IRQn); PWR_PVDTypeDef ConfigPVD; ConfigPVD.Mode = PWR_PVD_MODE_IT_RISING_FALLING; ConfigPVD.PVDLevel = PWR_PVDLEVEL_0; HAL_PWR_ConfigPVD(&ConfigPVD); HAL_PWR_EnablePVD();
I am using the Nucleo-STM32H723ZG board and I'm trying to set up a maximally reactive UDP/TCP communication channel between the board and an external node.Just to use a common ground, lets take as an example project the LwIP_UDP_EchoServer. If I send a message to the board and monitor the time it takes to receive the reply, it's over 1 millisecond. I tried to isolate the slow part and couldn't find it: I inserted a pin toggle inside the udp_echoserver_receive_callback, at the start and at the end; the time it takes to execute this function is around 11 microseconds. Nevertheless, the delay between the request and the echo reply, in wireshark, is more than 1 millisecond. I followed the function calls down to the HAL_ETH_Transmit and couldn't understand what may cause this long delay. It is a blocking function and my understanding is that HAL_ETH_Transmit returns when the DMA has finished transmitting the data. Could you please provide any hint about what may cause th
ST provided example "Nx_MQTT_Client" fails after running for up to a few minutes (can fail quickly or after a bit). nx_packet_allocate() fails to allocate memory so it looks like a memory stomp. How to fix?I took the provided example and got it to work as is. As provided it will run for 10 MQTT packets sent and received. Sometimes the provided example would fail within that normal 20 seconds of operation (by hanging or printing some unfindable log-report strings. Since I wanted to use this example as a boilerplate for an application, it was not OK to have it fail sometimes for no known reason. I delved...I reduced the message timeout and switched the program to one of its option modes - run forever. That way I could replicate the issue without waiting for a long time. Now the program fails quite quickly and repeatedly within the first 1000 messages.When it failed, the log message it was printing (or sometimes just trying to print) looks like this:Number of allocated buffer for Rx and c
Hello all, currently I am facing next problem - I have STM32H743 with USB configured such as CDC Virtual port COM. Receiving data works very well. But I have a strange problem with sending data. Data I send are not correct received in case of using dynamic array:If I use CDC_Transmit_FS(buffer, 5) are bad data received. If I use CDC_Transmit_FS((char*)data, 5) all is good. I have checked memory locations and both data pointers in function CDC_Transmit_FS have correct data, but on different memory address. I don't have idea why it is so behave. Can anybody help with this? CHATGPT failed, so I try live peoples. Thank you very much.
Hello everyone, I am writing a new firmware received by UART. I use DMA with Interrupt and my new firmware is in .HEX format, I receive it in blocks of 1500 in 1500 bytes, and I have a case that performs the processing of extracting the addresses, crc, cheksum, and the real data and after that calls the businessRules_update_firmware function. I want to write the firmware using the application code itself. However, I have a problem writing after 0x08018000. My microcontroller is category 5, with 192KB and dual-bank. And my application code is running on bank1 and I want to write the new firmware on bank2. I always record correctly from 0x08018000 to 0x080180F0, but I can never record after 0x08018100, what could this be? The businessRules_updateFirmware function is called within a loop after the data from the .HEX file has been processed.uint32_t flashAddress = 0x08018000;void businessRules_updateFirmware(void){ uint8_t buffer[FIRMWARE_PACKAGE_SIZE]; uint32_t page
Hi Team, I am working on USB MSC to have multiple LUN (2 to 3) on RAM to be visible on windows. With same code we can see 2 partitions on Linux PC. Below are some details on code changed.1. Added extra LUN in STORAGE_Inquirydata[] {/*LUN 0*//*LUN 1*/}2. Changed MACRO for LUN_NBR to 2.3. Handled read and write accordingly for 2 LUN. When connected to a Windows machine, all descriptors go through and it also queries MAX_LUN and we see it as (LUN_NBR - 1). But subsequent scsi related queries are only done on LUN 0 and not on LUN 1. Is there anything that we are missing?Regards,BRR
I using OLED I2C display and its interface with STm32F091VBT6 MCU. My application is fuel dispensing i face issue while dispensing the OLED display is stuck. i cant find any error. can any body know me the solution.i also attached the OLED & I2C file for reference which i made in keil IDE.
I am using STM32L0 with LSE rtc xtal, CubeMX/HAL. I have a 20 second wakup using if (HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 40960, RTC_WAKEUPCLOCK_RTCCLK_DIV16) != HAL_OK) { Error_Handler(); } AND HAL_SuspendTick(); HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI); HAL_ResumeTick(); this works ok as long as I don't use //HAL_PWR_DisableBkUpAccess(); or it never enters stop modenow I use HAL_PWR_EnterSTANDBYMode(); to shutdown the device but it wakes 20 seconds later.so I tried adding if (HAL_RTCEx_DeactivateWakeUpTimer(&hrtc) != HAL_OK) { ErrorHandler(ERR_ALARM_DEACT); } but the call returns HAL_RTC_STATE_TIMEOUT Any ideas?
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.