Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
Hello,I need to communicate with a component whose configuration register expects a 9-bit value. However, my current SPI setup sends data in 8-bit chunks.In this case, what would be the correct approach? Should I send two bytes back-to-back? Or would it be better to make this configurable in main.c so that the behavior can be adjusted easily?If you were in my place, how would you handle this? static void MX_SPI3_Init(uint32_t bit_size) { /* USER CODE BEGIN SPI3_Init 0 */ /* USER CODE END SPI3_Init 0 */ /* USER CODE BEGIN SPI3_Init 1 */ /* USER CODE END SPI3_Init 1 */ /* SPI3 parameter configuration*/ hspi3.Instance = SPI3; hspi3.Init.Mode = SPI_MODE_MASTER; hspi3.Init.Direction = SPI_DIRECTION_2LINES; hspi3.Init.DataSize = bit_size; // <-- here hspi3.Init.CLKPolarity = SPI_POLARITY_LOW; hspi3.Init.CLKPhase = SPI_PHASE_1EDGE; hspi3.Init.NSS = SPI_NSS_SOFT; hspi3.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_8; hspi3.Init.FirstBit = SPI_FIRSTBIT_MSB
Hello,I have a NUCLEO-L476RG and after update the firmware of the ST-Link V2.1 embedded on the board, stops to communicate. I want to know if it's possible to downgrade this firmware. If yes, how can i do the downgrade?Thanks!!!
When the MCU is placed in Standby Mode, where does the CPU begin to execute when exiting the mode? (for example, on an RTC event) Is it a reset or a return from interrupt? RM0394 isn't clear on this.
Hi all, I am trying to use FDCAN with Baud rate switch (500 kB / 2 MBit) activated and I want to send 64 Byte. Processor is STM32H7A3. Project was set up with CubeMX V. 6.11.1 and HAL FW_H7 V1.11.2. Clock for FDCAN is 80 MHz. The problem is that the system only sends with 500 kB and 8 Bytes only. I am transmitting the data to my PC using a PEAK USB dongle (FDCAN capable with BRS) and in parallel check the messages on a scope. I don't know, why it doesn't switch to 2 MBit and I only see 8 Bytes with 500 kBit on my scope and on PCAN-Explorer. Here my init and transmit code sequences: FDCAN_HandleTypeDef* phCan; phCan = &hfdcan1; phCan->Instance = FDCAN1; phCan->Init.Mode = FDCAN_MODE_NORMAL; phCan->Init.FrameFormat = FDCAN_FRAME_FD_BRS; phCan->Init.AutoRetransmission = ENABLE; phCan->Init.TransmitPause = DISABLE; phCan->Init.NominalPrescaler = 10; phCan->Init.NominalSyncJumpWidth = 1; phCan->Init.NominalTimeSeg1 = 11; phCan->Init.No
Hi all,I’m working with the W5500 Ethernet module over SPI on an STM32 with Trust-zone enabled. The W5500 requires a clock source for proper operation, which I’m trying to provide using the MCO on the CS pin.The issue is that I’m not able to enable the Master Clock Output (MCO), neither in the secure project nor in the non-secure project using CubeMX. Because of this, I can’t feed the required clock to the W5500.Has anyone managed to enable MCO in a Trust-Zone setup, or know if there’s a specific way to configure it so that it works in the non-secure region?Thanks for any help!
Hi,I would like to in-live upgrade firmware of STM32F407 through USART1, that means in-application program(IAP) . If I remember right, there need a trigger signal from key meanwhile NRST is low.My question is that the Key signal could be connected to any GPIO I/O of STM32F407 except those dedicated pin, right? Is there special point to care about selection of Key I/O pin? Thanks in advance!Best regards!Jason
Hello everyone,I’m working with an STM32WLE5CCU6 and I have implemented a bootloader that should be able to start applications stored in two flash regions (“slots”).Bootloader at 0x08000000Slot 1 (FW1) at 0x08005000Slot 2 (FW2) at 0x08015000Applications are built with IAR EWARM using ROPI (Read-Only Position Independent).The bootloader uses the following jump code:__attribute__((naked)) static void jump_to_app(uint32_t pc, uint32_t sp) { __asm volatile("msr msp, r1 \n" /* load r1 into MSP */ "bx r0 \n" /* branch to the address at r0 */ ); } #define VECTOR_TABLE_SIZE 0x138 static void start_app(uint32_t *fw_addr) { // Remap 0x0000 (NVIC table location) to SRAM1 SYSCFG->MEMRMP = 0b011; const uint32_t *app_code = fw_addr; volatile uint32_t *sram = (uint32_t *)0x00000000; // Copy SP (no offset) sram[0] = app_code[0]; // Copy PC (with offset) sram[1] = app_code[1] + (uint32_t)fw_addr; // Copy the rest of the vector table for (int i = 2; i < VECTOR_TABLE_SIZE / 4; ++i) {
What is the difference between STM32F411VEH6U and STM32F411VEH6? What does the suffix U mean?
Hi,We have a STM32H7B3 which uses TouchGFX (4.25.0) for GUI with external flash for storing images, texts, fonts etc. The storing and reding of images, text, fonts from external flash works fine for us in our current product. In a new design we want the code generated by TouchGFX to also be stored on external flash and be XIP from external flash. How can I make TocuhGFX map the code that it generates to external flash. There is a lot of code that gets generated and manually using the __attribute__((section("ExtFlashSection"))) for each function is not possible. Please help how this can be achieved with TouchGFX software.Regards,Devanshu Agarwal
STM32L072 – LPTIM1 external pulse counting with LSE in STOP mode not workingDescription:Hello,I am trying to configure LPTIM1 on an STM32L072 to count external pulses from a button connected to PB5 (LPTIM1_IN1). The goal is to keep counting pulses while the MCU is in STOP mode.What I did:RTC is already running from LSE in STOP mode, so LSE is enabled and stable.In CubeMX I selected:LPTIM1 clock = LSE (ULPTIM)Counter source = ExternalGenerated initialization looks like this:hlptim1.Instance = LPTIM1;hlptim1.Init.Clock.Source = LPTIM_CLOCKSOURCE_APBCLOCK_LPOSC; // CubeMX output, even if I picked LSEhlptim1.Init.Clock.Prescaler = LPTIM_PRESCALER_DIV1;hlptim1.Init.UltraLowPowerClock.Polarity = LPTIM_CLOCKPOLARITY_RISING;hlptim1.Init.UltraLowPowerClock.SampleTime = LPTIM_CLOCKSAMPLETIME_DIRECTTRANSITION;hlptim1.Init.Trigger.Source = LPTIM_TRIGSOURCE_SOFTWARE;hlptim1.Init.UpdateMode = LPTIM_UPDATE_IMMEDIATE;hlptim1.Init.CounterSource = LPTIM_COUNTERSOURCE_EXTERNAL;HAL_LPTIM_Init(&hlptim1
It is compiled with AC6.24 in MDK 5.43.run on NUCLEO-H7A3ZI-Q.But it cannot run.compiling is ok. The programme compiled with stm32cubeIDE is not problem.It can run perfectly.The project is attached blow.
I'm developing a Sigfox product using the STM32wlxx series.For testing purposes, I'm trying to provision Sigfox using the STM32 programmer,but I can't log in using the link https://my.st.com/cas/login?service=https://my.st.com/sfxp.
Dear,I am writing to inquire about the inclusion of a validity period in the debug authentication certificates used with the STM32H7S3 microcontroller.My project requires that the debug access certificates I provision have a limited, defined lifespan to align with security policies. I am currently using the latest versions of STM32TrustedPackageCreator (v2.20.0) and PSA_ADAC (v0.2.0) to generate these certificates.I have reviewed the documentation for both tools and have not found a user-configurable option to specify a notAfter (as is available for X.509) or expiration date for the generated ADAC certificates.Could someone please clarify the following:Is it possible to generate ARM ADAC certificates with a defined validity period using any publicly available tools?If not, is there a different process, tool, or service that would allow me to create such certificates?Are the certificates generated by the public tools created with a fixed, pre-defined validity pe
Hi,We are using SBSFU and FreeRTOS in STM32H755xI. We are planning to use Zephyr RTOS in STM32H755xI. Can I use SBSFU bootloader in Zephyr RTOS?--Muthukrishnan
Hi everyone!I'm having trouble in measuring the VBAT through ADC. I'm using 3.3V on aNUCLEO_476 board to connect to VBAT and when I measure VBAT through ADC,I cannot obtain the value of the VBATHere's my code:void MX_ADC1_Init(void) { /* USER CODE BEGIN ADC1_Init 0 */ /* USER CODE END ADC1_Init 0 */ 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_ASYNC_DIV1; hadc1.Init.Resolution = ADC_RESOLUTION_12B; hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE; hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV; hadc1.Init.LowPowerAutoWait = DISABLE; hadc1.Init.ContinuousConvMode = ENABLE; hadc1.Init.NbrOfConversion = 7; hadc1.Init.DiscontinuousConvMode = DISABLE; hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START; hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRI
Hello,I can run older TCP/IP examples on my F767 Nucleo but I want to start fresh and understand what is going on.Basic project started with CubeIDE/CubeMX code generation. FreeRTOS, LWIP, fixed IP => Does not answer to ping. Turns out MX_LWIP_Init() never returns.If I step into the ethernetif initialisation code, I see that anywhere HAL_Delay(ETH_REG_WRITE_DELAY) is called within stm32f7xx_hal_eth.c, it never returns, unless I step into it from the debugger and go step by step (and see uwTickFreq increment) until HAL_Delay returns.I understand the time base is a common issue often because of the interrupt priorities, but I think I have everything setup correctly. I am using Timer 6 as a tick source, with its IT priority set to 0. Again, I do see uwTickFreq increment if I run the code step by step.I removed MX_LWIP_Init() from the code and added some HAL_Delay(1000) in the for(;;) loop in the defaulttask and it returns every second, which tells me
Hello,I wrote a custom bootloader (that loads firmware image from an external flash) for a device that was using an STM32WL55CCU6. Now I want to use the same bootloader on a device with a similar uC, the STM32WL5MOCH6TR.The bootloader works correctly up and until the point where it needs to jump to the main application. The code that I am using is this:static void jump_to_user_app(void) { typedef void (*FUNC_PTR_T)(void); FUNC_PTR_T jumpTo = (FUNC_PTR_T)(*(__IO uint32_t *)(FLASH_INT_APP_START + 4U)); // de-initialize the used peripherals HAL_SPI_MspDeInit(SPI_BUS); // disable interrupts, set the stack pointer and ... fingers crossed __disable_irq(); __set_MSP(*((__IO uint32_t *)FLASH_INT_APP_START)); jumpTo(); }I checked the registers at the moment of the jump, and they are correct. My application was compiled with the correct vector table offset, and it runs correctly otherwise.But when the bootloader jumps to the application, it crashes. And looking at the stack,
Hi,I’m working on an STM32F767 custom bootloader with two application slots:Main Application Slot → starts at 0x08040000Backup (Factory) Slot → starts at 0x08100000I have written a bootloader that checks both slots and jumps to the valid application: SCB->VTOR = app_base; // Set vector table offset __set_MSP(*(uint32_t*)app_base); // Set initial stack pointer void (*app_reset_handler)(void) = (void*)(*(uint32_t*)(app_base + 4)); app_reset_handler(); // Jump to reset handler ProblemI tested two scenarios: Using app_main.ld (FLASH origin = 0x08040000)I built one binary with FLASH start = 0x08040000.I program the same binary into both slots:Slot 1 → 0x08040000Slot 2 → 0x08100000Result:Main slot works :white_heavy_check_mark:Backup slot fails :cross_mark: — the application does not start.QuestionThe binary built for 0x08040000 fails when executed from 0x08100000?Is there a way to make one application binary run from both flash addresses?Edited to apply source code formatt
Hello Support Team,for testing purposes i am using the H533NucleoBoard. I can load my firmware into the MCU and the firmware is running as expected. I want use the final product in ProductionState: closed.The problem is, the firmware isn't running any longer whe changing the productionState to closed. But I am able to switch back to ProductionState: open via Regression.Following informations:Used Tools: Stm32CubeProgrammer V2.20.0STLink V3 FirmwareVersion: V3J16M8Following Settings:TZEN: C3 (disabled) (I don't want to use TrusZone enabled)BOOT_UBE: B4 (OEM-iRot UserFlash)NSBOOT_LOCK : C3SECBOOT_LOCK : 0Sequence:1. set product state: Provisioning2. start provisioning3. set product state: closedLogFile of Provisioning process:06:55:11:421 : reset ap 106:55:11:421 : Reset MCU06:55:11:422 : Reconnecting...06:55:11:422 : Disconnected06:55:11:422 : ST-LINK SN : 0019002A343351153736393406:55:11:423 : ST-LINK FW : V3J16M806:55:11:423 : Board : NUCLEO-H533RE06:55:11:423 : Voltage : 3.30V0
Hello everyone, I'm using STLINK-V3MINIE as my programmer. The VCP is functional when I received it. But as soon as I upgrade its firmware to V3J16M8 STM32 Debug+VCP, the VCP is unusable. The VCP device enumerated on Windows 11 PC is openable but doesn't give out any digital waveforms on RXD and TXD pins, also no message is displayed when I give a valid UART TTL signal to RXD pin. Currently its firmware is running on V3J16M9 flashed with ST-LINKUPGRADE software on Windows 11. VCP is still not working. I can't remember its factory firmware version. How to solve this problem? Ideally its VCP should work as many USB-to-TTL.
Hi Everyone,I'm trying to install TouchGFX Designer (v4.25.0) but I keep getting this error during setup:“TouchGFX Setup Error writing to file: C:\TouchGFX\4.25.0\designer\TouchGFXDesigner-4.25.0.exe. Verify that you have access to that directory.”I've already installed the following STM32 tools:STM32CubeMX: C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMXSTM32CubeProgrammer: C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammerSTM32CubeIDE: C:\ST\STM32CubeIDE_1.19.0\STM32CubeIDEI’m running the .msi installer for TouchGFX Designer, and the error appears consistently. I’ve followed both:How to TouchGFX: Installing TouchGFX Designer for STM32 GUI applications on installing TouchGFX Designer for STM32 GUI applicationshttps://support.touchgfx.com/docs/getting-started/installationMy installation directory is: C:\TouchGFXI’ve checked permissions and tried running the installer as administrator, but no luck so far. Has anyone encountered this issue or found a workaround?T
I'm working on a STM32C071RB, which I've managed to generate PWM pulses as desired. However, I try to more than once while the chip is running, it stops working.My main.c file:#include "main.h" #define PWM_HI (12) #define PWM_LO (6) TIM_HandleTypeDef htim1; DMA_HandleTypeDef hdma_tim1_ch1; uint8_t wr_buf[32] = {0}; void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_DMA_Init(void); static void MX_TIM1_Init(void); void led_set_RGB(uint8_t r, uint8_t g, uint8_t b) { for(int i = 0; i < 8; i++){ wr_buf[i] = (g & (1 << i)) ? PWM_HI : PWM_LO; wr_buf[i + 8] = (r & (1 << i)) ? PWM_HI : PWM_LO; wr_buf[i + 16] = (b & (1 << i)) ? PWM_HI : PWM_LO; } } void led_render() { while (HAL_DMA_GetState(&hdma_tim1_ch1) != HAL_DMA_STATE_READY) {} HAL_TIM_PWM_Start_DMA(&htim1, TIM_CHANNEL_1, (uint32_t *)wr_buf, 32); } void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim) { if (htim->Instance == TIM1) { // Sto
I have written a custom bootloader that is running on a Nucleo-L433RC-P board. The application uses USB CDC to call the bootloader and the bootloader uses USB DFU to download the application. I wanted to use USB to call the custom bootloader, rather than having to use a physical switch on the BOOT0 pin to call the internal bootloaderI can successfully download a simple application which just flashes an LED using the USB DFU bootloader.However, when I download my actual project, it appears to download successfully but does not run.My actual project is more complicated and uses the following peripherals:RTCSPI2 and DAC1 (using DMA)SPI1TIM6TIM7I2C1I2C2USBShutdown and standby using WKUP and RTC wake sources I used the following guide to write the custom bootloader and simple application...https://stm32world.com/wiki/Custom_DFU_BootloaderThe following web tool is used to download the application...https://devanlai.github.io/webdfu/dfu-util/ I have spent days trying
Our STM32H745XIH microcontroller enters an infinite loop after updating the software with “Release” compilation flags (optimization enabled). This only happens with a specific build, and changing a single piece of code that is definitely not related to any hardware component can solve the problem (e.g., adding a single line such as int a = 45;). We believe the problem may be related to the watchdog reset, because when connected to the microcontroller via a debugger, it resets and starts working normally without any problems, the logic of our application works, and the device is fully functional. We thought the problem might be caused by the clock initializing too quickly, so we added a startup delay using: static void __attribute__ ((optimize("-O0"))) StartupDelay(void) { for(uint32_t i = 0x27614U; i > 0U; i--); } This seemed to solve the problem. However, after changing another part of the code, the problem started to reappear.RCC_RSR value: 4FE0000 No hardfault is observed before
I'm attempting to use a custom LCD daughter board designed to plug onto the STM32U5G9J-DK1 in place of the round display that comes with the DK1. The schematics for the DK1 have a note in read indicating that the DSI_CK_N and DSI_CK_P pins are reversed and that they should be swapped in software, and indeed the pin assignments on the schematics seem to agree with that note. The schematics for the round display board show those pins to be correct, i.e. not reversed. I have working example code for the round display, but nowhere in that code do I see that the DSI clock pins are reversed.There's a HAL function for doing this: HAL_DSI_SetLanePInsConfiguration(), and the DSI register that does the swapping is WPCR[0]. Nowhere in the working example project do I find any call to the function or any write to that register, so I'm confused as to how it could be working. Is the schematic not correct? Is there some other means of swapping the pins? Needless to say, my custom board is not working
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.