Developer support experience survey - We value your feedback
Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hi,I started a new project with selected target of Nucleo-STM32F767ZI board, and followed the instructions from "How to redirect the printf function to a UART for debug messages"The printf works in the new project, however, when I did the same in the example project "LwIP_HTTP_Server_Netconn_RTOS", I did not get anything from printf.I added the following into the main.c of the example project: and RegardsChao
Hi,My aim is to generate a pulse sequence using the PWM timer and DMA analogue to Stm32 custom signal generation using pwm and dma with a STM32F303 on RTX5 RTOS.I need Pulsefrequency with max. 500khz, i use the STM32F303RCTx with PA2 as outputHere are my Config: static void MX_TIM2_Init(void){ /* USER CODE BEGIN TIM2_Init 0 */ /* USER CODE END TIM2_Init 0 */ TIM_MasterConfigTypeDef sMasterConfig = {0}; TIM_OC_InitTypeDef sConfigOC = {0}; /* USER CODE BEGIN TIM2_Init 1 */ /* USER CODE END TIM2_Init 1 */ htim2.Instance = TIM2; htim2.Init.Prescaler = 60; htim2.Init.CounterMode = TIM_COUNTERMODE_CENTERALIGNED1; htim2.Init.Period = 600; htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; if (HAL_TIM_PWM_Init(&htim2) != HAL_OK) { Error_Handler(); } sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterCon
Hello Everybody,I sucessfully included the X-CUBE-TCPP software expanison onta a NUCLEO-G071RB Board.After some inital tests we decided to switch to the NUCLEO-G0B1RE Board for more flash as the Getting Started PDF (https://www.st.com/resource/en/user_manual/um2902-getting-started-with-the-usb-typec-software-expansion-for-stm32cube-stmicroelectronics.pdf) said that it would be possible to port the software to this chip.I did the instructions (https://wiki.st.com/stm32mcu/wiki/STM32StepByStep:Getting_started_with_USB-Power_Delivery_Dual_Role) again, but i discovered that it wouldn't work now.AS it seems the Task won't start I tried to connect the board agin to the stm32CubeMonitor with no suscess. I attached the traces file. Also the RTOS tasks seems not to start without a reason. What do I have to change to get it running on the G0B1RE Board?Thanks in advance.
I previously posted here when I was having issues with my STM32F407 board that I have configured as a HTTP server.https://community.st.com/t5/stm32-mcus-products/where-to-find-lwip-incoming-payload-data-for-webserver/m-p/640137This is a follow-up post with more questions. The server is apparently working more or less the way it should. Wireshark shows the following data. The first 3 lines are when I connect to the server. The next 8 lines are when I click a button on my page. It appears that the button sequence all is working properly as the server ACks, client ACKs, and back and forth until the transaction is complete. The really strange thing is, the last 8 lines are repeated 9 more times before transmissions stop. Transmissions should stop after the first full handshaking sequence completes. Any idea why it repeats an additional 9 times?Source Destination Protocol Length Info172.16.1.115 172.16.1.125 TCP 66 65055 → 80 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 WS=256 SACK_PERM172.16.1.125
Hi all,i want to implement the sleep mode using USB as the source to put the device in to sleep mode and waking the device from the sleep mode. The controller im using is STM32U585. My quarry is, is it possible to do it.? i have implemented the same using UART it working perfectly fine, the same i want to using USB, is it possible. is yes, any suggestions for the same will be helpful.
I downloaded gnu-tools-for-stm32 repo to a Windows 10 machine. I have mingw64 installed.I want to study arm-none-eabi-objcopy with a view to extracting bin files for internal and external flash from an elf in a self-contained utility.When I navigated to my checked out repo and ran build-prequisites.sh from a mingw64 shell it failed with the below+++2024-01-05:11:53:13 (/e/Various_Backups/gcc-arm-src/gnu-tools-for-stm32/build-common.sh:316): host_arch=x86_64 +++2024-01-05:11:53:13 (/e/Various_Backups/gcc-arm-src/gnu-tools-for-stm32/build-common.sh:317): '[' xMinGw64_nT-10.0-18363 == xlinux ']' +++2024-01-05:11:53:13 (/e/Various_Backups/gcc-arm-src/gnu-tools-for-stm32/build-common.sh:326): '[' xMinGw64_nT-10.0-18363 == xdarwin ']' +++2024-01-05:11:53:13 (/e/Various_Backups/gcc-arm-src/gnu-tools-for-stm32/build-common.sh:340): error 'Unsupported build system : MinGw64_nT-10.0-18363' +++2024-01-05:11:53:13 (/e/Various_Backups/gcc-arm-src/gnu-tools-for-stm32/build-common.sh:29):
Hi all,I am trying to study the buck converter program provided by ST for the STM32G474 discovery kit. From previous study, I know that buck converter uses the 3p3z (3 poles 3 zeros) structure to calculate the current output, as shown in the figure below, where the equation of this structure can be written as follows. In the sample code, the IIR filer in the FMAC register is used to represent this controller, the structure diagram of IIR filer and the corresponding equation can be written as follows.where X is the vector representing {x0, x1, x2, x3}, Y' is the vector represent {y1, y2, y3} and Y is the output y0.From the information given, A is the vector representing {a1, a2, a3} in the IIR filter and B is the vector representing {b0, b1, b2, b3} in the IIR filter. From my understanding, the values in this 2 vector should be identical to the parameters in the 3p3z controller, however, when I study the program, I see that this is only the case for vector A,&nb
Hello,I am using the NUCLEO-G071RB and the X-NUCLEO-DRP1M1 with the X-CUBE TXPP Software Bundle.I created my project via the instructions from https://wiki.st.com/stm32mcu/wiki/STM32StepByStep:Getting_started_with_USB-Power_Delivery_Dual_Role.Everything works fine.I have another question regarding this bundle. I want to disable both the sink and the source right from program start. I entered TCPP0203_REG0_RST_VALUE as 0b11001000U. Also i set VCC_VCONN to GND via a external wire. This should set the device in Hibernate Mode and start in default Mode. Which should be both Sink and Source disabled. After the initialization the Sink still starts up for a short period of time.How can i prevent the short startup of the Sink? Thanks in advance.
Hello,I've read several forum posts commenting on the STM32 HAL management of LWIP, particularly ethernetif.c and trying to understand the interrupt driven zero copy examples. For reference in my application I do not use RTOS.After updating cube, and comparing my previous project version (based on FW_F4 V1.26.2) that the ethernetif.c file has changed quite significantly. I assume this is in reaction to feedback from users in forum posts such as this detailed post https://community.st.com/t5/stm32-mcus-embedded-software/how-to-make-ethernet-and-lwip-working-on-stm32/td-p/261456The above mentions drivers being reworked following V1.27. And comments on problems such as [in reworked drivers].Could someone comment on whether the ethernetif.c in FW_F4 V1.28 rectifies the problems and criticism's that have been previously discussed across the forum?Alternatively, if the ethernetif.c is still a poor implementation, is it possible to comment on what has not been addressed (specifical
I'm using the tamper peripheral clocked from the LSE (32.768Khz crystal), triggered by a tamper event on PC13. The core is clocked from the HSI, using the PLL to run at 120MHz.The tamper peripheral seems to work fine under normal operation, but if an unmasked tamper event occurs during a breakpoint (paused in a debugger, or a semihosting printf for example), the core hardfaults.This sounds it could potentially be related to Errata 2.15.1 where the RTC peripheral has incorrect behaviour when the core is stopped in a breakpoint.I haven't tested them, but I think the RTC_Tamper examples in STM32CubeL4 should showcase this behaviour, but I'll include my code here for the avoidance of doubt: RCC_OscInitTypeDef RCC_OscInitStruct = { .OscillatorType = RCC_OSCILLATORTYPE_LSI | RCC_OSCILLATORTYPE_LSE, .PLL.PLLState = RCC_PLL_NONE, .LSEState = RCC_LSE_ON_RTC_ONLY, .LSIState = RCC_LSI_OFF, }; RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { .PeriphClockSelection = RCC_PERIPHCLK_RTC,
I register a task in app_ble.cIn custom_stm.c (Custom_STM_Event_Handler) when client enables notifications I then call the custom_app.c (Custom_STM_App_Notification) which in turn gets data and returns the value via custom_stm.c ( Custom_STM_App_Update_Char). Now when the client disables notifications I would like to unregister the task, how do I do this?Custom_STM_Event_Handler has a use case to handle this and it in turn calls the case statement inside Custom_STM_App_Notification . From here I would like to call SET_UTIL_UnregTask() but it doesn' seem to exist ThanksSteve
Hi all,I am receiving date and time by CAN for my application, and not using the RTC functionality because I couldn't get it to work with LoRa.Basically I receive day and month separately, and declare the year as a int. Same thing for the time, I receive hour, minutes and seconds separately.Is there a way that I can join them into a timestamp variable?
I'm configuring the LTDC and I'm not sure where/how I enable the ltdc_aclk. I've enabled ltdc_plck in RCC->APB3ENR and I've configured PLL3R for the kernel/pixel clock but I cannot for the life of me find any info on how/where to enable ltdc_aclk so I'm unable to modify any of the registers in this clock domain. I'm using the STM32H745i-DISCO dev board.
HelloI am encountering an issue with a code running on an STM32F4xxx board. The code is designed to perform a measurement, and I aim to transfer this data to a computer. While I can successfully receive the measurement using various terminal programs, I require the data to be imported into an Excel sheet. To facilitate this, I've developed a macro that extracts data from the serial interface.However, I've encountered a problem where the data from the ST Link Virtual COM port isn't being received by Excel VBA, despite ensuring that all settings such as baud rate, parity, stop bits, and flow control are correctly configured.Concurrently, I've conducted a test using an Arduino, where I've programmed it to transmit identical data (excluding measurements, which remain constant). Interestingly, when I switch the COM port to that of the Arduino, Excel successfully receives the data.This leads me to speculate whether there's a discrepancy between the virtual COM port of the STM32F4 Nucleo boar
The Discovery kit with STM32H745XI MCU outputs a triangle wave, but how can I make it output a sawtooth wave instead of a triangle wave?Please let me know the specific improvement and source code.Looking forward to your answer.
Hello everybody.I have problems with uarts in the my bootloader. In the main program the communication works OK.The client card is stm32g484 based.The first problem:After HAL_NVIC_SystemReset()from main app enter to bootloader and HAL_UART_Transmit() send data to host but host received nothing. HAL_UART_Transmit() returns HAL_OK but the sniffer received nothing.The second problem:50-70% of the times the bootloader stopped accepting the data after erasing the flash. The next time (power cycle) the program will work fine.------------------------------------------------------------------int main(void){int16_t pack_left = 1, data_size;uint32_t pack_offset;flash_status status = FLASH_OK;HAL_StatusTypeDef hal_status; //grom 21feb2024 vA1 /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */HAL_Init(); /* Configure the system clock */SystemClock_Config();__ena
I want to save a text file to the SD card with the STM32F7508-DK Card, but the code gets stuck during the formatting process of the SD card.Can you help me how to solve this problem?The code line is as follows. /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2024 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "fatfs.h" /* Private inclu
I'm trying to define a region of RAM for storing debug information that can persist following a reset (DEBUG_RAM). I'd like to put variables in a section (.debug_ram) that are stored in the DEBUG_RAM memory such its usage properly displays in the Build Analyzer.When I do this my elf and hex files are a normal size, 1.3MB and 15kB respectively. My bin files, however, are 393MB. Unfortunately the company I work for has standardized on bin files, particularly for their bootloader software.I have attached my modified linker file (renamed STM32F765VITX_FLASH.ld.c so that it can be attached to the forum) and main.c where I locate the debug_ram_test variable in the in the .debug_ram section. When I build the build analyzer window correctly shows that 6.25% of the DEBUG_RAM region is used.If I use a bin-to-hex utility to convert the bin file I see it's almost all data records with all of the data equal to zero, interspersed with Extended Linear Address records outside the range for t
We are using Timer3 to increment a uint64_t counter for serial port operation and need to be able to grab the counter value in the main loop. //---------------------------------------------------------------- // -------------- Timer 3 ---------------------------------------- //---------------------------------------------------------------- // Setup for timer 3, set defaults uint32_t tim_prescaler = 0; uint32_t tim_period = 0; uint32_t TimOutClock = 1; // Timer 3 configuration. We want a timer 3 frequency of 2Khz(a interrupt // every .5msec tim_prescaler = 0; TimOutClock = SystemCoreClock/1; tim_period = __LL_TIM_CALC_ARR(TimOutClock, tim_prescaler, 2000); TIM_TimeBaseStructure.Prescaler = tim_prescaler; TIM_TimeBaseStructure.CounterMode = LL_TIM_COUNTERMODE_UP; TIM_TimeBaseStructure.Autoreload = tim_period; TIM_TimeBaseStructure.ClockDivision = LL_TIM_CLOCKDIVISION_DIV1; TIM_TimeBaseStructure.RepetitionCounter = 0; LL_TIM_Init(TIM3, &TIM_TimeBaseStruc
Hello, I've to add the x-cube-cryptolib to our application. I added to include path, the file cmox_low_level.c and the library file libSTM32Cryptographic_CM3.a. I get these errors: \Middlewares\ST\STM32_Cryptographic\lib\libSTM32Cryptographic_CM3.a(1): error: A1167E: Invalid line start\Middlewares\ST\STM32_Cryptographic\lib\libSTM32Cryptographic_CM3.a(2): error: A1167E: Invalid line start\Middlewares\ST\STM32_Cryptographic\lib\libSTM32Cryptographic_CM3.a(3): error: A1167E: Invalid line start\Middlewares\ST\STM32_Cryptographic\lib\libSTM32Cryptographic_CM3.a(4): warning: A1313W: Missing END directive at end of file What can I do to fix these errors? Thanks in advance!
Posted on June 13, 2017 at 09:14I'm using an STM32F103 and flashing a code into it using the bootloader. I'm successful in writing the code into the MCU, but when I try reading it using the Read Memory command (pg13) [http://www.st.com/content/ccc/resource/technical/document/application_note/51/5f/03/1e/bd/9b/45/be/CD00264342.pdf/files/CD00264342.pdf/jcr:content/translations/en.CD00264342.pdf] it fails at step 6 (Send the number of bytes to be read (1 byte) & a checksum (1 byte).) I receive a NACK. It's confusing here, so I tried sending both XOR of 8th byte with 0 and in the next try tried sending complement of 8th byte, both failed.Here's what I'm doing:1. Read 128 byte of the file to be written from SD card 2. Write this 128 bytes into the STM32 flash (code space) through the boot loader //works perfectly fine3. Read back the recently written 128 bytes to verify if the write was successful.4. If data written == read, move on. Write the next set of data. 5. Loop
Hi,i have a STM32F303RC and i have the following problem:With the Pin A2 i want to produce a sequence of 10 pulses.My attempt is to use a PWM TIMER Channel (TIM2 CH3) in one pulse Mode and retrigger it till i have generated my 10 Steps.However, my code only generates 2 pulses.ow can i rearm the Timer correctly?Does anyone know an easier way to solve the problem? void HAL_TIM_PeriodElapsedCallback (TIM_HandleTypeDef *htim) { if(htim->Instance==htim2.Instance) { __HAL_TIM_SetCounter(&htim2,0); p++; } } int main(void) { MX_TIM2_Init(); HAL_TIM_PWM_Start_IT(&htim2, TIM_CHANNEL_3); HAL_StatusTypeDef status= HAL_TIM_OnePulse_Start(&htim2, TIM_CHANNEL_3); if(status != HAL_OK) {} while(p<10) { while(htim2.State != HAL_TIM_STATE_READY) { } } finished=1; }
Hey everyone, I have developed a circuit board with STM32G030. I use the STOP 1 mode to save power, the device wakes up on a pin change interrupt.Sometimes the current consumption in STOP 1 mode is around 1,2mA higher mode than normal (3uA) but lower than run mode(2,5mA) and the MCU does not wake up anymore. The same in Standby Mode.I can´t find the reason, maybe someone has an idea. Here is my STOP Mode function:void StopMode(void){LED_On(OFF);I2C_On(OFF);MOT_EN(OFF);//DisableDebugger();//disablePeripherie();HAL_SuspendTick();sleep = 1;HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI); //Stop 1 SystemClock_Config();HAL_ResumeTick(); USR_LED_On(1); LED_On(ON);I2C_On(ON);MOT_EN(ON);}
Hi everyone,I'm encountering a problem with PWM generation using timers and DMA on the STM32F723.I've worked through some examples from ST and Controllerstech, such as this one:https://controllerstech.com/pwm-with-dma-in-stm32/I managed to get this example running, but now I need to develop something more advanced.We want to develop a protocol called XY2-100. Here's a description of the protocol:https://dvd.ilphotonics.com/Ray-Motion%20-%20galvanometers%20-%201D-2D-3D%20scanners/Motion%20Control%20-%20Optomechanics/Interface%20XY2-100.pdfThe protocol consists of four signals: Clock, ChannelX, ChannelY, Sync.The data of each axis consist of 20-bit words.The first 3 bits are used as a control word(C2-C0).The next 16 bits are data information(D15-D0, offset binary) and the last bit is a parity bit(P, even parity).The clock signal runs at a frequency of 2 MHz.When it goes high,the data bit changes.When it goes low,the data bit is sampled by the deflection system. The transfer of data
Hello STM32 community,I'm currently working on a project with an STM32F746ZG microcontroller, and I'm in need of SPI code snippets specifically tailored for this platform. I've searched extensively, but I haven't been able to find any suitable examples within the context of the STM32F746ZG.Could someone please share SPI code snippets or a reference example that is compatible and optimized for the STM32F746? I'm specifically looking for code that demonstrates the setup and usage of the SPI peripheral on this microcontroller. Any assistance in this matter would be highly appreciated.For reference, you can refer to the example codes available here, in which SPI is missing: Thank you very much for your help!Best regards,Pluto
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.