Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Posted on July 04, 2016 at 07:53My current SRAM usage on STM32F042 is miniscule. Since there doesn't appear to be a way to shut off parts of the SRAM for lower current usage (am I wrong?), the next best thing I can do to save power is to move frequently executed functions into SRAM. I know how to do this with my own code, but since I am regenerating the CubeMx code frequently (still in active development), whatever I modify in the stm32f0xx_it.c will be overwritten. Any suggestions? Thanks for reading. #cubemx-hal-isr
Posted on June 30, 2016 at 18:13Hello, In STM32F4 Discovery using HAL Library, bits 'CAN_FLAG_FMP0' and 'CAN_FLAG_FF1' of RF0R register and RF1R register are not defined in the 'stm32f4xx_hal_can.h' file. I have found bits 'CAN_RF0R_FMP0' and 'CAN_RF1R_FMP1' of RF0R register and RF1R register defined in 'stm32f407xx.h' file. Are these flag defined properly with the correct values. Please help me in this.I am using IDE: Atollic True Studio.Thanks in advance! #can #cubemx #!stm32f4-disco #!stm32f4 #canbus #stm32f4-can-tx-rx #hal #stm32
Posted on June 28, 2016 at 11:48Hello,I have a STM32L031K6 and I want some auomatiser my reception function is adding automatic detection of transmission speed (baud rate) how I can do. thank you very much
Posted on June 30, 2016 at 20:53Hello, can any one please provide me with CAN Filter configuration of 'FilterIdHigh', ''FilterIdLow', 'FilterMaskIdHigh', 'FilterMaskIdLow', 'BankNumber' of STM32F4 Discovery board. i want to receive any frame on CAN1 Receiver. i am using HAL Library.I have configured my CAN Filter as follows./*CAN1 filter function*/void CAN_filter_init(void){ CAN_FilterConfTypeDef sFilterConfig; /*♯♯-2- Configure the CAN Filter ♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯♯*/ sFilterConfig.FilterNumber = 0; sFilterConfig.FilterMode = CAN_FILTERMODE_IDMASK; sFilterConfig.FilterScale = CAN_FILTERSCALE_32BIT; sFilterConfig.FilterIdHigh = 0xFFFF;; sFilterConfig.FilterIdLow = 0x0000; sFilterConfig.FilterMaskIdHigh = 0xFFFF; sFilterConfig.FilterMaskIdLow = 0x0000; sFilterConfig.FilterFIFOAssignment = CAN_FILTER_FIFO0; sFilterConfig.FilterActivati
Posted on April 30, 2016 at 19:10Hi to all, I have STM32F4 Discovery board, CubeMx 4.14 version. I made an empty project with USB Full Speed VCOM port. And I tested both in Linux and Windows. All compiles OK, but... 1.- In Linux I was having this error (see kernel messages):[66654.903832] usb 1-2: new full-speed USB device number 37 using xhci_hcd[66655.070466] usb 1-2: New USB device found, idVendor=0483, idProduct=5740[66655.070471] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3[66655.070473] usb 1-2: Product: STM32 Virtual ComPort[66655.070476] usb 1-2: Manufacturer: STMicroelectronics[66655.070477] usb 1-2: SerialNumber: 00000000001A[66655.071569] usb 1-2: can't set config &sharp1, error -32[66655.706762] usb 1-2: reset full-speed USB device number 37 using xhci_hcdFirst of all, I has made plenty of test, the last line seems not always appear ... 2.- In windows machine (not virtualmachine) I have (with properly installed VCP driver)
Posted on June 20, 2016 at 08:59 Hello, I have wrote program to read data from ms5611 barometer for my F0Discovery board and i have two problems with it. First I need to convert pressure read by uC into alitude. To read real altitude i using code shown below: uint32_t ms5611RealPressure(I2C_HandleTypeDef *hi2c) { uint32_t pressData = 0; uint32_t tempData = 0; int32_t realPress = 0; int32_t dT = 0; int32_t TEMP = 0; int64_t OFF = 0; int64_t SENS = 0; pressData = ms5611PresTempRead(hi2c, pressure, UHIGH); //odczyt cisnienia RAW tempData = ms5611PresTempRead(hi2c, temperature, UHIGH); dT = tempData - (promData[4] * pow(2,8)); TEMP = 2000 + dT * (promData[5] / pow(2,23)); OFF = (promData[1] * pow(2,16)) + (promData[3] * dT) / pow(2,7); SENS = (promData[0] * pow(2,15)) + ((promData[2] * dT) / pow(2,8)); realPress = ((pressData * (SENS / pow(2,21))) - OFF) / pow(2,15); return realPress; } and it's work fine. For convert it to altitude i using function like this:
Posted on June 24, 2016 at 09:22 Hello, I am setting up communication via USART2 Asynchronous to receive my data. Configuration for receive the data is 9600/7bit/1-bit stop/Parity Even/Mode Rx/Tx. The implementation works fine when no parity is implemented. But the specification dictates that even parity should be supported. If added the parity, I received any value.I do not understand where is the problem. My configuration is with STMCubeMx for STM32L031K6 nucleo. void MX_USART2_UART_Init( void ) { huart2.Instance = USART2; huart2.Init.BaudRate = 9600; huart2.Init.WordLength = UART_WORDLENGTH_7B; huart2.Init.StopBits = UART_STOPBITS_1; huart2.Init.Parity = UART_PARITY_NONE; huart2.Init.Mode = UART_MODE_RX; huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE; huart2.Init.OverSampling = UART_OVERSAMPLING_16; huart2.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE; huart2.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_RXOVERRUNDISABLE_INIT|UART_ADVFEATURE_DMADISABLEONERROR_INIT; h
Posted on June 18, 2016 at 11:21HiI have previously worked with STM32CubeMX and I remember downloading it was easy. But now when I go to the website I go to the GET SOFTWARE section and there is no way of downloading it. I reinstalled my OS and I need to get all my tools back up and running. Where can I download it from. I need to get it as soon as possible.A few hours of struggle later... The website still doesnt work... but I found this link that works http://www.st.com/content/ccc/resource/technical/software/sw_development_suite/00/22/e1/cf/b7/83/42/25/stm32cubemx.zip/files/stm32cubemx.zip/jcr:content/translations/en.stm32cubemx.zip #bug-stm32cubemx
Posted on June 17, 2016 at 21:50Document AN2834 suggests that the STM32L1xx supports a self-calibration routine, which I would have assumed was documented in one of the reference manuals. I have had no luck finding any such reference in the manuals, on the forums, or in the supplied CubeMX libraries.Does anyone have more information on this? #stm32l151 #adc #cubemx
Posted on May 30, 2016 at 21:28Hello again, yesterday I updated to the newest version of CubeMX (v4.15.0) and since then in my project the clocks for the SDMMC and the STM32F746ZGT are disabled. In the pinout I selected the 4-Bit wide mode but the clocks are still off. I tested it with a new project -> same result. In my VM I have an old v4.9.0 and in this version the clocks still working as expected. Please can someone help? Is it a real bug? EDIT: STM32F779 is still working on both SDMMC interfaces. The clock are enabled after I choose one of the configuration in the pinout tab. #bug #cubemx #stm32f7
Posted on June 13, 2016 at 18:57Hi,I m using nucleo board STM32F103 and Keil Compiler.I have configured UART and DMA(for UART Rx) using CubeMX. But, While starting DMA using HAL_DMA_Start_IT function i m confused. following is the prototype of the function.HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)SrcAddress : Here i think array where i can store the dataDstAddress : Which start address i should give? UART RX register or pointer from UART_HandleTypeDef.pRxBuffPtr structure. #dma-uart-usart-hal #nucleo #stm32cubemx
Posted on June 10, 2016 at 11:39 Hello, I noticed that the STM32CubeMx doesn't generate default struct initialization in the code. This doesn't usually raise an error because all fields are tipically initialized, but sometimes this doesn't apply. I.E in MX_ADC1_Init: ADC_MultiModeTypeDef multimode; /**Configure the ADC multi-mode */ multimode.Mode = ADC_MODE_INDEPENDENT; if (HAL_ADCEx_MultiModeConfigChannel(&hadc1, &multimode) != HAL_OK) { Error_Handler(); } these lines cause an error because sometime the other two fields DMAAccessMode and TwoSamplingDelay aren't initialized at 0 as supposed. The correct solution is a default initializatio for the struct: ADC_MultiModeTypeDef multimode = {0}; as in the examples in the various STM32Cube_FW_*. Regards #cubemx
Posted on May 29, 2016 at 09:50 Hi, I m using cubemx for stacks. In files i foundassert_param is used for parameter checking. I don't understand how it is work. Here is syntax and use of that. #define assert_param(expr) ((void)0) assert_param(IS_UART_WORD_LENGTH(huart->Init.WordLength)); what will happen in both cases like IS_UART_WORD_LENGTH returns 0 and 1. #printf #assert #!cubemx #cubemx #debug
Posted on May 24, 2016 at 14:20I have a problem regarding CubeMX: the first time I generate the code, it works fine; but everytime I regenerate code and I open the project, an error occurs:cannot find entry symbol Reset_Handler; defaulting to 08000000What could be the problem of this?I�m working on STM32L153D-Eval board in TS.Thank you.Regards,Andreea #cubemx #stm32l1
Posted on May 19, 2016 at 00:35I'm working with a STM32F072RB, a Nucleo64 series board.I'm developing CAN communication and I've some issue during the initialization of the ''CAN handle''. I use CUBE MX and stm32cubef0 libraries for the initialization of all the peripherals.Once I try to init the CAN id on the handle structure with: ''hcan.pTxMsg->StdId = 0x001;'' (the only instruction I've added to the FW build by CUBEMX) the fw goes to the HardFault_Handler.The initialization was done by the CUBE MX functions. There are no examples for the STM32F072 board and I follow the example for the EVAL board using the same micro-controller.How can I fix this issue? Any idea?Thanks in advance! #stm32f0 #cubemx #bxcan
Posted on May 12, 2016 at 23:32In order to take full advantage of Tick-less Idle for Power-Saving I need to use an RTOS clock-source other than the SysTick.I need to alter the system clock (FreeRTOS does not accommodate this), and to do STOP1 or STOP2 FreeRTOS can't be using the SysTick.FreeRTOS has the flexibility to do this, but not only can I not implement this in CubeMX (which is OK, and understandable), CubeMX generates code I have to modify to make things work correctly.Since I am using LPTIM1 as the clock source for FreeRTOS, I have allowed SysTick to drive HAL. But when I can't ''turn off'' SysTick for FreeRTOS and when I generate code CubeMX sticks osSystickHandler into the interrupt for SysTick. osSystickHandler calls FreeRTOS's tick handler xPortSysTickHandler. None if these calls are structured in a way that I can remove them without altering code that is outside of the ''user code'' doman.All I need is a flag I can set that says ''Implement Your Own FreeRTOS Ticks''
Posted on May 11, 2016 at 10:39Does anybody know how to solve the re-inserting the SD card ? I have a project generated by STM32CubeMX. I have used it for re-inserting the SD card this function: if (CD_CARD == b_cd) { if (CD_NO_CARD == b_cd_last) { /* insert */ res = f_mount(&SDFatFs, (TCHAR const*)SD_Path, 0); if (res == FR_OK) { App_Clear_Error(ERR_SD_INIT); } else { App_Set_Error(ERR_SD_INIT); } } } else { if (CD_CARD == b_cd_last) {
Posted on May 11, 2016 at 15:47Cube is corrupting the .cproject file, resulting in no symbol table for the debug elf file.Create a project with Cube, edit run, test etc.Create a 'Release' build (No-debug).Back into Cube, modify and re-generate.Back in Eclipse, select Debug configuration, do a build. No symbol table.Comparing the .cproject file we see this change that when reverted restores the symbol table.Correupt .cprogram file:^<sourceEntries> <entry flags=''VALUE_WORKSPACE_PATH|RESOLVED'' kind=''sourcePath'' name=''Src''/> <entry flags=''VALUE_WORKSPACE_PATH|RESOLVED'' kind=''sourcePath'' name=''Inc''/> </sourceEntries>^Good .cprogram file^<sourceEntries> <entry flags=''VALUE_WORKSPACE_PATH|RESOLVED'' kind=''sourcePath'' name=''''/> </sourceEntries>^(also, on this forum, if you click ''Click for help about adding HTML formatting.'' you get pop-up about sharepoint server).-Matt #cube #cubemx #stm32cubemx
Posted on May 11, 2016 at 12:15Hello, I am new to HAL Libraries. Can anyone please provide with an example of CAN Bus for STM32F446RE-Nucleo Board using HAL libraries. as it will help to have an idea how should we program.Thanks in advance. #can #cubemx #canbus #stm32-nucleo #stm32 #hal
Posted on May 06, 2016 at 05:09I use STM32CubeMX 4.14. It has little bug at MCU selector.When I checked ''ADC 16-bit'' and set the number as 1 at 'Peripheral Selection',CubeMX returns 22 items.But the 6 mcu(STM32F410xxx ) of 22 item dose not have a 16 bit adc.They only have sixteen(16) 12bit ADCs! #bug-stm32cubemx
Posted on May 03, 2016 at 22:24Hi,I'm using CubeMX and System Workbench by AC6 on STM32F407-vgt6 to develop some basic projects for university purposes. First of all I'm studying Cube firmware's examples to understand how to work with the board in the right way and I noticed the use of some functions such as ''BSP_LED_On(LED4);'' that are not defined in the HAL library, but in the BSP files.When I try to generate a new CubeMX project and import it into eclipse, I can't see the BSP folder within the Driver folder which contains all the HAL and CMSIS drivers.Is there a way to make CubeMX add this library in my project, too? Or, since I know where this file are saved, how to add it to the current project without build errors by Eclipse?Thank you in advance.A.A. #cubemx #bsp #stm32f4 #library
Posted on April 28, 2016 at 10:17I created a simple project using STCubeMX for my nucleo-f446ZE(STM32F446ZET6).The project should be a USB device HID but it fail to start. After messing around with the debugger, I discovered that the MCU PC register go to 0x00000000 or 0xFFFFFFFF or sometimes random invalid value.I didn't modify any code. I compiled the code with MDK-ARM (modified GCC, Vision IDE), and with GCC (openSTM32) and the same thing happen.Callstack : Main SystemClock_Config HAL_RCC_ClockConfig (632) Hal_GetTickPs: RAM got corrupted after 0x080149A and that why the program do weird stuff Image http://i.stack.imgur.com/1VVLb.png #stm32f4-nucleo-f446-stcubemx-hal
Posted on April 23, 2016 at 23:45Hello all, in version F4 1.11 the code for SPI has been changed from WaitForFlag execution style to if loops. (see Release Notes) While this sounds ok it causes malfunctioning codesequences. The problem is in TransmitReceive function only (probably). We need a sequence in the form 1 write data register 2 wait to read received data 3 read data 4 goto 1) until end To speedup things we might write to the transmit register 2nd byte before reading 1st byte in order to avoid small gaps in between the transmitted bytes. Now we have 1) if tx register empty then write data 2) if read register full then read data 3) loop to 1) until txcount = 0and rxcount = 0 What really happened might be that - tx becomes empty quickly, 1 byte in shift register and 1 byte in hold register - rx is not read in time and the 2nd received byte will be read first - the first received byte might not be moved to the users rx buffer This explained condition might happe
Posted on February 06, 2016 at 22:31 Hello, in the file usbd_cdc_if.c there is this function: uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len) { uint8_t result = USBD_OK; /* USER CODE BEGIN 7 */ USBD_CDC_SetTxBuffer(hUsbDevice_0, Buf, Len); while(result != USBD_OK); do { result = USBD_CDC_TransmitPacket(hUsbDevice_0); } while(result != USBD_OK); /* USER CODE END 7 */ return result; } those lines: while(result != USBD_OK); do { result = USBD_CDC_TransmitPacket(hUsbDevice_0); } while(result != USBD_OK); don't make many sense and might lead to potential deadlock bcs. the situation is not resolved within timeout. Happyly the function USBD_CDC_TransmitPacket always returns USBD_OK. So in this version it will not lead to deadlock. Please provide a more professional solution. Regards, Adib. #usb-cdc-stm32-cubemx
Posted on April 13, 2016 at 18:02hi all i get for transmission data with using can protocol with stm32f429, i studied ''can primer'' article from keil.com also reading user manual of ''stm32f429'' . i configured can parametrs an all of things we can configure in ''Cubemx'' and generating code for use in keil V5 . ok . thats write, good , now how i can sending data ??!! in HAL driver we have few of functions about transmit and receive but all of them no more parameters in their argumans about whats your data for transmit . for example HAL_CAN_Transmit(CAN_HandleTypeDef *hcan, uint32_t Timeout); how i can send my data into TX mailbox's?? #canbus #stm32 #hal #can #cubemx
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.