Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
In STM32G474 UART4 pin no PC11(Rx) is 5 Volt tolerant . If I pull up this pin to +5V with 4.7kOhms then it will affect life or operation of microcontroller? please Suggest.
Hi Everyone,We are using an STM32F401RE Nucleo board with the IHM16M1 power board, running a sensorless FOC algorithm generated using ST Motor Control Workbench. The motor parameters were averaged over several runs using ST Motor Profiler, and the control is implemented in 3-shunt topology.Observed Issues:Humming noise becomes audible and increases as RPM increases.This is more prominent at higher speeds.At low RPM, noise is tolerable but increases as speed ramps up. Speed graphModifications done in Motor Control Workbench to mitigate issues:Increased Kp divider to reduce aggressive control at low speeds (reduces noise at low RPM but not high RPM).Reduced Ki to prevent instability.Reduced Observer G2 gain to prevent speed feedback faults in Motor Pilot.PWM Mode Testing:Switching from center-aligned to discontinuous PWM seems to delay the onset of the humming noise slightly, but noise still eventually appears at high RPM. Is there a recommended strategy to suppress audible noi
Hello,we do have a custom motor control board based upon B-G431B-ESC1.A custom inverter board is created with the board designer and the project is created with MotorControl Workbench 6.3.1. The system is running fine at higher RPMs (>2500 RPM; max RPM of the motor is 2900).However when running at lower RPMs the system is becoming instable after some time. I see in the motor pilot that IQ_MEAS and ID_MEAS are increasing till the overcurrent limit is triggered. In this error case the motor RPM is remaining constant, but power consumption is increasing. I can also see that a shift between the HALL_EL_ANGLE and the STOPLL_EL_ANGLE (this is the auxiliary sensor) is becoming visible in this case. When the system is working normally the two are aligned.I can delay this behaviour by decreasing the integral part of the PI parameters for Iq and Id or increasing FOC rate to 5, but I can not get it to stop. Does anyone have any tipps how to get the PI regulators to become stable
Hi, Has anyone managed to Trigger Timer 2(Combined PWM Mode, One-Pulse) with Internal Trigger 3(ITR3). The TIM14 OC1 waveform is the trigger. When I run Timer 14 in output compare mode, with an active level on match between Couner and CCR1. I cannot trigger the Timer nothing happens. If I go an manually trigger the timer, everything works. Here is my Software to setup Timer 2 in Combined PWM Mode 2, on channel 2, One-Pulse Mode. Image on the left is the TIM2 code and imagine on the right code for Timer 14. I have verified this works by using the debugger and seeing that TIM2 is never enabled even if the OC1 Signal on Timer 14 goes high
Hello,I have modbus master and slave device, where I have design modbus master for testing in that way that it will continuously send modbus request after each successfull response, and if any response fail then it stop.Now on I'm getting continuous response from slave device and working fine. The issue is with slave device having undesired behavior if we restart the slave device.Slave device has custom bootloader and slave device. So once we start the device it will start bootloader and bootloader will take care to check integrity of slave application and if all well, then jump to slave application.So, if I dump the code in release mode (via bootloader) first time then slave device continuously give response on each request and it continue until I stop or reset and even after master reset and ON again, the slave device still continue to work well.Note: It works in all the way if we dump a debug code, only issue with release code. I have remove bootloader and allow to run s
Hello there-Is there a way to add own commands/requests to the ASPEP protocol like retrieving own custom introduced values?I´m running the B-G431B-ESC1 board and adapted the esc.c file to my needs and it now holds a value I´d like to be able to retrieve. As far as I understand from looking at the code, callbacks are registered through uint8_t MCP_RegisterCallBack (uint8_t callBackID, MCP_user_cb_t fctCB)defined in mcp.h / implemented in mcp.c-Searching the project for this text I didn´d find locations where it is called / callbacks registered. - br, Justus
I am able to do a line reset, enter into JTAG_SWD mode and read the SWD_ID. I want to know how to configure the core registers for SWD initialization process.
Description:My RTOS application on NUCLEO-H563ZI board runs a thread CollectSamplesThread. I generate an interrupt every 8Khz using a timer and the ISR triggers a non blocking SPI transfer:The application code: void InitAdeSpi() { // SPI1 Initialisation if (hSPI.hdmarx != NULL) { HAL_DMA_RegisterCallback(hSPI.hdmarx, HAL_DMA_XFER_CPLT_CB_ID, AdcSpiRxCallback); } } void AdcSpiRxCallback() { BaseType_t xHigherPriorityTaskWoken = pdFALSE; // Release the sempahore thats blocked to validate the frames in CollectSamplesThread xSemaphoreGiveFromISR(xSpiRxSemph, &xHigherPriorityTaskWoken); portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } void TIM3_IRQHandler(void) { EvbDataRdyTimerHandler(); } void EvbDataRdyTimerHandler(void) // Ensure this matches the existing declaration { __HAL_TIM_CLEAR_FLAG(&hTimDready, TIM_FLAG_UPDATE); // Release the sempahore that is blocked in the CollectSamplesThread for Dready callback xSemaphoreGiveFromISR(xSamplesAvailS
Hello everyone,I created a project using Motor Control Workbench, configured for FOC with Hall sensors and 3-shunt current sensing, PWM at 20 kHz. The initial setup used:NUCLEO F303RE boardSTDRIVE101 evaluation boardA BLDC motor with a nominal current of 4 ADuring testing, everything worked perfectly: the current reading matched the expected load (4 A at constant effort).Based on this setup, I developed a custom electronic board using an STM32F303VC. The schematic is identical to the EVALSTDRIVE101 board (same components).I reconfigured the project in MC Workbench using exactly the same parameters as in the evaluation setup. However, when testing the custom board under the same load conditions, I read a current of 8 A.I’ve double-checked the hardware: shunt resistor values, op-amps, connections — everything is identical. I suspect a configuration issue or a subtle difference I may have overlooked.Questions:Are there any specific parameters in MC Workbench or Motor Pilot that depend on
Subject: PMSM Motor Drawing Higher Power at Low RPM – Guidance on Parameter TuningHello Expert,I have developed a custom board based with STM32F303VET6X, using two IPMs and 0.47 Ω shunt resistors, similar to the STEVAL-IHM045V1 design. The board utilizes the internal op-amps and comparators for current sensing and protection.With MCSDK 6.41, I have successfully run two PMSM motors using this custom board, equivalent to the setup with STEVAL-IHM045V1 power board and STM32F303E-EVAL control board.However, I am observing that at lower RPM, the motor exhibits audible noise and higher input power consumption compared to a typical ECM motor operating at similar conditions/ airflow/rpm. In the custom board livewatch target RPM is achieved always, but I am unsure which parameters should be optimized in MCSDK to reduce input power and improve efficiency.As an random experiment, I thought to play with RSH. I changed the shunt resistor values to see the effect on power consu
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
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
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
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 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 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
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?
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.