Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Board: Nucleo - H745ZI-QSw: Cube MX 5.6.0I want to use cube mx for generating simple blinky code (I use the board specific details), for some reason it doesn't work out, I suspect its because I cant specify how both cores will work together from MX. So I want to completely power off one core say M4 and work only with M7 for the time being. Is it possible? Also I notice that datasheet says M7 is in D1 and M4 in D2 but cube MX shows both of them in D1. Is it a bug? Thanks in advance.
Dear CubeMX developers!I would like to suggest you to add an user code section around the function body of the Get_SerialNum in the usbd_desc.c file generated with the CubeMX for the STM32F1 family:static void Get_SerialNum(void) { uint32_t deviceserial0, deviceserial1, deviceserial2; deviceserial0 = *(uint32_t *) DEVICE_ID1; deviceserial1 = *(uint32_t *) DEVICE_ID2; deviceserial2 = *(uint32_t *) DEVICE_ID3; deviceserial0 += deviceserial2; if (deviceserial0 != 0) { IntToUnicode(deviceserial0, &USBD_StringSerial[2], 8); IntToUnicode(deviceserial1, &USBD_StringSerial[18], 4); } }As seen in the snipplet above the current implementation puts the die ID to the serial number.I think it is widespread to program an own unique serial number to the device at the manufacturing stage. In this case the user needs to override this function which got overwritten each time when the CubeMX generates code. Introducing a new user section here would solve this use ca
It looks like function CDC_Receive_FS() doesn't use the Len parameter? Is this a bug? I just noticed that when looking through the source code./** * @brief Data received over USB OUT endpoint are sent over CDC interface * through this function. * * @note * This function will block any OUT packet reception on USB endpoint * untill exiting this function. If you exit this function before transfer * is complete on CDC interface (ie. using DMA controller) it will result * in receiving more data while previous ones are still not sent. * * @param Buf: Buffer of data to be received * @param Len: Number of data received (in bytes) * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL */ static int8_t CDC_Receive_FS(uint8_t* Buf, uint32_t *Len) { /* USER CODE BEGIN 6 */ USBD_CDC_SetRxBuffer(&hUsbDeviceFS, &Buf[0]); USBD_CDC_ReceivePacket(&hUsbDeviceFS); return (USBD_OK); /* USER CODE END 6 */ }
In the old standalone version of CubeMX one could access the datasheet/application notes appropriate to the board/CPU part your project was based on.Probably me being a bit dense but I can't see to find this in CubeIDE. Does an equivalent exist?Used to save a lot of time hunting for relevant documents.ThanksPete
Hello,i'm Antonio and few week ago i've start to learn simulink and PIL simulation.I tring to test the IIR-Filter project from STM32_MAT-TARGET on my stm32f429i-DISK1 board with sw4stm32 toolchain but i've some problems ( used many time all the steps of STM32_MAT-TARGET_HandsOn_v1_0.pdf) but for me the biggest issue is the freezing when simulink try to open stm32cubemx (probably at clockwizard start).Java not work and only after i kill the process stmCube work, but without the settings...i've uninstall java with the relative tool , clean registry, reinstalled, killed processes that can use java, but nothing have work...Someone can help me?Someone have had the same problemMy system is:Win10 homejava Version 8 Update 241 /64bitMatlab R2019bStm32cubemx v. 5.6.0Thanks!
Hi I would like to read a file on a USB stick. But phost-> gState remains HOST_ABORT_STATE; (usbh_core.c) . The code was generated with STM32CubeMX.USB_OTG_FS is set to Host_Only. Class for FS IP is set to Mass Storage Host Class in USB_HOST Mode and configuration.board :NUCLEO-F413ZHclock settings : RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; RCC_OscInitStruct.PLL.PLLM = 16; RCC_OscInitStruct.PLL.PLLN = 192; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLQ = 4; RCC_OscInitStruct.PLL.PLLR = 2;ide:Keil µVision V5.26.2.0Thanks in advanceKind regards
Hi everybody,I have installed STM32CUBEMX and also pack for F1 series(V 1.8).When i generate code for keil or truestudio i expect to have :#include "main.h"#include "stm32f1xx_hal1.h"inside of main.c file but unfortunately it does not generate #include "stm32f1xx_hal1.h".It is also the same situation with STM32CUBEIDE.Where is the problem.Thanks in advance
..
Is it possible that some Cube settings is so wrong that there is no SPI2 clock. Uart and ADC seem to work. I have checked my solderings but I have soldered the board my self. PCB is OK.I have tried every SPI2 setting except The advanced settings, there I tried to stop all extra transfers.MOSI and MISO worked in a local loop (tied together).I have attached the ioc-file and a screen capture of CubeMX
CubeMX version 5.5 is used.CubeMX generate 2 times the same include 'stm32F4xx_hal.h' in main.h
Is it possible to get from CubeMX a report with an additional column?I need columns:PERIPHERALS MODES FUNCTIONS PINS Pin Nbwhere 'Pin Nb' is an additional parameter. It will be easier to analyse PINs allocation.
Hello. I always cross reference my projects with STM32CubeMX software ( all up to date and new)https://www.digikey.com/products/en?keywords=STM32L4A6VGT6P%20But i can't find this device I am making my project on, did you forgot it ?Hope you can fix this ST, thank you !
I'm trying to communicate over CAN using the HAL_CAN library between two STM32F boards. Specifically the issue seems to be in receiving messages. Following the documentation:============================================================================== ##### How to use this driver ##### [..] (#) Initialize the CAN low level resources by implementing the HAL_CAN_MspInit(): (++) Enable the CAN interface clock using __HAL_RCC_CANx_CLK_ENABLE() (++) Configure CAN pins (+++) Enable the clock for the CAN GPIOs (+++) Configure CAN pins as alternate function open-drain (++) In case of using interrupts (e.g. HAL_CAN_ActivateNotification()) (+++) Configure the CAN interrupt priority using HAL_NVIC_SetPriority() (+++) Enable the CAN IRQ handler using HAL_NVIC_EnableIRQ() (+++) In CAN IRQ handler, call HAL_CAN_IRQHandler() (#) Initialize the CAN peripheral using HAL_CAN_Init() function. This function resorts to HAL_CAN_MspInit() for low-level initialization. (#) Configure the
I started a new project using STM32CubeMX for a STM32F303VCTx, and used all the default options, and then configured the Timer3 for the all 4 channels as PWM ouptut (as in the snapshot).I open the project using uvision V5.26 and change the main.c only be adding one line of starting the timer HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_1);I can compile and download it to the board, but I cant see any output on PC6 (Timer 3 / Ch1).Could please someone tell me what I am still missing here?
Hi,Since Oracle changed their licensing for their JDK/JRE last year, we have been using OpenJDK so that we do not need to pay for the Oracle release.The only time I have a problem with this on my computer is running STM32CubeMX and STM32CubeProgrammer. When I start them up, I get the error message below, and then am sent to https://www.java.com/en/download/.Does STM32CubeMX really require the use of Oracle JRE? I have tried launching it from the command line using the below:java -jar "C:\Program Files (x86)\STMicroelectronics\STM32Cube\STM32CubeMX\STM32CubeMX.exe"This works fine, as the `java` command launches OpenJDK. So my workaround at the moment is to manually change the shortcuts to STM32CubeMX and STM32CubeProgrammer to launch via this command, but it is awkward. It would be much better if STM32Cube applications could simply use whatever Java implementation is present on the user's machine.Thanks,Andy
Dear all,I recently tried to bump the CubeMX version on my project from 4.27.0 to 5.0.0.I ran into compiler error on file syscalls.c while trying to build project with arm-none-eabi-gcc on OpenSTM32:../CubeMx/syscalls.c:63:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'asm'The error occurs on following line 63:register char * stack_ptr asm("sp"); I tried to switch from C standard C11 to C99; it did not solve the problem.Did anybody in the communitiy ran into the same problem ? Is there a workaround solution or is it scheduled to be fixed by ST ?ThanksR
STM32CubeIDE v.1.3.0STM32G431RBTxIn any timer if the input channels 1 and 2 are set for use as "Combined channels = Encoder Mode" (by CubeMX or integrated in CubeIDE), it is not possible to select a remapped input (for example from the comparator). This makes it mandatory to use a useless input pin, to then command the remap in the software through HAL or LL libraries. Please fix up.RegardsAndrea
I have added the library but I cannot build the project because there is a call to TP_STM32_MotionFX_Library_Init in StartDefaultTask (I am using FreeRTOS and Atollic) that appears to be missing from the library.If I comment out this line, the call to MotionFX_initialize does not return.I cannot send the entire source as this is a commercial project, but I can send pieces if required.
I install jdk13.0.2 and i have generated jre using following commandbin\jlink.exe --module-path jmods --add-modules java.desktop --output jre then i add C:\Program Files\Java\jdk-13.0.2\bin and C:\Program Files\Java\jdk-13.0.2\\jre\bin to environment variable ,but i connot run CubeMX in java runtime environment.
According to the website, STM32G474CE is "Active."However according to STM32CubeMX, the Marketing Status is "Proposed."Is it safe to specify this part for a new design?
I think, there are some bugs in stm32g0xx_ll_adc.c.In the function LL_ADC_REG_Init() is the statement "LL_ADC_REG_SetSequencerLength(ADCx, ADC_REG_InitStruct->SequencerLength) [line 713] outside of the parentheses. I think, it should be inside the last one [move it two lines up], because the sequencer length could only be written if LL_ADC_REG_SEQ_FIXED is not set. Setting the length in fixed sequencer mode modifies the channel selection because of the the dual mode useage of register ADC_CHSELR.---------------------------Another problem in the same context: CubeMX generates a statement like LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE(ADC1), LL_ADC_CHANNEL_VREFINT|LL_ADC_CHANNEL_TEMPSENSOR) if you add the two internal channels (Vref and temperature) to the ADC sequence.I think, the parameters for the function call are wrong. It works with LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE(ADC1), LL_ADC_PATH_INTERNAL_VREFINT|LL_ADC_PATH_INTERNAL_TEMPSENSOR). Please s
Hello I am using MxCube V5.6.0 FW V. 1.7.0 tto generate my code for usb cdc class.the problem is that the usb device is not recognized without modifying the usbd_cdc.c filethe work around is mentioned here https://community.st.com/s/question/0D50X00009Xkfnj/problem-solved-with-usb-cdcI keep following the updates in the FW and MxCube , but the solution was not implemented in any update, which puts me in doubt if the work around is correct or not?
hi I'm trying to send a byte to arduino with spi2 in circular dma tx in circular mode,at the beginning the dma starts then I don't understand why the cpucrashes in the while (1), here the code: MX_GPIO_Init(); MX_DMA_Init(); MX_SPI2_Init(); MX_USART2_UART_Init(); /* USER CODE BEGIN 2 */ HAL_SPI_Transmit_DMA(&hspi2,&i, 1); /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { i++; HAL_Delay(200);}}here dma set:void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi){ GPIO_InitTypeDef GPIO_InitStruct = {0}; if(hspi->Instance==SPI2) { /* USER CODE BEGIN SPI2_MspInit 0 */ /* USER CODE END SPI2_MspInit 0 */ /* Peripheral clock enable */ __HAL_RCC_SPI2_CLK_ENABLE(); __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE(); /**SPI2 GPIO Configuration PC2
Hi,project details:master: FPGA zynq board, clk freq = 25MHzslave: STM32F411VE board, pull up in CSfull duplex tx/rx in both boardsslave code generated with cubemxsw4stm32 IDE20cm jumper cables to connect both boardsGND connection beteween the boardsI have understand that in the master (I am using a FPGA) I must select low or high the CS to select the slave (STM32F411VE board), but what about the slave?, do I need to implement something like this to receive the data?//first way while(1) { if (HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_1) == 0) //CS pin { HAL_SPI_TransmitReceive(&hspi5,txbuffer,rxbuffer, 12, 5000); } }or the function transmitreceive detects internally if the CS is low to start the communication?, I mean, receive the data just doing this://second way while(1) { HAL_SPI_TransmitReceive(&hspi5,txbuffer,rxbuffer, 12, 5000); }I have this query because I am doing tests (second way) in the slave but always receive data when I connect the CS pin to GND or 3.3V
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.