Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Posted on September 07, 2017 at 21:43I am using STM32CubeMX 4.22.0I am using STM32F103C8T6 chip with Keil v5 under Windows 10.I configured only RCC to HSE for Crystal\Ceramic Resonator and in Clock Configuration input frequency to 8 MHz and HCLK to 72MHz .I generated the code for keil, but at the function 'SystemClock_Config()' the chip falls into Error_Handler().following code was generated:void SystemClock_Config(void){RCC_OscInitTypeDef RCC_OscInitStruct; RCC_ClkInitTypeDef RCC_ClkInitStruct;/**Initializes the CPU, AHB and APB busses clocks */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1; RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { _Error_Handler(__FI
Posted on September 07, 2017 at 17:47Hi,I found a bug in the last version of stm32l4xx_hal_rcc.h from stm32L4 uC.file: stm32l4xx_hal_rcc.h/.cversion 1.7.2&sharpdefine __HAL_RCC_GPIOB_IS_CLK_ENABLED()it should refer to RCC_AHB2ENR_GPIOBEN instead of RCC_AHB2ENR_GPIOCENthanks,#stm32l4 #cubemx
Posted on August 27, 2017 at 10:21I use a discovery board, STM32F303VCT6 and the CubeMX / System Workbench for the coding (in C).If I generate a project via CubeMX, I can open this project and build it in System Workbench - no problems.In CubeMX I have installed library: Firmware Package for Family STM32F3 - version 1.9.0 which downloads a zipped folder in the CubeMX repository path.This zipped folder contains examples and demonstrations which I wish to test. Following the Getting started with STMCubeF3, I try to open the GPIO_EXTI example project.I set the workspace using the Switch Workspace >> Other command in System Workbench.From the Getting started - guide, you should browse to the SW4STM32 directory and open the project using Import >> Existing Project into Workspace. Whatever project I try to open and build, I get Fatal Error: stm32f3xx_hal.h: No such file or directory. I follow the instructions from the Getting started&
Posted on March 21, 2017 at 18:48 Hi STM32 Support Team, I have an existing STM32CubeMX project for the Nucleo-F303RE board which uses UART2. In the project the pins PA2 (Tx) and PA3 (RX) are configured as alternate function pins. In the old code (probably generated with V4.x) I could see that the pins were correctly initialized, file main.c, function MX_GPIO_Init: /*Configure GPIO pins : USART_TX_Pin USART_RX_Pin */ GPIO_InitStruct.Pin = USART_TX_Pin|USART_RX_Pin; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.Alternate = GPIO_AF7_USART2; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);�?�?�?�?�?�?�? Now, I am using a newer version of STM32CubeMX (V.4.0 and also newer libraries) and the above mentioned code is missing! Also, the TX pins is showing a low level in idle state. (I would have expected a high level.) Can you confirm this issue? Is this an intentioned feature? Regards, m
Posted on July 14, 2016 at 01:05Hi, I generated a project that included ADC2. Multimode is set to independent. When I run my project I get an error in MX_ADC2_Init. When I trace it, the problem is in HAL_ADCEx_MultiModeConfigChannel(). At line 2200 in the attached file t it tries to set the slave, using ADC_MULTI_SLAVE, but since it is ADC2 the slave instance is set to NULL. It then immediately tries to access that null on line 2208, causing the function to return an error. Is this a bug, or have I configured something wrong? Ricardo #stm32l4-cubemx-fw1.5.1-adc
Posted on June 26, 2017 at 11:49Hi,I want to use STM32CubeMX and I would like to program my new project in C++. I am using the latest version of STM32CubeMX (4.21.0) and the latest version of Keil uVision (5.32.0.0).After code generation I have added the compiler flag '--cpp'. I haven't added any custom code yet. But when I compile the project I get the following error. Without the compiler flag everything compiles and links without an error or warning.compiling main.c...../Inc/adc.h(62): error: &sharp337: linkage specification is incompatible with previous '_Error_Handler' (declared at line 162 of '../Inc/main.h') extern void _Error_Handler(char *, int);The function declarations for '_Error_Handler' seems to be correct. In main.c the function declaration is included from main.h and from every peripheral-header. In main.h the declaration does not have an 'extern' specifier. That seems to be the only difference. When I remove the function declaration for '_Error_H
Posted on August 21, 2017 at 15:17I have setup the USB Host using the STM32CubeMx and I can transmit data in bulk and it has a state machine. The USB is attached to the host which is a CDC USB Modem. The CDC_ProcessReception(phost) does not receive data through the pipe and it gets into the CDC_RECEIVE_DATA_WAIT state and gets suck without any data received. The USBH_CDC.c file has the transmit and receive function which uses a state machine andcase CDC_TRANSFER_DATA: CDC_ProcessTransmission(phost);CDC_ProcessReception(phost); break; The ProcessTransmission function works for me but not the ProcessReception(phost)? How can I get to receive data?#usb #usb-cdc #usb-modem #stm32cubemx #usb-host #usb-receive
Posted on April 13, 2017 at 16:19hi to all, i use a cubemx 4.20.1 for configure STM32L152RE; when i configure the RTC pin with alarm A i see a error handler.indeed when the system arrived to LSE configuration i have a HAL_TIMEOUT, can you help me?best regardsA.#bug #rtc #cubemx #lse-osc32-not-starting-oscillation
Posted on August 18, 2017 at 09:50During update to the new version of CubeMX, I hit this error message:Not sure how to deal with it.Regards, Nikolay#cubemx #cubemx-4.22 #update
Posted on August 16, 2017 at 00:58Dear Forum,I bring forth a frustration question yet I'm uncertain how to approach it.I have STM32F402, and I can communication over UDP . In cube I reviewed every options but my problem do not solved. If I can sending data over UDP smaller than 1514 byte is every OK - I have Java applicaton to receive and monitoring data from UDP and works good , but if I can send over 1514 byte in wireshark seeing every fragmented data and full packet good . But in PC doesnt see any packet. Maybe problem is in header or fragmentation .. I dont know.Please help me.My code : void udpinit(void){udp_p = udp_new(); udp_bind(udp_p,IP_ADDR_ANY,port); udp_connect(udp_p, IP_ADDR_BROADCAST, port);}void packet_send(void){ struct pbuf *TxBuffer_p; TxBuffer_p = pbuf_alloc(PBUF_TRANSPORT, sizeof(adc_data), PBUF_RAM);memcpy(TxBuffer_p->payload,adc_data,sizeof(adc_data));udp_send(udp_p,TxBuffer_p);pbuf_free(TxBuffer_p);}#fragmentation #st
Posted on August 13, 2017 at 18:25Hi all,I am not the most skilled when it comes to putting projects together with various libraries. So this entire area is a steep learning curve for me. I am trying to get a FreeRTOS project for the stm32F429i-DISC1 board going using CubeMX to generate the basic FreeRTOS project code then I am hoping to use the uGFX library as I have worked with it a lot in the past.After generating a ''generic'' FreeRTOS project through Cube and adding in all the necessary uGFX libraries I can get uGFX to compile, with one small error. It looks for the header stm32f429i_discovery_lcd.h which I believe is part of the standard peripheral libraries. As such I started again, this time just trying to get a FreeRTOS project to compile whilst including the standard peripheral libraries for the stm32f429i discovery board.I downloaded the STM32F429 discovery firmware package from here http://www.st.com/en/evaluation-tools/32f429idiscovery.html and have th
Posted on December 14, 2016 at 12:11Hello ST,I'd like to ask if there are plans to upgrade the lwIP embedded (1.5) in the Cube to the recent release 2.0.0Meanwhile, I can assure that upgrading an existing Cube project is possible!If someone is interested, I can attempt to remember how I did :D or better, share my whole lwIP directory.This is cool, but when the Cube regenerates the code... bye-bye 2.0.CheersGiuseppe#stm32cubemx* #lwip
Posted on August 07, 2017 at 09:13Hi,I would like to used EEPROM for STM32F301C8. I am used code belowuint32_t READ_FLASH(uint32_tDataAdr){ return *(int32u *)DataAdr;}void WRITE_FLASH(uint32_tDataAdr, uint32_tData){ erase_pages.PageAddress=DataAdr; erase_pages.NbPages=4; erase_pages.TypeErase=TYPEERASE_PAGES; HAL_FLASH_Unlock(); HAL_FLASHEx_Erase(&erase_pages, Error); HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, DataAdr, Data); HAL_FLASH_Lock();}It's not working. Please tell me about EEPROM or How I can learning if I am used to HAL library.#stm #cube-mx #stm32-f3 #hal
Posted on July 28, 2017 at 09:25Hello, i made my own devkits with huge altera and STM32F4/7 micro-controllers.As usual, STM32F479 performing very well, it uses 26b ADR, 32b data lines directly to FPGA.But for some reason code generated by STM32CubeMX does not want to work. I mapped 4 banks of SRAM 16Mx32b to SRAM controllers, but they don't work, at all.I am using this code to test it:&sharpdefine Bank1_SRAM1_ADDR ((uint32_t)0x60000000) // FPGAvolatile uint32_t FMC_ADR_R = 0;volatile uint32_t FMC_ADR_W = 0;volatile uint32_t FMC_R = 0; volatile uint32_t FMC_W = 0; while (1) { *(uint32_t *) (Bank1_SRAM1_ADDR+FMC_ADR_W*4) = FMC_W; *(uint32_t *) (Bank1_SRAM1_ADDR+0) = 0; FMC_R = *(uint32_t *) (Bank1_SRAM1_ADDR+FMC_ADR_R*4); }By using debugger, i am changing FMC_ADR_R, FMC_ADR_W, FMC_W values, and CS goes only single time low during init, after that it keeps high. Adding more del
Posted on August 02, 2017 at 11:42I have a clean slate CubeMX project on a STM32F401C-Discovery board. I have set up the onboard Cirrus audio DAC, and send a hard-coded test signal to it via DMA-driven I2S. I can hear the sound, but it is at wrong frequency. The 2kHz test signal, and the i2s-3 is set to 48kHz samplerate, but depending on how I configure the PLL, I hear 122Hz, 180Hz or 244Hz audio. I have confirmed with a logic analyzer that the I2S protocol runs too slow. The only things I have changed from the CubeMX generated template project is: enable i2c-1 (communication with the DAC, this works)enable i2s-3configure i2s-3 to have a cyclic DMA, 48kHz, 16bits on 32bit dataframeIn the source code, I only initialize the DAC and enable the DMA. No other changes to the generated source are done.The three configurations I tried with: PLLM=4 gives a I2S WS (frame clock) of 2.93kHz, and the 2kHz audio is at 122Hz:With PLLM=6, I see a WS of 4.4kHz, and audio at 184Hz:And with PLLM=8, WS i
Posted on July 31, 2017 at 13:36Hi, I am working on my project which requires to send some data over UART.I have F429ZI Nucleo board with a UART2 configured (see uart2_config image). The UART2 has Interrupts enabled so I can use the HAL_UART_Transmit_IT function.I am passing an array of uint8_t values. Only 4 bytes. The bytes are getting transmitted via the TX pin as expected, but only 7 bits per byte are transmitted. (see tx_8_bits_no_parity image).So I got into the F429xx datasheet (http://www.st.com/content/ccc/resource/technical/document/reference_manual/3d/6d/5a/66/b4/99/40/d4/DM00031020.pdf/files/DM00031020.pdf/jcr:content/translations/en.DM00031020.pdf ) and on page 994 the Table 146 clearly states that when the bits M (length = 8bits) and PCE (parity = None) are reset, the UART frame will be: Start Bit, 8 data bits, Stop Bit.Why is MCU sending only 7 bits when no parity is enabled? So I decided to enable parity in CubeMX and set it to Even.However, the parity bit just tak
Posted on August 01, 2017 at 07:37Hi,the Cube MX Version 4.22.0 don't generate the Middleware/ST correct. The folder tree is correct, but not filled with files.I tested with the L475VGT and add the Virtual Com Port.#middleware #cube-mx #usb-cdc #4.22.0
Posted on July 31, 2017 at 23:37I'm using CubeMX with the STM32F469IIT and trying to select 32-bit wide SDRAM using the FMC but the options only show 8 or 16-bit.Is this correct? I can't see anything in the reference manual about the LQFP176 not being able to do 32-bits. It works for other 469 chips.Thanks.#cube-mx #fmc
Posted on July 27, 2017 at 02:34hello to everyone,before starting a project that involves digital signal processing, I'm doing some tests with the stm32f746g-DISCO to evaluate the capabilities of the board.In particular, i've measured (toggling the GPIOI_PIN_1) the execution time of NOP : 60ns.I'm using the CubeMx and I've properly set up the clock configuration to run at 216Mhz (maximum frequency).Also, i've enabled in the 'Cortex_M7 Configuration' section: TCM Interface, ART ACCELERATOR, Instruction Prefetch,CPU ICache and CPU DCache.I'm a little bit upset, because 60ns for a NOP is in contrast with the idea of a system core clock that runs at 216 Mhz. I'm doing something wrong, I'm sure, but I really don't understand where.I've checked the RCC registers and the content is coherent with the code generated with the CubeMx.Is there any possibilities that I'm in error? In the documents related (datasheet, reference manual, programming manual etc.) there isn't the information that
Posted on July 31, 2017 at 09:13Hi,I simply generate the code using CUBEMX and I switch on CAN1 controller. I try to start the program but it halts on 'MX_CAN_Init()' function. In detail, it doesn't pass the 'while' at line 310, in 'stm32f4xx_hal_can.c'.Is this a bug? Should I follow some preliminary instructions to make it work?Thanks a lot!#can #cube-mx #stm32f446re
Posted on July 30, 2017 at 11:36Hi everybody,my CubeMX project and the code generated are attached.GPIO is initialized as bellow:static void MX_GPIO_Init(void){ /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOG_CLK_ENABLE(); __HAL_RCC_GPIOE_CLK_ENABLE(); __HAL_RCC_GPIOD_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE();}there is no any configuration relating to FSMC.Regards, Rasool#stm32 #fsmc #cubemx #cube
Posted on July 19, 2017 at 16:49Hi. I was running CubeMx4.21.0 and upgrade for 4.22.0This meant an upgrade on the F1 family from 1.4.0 to 1.6.0 (may 2017)have a bootloader configured, so debug should align to 0x8004000 On the new version everything builds just fine it seems like the its ok,howeverIn STM32SystemWorkbench debug mode, the debugger is now starting at 0x8000000. If I use git to specifically roll back the ONLY STM32F1xx_HAL_Driver folder, then debug works just fine. Im guessing there is a define somewhere that causes eclipse to debug from the default location and it is looking for a parameter that is now new-or-missing on the new driver. Any ideas why it works on 1.4 and not 1.6? /David#stm32f1 #cubemx-4.22 #system-workbench
Posted on July 25, 2017 at 04:35HiWhat is the difference Yellow marker and Red marker in CUBE MX?Can I ignore the Yellow message and use that function?I want to use 6 channel of SDADC, but the Yellow message make me confuse.Is there any problem?i attach my CUBE MX project.#cubemx
Posted on July 26, 2017 at 05:52I WANT TO KNOW THE STM32F4 SERIES BOARD HAVING TWO SDIO INTERFACES???ANYONE PLEASE SUGGEST ME......https://community.st.com/community/stm32-communityhttps://community.st.com/community/stm32-community/stm32-forumFahrenkrog.Albertosimon.scullionLappin.Xenaoliverbeirnesergio.sousast.mcu#discovery #stm32f4 #hal #cubemx #stm32
Posted on July 22, 2017 at 00:59I have been using an STM32F030C6 and configuring it with STM32CubeMX and have had success running the chip using the 8MHz HSI and an external 16MHz crystal. I would like to run at 48MHz but I have not had any luck enabling the PLL, at any multiplier. If I enable the PLL in CubeMX, select any multiplier, and upload the unmodified generated code I can only get as far as ''__HAL_RCC_PLL_ENABLE();'' in the debugger (using Atollic TrueStudio free version) before the target stops responding. I get the same result using an internal or external clock source. I have attached a screenshot of my CubeMX clock settings below along with the generated project.Using CubeMX 4.22.0 and STM32F0 1.8.0 firmware package.Are there some other settings that I'm missing somewhere or chip limitations that I am not aware of? #cubemx #stm32f030 #pll
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.