Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
Hello,I am an employee of a company producing underwater scooters, currently working on implementing the STSPIN32G4 microcontroller in our products. I have the following question:In the Motor control Workbench software, in the "Speed Sensing Mode Selection" section, the "High sensitivity observer" option is available to choose from1. How should the microcontroller hardware connections be made to be able to use this option?2. Will STSPIN32G4 allow the use of this functionality?I also have the EvalBoard EVSPIN32G4, but when trying to configure it, the "High sensitivity observer" option for this evalboard is unavailable.3. What should be changed in the scheme of this evalboard to be able to use this option?Best regards,Slawomir Gradowicz
SPD_GetInstElSpeedDpp is implemented in speed_pos_fdbk.h static inline int16_t SPD_GetInstElSpeedDpp(const SpeednPosFdbk_Handle_t *pHandle) { #ifdef NULL_PTR_CHECK_SPD_POS_FBK return ((MC_NULL == pHandle) ? 0 : pHandle->InstantaneousElSpeedDpp); #else return (pHandle->InstantaneousElSpeedDpp); #endif } The returned variable pHandle->InstantaneousElSpeedDpp is however only updated when using STO+PLL as speed sensing method (see sto_pll_speed_pos_fdbk.c). For any other method (sensored or sensorless) InstantaneousElSpeedDpp is never updated.SPD_GetInstElSpeedDpp is used in mc_tasks_foc.c (mc_tasks.c before version 6.3.0) to do do reverse park angle compensation. This means that REV_PARK_ANGLE_COMPENSATION_FACTOR does not work as expected for any other speed sensing method than STO+PLL. hElAngle += SPD_GetInstElSpeedDpp(speedHandle)*REV_PARK_ANGLE_COMPENSATION_FACTOR; As far as I can figure out, SPD_GetInstElSpeedDpp s
I am working on a STM32N6570-DK board, and I want to make sure that if I want to start a program on the external Nor Flash(the default mode), before using the Cubeprogrammer to download it, the boot0 and boot1 can both be set to 0, or boot0 has to be set to 1 to successfully download it using the ST-link. I have already known that when running the program, boot0 and boot1 have to be set to 0.
Hi All,I have a project that is using the STM32H562. I am having an issue using tim13 and tim14 to generate PWM outputs going to LEDs. The project uses timers tim2, tim3, tim4, tim13, and tim14 for a range of different PWM peripherals. For all of the timer instances that aren't tim13 and tim14, the PWM configures and works as expected, but I am unable to get any PWM output signal on the channels controlled by tim13 and tim14. Neither the autogenerated INIT functions or my application code to update the pulse width value return any errors from the HAL functions, and I can see the value of the registers being updated with the new pulse value, but there is no output on those pins. I have verified to some extent the hardware, because I am able to toggle those LED pins by configuring them as standard GPIO outputs and driving them high to see the LEDs illuminate. Any suggestions or information would be greatly appreciated! I can provide more information upon request. Thanks!
Hi, I have an STM32F407-DISC1 connected to an Raspberry PI via I2S. The clock frequency is about 3MHz. The STM is receiving as slave on I2S2 and feeding data to a ring buffer. When the ring buffer is half full transmission on I2S3 is started (as slave). I meassure the timing between the two DMAs with __HAL_DMA_GET_COUNTER(hi2s2.hdmarx) and __HAL_DMA_GET_COUNTER(hi2s3.hdmatx). With this approach I am expecting to have a constant delay of one half buffer length between the two channels but the delay are slowly decreasing. Does anyone know why this is happen and if there is a solution.This software is to test the data path. Next i will use an external low noise ocillator to drive I2S3 (as master). The external ocillator will drift compared to the bit clock from the PI and the buffer shall be deep enough to absorb the drift.
I want to make a communication between 2 microcontrollers by can protocol i put after each microcontroller a can transceiver and the problem is that we send data but i other board we don't receive it, i mean after the second receiver we don't have proper output in RX,TX even it's CANH,CANL input of transceiver is ok and the transceiver doesn't have problem because i changed them but the problem remain! and i archived the codes if you want to take look...if you know where the problem is pls tell me.
Hi, I first worked with CAN with STM32H563 with normal mode. It worked. Later Again I tried it is not working with same code. Loop back mode is working fine. I would like to use other pins for CAN since I am using PD0 and PD1. May I know which pins are good for working with CAN. Please find the attached code and let me know if there any issues in the code. Thanks & Regards, Keerthi
I managed to create a working example ethernet NetXDuo project for the nucleo-h753zi board based of this guide:https://community.st.com/t5/stm32-mcus/creating-a-dual-ipv6-amp-ipv4-netxduo-udp-application-for/ta-p/570521See my repository here:https://github.com/mo-krauti/nucleo-h753zi-ethernet-netxduoThis only works by adding a delay before starting NetXDuo. Why could that be? I also could not find any link mentioning this online? Generally I think setting up the Ethernet Controller on H7 is quite hard compared to the F7 series.
Hi,On the keynote speech, I saw that FreeRTOS will be the main kernel.Does that mean that ThreadX will not be offered as an alternative?What is the reason for this change?What about NetXDuo as a middleware?I am quite happy with how ThreadX and its components worked with each other. Over the years, I have developed several products with NetXDuo, USBX middlewares with ThreadX as an operating system. Not sure why ST is stepping back to FreeRTOS. Curious to know. Best regards,Navin
Hi, we are evaluating STM32L4A6VGT6TR, with our new product prototype. We are only suppling one 3.3V to the MCU as it requires. We have already included discharge circuit, and we can see this 3.3V rail will be completely discharged within 0.288s. However, the MCU cannot every time come up again (loading firmware), if we power cycle within 3 seconds. If we wait for 10 seconds before we turn on the power again, it seems to work OK. We are not sure if we are missing any special requirement regarding power cycle, power sequence about power supply, or critical pins, such as reset. Do you have any inspiration what that could be? Thanks
Hi,I am using STM32G474RET6 controller and would like to send and receive data in classic mode. I have configured all necessary parameters using cubemx but the hard fault occured when I call this function HAL_FDCAN_AddMessageToTxFifoQ(&hfdcan1, &TxHeader, TxData).The CAN termination is connected properly.Following are my configuration settings:i also init the CAN filter before transmit can message using the function below:the can message transmitting function is as below:when the code run till FDCAN_CopyMessageToRAM, it will go into HardFault_Handler, that's really confused me.disable the code that related to can function in main.c file, it could run normally.
We have tried Waking up the STM32WL IC using standby mode, sleep mode, stop mode using various different permutations and combinations - RTC , EXTI , without using RTC but it is not at all waking up from any of the modes mentioned above.Using Arduino IDE, we are using STM32WLx + RadioLib + RTC/LowPower/EEPROM combination , but we are unable to find any solution.Any help and support would be highly appreciated so that we can proceed further.
Everything else is working fine.Setup packet with SET_ADDRESS received and processed.Next GET_DESCRIPTOR for DEVICE which is sent back ok I've verified the data written to the Tx FIFO is correct.Correct number of bytes it transmitted but the bytes are not correct.I'm using a STM32H743-EVAL board, hardware is working fineAny suggestions?p.s. the Device Descriptor received displayed by USB View
Good afternoonI am working on the STM32H755 and am dealing with the retransmissions from my CAN FD periphery. According to the ISO-11898-1:2024 standard, the number of retransmissions should be configurable:"- from 0 (no retransmission),- to at least 6 (6 retransmission attempts),- and the highest number in this range can allow unlimited retransmission attempts."Currently I have FunctionalState AutoRetransmission in FDCAN_InitTypeDef set to ENABLE and on the oscilloscope I see an infinite number of retransmissions when I disconnect between two nodes. Now I want to limit the retransmission count to 6 retransmissions.Can I do this?Thank you very much for your answer.Manuel
Hello,I'm trying to port the example found here: https://blog.embeddedexpert.io/?p=1680 to NUCLEO-U385RG-Q.The example in the link is for STM32F411. I've successfully tried the example.Verbatim port of the code leads to USEF being set in GPDMA_C0SR.There are some unclear things about GPDMA:Reading generated HAL code: when memory-to-peripheral is chosen, DREQ bit is set in GPDMA_CxTR2, otherwise, SWREQ is set. I can't make sense of this fact and documentation given in RM0487.To achieve circular mode (i.e. setting CIRC bit in DMA_SxCR for STM32F411) do I have to use linked-list mode?I can imagine a linked list of length one pointing back to itself. Or does it have to be linked list of length two (First element is for setting GPIO bit, second element is for resetting GPIO bit) ?Thanks in advanceint main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Fl
I have designed a board with a STM32H573 and a KSZ8081RNACA PHY. As soon as I enable ETH clocks the ETH_DMAMR:SWR bit gets set.Verified:1. The 50 MHz clock from the PHY is present and stable (oscilloscope) at PA12. GPIO PA1 is configured for AF11, NOPUPD, SPEED100 as well as all other RMII pins PA2; PA5, PA7, PB12, PB15,PC1,PC4 and PC53. HCLK is stable 250MHz4. Tried forced ETH reset before and after clock enable.5. Tried to add delays after clock enable6. Tried to enable ETH clocks one by one or together7. MDIO is working and all ETH registers are writable8. I can see traffic on RXD0 (oscilloscope)If I ignore the set SWR bit I can continue but I never get a ETH interrupt.I am out of ideas and did not find anything in the errata about it. On a STM32H753 I used for another project a compensation cell bit needed to be set but I dont find this for the STM32H573.
I used the example code in RM, and room temperature is arround 31℃,the ADC value is 10644, calculated temperaure is 4127, does it means 41.27℃?what will happen if minus temperature?/* Temperature sensor calibration value address */#define TEMP130_CAL_ADDR ((uint16_t*) ((uint32_t) 0x1FF8007E))#define TEMP30_CAL_ADDR ((uint16_t*) ((uint32_t) 0x1FF8007A))#define VDD_CALIB ((uint16_t) (300))#define VDD_APPLI ((uint16_t) (330))int32_t ComputeTemperature(int32_t measure){int32_t temperature;temperature = ((measure * VDD_APPLI / VDD_CALIB) - (int32_t) *TEMP30_CAL_ADDR ) ;temperature = temperature * (int32_t)(130 - 30);temperature = temperature / (int32_t)(*TEMP130_CAL_ADDR - *TEMP30_CAL_ADDR);temperature = temperature + 30;return(temperature);}
I have an odd issue. I am setting up a timer compare channel for a 5ms delay in the future. I set the counter to 0, set the compare value to 5ms in the future. The compare interrupt does not occur, until the timer wraps all the way around and passes the compare value for a second time. It passes the compare value the first time with no interrupt.Setup is: STM32H753 (on custom HW), TIM2, Ch1/Ch2 used for PWM input capture. Ch3 used for timeout if IC does not occur. All setup is using STM32Cube MX. See code below. The timers are started with the following code:The idea is that the PWM input rising edge on Ch1 will reset the counter every cycle (1kHz), but if the counter does not get reset due to no PWM input signal for 5ms, Ch3 compare happens. Everything works as expected except if there is no input signal from the start, the timeout takes a full timer roller over, instead of 5ms, then is always 5ms after that! It is like the ti
I've got the NUCLEO-G491RE board and have it connected to my PC over the only USB port which is of course also used for the debugger. Both printf() and HAL_UART_Transmit() work to send data to a terminal program on the PC, but I can't use polling for my communication (there's too much else going on). If I call HAL_UART_Transmit_IT() it returns HAL_OK but doesn't actually transmit anything, and any subsequent calls to printf() or HAL_UART_Transmit() no longer do anything. I'm assuming this is because this isn't a "real" UART but some kind of virtual UART that gets converted into USB commands that cooperate with the debugger. Is there a way to use interrupt-driven communication over this (virtual) serial port? Thanks, Chris
I'm setting up the ADC in "manual continuous" mode where hadc1.Init.ContinuousConvMode = DISABLE and then I call HAL_ADC_Start_IT() inside of HAL_ADC_ConvCpltCallback(). I get the first call to HAL_ADC_ConvCpltCallback and calling HAL_ADC_Start_IT() returns HAL_OK but the callback never gets called again.What am I missing?Thanks,Chris ADC_MultiModeTypeDef multimode = {0}; ADC_ChannelConfTypeDef sConfig = {0}; /* USER CODE BEGIN ADC1_Init 1 */ /* USER CODE END ADC1_Init 1 */ /** Common config */ hadc1.Instance = ADC1; hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV2; hadc1.Init.Resolution = ADC_RESOLUTION_12B; hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc1.Init.GainCompensation = 0; hadc1.Init.ScanConvMode = ADC_SCAN_DISABLE; hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV; hadc1.Init.LowPowerAutoWait = DISABLE; hadc1.Init.ContinuousConvMode = DISABLE; hadc1.Init.NbrOfConversion = 1; hadc1.Init.DiscontinuousConvMode = DISABLE; hadc1.Init.ExternalTrigC
Hello,I'm having an issue with the SPI clock on the NUCLEO MB2032 board. As you can see in the image, I only have the debugger connected, and the clock signal isn't completely square.In the code, the only thing I'm running is the following:const uint8_t EEPROM_RDSR = 0b00000101;while(1){ HAL_SPI_Transmit(&hspi3, (uint8_t *)&EEPROM_RDSR, 1, 100);}What I'm measuring with the oscilloscope is pin SB14, which, according to the PCB file provided by ST, is directly connected to the SPI clock.
Hello,I bought P-NUCLEO-LRWAN3 which is STM32 Nucleo pack LoRa™ LF band sensor and gateway. It has NUCLEO-F746ZG and NUCLEO-L073RZ boards and both boards have expansion boards for LoRa communication. NUCLEO-F746ZG has LRWAN_GS_LF1, NUCLEO-L073RZ has LRWAN_NS1 as expansion boards. LRWAN_GS_LF1 and LRWAN_NS1 are both from RisingHF.When you develop software for LRWAN_NS1, you don't directly communicate with Semtech SX1278, you send AT commands to LRWAN_NS1 via UART and RisingHF handles rest of the job. So I can have my own firmware on NUCLEO-L073RZ to do both my tasks and LoRa communication. (My point is document of LRWAN_NS1 tells you how to control LRWAN_NS1 independently)On the other hand, NUCLEO-F746ZG and LRWAN_GS_LF1 communicates via SPI. I found a document about LRWAN_GS_LF1, it shows how to use initial firmware (firmware which is on device when you first bought) of NUCLEO-F746ZG. You are sending AT commands via com port to initial firmware, it translates your AT command and
I have tried to run the "UX Device HID Standalone" example under nucleo-wba65ri, and it doesn't seem to work.I connected the board's via the USB connector to my PC and while it is recognized, in function USBX_DEVICE_HID_MOUSE_Task on line 160 both:1. hid_mouse == UX_NULL2. device->ux_slave_device_state == UX_DEVICE_ATTACHED and not UX_DEVICE_CONFIGURED as needed would appreciate your support, might be imply a setup issue (I simply used a new nucleo boar and compiled and flashed the example)
On an STM32G4, if an I2C error occurs (e.g. a bus error) during a DMA driven I2C transaction, is the intention that the HAL I2C driver abort the DMA transfer?Starting at line 6599 in stm32g4xx_hal_i2c.c (v1.2.5), I see code in the I2C_ITError function that looks like it's intending to cancel an ongoing DMA transfer. However, when using the HAL_I2C_Master_Seq_*_DMA functions, it does not appear that it actually does.Consider the case of a HAL_I2C_Master_Seq_Transmit_DMA, followed by a HAL_I2C_Master_Seq_Receive_DMA (a basic I2C write-read transaction with repeated start). At the end of the initial transmit, the HAL_I2C_EV_IRQHandler will call I2C_Master_ISR_DMA, which in turn calls I2C_ITMasterSeqCplt (line 5477), which will set the PreviousState variable of the I2C handle to I2C_STATE_MASTER_BUSY_TX (line 6014). Then, if an I2C error occurs during the receive DMA transfer, the HAL_I2C_ER_IRQHandler will call the I2C_ITError function (line 4699), which will fail to abo
Hello everyone,I’m developing an STM32H750 application using STM32CubeIDE and TouchGFX, and I’m trying to integrate a sensor using I2C.I implemented a sensor driver and added the corresponding source files, but I’m running into linker errors like:undefined reference to `Sensor_Calc()'I made sure the source files are included in the build and headers properly referenced, but the errors persist.If anyone has working examples, suggestions, I’d be grateful.Thanks for your help!Additional Info:STM32CubeIDE version: 1.17.0Compiler: arm-none-eabi-gcc 12.3.1Target MCU: STM32H750B-DKUsing C++ and TouchGFX framework
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.