Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
Hello Everyone,I'm quite new with this kind of coding.I'm editing two dual core projects written for Nucleo WL55JC1, Node2 and Node1. Node2 allready implements the reading from adc and now i have to implement into Node1. I would like that the "adc.c" file was the same in the two projects so i checked the .ioc file from Node2 and I configured the .ioc of the Node1 in the same way doing some changes (Node2 has to read from 3 sensors, Node1 just from one).Now, the two adc.c files are basically the same but the one in the Node1 implements the code RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; ---------------------------- /** Initializes the peripherals clocks */ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_ADC; PeriphClkInitStruct.AdcClockSelection = RCC_ADCCLKSOURCE_HSI; if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) { Error_Handler(); }and the one in the Node2 don't. For what I understand it regards the adc clock so i checked the Node2's .io
Hello.I am using a custom image sensor board controlled by an STM32H7 MCU.The image sensor is AR0134, and the I2C peripheral clock source for the MCU is set to 100 MHz (standard I2C bus speed is configured via timing registers).There is one strange problem when the image sensor board is connected to the main control board (with the STM32H7 mounted).1. I built a total of 30 identical MCU control boards.2. The same firmware is programmed into all boards.3. About 11 of these boards show problems when configuring the AR0134 registers over I2C.- The MCU configures the sensor by writing to its registers over I2C.- During testing, the same image sensor board is reused; only the MCU control board is swapped.- With the same firmware and the same sensor board, some MCU boards configure the registers correctly, but on the problematic boards, when the registers are written and then read back, the values are all 0.- Occasionally, on these problematic boards, if the power is turned off for a long t
This is a pretty basic question but I would like a bit of clarity if possible.If a GPIO pin is configured for the fsbl code can it also be used in the Appli code?If so how would you go about defining it in the Appli code? There doesn't seem to be an option to use a GPIO pin in both fsbl and Appli in STM32CubeMX or do you have to configure it manually in the Appli code?
Our company has a chip that outputs data via DCMI, though it does not employ a standard DCMI interface. It lacks a horizontal synchronisation signal, possessing only a vertical synchronisation signal. Could you advise which chips are capable of receiving such data? If available, please provide specific chip models and concrete code examples. Edited by ST moderator: This post has been translated from Chinese to comply with the ST Community guidelines.
Hello Everybody,Here are the software and boards in this case:1. MC workbench 6.3.22.STEVAL-IHM039V1/STEVAL-CTM009V1I am using an I-PMSM motor with the ST development boards (STEVAL-IHM039V1 / STEVAL-CTM009V1). In open-loop mode, the motor spins smoothly and quietly. However, when I switch to normal mode—which uses the Hall speed sensors and ICS current sensors—two issues arise:The motor consistently produces a high-frequency noise.At low speeds (e.g., 500 RPM), there is a noticeable lack of torque; the motor cannot sustain rotation when I manually apply light resistance by hand.Could you please help identify the main cause of this problem?Thank you for your help.
Hello Everybody,Here are the software and boards in this case:1. MC workbench 6.3.22. NUCLEO-F401RE/X-NUCLEO-IHM08M13.?B-G431B-ESC1I have an I-PMSM motor, and I use two boards (one is?NUCLEO-F401RE/X-NUCLEO-IHM08M1, and the other is?B-G431B-ESC1) to run the?ST Motor Profile for detecting the motor parameters. However, the motor parameters in the two test results differ significantly. For example, the result from Board 1 (NUCLEO-F401RE/X-NUCLEO-IHM08M1) is shown in picture 1, and the result from Board 2 (B-G431B-ESC1) is shown in picture 2. We can see that the motor phase resistance is 0.23 ohms, the phase inductance is 0.62 mH, and the back EMF constant is 9.32 in picture 1. And we can see that the motor phase resistance is 0.16 ohms, the phase inductance is 0.43 mH, and the back EMF constant is 10.42 in picture 2.Which result should I trust? Thanks!
I am working on a simple mp3 player project and have spent a few days on the Spirit library, as offered by ST.This comes in a binary (.a) form only lib_mp3decoder_cortex_m4_v2.2.0.a and has apparently been built for soft floats, using some weird mode where they drive the FPU directly - the "VFP reggister arguments" thing. My project uses the FPU for a lot of stuff, and since you apparently cannot mix these floating modes at link time, I get these errorsSearching online finds a 2021 reply from ST on same topic, where ST say the Spirit company no longer exists so they can't help. But the website is still there, so I emailed them. I got a reply, surprisingly:They don't support users, so I need to contact ST, to which I replied that I am not a car manufacturer, and I am happy to give them some money for a cortex-m4 lib which is actually usable :)Lots of people have been around this. I have a hardware float compiler setting but this mp3 lib uses something different. One poster suggests
I’m working on a project with the Nucleo-L476RG. I want to perform a measurement, then put the microcontroller into Sleep Mode for 2 seconds, after which it should be woken up by the RTC clock.I followed the tutorial:How to configure the RTC to wake up the STM32 from Low Power modesUnfortunately, Sleep Mode is entered but not exited properly.Down below are my project settings: In my measurement function, I call a custom sleep() function.void start_measurement(hx711_t *hx711){ hx711->processed_reading = get_weight(active_hx711, 10); menu_refresh(); pack_data(hx711); if (HAL_UART_Transmit_DMA(&huart2, (uint8_t *)( active_hx711->tx_buffer), HX711_TX_BUFFER_SIZE) == HAL_OK){ active_hx711->measurement_count = 0U; active_hx711->tx_in_progress = 1U; } sleep(); }there's the call of the sleep function:void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *hrtc) { //HAL_ResumeTick(); printf("Inside the HAL_RTCEx_WakeUpTimerEventCallback function")
Hi ST Team, I am using STM32H7S78-DK development board.I have read and tested following article:https://wiki.st.com/stm32mcu/wiki/Security:STiRoT_for_STM32H7Shttps://wiki.st.com/stm32mcu/wiki/Security:OEMiRoT_OEMuRoT_for_STM32H7Shttps://wiki.st.com/stm32mcu/wiki/Security:How_to_start_with_STiRoT_OEMuRoT_on_STM32H7SI need some help on my project.In How_to_start_with_STiRoT_OEMuRoT_on_STM32H7S wiki page, I got the correct result following "1.5 Full regression" section. But for the "3.1 Debug Opening procedure" section, I got error message after clicking "Execute". The life cycle after clicking discover is "ST_LIFECYCLE_CLOSED (Debug opened)". Any method to fix this error?10:31:36 : STM32CubeProgrammer API v2.20.0 | Windows-64Bits 10:37:49 : Start Debug Authentication Sequence 10:37:49 : SDMOpen : 624 : open : SDM API v1.0 10:37:49 : SDMOpen : 625 : open : SDM Library version v1.2.0 10:37:49 : open_comms : 513 : open : Asserting target reset 10:37:49 : open_com
Hi everyone, I was trying to port TFM + TFM_SB on my STMU575ZI-Q Nucleo following this guide: https://www.st.com/resource/en/user_manual/um2851-getting-started-with-stm32cubeu5-tfm-application-stmicroelectronics.pdf and I've managed to flash secure bootloader and TFM. I've managed to do the regression of the MCU setting the option bytes. When I finally lunched TFM_UPDATE.sh script, logs appeared on tera term as expected, but in the end it got stuck in TFM BOOT log. So I disconnected the board and tried to repeat the process, cleaning and building again the TFM SB image, TFM Appl image etc... But When I tried to mass erase the system flash, an error has occurred: DEV TARGET NOT HALTED. When I reset the board and I observe tera term logs, I can see the following:[INF] Flash operation: Op=0x0, Area=0x0, Address=0x0[INF] Starting bootloader[INF] Checking BL2 NV area[INF] Checking BL2 NV area header[INF] Checking BL2 NV Counter consistency[INF] Consistent BL2 NV Counter 3 = 0x1000000[INF] C
HelloI am developing on the STM32H7B3-DK using X-CUBE-SBSFU v2.7.0 with IAR compiler version 9.70. During the build, I encountered the following critical error:Fatal error[Li004]: file "STM32CryptographicV3.1.3_CM7_IARv8.a" is not an object or archive fileIt appears that the provided static library (STM32CryptographicV3.1.3_CM7_IARv8.a) was built with IAR v8.x and is incompatible with IAR v9.70, preventing successful linking. The static library is present in STM32CubeExpansion_SBSFU_V2.7.0\Middlewares\ST\STM32_Cryptographic\Fw_Crypto\STM32H7A3\LibCould you please advise:Is there an official version of the STM32 Cryptographic static library compatible with IAR v9.x for STM32H7B3?If not, what is the recommended procedure to rebuild or obtain a compatible library for use with IAR v9 ?Thank you for your support. @STackPointer64 @Jocelyn RICARD @Fred
Hello,I have already read the AN4758 application note and I still have a few questions regarding PCROP.I have a project for end-users where the main application provides functions (API) that users can call to develop their own code. I was originally planning to provide these functions as a static library, but since PCROP is very useful and secure, I would prefer to protect my API using PCROP instead of distributing a library with unnecessary header files.In my application, the region 0x08000000 to 0x0805DFFF contains my API code. I plan to flash this code first and then protect this area with PCROP.Here are my questions:If the end-user creates an empty project and I only provide the header files, can they still debug their own application even though the API code region is PCROP-protected?Since a PCROP-protected area cannot be read or written, is there any way to update my API code later? I have a CAN bootloader, but this region will be protected by PCROP.(I am using STM32G474RET6 with
Hi,I am using STM32H56x with OEMiROT_Boot example project, currently the swap method of the OEMiROT_Boot is "MCUBOOT_SWAP_USING_SCRATCH", can I change it to MCUBOOT_SWAP_USING_MOVE?Is there any security concern use MCUBOOT_SWAP_USING_MOVE?Regards,Snaku
I've been playing around with the TrustZone Enabled on the STM32H573 board and using this tutorial:https://wiki.st.com/stm32mcu/wiki/Security:How_to_start_with_OEMiRoT_on_STM32H573_and_563%E2%80%93TrustZone_enabledI had no trouble executing the tutorial, using the Debug Authentication, or changing the permission levels to attach the IAR Debugger to put breakpoints in the main functions of the Non Secure or Secure Applications.However, my group uses the STM32 Cube IDE, and I've been having trouble doing the equivalent using that tool. I know where to enable and set up the Debug Authentication, but I'm having trouble attaching to the running target, hitting the reset button (as instructed in the above tutorial), and having the program stop at the breakpoint I have enabled in the main function of the Secure Application (before it jumps to Non Secure Init) and displaying the associated source code. I have built all the projects (OEMiROT Boot, OEMiROT_Appli_TrustZone_Secure, and
I am trying to setup FreeRTOS for the new STM32N6 Nucleo board. Running into the following error `GCC/ARM_CM55_NTZ/non_secure/port.c:1814: undefined reference to `__privileged_sram_start__'`.Based on https://github.com/STMicroelectronics/x-cube-freertos/blob/main/Projects/NUCLEO-N657X0-Q/Applications/FreeRTOS_MPU/README.md#notes, it looks like I am missing some linker files. The example itself has it defined at https://github.com/STMicroelectronics/x-cube-freertos/blob/main/Projects/NUCLEO-N657X0-Q/Applications/FreeRTOS_MPU/EWARM/stm32n657xx_axisram2_fsbl.icf#L80 . But looks to be using EWARM whereas I am using CubeIDE. How can I define/find these linker files needed for the privileged calls?
Hi, I am working on proof of concept project with B-L4S51-IOT1A Discovery board with STM32 micro on board and many useful sensors for fast development, I am wishing to learn in the on board wireless sensors i.e. BlueNRG-M0 and Wifi. I want to load and run BLE examples but current versions of X-CUBE-BLE1 do not provide any working examples. Request to ST to provide working examples for Discovery Kit and BlueNRG-M0. Thanks
Hi All,I'm using STM32G4 with TIM1 for motor control. The BKIN hardware protection works correctly - when I pull the BKIN pin (PB10) low, the motor stops, and when high, it runs again with AOE enabled. However, the break interrupt never fires and HAL_TIMEx_BreakCallback is never called. I've verified that TIM1_BRK_TIM15_IRQHandler exists in stm32g4xx_it.c, NVIC is enabled. The break flag never gets set even though BKIN is functioning. What could prevent the break flag from being set while the hardware break feature still works?I want to print diagnostic using BKIN callback routing but it doesn't work.I've attached IOC timer configurations.Best regards
Using Nucleo-U545RE-Q, SPI2 Full-duplex Master, default GPIO selected by STM32CubeMX v6.15.0 with LL selected for implementation.Config clock for max 160 MHz and prescale SPI by 8 for 20 Mbps. Add GPDMA Ch2/3 for SPI2 TX/RX.I double checked the output configuration code generated by the CubeMX against the Cube_FW_H5_V1.5.0 Examples_LL: SPI_TwoBoards_FullDuplex_DMA_Master_Init, and it matches exactly but for peripheral selection. Jumper-wire PC1-to-PC2 (CN7.36-to-CN7.35) for simple SPI loop-back test. With this configuration, the loop-back works when I implemented the SPI full-duplex transfer by LL blocking code. But trying to use the GPDMA channels results in no data, no DMA IRQ for TC or DTE, no SPI IRQ for anything. Below is the simple code to try to get a transfer going, there is initialization code that enables all SPI and DMA interrupt sources and handles the IRQ by clearing the flag and setting the local global booleans that you see below. Note that this is setup f
Development environmentMotor control workbench Version: 6.4.0STM32CubeMX Version: 6.16.0STM32CubeIDE Version: 2.00.0Controler/Driver: B-G431B-ESC1 kitI want to drive a 30W BLDC motor using the B-G431B-ESC1 kit.I'm currently following the instructions in the UM2516 user manual on the ST website:Chapter 6, "Connection and first execution of the electronic speed controller (ESC) program"6.1 First case: daughterboard not removed3. Generate and upload the firmware code into the STM32G431CB MCU with the available IDE tool.I selected the "B-G431B-ESC1" sample project in MC WorkBench, ran "Generate the Project," then launched "CubeMX" and then "Code Generate" to generate the project.Up to this point, there were no issues.After opening the project in "CubeIDE," I tried to run "Build," butthe "Build" commands were not enabled.I don't know what the problem is.Is there a more detailed guide for using the "B-G431B-ESC1"?(The UM2516 documentation is insufficient.)Please help
I believe there's a bug in the stm32h7rsxx_hal_dma code for dealing with repeated blocks in interrupt mode. This bug probably exists in other STM32H7 devices as well.With a typical repeating transfer, in *NON* interrupt mode, the DMA transfer completes successfully, and the DMA state ends up in HAL_DMA_STATE_READY, ready for another request. All is well.However, in interrupt mode, the DMA transfer completes successfully (all data is correctly transferred), but querying the DMA state in the DMA Transfer Complete callback, you'll get HAL_DMA_STATE_BUSY. In fact, it will remain in this state forever.Looking at the stm32h7rsxx_hal_dma.c code, the block starting at 1154 ("Transfer Complete Interrupt management"). There are really only two cases where the HAL_DMA_STATE_READY can be set:1) LinkedList mode (not relevant to us)2) "Normal transfer" where CBR1 == 0. (i.e. not a repeating block transfer) In a repeating transfer, CBR1 contains the repeating config, and is generally not 0 (it's call
Hi,I have a custom board with an STM32L031C6 and I'm trying to read the internal temperature. The board is battery powered at about 2.6V and the vdda is the same.If I read the ADC channel with vrefint, it returns a value of about 850, which, when passed to the function __LL_ADC_CALC_VREFANALOG_VOLTAGE(adcVal[4], LL_ADC_RESOLUTION_12B), returns a calculated VDDA of 6V, which is obviously incorrect.Using this vref to calculate the internal temperature obviously results in a value that's out of range.The same thing works correctly on a NUCLEO-C031.What am I doing wrong?Thanks!
Hello,I am new to STM32F746-Disco and I was trying to develop an application starting from TouchGFX.It went all good in developing a touchGFX app and use the generated .ioc and so on to configure a project but I've tried afterwards to configure the ethernet stack LWIP and so on but I was never able to communicate and ping the ethernet device.I've tried on my local to run the ethernet example and I was able to properly ping the device but never been able to do it in the project configured with touchGFX.The strange thing is that I can partially see some comunication such as ARP messages and so on but then the ethernet stack is not capable to reply to ping message. here a snapshot of the communication between my PC and the st board. Does anyone might now what could be wrong in my configuration?I've attached the .ioc
Hello,I configured TIM1 as shown in the attached image: Everything works as expected I am controlling an inductive load which oscillates heavily after the PWM is turned off. I therefore decided to immediately short the low-side MOSFET (CH1N) to ground if a BREAK or BREAK2 signal is received. I set the Channel Idle State to SET. And the behavior of BREAK/BREAK2 changed.As seen in the close-up:: A low state on BK2 does not set a high state on CH1N. Should BK1 and BK2 not be ORed?
Hello ST Support Team,I'm working with the STM32L031K6U6 (32-pin UFQFPN package) and need clarification on ADC channel mapping.Question: Is there an ADC Channel 9 available on the STM32L031K6U6, and if so, which physical pin does it map to?Context:- I'm trying to use PB1 as an ADC input- Documentation suggests ADC Channel 9 should be availableCould you please confirm:1. Which pins have ADC capability on STM32L031K6U6 32-pin package?2. Is ADC Channel 9 available on this specific package variant?3. If ADC Channel 9 exists, which physical pin does it connect to?Hardware: STM32L031K6U6 (32-pin UFQFPN package)IDE: STM32CubeIDEHAL Version: LatestThank you for your assistance.
I'm re-using a sequential I2C library that worked on a couple other ST devices with different I2C devices, but it doesn't work on a STM32F030.They are functions for I2C register operations, where we always start with a write with the register address and then a write/read, depending on the operation: // Read register HAL_I2C_Master_Seq_Transmit_IT(peripheral, address, &registerAddress,1, I2C_OTHER_FRAME); HAL_I2C_Master_Seq_Receive_IT(peripheral, address, data,size, I2C_OTHER_AND_LAST_FRAME); // Write register HAL_I2C_Master_Seq_Transmit_IT(peripheral, address, &registerAddress,1, I2C_OTHER_FRAME); HAL_I2C_Master_Seq_Transmit_IT(peripheral, address, data,size, I2C_OTHER_AND_LAST_FRAME);The write doesn't work (read works fine). The first call to HAL_I2C_Master_Seq_Transmit_IT is successful, but not the second.I've tried the write with different I2C transfer options, but none seem to work. I don't have a scope on me so I don't know what frame is being produced.Anyone has ot
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.