Join discussions in the Product Forums. Ask questions, learn from your peers, and share insights on ST solutions to accelerate your design journey.
Most recent activity
I wrote the i2c communication code for the vl53l1x ULD API in vl53l1_platform.c and i2c32.c, and called the API in tof.c to initialize vl53l1. The VL53L1X_GetSensorId function can correctly read 0xEACC, but the VL53L1X_CheckForDataReady function always shows that the distance measurement is not completed, and at the same time, the VL53L1X_GetDistance also cannot read the distance measurement result.
Hello, I have modbus master application (Free RTOS using CMSIS lib), in which modbus constructure init the timer_ with osTimer. osTimerId_t ModbusMaster::createTimer_(const char* name) { osTimerAttr_t attr{}; attr.name = name; auto t = osTimerNew(responseReady_, osTimerOnce, this, &attr); return t; } So Modbus master send request to slave and start timer to wait for response, at start stagingLength_ = 0 __HAL_UART_ENABLE_IT(uart_, UART_IT_RXNE); HAL_UART_Receive_IT(uart_, &mbMsg_.payload.rawResponse.rawData[stagingLength_], 1); osStatus_t stat = osTimerStart(timer_,1500); Now as soon as I got first character received, I will change the period of timer to 3.5 character silence time and once that silence time is expire, the time will invoke its callback as responseReady(). Here below the value 1000 is not match with silence time but keep as big as possible. void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) { if(huart->Instance == USART2) { BaseType_t xHighe
Hello,I'm doing Modbus communication using RS485. And using MAX485 IC to convert to RS485. and running on Free RTOS CMSIS.I have tried and the behavior is random for all below, not consistent. Here I have tried with RS232 and it works like charm. The only issue with RS485. Where Modbus slave we have testing separately and it works fine too. - Transmit and receive blocking call but seen packet drop during receive- Transmit and receive interrupt with each byte and complete block of bytes, and saw complete frame is missing in reception.- Transmit blocking and Receive using DMA, saw complete frame missing during reception.- Transmit DMA and Receive DMA, saw receive frame is missing. So lets continue discussion on DMA transmit and receive.Here is the configuration for DMA and the USART2 is running at 16mhz- Enable DMA for rx and tx and also enable rs485 hardware flow control, so that it can internally handle the DE pin.static void MX_USART2_UART_Init(void) { huart2.Instance = USA
I've been trying to build example projects (i.e. Ux_Host_HID) with the make tool chain config with stm32cubeMXSo when i run make, a bunch of stuff compiles, then i get this error.make: *** No rule to make target 'build/tx_initialize_low_level.o', needed by 'build/Ux_Host_HID.elf'. Stop. So when I search for that tx_initialize_low_level I find a .s assembly file in Ux_Host/Core.SrcAlso, the make file seems to already be looking for assembly files to create the .o but for some reason, make is not recognizing it has a valid rule. $(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)$(AS) -c $(CFLAGS) $< -o $@$(BUILD_DIR)/%.o: %.S Makefile | $(BUILD_DIR)$(AS) -c $(CFLAGS) $< -o $@ Note: all files are generated from STM32CubeMX form their examples directory.
STM32 (I²C Master) → ESP32 (I²C Slave) “WASD” Command Link with UART InputSummaryThis project establishes a reliable data path from a PC to an STM32 microcontroller over UART, and from the STM32 to an ESP32 over I²C. The user types a line containing WASD characters in a serial terminal connected to the STM32. Upon pressing Enter, the STM32 transmits only the valid WASD bytes over I²C to the ESP32. The ESP32 runs in true I²C slave mode and logs each received command. The design emphasizes correct I²C electrical configuration (external pull-ups), address handling in STM32 HAL, and predictable serial console behavior.Hardware SetupMCU (Master): STM32F103 (I²C1: PB6=SCL, PB7=SDA; UART1: PA9=TX, PA10=RX).Target (Slave): ESP32 family device.Classic ESP32: SDA=GPIO21, SCL=GPIO22.ESP32-S3: SDA=GPIO8, SCL=GPIO9.Pull-ups (mandatory): 4.7 kΩ from SDA→3.3 V and SCL→3.3 V (one pair for the entire bus).Common reference: Tie grounds together (STM32, ESP32, and any USB-TTL adapters).I²C speed: S
Hi, I am working on the LIS2DH12, I have a problem to the appearance of acceleration data. I'm using full scale of +/- 2g and ODR of 400Hz. When the resolution is either 10-bit or 12-bit, only even number acceleration data is read(all x/y/z axis). The acceleration data is generally correct(but only even number). When resolution of 8-bit is selected, now both even and odd number acceleration data can be read. It shows the same appearance for ODR from 1Hz to 400Hz.
Hello,It is the first time I am using STM32 and migrating my code from texas instruments controller using USART3. I want to receive data and then transmit data of different sizes. I get a problem that I see appears often but in my case I cannot see why it appears. I want to use USART on port C, PC4 = Tx and PC5 = Rx. I have a partner sending data via uart and I can see the data is on the Rx line but somehow it does not come to the buffer. I get to the interrupt handler and then Error callback. I am using the receive to Idle with interrupts when data is received. The first expected data is 10 bytes, my rx buffer is 1024 big and my rx buffer is defined , not NULL. I call the function for receive directly after my partner device is on and I have got the reply this device is on. The partner device is making 10 attempts to send the same data and without answer is shutting down. It starts sending shortly after it is on. My uart onfiguration is as follows: handleUart3.Instance
I'm working with the STM32U5G9, trying to configure access to internal RAM blocks with TrustZone enabled. Part of this configuration uses the HAL_GTZC_MPCBB_ConfigMem() function from stm32u5xx_hal_gtzc.c from STM32CubeU5 v1.7.0.I see in that function a comment indicating: /* limitation: code not portable with memory > 512K */ pMPCBB_desc->AttributeConfig.MPCBB_LockConfig_array[0] = READ_REG(mpcbb_ptr->CFGLOCKR1);but the STM32U5G9 has several internal SRAM blocks with size over 512K: Is TrustZone MPCBB control not fully supported by STMCubeU5 for the STM32U5Gx processors? Am I missing something?Thanks,-Rob
As the title says, I'm trying to just simply run the SensorDemoBLE project. My configurations should be correct, my spi data size is set to 8 bits, and a clock baud rate of 6.0 Mbit/s. First of, after generating the project there's loads of errors which makes sense since the demo project is on the older side. After fixing most of the errors, and finally compiling and running the project, there's major issues with the hci module. I'm getting timeout errors in the hci_send_req function. Any help would be aprreciated. Thankyou.
I am new to the NUCLEO WL55JC1 and wanted to experiment with LoRaWAN.I've followed the YT series on the topic, especially the 3rd part (https://www.youtube.com/watch?v=8KNfrWoa1fw&t=26s). My End node is properly joined and connected to the things network. I am using the 868 MHz band in EU. However after several successful transmits that I can observe on the UART, the device seems to reset after a timeout. What could be the reason?... ###### ========== MCPS-Confirm ============= 420s356:VDDA: 254 420s356:temp: 21 420s360:TX on freq 868500000 Hz at DR 0 420s363:SEND REQUEST 422s009:MAC txDone 427s041:RX_1 on freq 868500000 Hz at DR 0 427s239:IRQ_RX_TX_TIMEOUT 427s239:MAC rxTimeOut 427s996:RX_2 on freq 869525000 Hz at DR 3 428s055:IRQ_RX_TX_TIMEOUT 428s055:MAC rxTimeOut ###### ========== MCPS-Confirm ============= 430s364:VDDA: 254 430s364:temp: 21 430s364:Next Tx in : ~3169 second(s) FATAL: read zero bytes from port term_exitfunc: reset failed for dev UNKNOWN: Input/output err
I am creating a custom yocto image on a STM32MP157F-DK2. I am using the meta-stm32mp layer as apart of the bitbake build. Yocto version : Scarthgap When I run bitbake I get this failure ERROR: hydra-image-1.0-r0 do_rootfs: Postinstall scriptlets of ['busybox'] have failed. If the intention is to defer them to first boot, then please place them into pkg_postinst_ontarget:${PN} (). Deferring to first boot via 'exit 1' is no longer supported. Details of the failure are in /home/hydra/yocto/build/tmp/work/stm32mp1_brady-hydra-linux-gnueabi/hydra-image/1.0/temp/log.do_rootfs. ERROR: Logfile of failure stored in: /home/hydra/yocto/build/tmp/work/stm32mp1_brady-hydra-linux-gnueabi/hydra-image/1.0/temp/log.do_rootfs.661419 ERROR: Task (/home/hydra/yocto/layers/poky/../meta-brady/recipes-core/images/hydra-image.bb:do_rootfs) failed with exit code '1' Log file update-alternatives: Linking /home/hydra/yocto/build/tmp/work/stm32mp1_brady-hydra-linux-gnuea
Hi,I've started working with the SBSFU example recently on an STMU585. I have noticed that flashing the sbsfu_app_init.bin file is much slower (10x maybe?) if TrustZone is enabled.My workaround has been to create a script to do a regression to RDP level 0 with TrustZone disabled, which will mass erase the device, and then reflash both sbsfu_app_init.bin and the bootloader each time before renabling TrustZone at the end.I was wondering what the specific root cause of the slower flashing is, and if there is a better workflow that would allow me to update just the sbsfu_app_init.bin, or potentially just the NS part, with speeds comparable to those I get when the device is blank.Thanks,Mike
I can't find anything in CubeMX or HAL documentation or STM32G4xx_hal_adc.h or STM32G4xx_hal_adc_ex.h about how to enable Bulb Sampling Mode. How do I enable Bulb sampling mode using CubeMX and HAL?
I tried creating I2C connection between my stm32 board and esp32. I assume it is not working because of my code, due to the wiring being so simple in I2C communication, the pull up resistor is connected externally. Do you guys see any mistake in my code that could make my I2C to not work? I cannot figure out why it would not work.
Hello, I'm trying to implement a USBX host... and the code generates a lot of runtime errors. I assume everything is setup properly from CubeMX, but the code always fails. 1- I see that the mutex was created from the debug session: (ux_system_mutex)2- the system fails when trying to initialize the UX system.3- The error came from _ux_utility_mutex_on() and generates an error code 0x04VOID _ux_utility_mutex_on(UX_MUTEX *mutex) { UINT status; /* Call ThreadX to get system mutex. */ status = tx_mutex_get(mutex, TX_WAIT_FOREVER); /* Check for status. */ if (status != UX_SUCCESS) { /* Error trap. */ _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_UTILITY, status); } /* Return to caller. */ return; }so, it is trying to get the mutex (ux_system_mutex) and then wait forever....4- If I look at the AzRTOS manual: 0x045- The base code was auto generated by CubeMX. So basically it is trying to initialize memory using a mutex before starting
Hello, I am trying to use the STMicroelectronics classic USB device middleware to implement a CDC class in the STM32U575 microcontroller. I am currently working on NUCLEO-u575ZI-Q. At first, I followed the tutorial on "How to use STMicroelectronics classic USB device middleware with new STM32 families" by @B.Montanari (https://community.st.com/t5/stm32-mcus/how-to-use-stmicroelectronics-classic-usb-device-middleware-with/ta-p/599274) but I encountered the same errors pointed out in the tutorial comments by other users with STM32U5. Then, I created a new project and used the "STM32U5 classic core Middleware Firmware Package" repository (https://github.com/STMicroelectronics/stm32u5-classic-coremw-apps) without any success. In the end, I created another project using the USB Device CDC Standalone Library for STM32U5 (https://github.com/STMicroelectronics/stm32u5-classic-coremw-apps/tree/main/Projects/NUCLEO-U575ZI-Q/Applications/USB_Device/CDC_Standalo
I run STM32CubeMX from the terminal and get an errror message in termianl.You can find the details in ‘error.txt'.
Hi: We are currently using the STM32G431 MCU with an HSO observer. We are working on a high-speed motor driver that requires an electrical frequency of 5000 Hz. We are unsure whether the STM32G431 can handle a 5000 Hz electrical frequency and if there are any related applications. Based on our current testing, we need to generate 8 carrier cycles within one electrical cycle. So for a 5000 Hz electrical frequency, we want it to operate at a 40 kHz carrier frequency. However, the STM32G431’s processing power cannot handle 40 kHz. We would like to know if the H7 series supports HSO and if it can meet the 40 kHz carrier frequency and operational amplifier speed requirements?
"Hello.We are currently developing a medical device in Korea using the STSPIN32G4.During an EMI pre-scan, we confirmed that noise is being generated in the 188MHz band from within the chip.We have seen posts on forums from others who are experiencing similar issues.We would appreciate your advice on how to resolve this.Thank you."
Hello,I'm using an EVSPIN32G4 with a Bodine BLDC motor (Hall-less). I used the motor profiler to get all the need motor settings and have compiled firmware. It spools up nicely but I can't get it to 6000RPM. The motor profiler says that the motor is capable of 6000 RPM. All of my settings appear to be correct.I'm using a 48VDC supply capable of 12A. The motor cable says 6000 RPM, 7.8A, 48VDC.This is a 2 pole pair motor. It seems that every change I make to try and resolve this tends to break something.Does anyone have suggestions?
Moved from STM32 forum - this is not an STM32 question.I am facing an issue with the Auto Dev Kit debugger. My previous license had expired (Hightec), and although I tried renewing it and even registered to get a new license, the debugger still does not work.Additionally, I notice that the debugger and flash icons appear greyed out.Could you please assist me in resolving this issue?
Hello!I'm working with a STM32G474 and would like to achieve, that a HRTIM trigger is used to trigger sampling of an injected group in an ADC. So far, I managed to set everything up and have the system running. But now, I'd like to combine this mechanism with the ADC Oversampler. The course of actions I'd like to achieve would look as follows (assuming Oversampling ratio x4 and 2 channels in the injected conversion sequence):Is this achievable with some out-of-the-box CubeMX configuration settings?Alternatively, I'd also be happy with a sequence like this:Thanks already!KR, Michael
Hello everyone, I am working with an STM32H5 series board and have successfully initialized Ethernet using the lwIP stack.The DHCP process works correctly — I am able to obtain an IP address. However, I am facing a “Request Timeout” issue when I try to communicate with other devices or servers over the network. Below is my sys_check_timeouts() function (default lwIP implementation): void sys_check_timeouts(void) { u32_t now; LWIP_ASSERT_CORE_LOCKED(); now = sys_now(); do { struct sys_timeo *tmptimeout; sys_timeout_handler handler; void *arg; PBUF_CHECK_FREE_OOSEQ(); tmptimeout = next_timeout; if (tmptimeout == NULL) { return; } if (TIME_LESS_THAN(now, tmptimeout->time)) { return; } next_timeout = tmptimeout->next; handler = tmptimeout->h; arg = tmptimeout->arg; current_timeout_due_time = tmptimeout->time; memp_free(MEMP_SYS_TIMEOUT, tmptimeout); if (handler != NULL) { handler(arg); } LWIP_TCPIP_THREAD_ALIVE(); } while (1); } My setup: Control
Hi.During production, we use USB to test the board. Finally, the MCU is supposed to be password-protected against flash reads. Unfortunately, it turns out that as long as the USB cable is connected, it's impossible to program the OBK. Segger Device Provisioner returns an "Error writing OBK". Using STLink and CubeProgrammer also doesn't work. After disconnecting the USB, changing the state to Closed works. BOOT0 is connected to ground. Is there a solution?Artur
ST Community highlights – April to June 2026
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.