Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
After the latest CubeMX update, where are the packages now stored? I have been using revision control on 'C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX\packages' and am curious, I no longer see updates here
Why does Keil run crash when debugging with KEIL project generated by STM32CubeMX 5.0?
How can I access the example peripheral projects for the STM32F091RC? I am using TrueSTUDIO & System Workbench and have looked exhaustively, are these available?
Hello,I am trying to interface USB Mass Storage with external Flash. I have implemented the complete structure that is necessary as below,typedef struct _USBD_STORAGE { int8_t (* Init) (uint8_t lun); int8_t (* GetCapacity) (uint8_t lun, uint32_t *block_num, uint16_t *block_size); int8_t (* IsReady) (uint8_t lun); int8_t (* IsWriteProtected) (uint8_t lun); int8_t (* Read) (uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len); int8_t (* Write)(uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len); int8_t (* GetMaxLun)(void); int8_t *pInquiry; }USBD_StorageTypeDef; USBD_StorageTypeDef USBD_MSC_Template_fops = { FLASH_Init, FLASH_GetCapacity, FLASH_IsReady, FLASH_IsWriteProtected, FLASH_Read, FLASH_Write, FLASH_GetMaxLun, (int8_t *)UMSC_FLASH_Inquirydata, };In addition, I have defined all the functions that performs flash operations (i.e read/write operations, initialization etc). I have also passed the structure to USB register,
Posted on October 10, 2017 at 21:22 I would like to see CubeMX support for SD cards + FatFS using an SPI driver option. Both for MCUs that don't don't support SDIO and also on MCUs that have SDIO but where SPI fits the project better. FatFS is there as 'user defined' forall. SDIO option is there where supported. Why not add SPI option under FatFS? Seems like would be pretty minor to the follow the templates used in SDIOfor SPI. Certainly would make it easier to get an stm32 project doing FatFS on SD! #cubemx #sdio #spi #sd-card Note: this post was migrated and contained many threaded conversations, some content may be missing.
..
Hello,i try to get a most simple I2C driver to work. So, i setup I2C1 with CubeMX and select code generation.In the resulting main.c, all i have to do is to add something like that: /* USER CODE BEGIN WHILE */ while (1) { uint8_t value = 0; for (uint32_t i = 0; i < 100000; i++) asm("NOP"); HAL_I2C_Master_Transmit(&hi2c1, (uint16_t)(0x27 << 1), (uint8_t*)&value, 1, 100);This should be enough to see anything an my data logger, shouldn't it?But all i see is SCL and SDA staying hijgh - no glitch no change.Before you ask: The hardware is working as expected. I have this same device running with a Standard Peripheral Library driver (where i did hardware initialization by myself) wijthout problems.So, what do i miss in this CubeMX project?Best regards,SF49ers
Title says almost all:I have had a project which needs support package migration. I hit cancel and the project disappeared from the home screen and the File -> recent projects menu as well. I am using 5.0.0 version on Linux
Hello all,I'm encountering an issue with a custom board I've made with a STM32L011D3 MCU on it.I am trying to run a very simple blink program to check the global functionalities. It looks like the code generated with STM32CubeMX does not work for the systick config, as my code uses HAL_Delay and never returns from the function. I am using STM32CubeMX with makefile, then a Bla*ck Mag*ic Probe with gdbserver on it to load my .elf software on the STM32L0. I can debug my software and I can see I get stuck in HAL_Delay(500) function call.I think there is some configuration for the clock that I must have missed in STM32CubeMX ? Here is my main.c code : /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** ** This notice applies to any and all portions of this file * that are not between comment pairs USER CODE BEGIN and * USER CODE E
Hi,I was working with CubeMX v4.27.I've installed CubeMX v5.0.0, and loaded an existing project.When trying to generate code I encounter problems during download some item CubeMX requires.Please find attached screen shots.Thanks,Aviv
I believe I have found a serious code creation bug in STCubeMX concerning PLL initialization on (at least) STM32F767ZI MCUs. Additionally, I take issue with some pre-processor macros used for register manipulation that allowed the code creation bug to become a very serious issue. Please read the detailed description.We created code using the CubeMX tool and have soon discovered the following symptoms:With compiler optimizations enabled (-O3), the MCU's timers ran with double frequency after a power-cycle. If you reset (while keeping the power enabled) the timer frequency would be correct.Analysis showed, during init of the RCC subsystem some register values are set incorrectly. Namely the RCC_DCKFGR1 register, which controls some clock muxes and prescalers for peripherals. Please have a look at this piece of Cube generated init code taken from the SystemClock_Config() function in "main.c"Exhibit A: PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USART1|RCC_PERIPHCLK_SAI1|RCC_P
I generate a project for processor: STM32L4A6VGT6 and open it in Atollic TrueStudio and start debugging with ST-Link (V2). The processor excutes, stops at main, as it should. I can step through the initializations correctly. After the last function (in a very simple project) the SystemClock_Config() function starts execution and at the end of this funcion, instead of going to the next C instruction of "while(1) " the processor goes somewhere from where it does not returnAm I missing some a step in using the CubeMx generated project in TrueStudio?
Posted on November 15, 2017 at 13:20Hello Community,currently i'm starting development with Nucleo-H743ZI. I'm using STM32CubeMX V4.22.1 andAtollic True Studio V8.0.0 on Win10.I'm creating a new CubeMX project. Under Board Selector i'm selecting the Nucleo144NUCLEO-H743ZI as target.1. First i fixed pinning in the Pinout Tab.Under USB_OTG_FS i do the following settings:- Mode: Device Only- Activate_VBUS: VBUS sensing- Activate SOF: YesUnder SYS:- Debug: Trace Asynchronous SWUnder RCC:- HSE: Crystal/Ceramic Resonator- LSE: Crystal/Ceramic ResonatorUnder MiddleWares:- Class for FS IP: CDC (VCP)2. Second i go to Clock Configuration:- Setting HSE Input Frequency to 8MHz- PLL Source Mux: PLL source is HSE- PLL1: DIVM1=4; DIVN1=400; DIVP1=2- System Clock Mux: switch to PLLCLK (on SYSCLK appears 400MHz)- Prescaler for core/peripherals: D1CPRE=1; D1HPRE=2; HPRE=2; D1PPRE=2; D2PPRE1=2; D2PPRE2=2; D3PPRE=2- PLL3: DIVM3 = 4; DIVN3 = 192; DIVQ=8 (right to DIVQ3 48MHz appears)- USB Clock Mux: selec
Hi, I am looking to calculate the power consumed by the MCU STM32F469NIH. The CubeMX tool has a power consumption calculator with the flexibility to select the peripherals used. Apparently when I calculate using CubeMX with all the peripherals selected, the tool says that MCU consumes 120mA of current. When I check the data sheet the VDD and IDD power lines together consume 390mA of current which is far more than the CubeMX value of 120 mA. I am in a dilemma as to which one of these two sources is close to the real values. Please help, Your input is much appreciated. Thank you.
I created a plain project using cubemx (v4.27.0) with lwip, mbedtls and freefrtos,. I just tried to compile a fresh, clean project (with no additional code) with no success:linking... Project\Project.axf: Error: L6218E: Undefined symbol time (referred from ssl_cache.o). Not enough information to list image symbols. Not enough information to list load addresses in the image map. Finished: 2 information, 0 warning and 1 error messages. "Project\Project.axf" - 1 Error(s), 1 Warning(s). Target not created.
Has anyone managed to use the lwIP Stack without an RTOS but still using it in an interrupt manner?As it is not allowed to choose interrupt mode while not configuring freeRTOS in CubeMX I assume that it is not possible using it that way.Thanks a lot for your answers.
When enabling a peripheral in STM32CubeMx (switch from disable to enable) Does this mean that its clock wil be activated in the program after generating the initialization code for a given IDE and we don't need to insert the __HAL_RCC_peripheral_CLK_ENABLE() function ? thank you Wissem
HelloIt may stop with the interrupt routine of HardFault_Handler.MCU: STM32F446VCTxTools: CubeMXIDE: IAR Embedded Workbench IDEThis routine is in stm32f4xx_it.c.void HardFault_Handler(void) { /* USER CODE BEGIN HardFault_IRQn 0 */ /* USER CODE END HardFault_IRQn 0 */ while (1) { } /* USER CODE BEGIN HardFault_IRQn 1 */ /* USER CODE END HardFault_IRQn 1 */ } Currently the status of the following registers is confirmed.CFSR: Settable Fault Status Register INVSTATE bit is 1.BFAR: The bus fault address register is 0xE000EDF8.Registers above seem to be involved.If you have detailed information, please explain the comment.Attention, I am Japanese. This content is based on Google translation.
Hi, Does any one know that how to add OEM CANopen driver in to existing CubeMx+ARMMDK project.History:I have started project by using CubeMx to configure required pins and peripherals. It is working ok. Even I have configured required CAN pins using CubeMx. CubeMx is does generate HAL CAN related code. Now we have decided to use OEM CAN library. So do I have to remove MX_CANx_Ini call and use OEM CAN driver initiation code? Has any one tried to mix HAL and OEM driver code in one project ?If so then what should I take care of.
Posted on February 15, 2018 at 04:53STM32CubeMX Version: 4.24.0Target MCU: STM32F103RFTx LQFP64Target IDE: Atollic TrueStudioSteps to reproduce: Start with a valid, working .ioc fileSelect Save and Generate CodeThe first time, it successfully generates the codeNote that the VCS reports changes to certain files (eg .cproject, .project, *.elf.launch, main.h, main.c) have been applied as expectedWithout changing anything at all in CubeMX, select Generate Code againThis second time, an error occurs:'The Code is successfully generated under C:/ProjectX/Firmware/MainBoardbut TrueSTUDIOproject generation have a problem'The tail of the log file shows the exception:...2018-02-15 14:43:53,475 [INFO] CodeEngine:179 - oldGeneratedFile, C:\ProjectX\Firmware\MainBoard\Src\main.c_save2018-02-15 14:43:53,690 [INFO] CodeEngine:197 - Generated code: C:\ProjectX\Firmware\MainBoard\Src\main.c2018-02-15 14:43:53,902 [INFO] ProjectBuilder:1243 - Time for Copy HAL[2] : 8mS.2018-02-15 14:43:53,913 [INFO
HiI used STM32CubeMX (4.27.0) to generate the files for the STM32L433CB and noticed that in the link script (STM32L433CB_FLASH.ld) the memories are incomplete (RAM2 "is" in RAM).I checked the examples of STM32Cube_FW_L4_V1.13.0 (NUCLEO-L433RC-P) and they are different (RAM2 is separated ).The end of RAM (_estack) and some ALIGN are different too.On Release Notes for NUCLEO-L433RC-P Templates (and LL) there is the following entry:V1.13.0 / 27-July-2018Main Changes - Correction of stm32l433xx_flash.icf RAM sections definitionI suppose that the update was not replicated on STM32CubeMX.Shouldn't the generated link script be the same as the template?Best Regards,Carlos
Hi,Since cubeMX 4.27, in the function of MX_RTC_Init() there are no more /* USER CODE BEGIN RTC_Init X */ to add code.We need this to add test is there is an external battery to save the calendar.Regards,Sébastien
I'm starting a project working with hoverboard motors and came across this MCU+gate driver combination. How would I go about programming this? I cannot see this chip in CubeMX.
It would be nice to see the baud rate's error percentage (especially for asynchronous serial peripherals) when setting the desired baud rate in the peripheral's configuration dialog.For example, I'm setting 115200 Bits/s for USART1, STM32CubeMX knows that I have oversampling enabled, and my USART1 is clocked by PCLK2 which is 8Mhz. So it can calculate:BRR = 8,000,000 / 115,200 = 69.44 = 698,000,000 / 69 = 115,942.02(115,942.02 / 115,200) * 100 = 100.64So the error percentage is +0.64%Depending on the error percentage, it can also become a warning when it's too much.Thanks!
Posted on September 04, 2017 at 12:58I'm trying to get the DMA + SDMMC to write to an SD Card using the HAL_SD_WriteBlocks_DMA() function. After I call the function, the HAL_DMA_GetState() function never returns HAL_DMA_STATE_READY, and the same is true for HAL_SD_GetState(), meaning all subsequent calls to the SDMMC fail.I attached Data, Clock and Cmd to an Oscilloscope (the wires from the board to SD card), and I don't register any activity on the Data and Cmd lines in the above case. So no data is written.Firmware: Using Cube, 1.8.1, SDMMC is clocked at 48Mhz, the DMA at 80Mhz. Transfer using 1 Data line. Interrupts are set for both TX, RX and there is a global SDMMC interrupt with a higher priority than TX and RX.DMA: TX uses DMA2 Channel 4, RX uses DMA2 Channel 5. HAL_SD_ReadBlocks_DMA, HAL_SD_ReadBlocks, and HAL_SD_WriteBlocks all work. I modified the BSP_SD_WriteBlocks_DMA function to wait for the DMA and SDMMC to finish before retur
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.