Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi,I have control H-bridge with 4 MOSFET up to 100KHz.Will it possible to Generate PWM in Push Pull Mode with deadtime with STM32G0 MCU and CubeMx ?Is there any PWM Fault pin for that ?--Karan
Hi, I kindly need your help. I have a STM32F769 and TCP server application . I am using LWIP stack . In my application server is arm and PC is client. When client tries to send something to arm, arm binds client’s ip address. So the connection is ok for reception and transmission. Client can change Ip address (if client wants) or another Network parameters also. But what if client forgot arm’s ip address ? I tried cmd arp -a command to list mac and ip address (bcs I know mac address) but it did not work. But when I ping to arm or send another data form pc to arm then arp -a gives me correct ip and mac address for arm. So is there any code or application or gui that we use to get ip address ? I am not sure that tcp server application is appropriate for this. Also Our client (pc) is not only one . It can be changed. So maybe we need a connection between client and server even their ip address cannot be known. I am not good at network protocols and network applications . So your help woul
Hello,Sorry in advance for my English. I am also very new to embedded systems and softwares worlds.I am currently trying the lwIP TCP/IP stack on a STM32756G-EVAL2 (STM32F756NGH) board. On one end, I have a Red Hat PC with a network interface used specifically to connect with the board through Ethernet. On the other end, the board linked to the PC with RJ-45 cable. I use STM32CubeIDE v1.5.0 as the IDE for developping my softwares, and the board is connected to the PC via ST-LINK v2.1. I am able to flash and debug my binaries without any issues.My PC is network-configured with a static IP address (192.168.0.2), a netmask (255.255.255.0), a gateway (192.168.0.1) and a MAC address. The board is configured with a static IP address (192.168.0.10), a netmask (255.255.255.0), a gateway (192.168.0.1) and a MAC address (by default 00:80:E1:00:00:00).To reproduce the issue as stated in the title (I will explain more specifically the issue below), here is what I do:First I create a new workspace,
I just got a Nucleo 144 F746. I tried setting up the default configuration in the latest CubeMX for this Nucleo board, and writing a super simple blinky program (put the following in the main while(1) loop: HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin); HAL_Delay(500);)LED does not do anything, even when I just try to make it always on and then enter an empty while loop.I tried making a dumb simple blinky in Arduino IDE, i.e.,```void setup() { // put your setup code here, to run once: pinMode(LED_BUILTIN, OUTPUT);}void loop() { // put your main code here, to run repeatedly: digitalWrite(LED_BUILTIN, HIGH); delay(1000); digitalWrite(LED_BUILTIN, LOW); delay(1000);}```, and this works perfectly fine. Anyone able to give me some pointers to using CubeMX and CubeIDE?
It comes as surprise to us that the x-cube-display module cannot be enabled on anything else rather than a G0 based MCU. why can't it be used for other nucleo boards?
Posted on February 06, 2017 at 11:00I would like to know if guys from ST are planning to support C++ in the next releases of the CubeMX? I know that you can port your project, but it's not hassle free operation, especially if you often regenerate your project through CubeMX (e.g. by adding some peripherals, changing configuration etc. etc.). I would really apprecciate it!#support #cubemx #c++
Hi all,I have an application that needs to receive some UART bytes and transmit those to a Linux processor over a Virtual USB Com port.The USB is enumerated fine in Linux and the device appears in /dev/ttyACM0, I can receive perfectly from Linux to the STM32.My application used CubeMX as a base and I have built it up from there.The issue is that the transmit from the STM32 to Linux is very strange. I have a timer interrupt that fires as soon as a timeout occurs are the last UART byte is received, at this point inside in the IRQ for the timer I attempt to transmit the packet over USB, below is a code snippet, uart_rx_buff and uart_bytes are global variables./* This interrupt fires when the UART string is finished from Quectel module*/ void TIM1_BRK_UP_TRG_COM_IRQHandler(void) { GPIOB->BSRR = (uint32_t)2; htim14.Instance->SR = ~ TIM_IT_UPDATE; __HAL_TIM_DISABLE(&htim1); NVIC_DisableIRQ(TIM1_BRK_UP_TRG_COM_IRQn); htim1.Instance->DIER &= ~TIM_DIER_UIE; GPIOB->BRR
The uninstaller.bat uses a temporary folder like:set tmp_dir="C:\Users\%USERNAME%\AppData\Local\Temp\MX-JRE-%random%%random%"Which on my computer becomes like:"C:\Users\HP 8460p1\AppData\Local\Temp\MX-JRE-73025091"Then it tries to use xcopy with this path, which does not work. The installer quits prematurely with the message "Invalid number of parameters".https://stackoverflow.com/questions/30651776/xcopy-returns-error-invalid-number-of-parameters-when-exclude-parameter-is-setPlease fix.A workaround is to edit the .bat file and hardcode the tmp_dir to some other location which does not contain any spaces.
Unable to add ARM CMSIS software library using STM32CubeMX. CubeMX version : STM32CubeMX version 6.2.1 Micro-controller : STM32H7Tired to add ARM CMSIS package by navigating to software packages option and clicking on select components. I am unable to find it there. Please let me know how to add this software component to CubeMX. Thank you.
FlashSTM32H7xxxl_BANK1.flash operation errorI want to know the cause of this message.Of course, it's not your program.The above example is an example downloaded through STM32CUBEMX.
For the life of me I cannot understand what is being said in the first box:STM32Cube Firmware Library Package option The following actions are possible: * Copy all used libraries into the project folder STM32CubeMX copies to the user project folder the drivers libraries (HAL, CMSIS) and the middleware libraries relevant to the user configuration (e.g. FatFs, USB). * Copy only the necessary library files: STM32CubeMX copies to the user project folder only the library files relevant to the user configuration (e.g., SDIO HAL driver from the HAL library). : etcI can see when I select the first option that I get a TON of files and directories copied into my Drivers\CMSIS folder.When I choose the second option I get only Device and Include.BUT I'm not using any of them! I created basically a blank project so this must be a language issue. What does "copy all used libraries" mean? Does it really mean "copy ALL libraries"? That's the only thing I can come up with here. Help?  
I have attached a trace file showing the error.When ethernetif_input() receives multiple frames in its for() loop, the 2nd frame is assigned the 1st frame's buffer so the 1st frame is processed twice. Then every following frame in the receive loop uses the wrong receive buffer, the previous message buffer.. In the case when I sent 10 UDP frames that were received within the for() loop, the 1st frame is correct, the 2nd is a duplicate of the 1st, then remaining are assigned the wrong buffer, and the last frame was never received. This is very repeatable. It happens whenever 2 or more frames are received by ethernetif_input() . Just being connected to a busy Ethernet is sufficient to receive multiple frames.The attached file is too long to post inline.One more issue to consider in the ethernetif_input() for() loop:void ethernetif_input( void const * argument ) { struct pbuf *p; struct netif *netif = (struct netif *) argument; for( ;; ){ if( osSemaphoreWait( RxP
I have setup UART1 clocked with HSI clock, with drivers version 1.16Which led to incorrect output on the line.Same code with drivers version 1.14 worked completely fine. See picture.Turns out HSI trimming value is not correct in clock setupRCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; RCC_PeriphCLKInitTypeDef PeriphClkInit = {0}; /** Initializes the CPU, AHB and APB busses clocks */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; RCC_OscInitStruct.HSIState = RCC_HSI_ON; /* RCC_HSICALIBRATION_DEFAULT seems to be wrong */ RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { Error_Handler(); } /** Initializes the CPU, AHB and APB busses clocks */in different versions of drivers it is hardcoded to different value:v 1.14 - 0x10uv 1.16 - 0x40uAlso, when I entered debug mode and checked actual value
In the STM32H7 Example project, the CubeMx .ioc file is missing.Does CubeMx support STM32H7?Could anyone please tell me about the above?
Is there an export/import option for pin configuration?
I create a STM32CubeMx project (test.ioc) for a NUCLEO-H745ZI-Q board and select PPL3 to clock the ADC, but the function PeriphCommonClock_Config() is not generated unless I also clock the USB from PPL3 as well.After enabling a single ADC1 channel I change the clocking as shown belowI then toggle the clock source for the USB and captured the code generated for each option as shown below. Left side is ADC clocked by PLL3, right side is is ADC and USB clocked by PLL3So it looks like STM32CubeMx is ignoring the generation of PeriphCommonClock_Config() when only the ADC is clocked from PLL3.I think this is a bug in STM32CubeMX code generation.cheersChris
Hi all, I have had some problems when working with sdcard (using sdio) in freertos. I use dev kit STM32-E407 Olimex ( it support sdcard slot on board, I use sd card 16GB). when I read sdcard without using freertos, It's working. But when I using freetos, f_open return FR_NOT_READY (I read sd card outside thread). Please explain me what's reason and I can read sdcard (using sdio) outside thread when using freertos ? Below are some configures in my projects.
I make a usbh freertoss programe by stm32cube.The programe have three thread /* definition and creation of defaultTask */ osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 512); defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL); /* definition and creation of commTask */ osThreadDef(commTask, StartCommTask, osPriorityIdle, 0, 512); commTaskHandle = osThreadCreate(osThread(commTask), NULL); /* definition and creation of LedTask */ osThreadDef(LedTask, StartLedTask03, osPriorityIdle, 0, 512); LedTaskHandle = osThreadCreate(osThread(LedTask), NULL);The usbH thread is created in StartDefaultTask thread.#if (USBH_USE_OS == 1U)#if (osCMSIS < 0x20000U) /* Create USB Host Queue */ osMessageQDef(USBH_Queue, MSGQUEUE_OBJECTS, uint16_t); phost->os_event = osMessageCreate(osMessageQ(USBH_Queue), NULL); /* Create USB Host Task */#if defined (USBH_PROCESS_STACK_SIZE) osThreadDef(USBH_Thread, USBH_P
Hello,I recently started using STM32 Microcontrollers, and before using STM32 Cube IDE, I used Mbed Studio for PC to USB communication using USB, and now having switched to Cube IDE, I can't seem to make the CDC class work, when I try to debug it, it shows that TxState in CDC_Transmit_FS function for some reason is never 0, and the code returns USBD_BUSY. AFAIK, I have set up the generated code correctly according to various YouTube tutorials.int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_USB_DEVICE_In
I have semi-recent backups, but this has created a lot of extra work.Is this a problem specific to the versions I am using?
Hello,if I generate with CubeMX 6.2.1 (Windows 10 or Ubuntu 20.04) the attached project, it freezes with the following screen:MCU: STM32H7A3V(G-I)Tx2021-07-13 09:20:39,936 [ERROR] runtime:60 - Error executing FreeMarker template FreeMarker template error: The following has evaluated to null or missing: ==> varName [in template "ip_c.ftl" at line 420, column 82] ---- Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use [#if myOptionalVar??]when-present[#else]when-missing[/#if]. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign indicatorName = varName + "."... [in template "ip_c.ftl" in macro "generateConfigModelCode" at line 420, column 57] - Reached through: @generateConfigMo
The QSPI pins are mentioned in STM32H7A3 reference document. Please refer Img1.In STM32CubeIDE I am seeing the interface as OCTOSPI. Please refer Img2.I need to know Does STM32H7A3 board supports QSPI or OCTOSPI?If it supports , please give the details for the integration or documents mentioning the steps for integration.Read that some loader files are needed for QSPI. From where we will get this?Thanks,Jestina
Hello ST community.I am use NUCLEO-G474RE, wanted to set up HRTIM in push pull mode with dead time. I select the set and reset sources for outputs TA1 and TA2 period event and compare 1 event. But when i turn on dead time, TA2 setting is considered to be wrong. If remove set sourse for TA2 and run program, i get incorrect pwm signals. When i manually configure a set sourse for TA2 everything works fine.I am attaching a project with a fixed bug.
Hello, I have use Timer 2 in PWM one pulse mode to change the duty cycle of Timer 1 PWM when the pulse have ended using HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim)After restart the board, I press the button to trigger Timer2 One Pulse Mode, and the Timer 1 PWM is produced correctly (The first pulse width is 250us). But on the next button press and the rest, the PWM is produced slightly incorrect (The first pulse width is not 250us anymore).I hope the images below could help explain a bit of my situation. Anyone know what could the cause be?(Image Below) Correct first pulse width that only occur after program/hardware reset (Image Below) Using different timer 2 channel to adjust PWM 1's duty cycle (Image Below) Pulse Width of each Channel in Timer 2 (Image Below) Cursor measurement of the correct 250us that only occur after program/hardware reset (Image Below) Wrong pulse width 1 (Timer 2 channel 1 pulse width no longer 250us)on the next button press&n
Hello All, I am trying to get Full Duplex I2S working with a STM32H7 and a PCM3168A.The STM has 2 SAI blocks (SAI1 A/B) (A in master mode and B in synchronous slave) for sending data to the PCM for the DAC part of the PCM. I use this to transmit 4 Mono signals. This works with double-buffered circular DMA.I then have 2 SAI block (SAI4 A/B) both configured as synchronous slaves. both synchronized to SAI1. These should receive data from the ADC portion of the PCM. I want to setup a circular DMA transfer for this as well, to take data from the PCM and transfer continuously to a buffer.I can start a DMA transfer with status = HAL_SAI_Receive_DMA(&hsai_BlockA4, (uint8_t*)&adc0DMA, ADCDMABUFFERSIZE); And status returns HAL_OK. But I only ever see 0's in the adc0DMA buffer. I can see I2S data on the incoming SD data line. I also have global interrupts enabled for the SAI, but the following generated handlers are never called when I set a breakpoint:void BDMA_Channel0_IRQHandler(
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.