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, I am using an STM32U585 with STOP mode and FreeRTOS in tickless idle mode. The datasheet says the current consumption should be around 4.5uA, however I am measuring 35uA on my custom board that only has the MCU and some decoupling capacitators. Can someone tell me if I need to add something in the code to lower consumption? Are the datasheet consumptions possible running an RTOS? I will leave my code and measurements in attach: void PreSleepProcessing(uint32_t ulExpectedIdleTime) { /* place for user code */ (void)ulExpectedIdleTime; __HAL_RCC_GPIOC_CLK_DISABLE(); __HAL_RCC_GPIOH_CLK_DISABLE(); __HAL_RCC_GPIOA_CLK_DISABLE(); __HAL_RCC_GPIOB_CLK_DISABLE(); HAL_ICACHE_Disable(); HAL_SuspendTick(); HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI); } void PostSleepProcessing(uint32_t ulExpectedIdleTime) { /* place for user code */ (void)ulExpectedIdleTime; SystemClock_Config(); __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE()
I am using stm32f756zg. In which i configure LWIP with FREERTOS cmsisv2. I am getting hard faults when ping devices from other devices.It works fine when I change FREERTOS cmsis v1 and increase the default task stake.
Hello,I am currently experiencing some unusual Ethernet transmission (STM to PC) issues with a few of our custom PCBs. We use the STM32H753II chip and the KSZ8081RNB. The KSZ8081RNB is connected to the MCO2 and the RMII-interface of the STM.The IP/TCP/UDP checksum check primarily fails due to corrupted payloads ranging in size from 1 to 20 bytes, or, more rarely, due to corrupted protocols. It doesn't happen regularly, but it happens too often.This means that, for TCP, two or more retransmissions are sometimes needed.udp bad:udp good:Sometimes, packets with complete defects are sent. These defects are not sent by the application. Even, when I paused the application, I could still see these packets.For tests the PCB and the PC are directly connected. Using different cables does not solve the issue; only using different PCBs does.I set up the LwIP example project in CubeIDE 1.19, as described in Github STM32H7-LwIP-Examples#how-to-create-project-from-scratch.This project's
I created an independent task to run the TCP client and send.[424] local 192.168.10.188 port 5001 connected with 192.168.3.100 port 57804 [ ID] Interval Transfer Bandwidth [424] 0.0- 1.0 sec 5660 KBytes 46368 Kbits/sec [424] 1.0- 2.0 sec 5500 KBytes 45055 Kbits/sec [424] 2.0- 3.0 sec 5389 KBytes 44149 Kbits/sec [424] 3.0- 4.0 sec 5191 KBytes 42526 Kbits/sec [424] 4.0- 5.0 sec 5088 KBytes 41681 Kbits/sec [424] 5.0- 6.0 sec 4936 KBytes 40436 Kbits/sec [424] 6.0- 7.0 sec 4832 KBytes 39583 Kbits/sec [424] 7.0- 8.0 sec 3816 KBytes 31258 Kbits/secThe above is the data volume and status received by my iperf server. After that, my client task no longer sends any messages. I use my computer to ping the IP address of my STM32, and then the client will resume sending.I observed that the gState of my heth variable is HAL_ETH_STATE_STARTED, and the ErrorCode is HAL_ETH_ERROR_BUSY. The DMAErrorCode and MACErrorCode do not have any flags.I think it is the osSemaphoreAcquire(TxPktSemaphore, ETHIF_TX_T
HiInitial situationMCU = STM32U599VJTxQSTM32CubeIDE = v1.19.0TouchGFX = v4.26.0EEPROM Emulator = x-cube-eeprom-v8-0-0 (downloaded direct from STM website)I use the eeprom emulator to save an array of 251 bytes permant on the flash. To save the data into the flash I use the EE_WriteVariable32bits functionThis are my function to init the EEPROM emulator, write data to EEPROM and read data from EEPROMvoid Datastore::EEPROM_Init() { HAL_FLASH_Unlock(); // 1. Flash freigeben // 2. Sicherstellen, dass Flash idle ist uint32_t timeout = 1000000; while(__HAL_FLASH_GET_FLAG(FLASH_FLAG_BSY)) { if(timeout-- == 0) { HAL_FLASH_Lock(); this->m_errorHdl_p->Add(ERR_ID_EEPROM_INIT_FAILURE); return; } } // 3. Critical Section / Interrupts kurz maskieren __disable_irq(); // 4. EEPROM Init mit Retry EE_Status status = EE_WRITE_ERROR; const uint8_t max_retries = 3; uint8_t attempt = 0; while(((status != EE_OK) && (status != EE_PAGE_FULL)) && (attempt &l
Hello STM32 Community,I am currently developing a USB Type-C Active Cable application using an STM32 with the official USB-PD Middleware.My Goal: The MCU needs to behave as an EMarker/Active Cable. Therefore, it should:Ignore all SOP messages on the CC line (no response and no GoodCRC ).Only respond to SOP' and SOP'' messages.Able to monitor (Snoop) SOP messages exchanged between the Source and Sink to maintain state awareness.The Problem: In the current X-CUBE-USB-PD middleware and STM32CubeMX configuration, there is no explicit option to disable SOP handling while keeping SOP'/SOP'' active. Since GoodCRC is typically handled by the UCPD hardware autonomous logic to meet the strict tTransmitSOP timeout, the hardware automatically sends a GoodCRC when it detects a valid SOP message CRC, even if the firmware isn't intended to process it.Technical Details & Questions: I am looking for a way to bypass or disable the hardware-level auto-response for SOP only.Register Control: Is there
Hello,I am using X-CUBE-EEPROM as a mean to store variable in internal FLASH memory on STM32U5G9-DK2 board. Here is my function where a variable in flash:static FLASH_STATUS flash_slot_write_shared_key(const FLASH_INDEX *index, uint8_t slot, uint8_t *shared_key) { if (slot > FLASH_SLOTS_NUMBER) return FLASH_WRONG_PARAM; if (shared_key == NULL) return FLASH_NULL_PARAM; EE_Status ee_status = EE_WRITE_ERROR; HAL_FLASH_Unlock(); taskENTER_CRITICAL(); ee_status = EE_WriteVariable96bits((uint16_t)index->entries[slot].addr, (uint64_t *)(shared_key)); if (ee_status != EE_OK) return FLASH_ERROR; ee_status = EE_WriteVariable96bits((uint16_t)index->entries[slot].addr + 1, (uint64_t *)(shared_key + 12)); if (ee_status != EE_OK) return FLASH_ERROR; ee_status = EE_WriteVariable32bits((uint16_t)index->entries[slot].addr + 2, *(uint32_t *)(shared_key + 24)); if (ee_status != EE_OK) return FLASH__ERROR; ee_status = EE_WriteVariable32bits((uint16_t)index->entries[
Hello,I think I have interesting case, but from the beginningI use STM32F446ZEJx and HAL Drivers from STM32Cube_FW_F4_V1.28.3.When I use HAL_StatusTypeDef HAL_SPI_TransmitReceive_DMA(SPI_HandleTypeDef *hspi, const uint8_t *pTxData, uint8_t *pRxData, uint16_t Size)with Size=5 it internally checks the argumentif ((pTxData == NULL) || (pRxData == NULL) || (Size == 0U)) return HAL_ERROR;and passes the Size to/* Set the transaction information */ hspi->ErrorCode = HAL_SPI_ERROR_NONE; hspi->pTxBuffPtr = (const uint8_t *)pTxData; hspi->TxXferSize = Size; hspi->TxXferCount = Size; hspi->pRxBuffPtr = (uint8_t *)pRxData; hspi->RxXferSize = Size; hspi->RxXferCount = Size;later it configures the DMA channels,Rx/* Enable the Rx DMA Stream/Channel */ HAL_DMA_Start_IT(hspi->hdmarx, (uint32_t)&hspi->Instance->DR, (uint32_t)hspi->pRxBuffPtr, hspi->RxXferCount)Tx/* Enable the Tx DMA Stream/Channel */ HAL_DMA_Start_IT(hspi->hdmatx, (uint32_t
Is there a guide that shows how to set up a CDC USB device on the STM32N6 without using ThreadX in baremetal mode? I've tried following both, but it seems to hardfault on both examples crash at __lib_init_array(). I've tried increasing the stack and heap sizes to no success:https://community.st.com/t5/stm32-mcus/how-to-use-stmicroelectronics-classic-usb-device-middleware-with/ta-p/599274 https://community.st.com/t5/stm32-mcus/how-to-implement-usbx-in-standalone-mode/ta-p/614435 It's frustrating that the old USB_Device middleware got removed. We shouldn't be forced to use an RTOS where it is not needed...
Hello!I have a custom board with STM32F746VGT6 MCU, LAN8742A Eth PHY and Ethernet socket. I would like to implement MQTT communication in my project with my board as a client. I am familiar with LwIP and FreeRTOS and use both of these libraries in my current program.I already tried using WolfSSL and WolfMQTT (and succeeded to some degree), but it wasn't very pleasant experience and I had to manually copy and change many files to make it work. I want to rewrite the MQTT implementation as the current one doesn't work very efficiently, but I don't really know where to start. I'm grateful for all suggestions!
First and foremost, they aren't perfect. The code has tons of work left. But it took me SO long to get ANY i2s audio data from my guitar to my computer, the major hurdle being mostly the lack of USB Microphone drivers provided by the stack.Now that I've made them, and I am pretty sure it's the other parts of the code that are at fault for the clock drift, I am sharing it in hopes that it will help someone else who was in the same boat I was.This is designed for the STM32 to be the SLAVE to a CODEC with Full-Duplex mode support (4-5 wire bidirectional I2S Standard, 16 bit 48k. I know, nothing to call home about, but it is the simplest to get working) Try your luck with your specific CODEC, maybe you can configure things differently and get it working right. On the PCM3060, this was the best I could manage.I have no field experience, no college degree, I am just persistent. If I can do it, you can too. Don't give up. I know I haven't, this is just the start.Note: if you're just picking u
Hey there,I'm currently working on an audio application for the STM32U5A5 (which I'll later port to the STM32N657), using MDF.The application closely follows the MDF/ADF examples for audio recording found in the U5/N6 Cube firmware packages, with the difference that it does not output the transformed audio signal immediately via SAI, but instead stores it in a large buffer to download it later via the STMCubeProgrammer.Although the application generally works great, it does not record more than ~2 seconds of audio, even if I increase the size of the storage buffer (e.g., to a size corresponding to 4 seconds of audio recording capacity). No matter how large I set the buffer, the function HAL_MDF_AcqCpltCallback is called approximately 2 seconds after the recording starts. Within the implementation of this function, HAL_MDF_AcqStop_DMA is called to stop the recording.I would be interested in the criteria according to which the HAL_MDF_AcqCpltCallback function is called. I would
Hi everyone,I'm working on an audio acquisition project using the STM32H743ZIT6 microcontroller. The goal is to build a microphone array with 8 digital MEMS microphones (MP34DT05-A), connected via DFSDM and streamed over USB to a PC using the USB Audio Class (UAC). At the moment, I'm starting small and testing with one or two microphones.So far, I have successfully configured one DFSDM filter and one channel using regular conversion with DMA, and I'm receiving valid audio data.Now I would like to add a second microphone, which is connected to a second DFSDM channel (with opposite clock edge). Both channels should ideally be handled by the same DFSDM filter.I'm currently wondering:What is the best approach to sample two channels using a single DFSDM filter?Is it necessary or recommended to use injected conversion for the second channel in this case?How would I properly configure DMA and interrupts if both regular and injected conversions are used?Are there any known working examples for
Hi,I'm trying to get LPBAM Low power timer capture to work in a frequency measurement application. The intention is to use LPBAM to write input captures from LPTIM3 to a buffer in SRAM4 while in Stop mode 2. The app loop just sets a wakeup via the RTC of 500mS, then enters Stop Mode 2. On wakeup, it does a few GPIO read/writes and I2C3 writes amongst other things, then loops,That all works fine, and the system is in Stop Mode 2 95% of the time.LPDMA1 CH0 is enabled in the non-LPBAM IOC configuration editor in Linked-list and circular mode.I've created an LPBAM application/scenario with just one queue, and LPTIM3 channel2 set for input capture clocked by external clock (LSE crystal 32.768KHz).(ScreenShots below)This passes 'CHECK LPBAM DESIGN' in the editor, and generates code without errors.I've then added the LPBAM init/build/link/start calls to main before the main loop starts:/* LPT3App application initialization */MX_LPT3App_Init();/* LPT3App application LPT3Sce
We develop a measuring device which should be capable of SIL 2. It would be possible to fall back to SIL 1 only. STM32F4 MCU is used with STL-Safety-Library.Has anybody qualified the gcc for that? Or did you replace the compiler by already qualified products from Keil, IAR?If you have qualified the gcc, have you done it yourself or used commercial tools?
Looking to add a 4 mic pdm array setup to livetune environment. Had questions on how deep into the environment we need to go for the changes. Is it just a matter of changing the # of channels for the sysIn, # of slots and active slots on the pdm interface? or do we need to drive deep as address the audio buffer as well. At one point I thought I read the audio buffer was allocated dynamically. We are just looking for a little guidance before we start changing things as there might be a simple way to achieve our goal vs us guessing and creating issues.
Hello, I am currently using the NUCLEO-U545RE-Q and trying to set low-power modes with FreeRTOS. I have already seen videos from official ST channel and read documentation but I cannot get to set this functioning when using FreeRTOS and RTC. My goal is to blink an LED every 5 seconds and in the reamaining time go to STOP mode for low power consumption. This are my functions: void StartDefaultTask(void *argument) { /* USER CODE BEGIN defaultTask */ /* Infinite loop */ while(1) { osSemaphoreAcquire(BinarySemaphoreHandle, osWaitForever); printf("Toggle Led\n"); BSP_LED_Toggle(LED_GREEN); } /* USER CODE END defaultTask */ } /* Private application code --------------------------------------------------*/ /* USER CODE BEGIN Application */ void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc) { printf("RTC Callback\n"); osSemaphoreRelease(BinarySemaphoreHandle); } void PreSleepProcessing(uint32_t ulExpectedIdleTime) { HAL_SuspendTick(); /* Start low power timer
Hi everyone,I am developing a project on the STM32N657X0H3Q where I need to implement a Dual CDC ACM composite device.I am following the "Standalone" implementation to avoid a full ThreadX dependency, as I plan to integrate this with a FreeRTOS project (using X-CUBE-FREERTOS).While looking at the USBX configuration in CubeMX and the ST Wiki (Introduction to USBX), I noticed the option USBD_COMPOSITE_USE_IAD ( As seen in the picture).If I enable USBD_COMPOSITE_USE_IAD , can I simply increase the number of CDC ACM class instances in CubeMX to 2?Does CubeMX automatically handle the IAD grouping for the second CDC instance, or do I need to manually adjust the interface descriptors in the generated ux_device_descriptors.c ?Can you provide an approach to configure this using MX? Which are all the files that should be edited to configure this.
Hi Community,I am working on STM32H747I-DISCO Board and trying to bringup digital MEMS Mic (MP34DT05) which is integrated on STM32H7-DISCO Board.I am trying to record random voice for 5 seconds and need to play back via audio jack out which is connected to codec also it is integrated on the board. I am sharing you schematic of the board as below:MP34DT05 is connected to MCU directly with SAI4 Interface and Solder Brifdges are provided to connect via codec Here I developed the application code to interface and record via MIC and playback via Audio Jack out./* Includes ------------------------------------------------------------------*/ #include "main.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "stm32h747i_discovery_audio.h" #include <math.h> #include"log.h" #include<string.h> #include "pdm_config.h" #include "pdm2pcm_glo.h" #include <stdio.h> /* USER CODE END Includes */ /* Private t
Hi, I try to get the USB-Host running with USBX. Hardware is a custom board with TCPP02 and STM32U575. Init process is running, but I never get an interrupt (ux_host_event_callback) when plugging in a USB stick. Any idea? ioc file and schematic are attached. Best regards, Achim
The MCU I use is H533, but I guess the SPI peripheral in other MCUs would be similar.I'm looking for the recommended way to regularly transmit over SPI "small" data frames (in the sense that one frame fits into the FIFO) that can vary in size. For example, in response to different events I would be updating values of different DACs or shift registers and they all have their own data frame format and size, usually between 16 and 32 bits.SPI peripheral has TSIZE and DSIZE settings seemingly exactly for that, but they require disabling the SPI peripheral to be changed (for TSIZE it's documented, for DSIZE, it seems not), and it adds latency to transfers.So far it seems the optimal approach in my case is to as follows. Please bear with me for a moment and let me know if I'm missing something.1. Keep DSIZE at 8 bits.2. Keep the SPI enabled and set CSTART once at the beginning.LL_SPI_Enable(SPIx); LL_SPI_StartMasterTransfer(SPIx);3. When transferring, manually fill the FIFO with the data fra
Hello, I want to use an I2C port of a STM32F411 MCU (MCU_A) in target mode to receive data from another MCU (MCU_B), MCU_B code already existing and verified with other receivers.I configured the project with STM32CubeMX, with interrupts enabled to handle communication in interrupt mode.I used MX standard settings to generate CubeIDE project with HAL code.With some effort for setting up the initialization and other code for MCU_A in CubeIDE, communication looks ok from sending MCU_B perspective.Additional check of SDA and SCL signals with DSO looks ok to. But the problem was: No data was transfered to the receive data buffer in MCU_A. After several hours of debugging, I found a suspicious code section in the HAL code (stm32f4xx_hal_i2c.c).In the HAL function static void I2C_Slave_ADDR(I2C_HandleTypeDef *hi2c, uint32_t IT2Flags)which is called in HAL_I2C_EV_IRQHandler ()when adress matches, the direction flag received from MCU_B
Hello, I am searching for a example project to integrate a camera (e.g OV-Series) via DCMI interface. Can someone recommend an ST-Project or else? Thanks in advance!
Hello, Started to dwell info embedded development and got my hands on a NUCLEO-H7S3L8 development board. Firstly wanted to analyze the example code that comes with the development board and modify it a bit. But when started to debug, it seems to stop at I and D cache enable functions, and example LED blinking disappeared. Has anyone encountered something similar and could help to fix this problem? Only change I made to the example code is set-up a PC8 as a PWM to drive a LED switch. Additionally, tried a mass erase and re-flashing, but still nothing, the problems remains the same as I mentioned.
I would like to use some of your standard serial page eeprom'shttps://www.st.com/en/memories/standard-serial-page-eeprom.html The problem is that i don't understand how to use your memory loader with these chipshttps://github.com/STMicroelectronics/stm32-mw-extmem-ldr/tree/main The problem is that this library expects the chips to have 4 byte address and just doesn't work with 3 address chips. If you go through and just change all the call's to 3 byte address in the library i can make a STLDR file to talk to the chip. Just trying to see if there's a better way. You have this custom memory section that would help i just don't know how to use it? So i'm hoping for some help there.https://github.com/STMicroelectronics/stm32-mw-extmem-mgr/tree/main/custom
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.