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
Hi, I have a problem with the flow meterGenerally the flow meter catches air, which makes me unable to take accurate measurements.Correction, maybe not so much that the flow meter is catching air, because there is no signal on the logic state analyser during air. The signal is only there when water is actually flowing.I am attaching a screenshot where I have set the pump to take a measured 20ml three times, and let's say this would agree with the measurements I used to take "dry", i.e. without a water pump just pouring into the sensor And then it agreed that:ML = totalImpulses * 0.48 ; I got rid of the pins that the water pump was giving by adding a 10nF capacitor between the pump supply Below I attach the code I uploaded to the STM32L432KCU6 nucleoAnd the stm32CUBEide settingsThe components I am using:* Pump: https://botland.store/pumps/7206-liquid-pump-12v-110l-h-7mm-5904422335595.html* Sensor: https://botland.store/flow-sensors/4411-liquid-
Hello, I am new to STM and I am trying to configure USB as a device for MSC configuration.I have followed the tutorial from STM32 USB MSC (Mass Storage Class) by Controllers Tech but when I connect the USB port to my pc I getting detected but I can't able to format, read and write. I have gone through the internet I can't find any relevant info related to this, Has anyone actually managed to get it working and help me to resolve the issue.
Hi everyone! I was hoping to get some help on a function I've made which is called by timer to write to a DAC which takes 24 bit bytes, which I send in 8 bit chunks. I wanted to make my own function because the HAL_SPI_Transmit is oretty overhead heavy and slow to execute. The thing I can't figure out is that in the below function, if I comment out the line where I wait for the TXE flag bit to set, meaning the FIFO is empty, the funciton works BUT, if I try and execute that function TWICE in the same TIM function call, it does not work. So, something is happening between calls of the TIM callback that is somehow allowing me to write to SPI again, but this doesn't seem to happen if I wait for it in my function with a while(); If I uncomment the line with a while(!((SPI->SR)&(1<<1)){}; then the thing hangs up and sits at that line forever.I SUSPECT that I'm somehow leaving 8bits in the FIFO after my 24 bit sequence and it just stays that way forever and hangs on my line
STM32Cube FW_F4 V1.28STM32CubeMX 6.11.1file main.c line 209 function static void MX_SDIO_SD_Init(void)hsd.Init.BusWide = SDIO_BUS_WIDE_4B;fix hsd.Init.BusWide = SDIO_BUS_WIDE_1B;Related post.https://community.st.com/t5/stm32cubemx-mcus/sdio-interface-not-working-in-4bits-with-stm32f4-firmware/td-p/591776
I have coded a TCP client on a ST32F746ZGT6 and i am receiving data from a TCP sever with a rate of 50hz and a packet size of 1460 bytes through ethernet. as part of my TCP client in tcp_client_handle function, i am extracting only 4 bytes of the receive packets and send it another device by Wi-Fi. Here is my code for the whole TCP client: int counter = 0; uint8_t data[100]; extern TIM_HandleTypeDef htim1; /* create a struct to store data */ struct tcp_client_struct *esTx = 0; struct tcp_pcb *pcbTx = 0; void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) { char buf[100]; /* Prepare the first message to send to the server */ int len = sprintf (buf, "This is APM Computer %d\n", counter); if (counter !=0) { /* allocate pbuf */ esTx->p = pbuf_alloc(PBUF_TRANSPORT, len , PBUF_POOL); /* copy data to pbuf */ pbuf_take(esTx->p, (char*)buf, len); tcp_client_send(pcbTx, esTx); pbuf_free(esTx->p); } } /* IMPLEMENTATION FOR TCP CLI
I am using stm32h743 mcu and initialized cdc usb fs with cube mx for device only. After that i changed descriptors of cdc with uvc descriptors now the device is recognized as usb composite device on device manager but i am not able to transmit any data over it as i tried to send dummy data but no packets were sent as i monitored them on wireshark.
What options or tuning is possible to increase the throughput for this IP over USB?Goal is to at least transfer 64KiB each 20ms or better. (22MBit/s or greater)(started from project STM32H735G-DK/Applications/USBX/Ux_Device_CDC_ECM on github from Kind regards,Jan
Hi All,We are using the STM32H7 mcu interfaced with ethernet switch LAN9353.In our firmware application we are using the LwIP network stack and FreeRTOS. And using TCP server-client functionality for communication.We are able to establish the communication between mcu and external devices via the ethernet switch. The overall communication is ok.We are reading the PHY registers and according to the speed and duplex mode, we are setting it in the STM32H7 mcu's MAC peripheral. Generally the speed read from the control registers of PHY is 100Mbps full duplex but during the transmission/reception of the packet with the external devices the speed is getting reduced to in range of 8Kbps to 46Kbps.We have checked the speed by using Wireshark tool and "Task manager->Performance->Ethernet".Can someone guide us in the above. Is there any way to increase the packet transmission/reception in mcu side or ethernet switch side?Thanks in advance.Pratik
I am working on a project to include edge impulse package into my code. But while integrating edge impulse package I got to change the c file to cpp. But the Ble package which was working fine prior is now not work fine as the code converted to cpp.the files in bluenrg_ms file is not detected for the definition of functions to source code in main().
Hello!I suspect it has been already asked, but nevertheless:stm32f411xe.h: #define USB_OTG_DIEPMSK_TXFURM_Pos (8U) #define USB_OTG_DIEPMSK_TXFURM_Msk (0x1UL << USB_OTG_DIEPMSK_TXFURM_Pos) /*!< 0x00000100 */ #define USB_OTG_DIEPMSK_TXFURM USB_OTG_DIEPMSK_TXFURM_Msk /*!< FIFO underrun mask */ #define USB_OTG_DIEPMSK_BIM_Pos (9U) #define USB_OTG_DIEPMSK_BIM_Msk (0x1UL << USB_OTG_DIEPMSK_BIM_Pos) /*!< 0x00000200 */ #define USB_OTG_DIEPMSK_BIM USB_OTG_DIEPMSK_BIM_Msk /*!< BNA interrupt mask */ And reference manual (RM0383 Rev 3) omits 'em... Documentation looks inconsistent.
HI..,I am using the STM32H745 DISCOVERY BOARD in that i am working on ETHERNET SECTION in that my aim is to configure the FOUR DIFFERENT MACS for the stm discovery board. Now out of four MACS i have configured the two macs independently .The issue is i am unable to configure the remanning two macs although i have used these registers for the configuration of the macs (ETH_MACAxHR) & (ETH_MACAxLR).AM I missing any other thing in the configuration of mac or any other particular register related to enable of the remaining macs pls let me know . Thanks & regard:syed1.
Hello,I have a problem with HTTPD web server when I use STM32CubeMX 6.11.1 to produce a code. when I open Webpage with my static IP address,Network will disconnect ,so i want to know whether STM32CubeMX 6.11.1+ STM32CubeF4 Firmware Package V1.28.0 support Dynamic web pages 。I mean HTTPD web server httpd_cgi_ssi.
I am trying to allow an STM32G070x MCU I'm using in a project to be (OTA) updatable by a second MCU. To that end, I followed Viktor Vano's instructions, here and here.As described there, there is a (secondary) bootloader programmed at flash address 0x8000000 ("partition 1") and two versions of firmware for the MCU to run, at later flash addresses, in my case at 0x08003000 and 0x08011000 ("partition 2" and "partition 3"). The bootloader makes a decision of which firmware version to jump to, then jumps there using an assembly instruction, as also noted in the code here.That works fine when the two versions of the MCU firmware are programmed to the MCU using the STM32CubeIDE, or similar, and each version has the FLASH (rx) : ORIGIN value set to 0x08003000 or 0x08011000 in the STM32G070CBTX_FLASH.ld file, and the VECT_TAB_OFFSET value set to 0x00003000U or 0x00011000U in the system_stm32g0xx.c file. That writes them to the correct place, and the bootloa
Hello ST Community,I am working on a project using an STM32 microcontroller with USB CDC class for communication. I am using the CDC_Transmit_FS function to send data over USB, but I am looking for best practices to handle the completion of data transmission effectively.Current ImplementationIn my current implementation, I am transmitting data using the following code: char usb_buffer[64]; snprintf((char *)usb_buffer, sizeof(usb_buffer), "Hello, World!\r\n"); while (CDC_Transmit_FS((uint8_t*)usb_buffer, strlen(usb_buffer)) == USBD_BUSY) { HAL_Delay(100); // Delay to allow USB stack to process } While this works, it is not efficient as it relies on a blocking delay which may not be optimal for all applications.QuestionsNon-blocking Transmission: What is the best way to implement non-blocking USB transmissions using CDC_Transmit_FS?Completion Callback: Is there a way to use a completion callback to notify when the transmission is complete?Handling Busy State: How c
Hi allI want to enumerate a Virtual COM Port on my NUCLEO-U5A5ZJ-Q board, using USBX peripheral in standalone mode. I have followed other articles, but they either use RTOS, or a different device class.So my question is:How can I setup the USBX peripheral for a CDC VCP device that can send and receive without Threadx?Kind regards ☺
I have an application implemented with the NUCLEO STM32L552 board, in which I need to generate a sinewave of a known frequency (Period=T) and a single short pulse per cycle at a known phase angle say A.I have divided the time period of the signal say T into 360 steps, with each step representing a degree, and run a timer in Interrupt mode with the ARR value equal to T/360. In the Interrupt SR, I output the sine value from a pre-calculated source at a given degree, increment it, and reset the counter to 0 as it equals 360. This way the DAC successively outputs values from 0-360 and continues to output the sinewave which is working perfectly fine.Now I have to generate a single pulse of a short fixed duration at a given degree in each cycle. I am not able to find the right way to do it. Could anyone guide me please.
Hello,i have running an web applikation with netXduo on an STM32H735 and i try to open a TCP connection.Driver, initialization, communication and stuff is working, but for testing purpose i tried to let the netXduo API-calls to run into timout by setting the waitOpt to a very low time.But nothing happened, e.g. with nx_tcp_socket_receive with a timeout of only a few ticks, the stack waits till the next packet is received. The function doesn't return on timeout.I have also tried nxd_tcp_client_socket_connect, also this function does not timeout. It stucks infinitely if it can't establish the connection, although timeout is configured. Can anyone give me a hint, why these functions (and probably others too) will not return by timeout? best regards
Hi, today I found an pretty unusual bug while doing some projects with the USB CDC, my code, out of the blue, showed hundreds of errors, after some diggins, me and a friend, found out that in the usbd_def.h, the TypeDef of "USBD_StatusTypeDef" was changed with an "q", I think it must have been some mistake while updating the libraries. Anyway, just change the letter "q" in the line 209 to "USBD_StatusTypeDef" of the usbd_def.h folder and the errors should disappear.
I encountered a problem when trying to send more than 5 bytes of data using the FMC. // impossible example -- #define SD_DATA (*(volatile unsigned char *)0x60000001) SD_DATA = 0x01; SD_DATA = 0x02; SD_DATA = 0x03; Using this method, data is not transmitted to the same address without a delay. However, it is possible to write data to the FMC if I change the address each time I transmit or use a delay. // possible example -- 1 #define SD_DATA (*(volatile unsigned char *)0x60000001) SD_DATA = 0x01; HAL_Delay(1); SD_DATA = 0x02; HAL_Delay(1); SD_DATA = 0x03; // possible example -- 2 #define SD_DATA1 (*(volatile unsigned char *)0x60000001) #define SD_DATA2 (*(volatile unsigned char *)0x60000002) #define SD_DATA3 (*(volatile unsigned char *)0x60000003) SD_DATA1 = 0x01; SD_DATA2 = 0x02; SD_DATA3 = 0x03; What could be the problem? We used the STM32F756, and the following is the FMC initialization. static void MX_FMC_Init(void) { FMC_NORSRAM_TimingTypeDef Ti
Hi,part of the project I am working on, I have been asked to add an external device to a vending machine. It is an age-recognition system that would interface with the main controller via USB. But apparently uses HTTP protocol over USB if I understand correctly...?Attached is a (very short) PDF of the API and the product brochure. In the brochure there are 4 devices there but the one I've been asked to use is the one on page 4 and 5. It is like a USB pen drive that you can plug directly into a PC. At the back of it there is another USB port where you plug in the web cam. There are no other connectors. That is the whole system for age recognition. On page 5 it also says "no internet required"... You just send a command to that USB tiny device and receive back an answer... either ACK or NACK depending on the age.I am very familiar with C/C++ but never worked with networks. I barely know what HTTP is... So I am wondering (if you could look at the attached screenshot):- is
I have been trying to get values from an HCSR-04 sensor, but I only get garbage values. I debugged it and saw that my code doesn't clear the UIF flag of the TIM2 SR register. Could this be the cause of the garbage values? I tried the sensor with an Arduino, and it works normally. I have STM32F407G-DISC1 board. I copied this code from here it works for him but didn't worked for me. https://ruturajn.hashnode.dev/interfacing-an-ultrasonic-sensor-with-the-stm32f407-discovery-board-using-bare-metal-programming Here's my code: #include "stm32f4xx.h" #include <stdio.h> #include <string.h> void TIM2_us_Delay(uint32_t delay){ RCC->APB1ENR |= 1; TIM2->ARR = (uint32_t)(delay/0.0625); TIM2->CNT = 0; TIM2->CR1 |= 1; while(!(TIM2->SR & (1<<0))); TIM2->SR = 0; } void HCSR04_Init(void) { RCC->AHB1ENR |= 1; //trig PA5 GPIOA->MODER |= (1<<10); //echo PA6 GPIOE->MODER &= ~(0x3<<12); } uint32_t data=0; do
Hi,I have started my hand-on experiments of FreeRTOS using stm32u575 uc with stm32u575zi-q nucleo board as non secure.I have created 2 task and their handler. With the help of seial viewer, printed some messages.While executing the code,it does nothing.As I am newbiee,Unable to debug what's the exact issue.Kindly help me with it.Herewith I have attached the github link of my repo for your reference.https://github.com/soulbee30/FreeRTOS-main.Thanks In advance.
Hellois it possible for the microcontroller with USB OTG to download the program memory from the USB stick itself?In other words, change the firmware simply by connecting a USB stick with a .bin file and perhaps by resetting the component.So far I have solved it using two MCUs. One only reads the .bin file from the USB and then uploads it to the target device via the usart bootloader, but this seems too impractical to me.
Hi STM Team,I need to access test.wav audio file from External SPI Flash memory.Is there is any file system library to mount spi flash memory as file system?I am using Nucleo - G070RB.Is there is any microcontrollers with library that support external flash memory as file system.Please provide me the suggestions.
Hi,I am a beginner in STM32. I am doing a POC to read the coordinates of the touch sensor tsc2004 with ili9488 LCD driver. My custom board uses STM32F429i disc board. But I am using an external LCD driver rather than ili9341 (built-in). Based on the coordinates and touch detection my screen has to change. I use STM32 CubeIDE and TouchGFX for Graphics configuration. I try to implement the touch sensor pin as interrupt pin. So, whenever a touch is detected the display screen has to change. This is my specification. Can anyone guide me what are the functions needed to customize? Thank you in advance.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.