Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Posted on July 25, 2017 at 11:08I found two issues with the latest (and updated) STM32CubeMX when generating a Makefile project for STM32F334 Nucleo64 board.1. I selected only the LL drivers but the Makefile had the 'USE_HAL_DRIVER' definition, so the project wasn't compiling (because there was no HAL driver files in the project as I have selected 'Copy only the necessary library files...' in the settings)2. The SystemClock_Config function had this line which was giving an error because RCC_LSEDRIVE_LOW is a HAL definition:LL_RCC_LSE_SetDriveCapability(RCC_LSEDRIVE_LOW);I had to change it to:LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);Thanks!#ll #stm32cubemx
Posted on December 24, 2016 at 21:51Using STM32CubeMX version 4.18.0 on Windows 10 Pro (build 1607) with an UHD (4K) display results in tiny toolbar icons and a very tiny Clock Configuration diagram. Please see attached screen capture image. Not that this application window is not maximized.Is there any way to scale these images within the STM32CubeMX application so that I can see them with human eyes?Additionally, the screen looks the same even when I drag the STM32CubeMX application to a different, lower-resolution monitor.Any help would be appreciated.Thanks,Dale#stm32cubemx
Posted on June 03, 2017 at 20:12I have a board which was designed to use the STM32L433CCU6 and am attempting to use it with an STM32L452CEU6. The board works perfectly fine with the 433, but I am struggling a bit with the 452. The problem I was facing is that I am attempting (and failing) to use the HSI as the clock source for LPUART1. The UART was transmitting but not being understood, and reporting errors when attempting to read.After a bit of work, I have it working fine with the PCLK1 (via HSE/PLL) at 38400bps, but I need to operate at 9600bps. This cannot be done with an 80MHz clock.In order to see what was going on, I connected HSI to MCO and measured the frequency. At an ambient temperature of 21C, the HSI on one MCU is running at 13.89MHz and another at 14.29MHz. That seems excessively out of spec to me. Doing some digging, it appears that the HSI is not being calibrated properly.I am using STMCubeMX 4.20.1 and the 1.7.0 ver
Posted on March 21, 2017 at 10:16Hi I have a NUCLEO F746ZG board. How I initialize ethernet using CubeMX and using MQTT Protocol to transfer my data to MQTT broker ?#ethernet #f746zg #mqtt #nucleo #cubemx
Posted on October 13, 2017 at 21:38NucleoF722ZE board, Stm32CubeMX ver 4.22.1, Eclipse Version: Neon.3 Release (4.6.3)I wanted to setup TIM6 as timer interrupt for 400usec sampling loop. In CubeMX : TIM6 clocked at 1Mhz and ARR = 400, TIM6 Configuration/NVIC settings/Enabled (TIM6 global interrupt), then in NVIC Configuration/enabled TIM6 global interrupt with Preemp Priority=10 and Sub Priority=0. Then Generate code. The generated code seemed to be OK, and it also had set NVIC interrupt priority and enable as below.HAL_NVIC_SetPriority(TIM6_DAC_IRQn, 10, 0);HAL_NVIC_EnableIRQ(TIM6_DAC_IRQn);I added code to toggle the LED inside the ISR void TIM6_DAC_IRQHandler (void) and it never triggered.Result:TIM6 was counting OK (read TIM6.CNT and outputted on PWM pin for monitoring), but there was no timer overflow interrupt generated. However after adding TIM6.DIER = 1; // DMA/interrupt enable, then it worked.What I need to add TIM6.DIER=1; instead of by CubeM
Posted on October 05, 2017 at 08:56Hi all,I am using the latest stm32cubemx with a stm32f446re Nucleo board and I am trying to access a microSD card. I have soldered headers to a microSD to SD adaptor and connect all the pins to the corresponding pin on Nucleo. I made my project through stm32cubemx and I am using SD 4 bits wide bus as mode and enabled the FATFS Middleware. My problem seems to be in the lower level because I can�t even initialize the card.
Posted on October 09, 2017 at 12:22 I created a project with CubeMX 4.1, with a STM32F411VCTx. CubeMX generated a PLLN value of 100, which for RM0383 is correctsince the minimum PLLN value is 50: VCO output frequency = VCO input frequency × PLLN with 50 ≤ PLLN ≤ 432 Instead, since CubeMX has defined the following in the build settings: STM32F411xE The value of PLLN=100 produce an assertion error because the following macro states that the minimum PLLN value for STM32F411xE is 192: #if defined(STM32F411xE) #define IS_RCC_PLLN_VALUE(VALUE) ((192U <= (VALUE)) && ((VALUE) <= 432U)) #define IS_RCC_PLLI2SN_VALUE(VALUE) ((192U <= (VALUE)) && ((VALUE) <= 432U)) #else /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F401xC || STM32F401xE || STM32F410Tx || STM32F410Cx || STM32F410Rx || STM32F446xx || STM32F469xx || STM32F479xx || STM32F412Cx || STM32F412Rx || STM32F412V
Posted on October 30, 2016 at 22:27This is what I get when compiling an empty created CubeMX project (CubeMX 4.17.0, STM32F0 lib v1.6.0) with the CRC module enabled. File: stm32f0xx_hal_crc.c, affected lines: 470 -> *(uint16_t*) (&hcrc->Instance->DR) = ((uint16_t)pBuffer[4*i]<<8) | (uint16_t)pBuffer[4*i+1]; 474 -> *(uint16_t*) (&hcrc->Instance->DR) = ((uint16_t)pBuffer[4*i]<<8) | (uint16_t)pBuffer[4*i+1]; 506 -> *(uint16_t*) (&hcrc->Instance->DR) = pBuffer[2*i]; According to some googling, those pointers are accessing the memory of DR while interpreting it as uint16_t while DR originally is defined as uint32_t. This breaks the aliasing rules and should be avoided. See:http://stackoverflow.com/questions/3246228/dereferencing-type-punned-pointer-will-break-strict-aliasing-rules and:http://stackoverflow.com/questions/8824622/fix-for-dereferencing-type-punned-pointer-will-break-strict-aliasing So changing the *(uint16_t*) to *(uint32_t*)
Posted on September 29, 2017 at 13:53Using CubeMx with automatic Makefile generation.I want to alter the build target name.Example:CubeMx creates a build target in the Makefile:TARGET = myfirmwareBut I want to append a version:TARGET = myfirmware_$(FW_VERSION)However my custom change is overwritten each time CubeMx auto generates a new makefile.Does anyone know how to work around this?I have not found documentation on how to protect parts of the Makefile from updating.#stmcubemx #makefile #cubemx-project
Posted on September 27, 2017 at 09:36Have good days...I am trying to connect my STM32F107VC EasyMx Pro V7 development board with Visualgdb. I am using Visual Studio 2015 Community. My example is LedBlink which is codes from STM32CubeMx. I did provisioning of STMCubeMx and VisualStudio. I don't have error message or warning when i build my codes in Visual Studio. My debug method is OpenOCD, programming interface is St-Link v2. When i check communication Stlink Detect and Test OpenOCD Settings, there is no problem. However i have error that is name 'No executable file specified. Use the 'file' or 'exec-file' command. Cannot resolve the address of _estack. Skipping stack pointer validity check.' when i try to debug with Visualgdb. And i was not able to find the solution. Would you mind help ing me this problem ? How to solve this debug error ? I already remain grateful your assistance...#stlinkv2-1 #debug #openocd #visual-studio #stm32cubemx #stm32f107vc #stm32-error-debug
Posted on September 22, 2017 at 09:46 Hi there, i'm working on a STM32F103 MCU and I want to acquire 9 channels with ADC1. With STM32Cube I configured the ADC1 in this way: Scan conversion mode: Enabled.Enable regular conversion: Enable.Number of conversion: 9 These is the channel list: Vref IntTemperature SensorIN8IN9IN10IN11IN12IN13IN15 Also I configured the DMA to transfer the data from the ADC to a memory buffer. Mode: NormalIncrement Address: MemoryData Width: Word To start the conversion I use: HAL_ADC_Start_DMA( ADC1_ModuleHandler, ADC_1_Buffer, ADC_1_CH_MAX_VALUE ) Where: ADC1_ModuleHandler: ADC Handler.ADC_1_Buffer: uint32_t array with 9 elemets.ADC_1_CH_MAX_VALUE: enum to identify the channel. It starts from 0 to 9. The conversion works fine but into the ADC_1_Buffer only the first five elements contain a value different from 0. the other 4 elements contain 0. Moreover if I convert to analog voltage the value of the first element ( Vref Int) I obtain 1.2V that c
Posted on September 25, 2017 at 03:42Hi All,I have been experimenting with my http://www.st.com/en/evaluation-tools/nucleo-l476rg.htmlI have generated some code with CubeMX for SW4STM32 and I am getting some problems with the code, ending up in an Error Handler sometimes (in main):void _Error_Handler(char * file, int line){ /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */ while(1) { } /* USER CODE END Error_Handler_Debug */ }This happens when I do the following:Use the main clock source for the PLL as HSI, and tick the option 'generate peripheral initialization as a pair of '.c/'h' files per peripheral', which I prefer to keep things tidy, in CubeMX.If I use the MSI instead of the HSI, I don't get this problem.I am attaching my project for your perusal. Is this a known bug? Or am I missing something?Thanks!#pll #nucleo-l476rg #clock #stm32l4 #cubemx #stm32l476
Posted on September 24, 2017 at 21:48I have generated a project using the GPDSC format for STM32L151CC MCU and there are several 'LL' driver files missing from that output file. For example 'stm32l1xx_ll_gpio.c.'In the configuration for the peripherals all are selected to 'LL' driver.CubeMX is v4.22.0Please advise how I can resolve this,Sid#gpdsc #cubemx
Posted on March 26, 2017 at 14:09Hi,I want to use Timer with Quadrature Encoder. I'm new on STM32 so I'm trying to start with Cube and HAL.I'm able to setup STM32F411 to count pulses but there is an only 16bit counter. I need to measure pulses up to 400k.Can I rise interrupt on counter overflow to store revolutions? I want to do this using Cube and HAL. I was trying a lot of settings and interrupts but I'm unable to get interrupt from an encoder. Can you help me?Thanks in advance.Steve#cube #cube-mx #quadrature-encoder #stm32-cube #stm32f411 #quadrature
Posted on September 18, 2017 at 13:25 Hi, I use Stm32CubeMX v4. It creates the code for TIM2, TIM3 and TIM8 (STM32F103VCT, custom board). All timers have 'Clock Source == Internal Clock' and 4 channels configured to 'Input Capture direct mode'. When I debug the code with sw4stm32 v2.2.1 (ubuntu 04 x64) there is not return from 'Step over' debugging in MX_TIM2_Init(). Debugging hangs. The code is attached. After that in addition the only way to reload (or erase) the code is to connect the reset pin of St-link v2 to MCU NRST and use 'Reset Mode == Connect under reset'. When I comment MX_TIM2_Init() debugging is OK with 'Reset Mode == Software system reset'. Is there a way to debug with TIM2? Thanks for assistance, Boris. #tim2-debugging #stm32cubemx Note: this post was migrated and contained many threaded conversations, some content may be missing.
Posted on July 14, 2017 at 23:56ccsbcs.c of FatFS 3rd Party Lib is not copied from CubeMX repository to projects folder which prevents a compilation of the created project. Copying this file manually fixes compilation errors which give misleading messages.I found this with SW4STM32 + CubeMX 4.22 + STM32F429ZIT + SDIO on Win7.Best regards,Markus.#stm32f429 #cubemx #fatfs-sdio
Posted on August 11, 2017 at 18:39Hi Everyone, recently I am trying uSdCard FATFS library configured and generated from cubemx tool(v4.22.0),Only when I enable _USE_LFN parameter which is for long file name support I received compilation errors, Below is the Error I received during compilation. Error: L6218E: Undefined symbol ff_convert (referred from ff.o).How could I resolve it ? and hope ST Cube MX developer will realize this and fix it too.Thank YouBest Regards,Manojkumar#sdcard #cubemx-4.22 #stm32f7 #sdmmc #fatfs #stm32
Posted on September 11, 2017 at 21:16 Hi there, I am using STM32CubeMX to develop a USB HID touchscreen with the STM32F103C8T6 MCU. In the HID descriptor, I must report the following feature to support multi-touch: 0x85, REPORTID_MAX_COUNT, // REPORT_ID (Feature) 0x09, 0x05, // USAGE(Contact Count Maximum) 0x95, 0x01, // REPORT_COUNT (1) 0x25, 0x02, // LOGICAL_MAXIMUM (2) 0xb1, 0x02, // FEATURE (Data,Var,Abs) Which function should I use to do a USB control request as feature request? #stm32-hid-usb #usb-hid-getfeature-setfeature #stm32f103c8t6 #usb-hid #stm32cubemx(hal)
Posted on August 15, 2017 at 16:42 Hi! I am using STM32L476 uC to which I have interfaced an SD card via SDIO. I am using the code and libraries (together with the FatFs in question here) generated from CubeMX. The problem is that now and then, I get errors in the FatFs library, in ff.c for the functions f_write�? (returns FR_DISK_ERR);�? and f_mount�? CubeMX generates the FatFs library from version R0.11, and I was thinking to change it to the latest version (currently R0.13), in the idea that the bugs are fixed. Does anyone have any idea how to change this in CubeMX? Or did anyone encoutered this kind of issues? Any idea is highly appreciated! Regards, Andreea #fatfs #fr_disk_err #f_write #f_mount #sdio #error #cubemx #stm32l4
Posted on September 13, 2017 at 08:46The new CubeMX 4.22.1 fails to generate code (and hangs on generation) for a STM32 workbench project which has been successfully generated with the previous versions.Here is the command line output from the problem:https://pastebin.com/kgumCq6t I am using Linux please see the ioc file attached. The error also occurs when generating blank project.#bug #regression #cubemx-4.22
Posted on September 12, 2017 at 14:11Hi, I am new to stm and I have STM32L053R8 - NUCLEO, I have to make a smartcard project with this.I am using prepared code by given ST Firm and a smartcard. When I debug the code , it stucks. the code of smartcard project is http://www.st.com/en/embedded-software/x-cube-smcard.htmlI have been trying to get ATR for 1 mounth, but it stucks in code-1 I entered inside of atr_read and tried to find the problem, I think that the problem is about HAL_TIMEOUT.is there anyone who can help me to solve this ?I put here code that I believed the problem is linked with (code-2). Please help mecode-1/* Read ATR - loop until it's read */ do { atr_size = sizeof(atr_buff); } while (HAL_OK != ATR_Read(&SCInterface, atr_buff, &atr_size)); // it does not get out of herecode-2 if(SMARTCARD_WaitOnFlagUntilTimeout(hsc, SMARTCARD_FLAG_RXNE, RESET, Timeout) != HAL_OK) {return HAL_TIMEOUT;}#smartcard #stm32l053r8-nucleo #stm32
Posted on August 25, 2017 at 09:01Hi,I recently started programming on the STM32F207 nucleo board and I ran into a problem.I used CubeMx to create initialisation code for CAN1 and it doesn't seem to work.I'm trying to implement CAN with interrupt. Besides the code generated by the cubeMx I initialised the filter in CAN_MspInit function and called the HAL_CAN_Receive_IT(&hcan1, CAN_FIFO0) function in main() before while() loop. I looked over the example and I couldn't find an error.Am I missing something? Does anybody else have this problem.EDIT:So I tried it without interrupts.Transmit function is working fine, but when placed in loopback mode the receive function just times out.#can #cubemx #stm32f2
Posted on September 12, 2017 at 10:32 Hi everyone, I'm trying to convert a 'C' generated project with CubeMX in 'Cpp' but I have some problems with that. Indeed with CubeMX I have generate a project to read ADC values. This one work fine. The same project converted in Cpp compile but the value of the ADC is always the same ( 0 ). Do you have any idea where this problem could come from ? Thank you for your help and for your time. Regards Simon #stm32l0 #cpp #eclipse #adc #cubemx Note: this post was migrated and contained many threaded conversations, some content may be missing.
Posted on September 11, 2017 at 17:11I am attempting to create a simple project for AC6 (SW4STM32) to try out the 'atomthreads' multitasking executive on a Nucleo-64 board (STM32L476G). I went through the 'New Project' wizard in STM32CubeMX v4.22, selected by board and processor to create the CubeMX project, then switched the sys clock from systick to TIM5, adjusted the USART2 settings to my needs, and generated the project in my SW4STM32 workspace. I have the STM32L4 firmware packages 1.7.0, 1.8.0 and 1.8.1 installed under STM32CubeMX.The problem I've encountered is that the generated project does not build. The first error that it hits is because it cannot find 'core_cm4.h'. I looked at a number of older projects for this same board that I generated, and found that in all of those cases, STM32CubeMX had copied over the CMSIS include files under '<project-root>/Drivers/CMSIS/Include', but not for this new project. I've gone through the new pro
Posted on September 08, 2017 at 16:11 Whether using SDIO or SDMMC, CubeMX does not provide necessary configuration parameters available for these units. It also does not configure Bus Width, only generates 1Bit Bus configuration. Also setting BusWide to 4Bit does not initialize sd card. It only works in 1Bit mode. These are therequired parameters to be available at CubeMX void MX_SDMMC1_SD_Init(void) { hsd1.Instance = SDMMC1; hsd1.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING; hsd1.Init.ClockBypass = SDMMC_CLOCK_BYPASS_DISABLE; hsd1.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE; hsd1.Init.BusWide = SDMMC_BUS_WIDE_1B; hsd1.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE; hsd1.Init.ClockDiv = 0; }�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�? and this is a picture of available parameters at cubemx #bug #cubemx #sdmmc #sdio
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.