Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hello, I am an engineer working at Desird Arge Design. I had a problem with the STM32G031F6P6 processor. I think there is an error while selecting the timer channels in the STM32 Cubemx application. According to the datasheet description, TIM1; It includes 4 channels and 3 reverseers. When I check the list, I can confirm the information. However, when I use the STM32 Cubemx program for pin selection, the pins cannot be selected, the channel and inverting channels in the alternative pins conflict. Photos are attached. Would you help me with this topic?
I have an application that requires a low BOM cost, hence my selection of the STM32F030C8Tx.My requirements are as follows:2 UARTs operating at a maximum rate of 1152001 UART operating at a rate between 9600 and 1152008 PWM outputs, 8 bits is fine, anywhere between 1 kHz and 10 kHz is OK8 A/D inputs, 10 bit resolution is fine1 I2C channel1 SPI channel2 Digital outputs2 Digital inputsInternal clock will likely be maxed out at 48 MHz unless I can get away with less.The STM32F030C8Tx only has two UARTs. Since the third serial port is only for debugging I was planning on bit-banging it. My guess is I should be able to do 9600 no problem. Again, debug only.The problem seems to be in the requirement to have 8 PWM's and 8 A/D's at the same time. I quickly start losing the ability to have one or the other.My first thought was, OK, bit-bang the PWM outputs as well. If using a timer interrupt this would be a 256 kHz interrupt, which gives me 3.9 microseconds to make eight comparisons and toggle
It only happens when there's an active transfer.The OTG interrupt was called every 3...6uS (300-500 Core clocks @ 96MHz).It seemed crazy excesive to me, that can't be correct!Just to clarify: STM32F411, internal FS controller, cubeIde initialization, host mode (OTG).Checking what interrupt flag was causing the calls, I found the culprit to be the SOF flag.I put a small variable there and traced using SVW: I have SOF disabled in CubeMX, however the code enables it anyway:IDE: STM32Cube IDE v1.6.0 FILE: stm32f4xx_ll_usb.c LINE: 1355 FUNCTION: HAL_StatusTypeDef USB_HostInit(USB_OTG_GlobalTypeDef *USBx, USB_OTG_CfgTypeDef cfg) USBx->GINTMSK |= (USB_OTG_GINTMSK_PRTIM | USB_OTG_GINTMSK_HCIM | \ USB_OTG_GINTMSK_SOFM | USB_OTG_GINTSTS_DISCINT | \ USB_OTG_GINTMSK_PXFRM_IISOOXFRM | USB_OTG_GINTMSK_WUIM);Removing USB_OTG_GINTMSK_SOFM from the mask fixed the problem.I'm still having interrupts every 40uS (around 3000 cpu cycles) caused by the USB_OTG_GINTSTS_RXFLVL
When you configure a USART for the STM32G484 in CubeMX, it gives you a choice of RS485 or Modbus (but not both!). Yet, Modbus RTU runs *on top of* RS485, so this makes no sense. The Modbus configuration appears to put the MCU USART into half-duplex mode. I have seen RS485 implementations that use RTS with an external driver to switch from send to receive, so perhaps the setting in CubeMX is made in consideration of how the provided and instantiated drivers work? Is there any modbus application example (with circuitry?) for CubeMX's "Modbus" configuration or even an external driver configuration?Any thoughts are much appreciated.
CubeMX version 5.6.1, newest F7_FW_1.16.0, use board selector to create an STM32F723e-discovery project, and turn off usb fs host in connectivity and middle ware, only leave usb hs host enabled.then click generate.in generate srcs, navigate to line 386 in usb_core.cUSBH_StatusTypeDef USBH_Start(USBH_HandleTypeDef *phost) { /* Start the low level driver */ USBH_LL_Start(phost); /* Activate VBUS on the port */ USBH_LL_DriverVBUS(phost, TRUE); return USBH_OK; }it activate vbus with "1"(True). jump in to implementation of USBH_LL_DriverVBUS, you can see it simple invoke MX_DriverVbusHS in usbh_platform.c. document comment for these two functions saying the "0"(FALSE) is used for activate. it's the first mismatch.lookup into schematic for F723 board (mb1260_schematics.pdf), the FS and HS use different polarize for VBUS out enable signal.for HS usb host schematic, MX_DriverVbusHS in usbh_platform.c should modify like this:/** * @brief Drive VBUS. * @param state : VBUS st
I've implemented a hello world project, by just using the default settings with CubeMX for the NUCLEO-H723ZG board, then disabling ethernet and USB-to-go, and then adding a yellow LED blink code. Full project and generated code, for STM32CubeIDE:http://www.frank-buss.de/tmp/cubemx-test.zipI then created an array:uint8_t buffer[100000];I can see in the "Build Analyzer" at bottom right that I still have 320 kB RAM_D1:But when I increase the buffer like this:uint8_t buffer[200000];Then I get this compile error:c:\st\stm32cubeide_1.6.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\bin\ld.exe: test.elf section `.bss' will not fit in region `RAM' c:\st\stm32cubeide_1.6.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\bin\ld.exe: region `RAM' overflowed by 70656 bytesSo how can I use the free RAM_D1. I've
After CubeMx 6.2.0 upgrade and firmware to STM32F373VCTx also updated, the CODE GENERATION of my project presents the message:"The Code is successfully generated under : (...) but TrueSTUDIOproject generation have a problem."Compiling de project in Atollic TueStudio generates linking error.The reason is than CubeMX included two versions of the "system_stm32f3xx.c" in the project that definitely did not occur with previous versions.Deleting one of the files allows linking, but this must be done manualy.It is really annoying and impairs firmware development cycle.
Hi,Recently I got nucleo board with mentioned MCU. I've had numerous troubles with generating properly project and finding any sources how to flash the device so few things:Is CubeMX generating code properly for dual core for any toolchain? I've tried Makefile(preferable), SW4STM32 and MDK-ARM and my experiences are as follow:Makefile - some files are added twice to C_SOURCES, so one has to generate project and manually edit the Makefile in order to get rid of mutiple definition linker errors.SW4STM32(regarding examples from cube H7 repo) - no target for flashing at all from the IDE perpective, at least builds pass and can populate flash using st-link utilitySW4STM32(generated cube project) - suppose code is not generated properly (refer point 2. below).MDK-ARM - flashing generated code with blinky funtionality results in nothing but 'error 129: MapMem - map size truncated to 128MB'GPIO labels are not generated by the cube... seems like gpios are also not initialized at the generated c
After upgrading the IDE to version 1.5.1 within the eclipse IDE, the CubeMX built in tool auto generates this file. This conflicts with the one in src (same function is defined in both places). I had to temporarily exclude the folder from build for it to compile properly. My collogues who also have the same version of the software do not have this issue.
Hi,I have the STM32L412CBT6 in a product and now discover that it is going obsolete.There is a STM32L412CBT6P version (Note the P at the end) that is available from the usual suppliers.What is the difference between these two parts?When looking at the latest datasheet (Nov 2020), the 64pin version has a VDD12 (I believe this is what makes it the P version) but for the 48pin package, there is no mention of the VDD12.Does the new STM32L412CBT6P have a change in pin functionality or internal functionality?Thanks,Neil.
I have setup RTC wakeup functionality and generated code with CubeMX.The code does not work straight away, because imr1's mr20 in EXTI IMR1 register was not unmasked. I suppose this is a bug and should be handle by STM. It took some time to figure that out and that is not what you expect from automatic code generator.Note! This is just a bug report and notice for everyone who faced same issue./* RTC init function */ void MX_RTC_Init(void) { /** Initialize RTC Only */ hrtc.Instance = RTC; hrtc.Init.HourFormat = RTC_HOURFORMAT_24; hrtc.Init.AsynchPrediv = 127; hrtc.Init.SynchPrediv = 255; hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE; hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH; hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN; if (HAL_RTC_Init(&hrtc) != HAL_OK) { Error_Handler(); } if (HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 7, RTC_WAKEUPCLOCK_RTCCLK_DIV16) != HAL_OK) { Error_Handler(); } /* Adding this line
Dear all: I want to use STM32CubeMx or STM32CubeIDE to generate official demo of the this board, but not find that at STM32CubeMX->New Project->Example Selector->Board. Thank you!
CubeMX (currently 6.2) does not allow to enter more than 384KB (393216 bytes) for FreeRTOS TOTAL_HEAP_SIZE when using a STM32F767 (and maybe other F76x devices). This appears to be based on SRAM1 + SRAM2 size, but the first area of RAM, and where the heap gets located, is DTCM RAM. All three are linearly mapped, so it seems appropriate to allow up to the whole 128 + 368 + 16 = 512KB as FreeRTOS heap.If I manually edit the .ioc file to use more than 384KB the system seems to work, so it just seems to be an incorrect limit.
There is any issue while generating ethernet code using STM32 cubeMX. The tool chain I am using is TrueStudio. Please help. lwip initialization code is below.void MX_LWIP_Init(void){IP_ADDRESS[0] = 192; IP_ADDRESS[1] = 168; IP_ADDRESS[2] = 100; IP_ADDRESS[3] = 1; NETMASK_ADDRESS[0] = 255; NETMASK_ADDRESS[1] = 255; NETMASK_ADDRESS[2] = 255; NETMASK_ADDRESS[3] = 0; GATEWAY_ADDRESS[0] = 192; GATEWAY_ADDRESS[1] = 168; GATEWAY_ADDRESS[2] = 100; GATEWAY_ADDRESS[3] = 3; /* Initilialize the LwIP stack with RTOS */ tcpip_init( NULL, NULL ); /* IP addresses initialization without DHCP (IPv4) */ IP4_ADDR(&ipaddr, IP_ADDRESS[0], IP_ADDRESS[1], IP_ADDRESS[2], IP_ADDRESS[3]); IP4_ADDR(&netmask, NETMASK_ADDRESS[0], NETMASK_ADDRESS[1] , NETMASK_ADDRESS[2], NETMASK_ADDRESS[3]); IP4_ADDR(&gw, GATEWAY_ADDRESS[0], GATEWAY_ADDRESS[1], GATEWAY_ADDRESS[2], GATEWAY_ADDRESS[3]); /* add
CubeMX generated code does not align MDMA linked list nodes to double word addresses as required. This prevents MDMA from functioning when using linked list mode.
A few days ago I installed STM32CubeMX 6.2.0 on macOS Big Sur 11.2.3. I removed it because I got a message in the virus checker today that malware was found in uninstaller.jar. It is no longer possible to uninstall. I downloaded SetupSTM32CubeMX-6.2.0-RC3.app. The virus checker is Intego VirusBarrier Scanner. Which one is the problem?Also, I would appreciate it if you could teach me how to deal with it.
chip: F103VET6IDE version: STM32CubeIDE v1.6.0 Build: 9614_20210223_1703 (UTC)Firmware Package : STM32Cube FW_F1 V1.8.3Lib: low layer driverin GPIO Configuration: �?GPIO output level �? generate code BEFORE GPIO_init, that makes LL_GPIO_SetOutputPin invalid.---------------------------------------------------------------------------------------------------void MX_GPIO_Init(void){ LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; /* GPIO Ports Clock Enable */ LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOB); LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOA); /**/ LL_GPIO_SetOutputPin(GPIOB, LEDG_Pin|LEDB_Pin|LEDR_Pin); /**/ GPIO_InitStruct.Pin = LEDG_Pin|LEDB_Pin|LEDR_Pin; GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT; GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_HIGH; GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL; LL_GPIO_Init(GPIOB, &GPIO_InitStruct);}
I have a Keil MDK project which outputs a library mc_comms.lib. I have another Keil project which uses this library and there are any issues. My customer is using STM Cube and can't build the same test project with the same library. Here are the errors:c:\st\stm32cubeide_1.6.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\bin\ld.exe: cannot find -lB:/STM32/G4/Examples/CubeIDE_1_6_0/zti_lib/zti_lib/lib/mc_comms.libc:\st\stm32cubeide_1.6.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\bin\ld.exe: cannot find -lB:\STM32\G4\Examples\CubeIDE_1_6_0\zti_lib\zti_lib\lib\mc_comms.libFYI: b:\STM32\G4\Examples\CubeIDE_1_6_0\zti_lib\zti_lib\lib>dirVolume in drive B is homeVolume Serial Number is 4D4B-F115Directory of b:\STM32\G4\Examples\CubeIDE_1_6_0\zti_lib\zti_lib\lib03/18/2021 11:34 <
hello,i use a NUCLEO-G071RB board and want to route the internal HSI16 clock to MCO pin (Pin12).First i created a board project with CubeMX and aktivated the MCO pin. Then i set HSI16 as default clock and routed the clock signal to MCO pin. After code generation and starting the programm i cant measure a signal on MCO pin.
osram_init(3,1,2,6); // Initialized with Prescaler=3, HighSelect=1, tRWR=2,tACC=6, MemoryMap, refer to CUBE-MX L4R9Eval OSPI_MemoryMap example Project uint8_t* mem_addr = ( uint8_t * )( OCTOSPI1_BASE + 0 ); *mem_addr = 0xF0; *(mem_addr+1) = 0xF1; *(mem_addr+2) = 0xF2; *(mem_addr+2) = *(mem_addr+1); // 0x90000002=0xF1? Work *(mem_addr+3) = *(mem_addr+1); // 0x90000003=0xF1? does'nt work *(mem_addr+4) = *(mem_addr+1); // 0x90000004=0xF1? work // desc order *(mem_addr+2) = 0xF2; // ok *(mem_addr+3) = 0xF3; // error, set to 0x90000002 *(mem_addr+4) = 0xF4; // ok *(mem_addr+1) = *(mem_addr+2); // 0x90000001=0xF2? error. value set to 0x90000000 *(mem_addr+1) = *(mem_addr+3); // 0x90000001=0xF3? error. value set to 0x90000000 *(mem_addr+1) = *(mem_addr+4); // 0x90000001=0xF4? error. value set to 0x90000000 can't assign value by access it's self. can someone help me?
If I want to create C++ project from Cube configurator then after my intentions it says that it is done (picture 1). After that it says that not all the necessary firmware pacakges is downloaded (picture 2). In the end it gives me empty project with .ioc file and do nothing (picture 3). But if I try to generate code after configuring everything - it's ok. There will be code.
..
STM32CubeMX does not copy custom_motion_sensors.c and custom_motion_sensors_ex.c files when the code is created. Has anyone come across this issue, if yes what was the issue? I have checked in and out but unable to find the issue. I have checked the Free Marker template files and all looks okay. Please see below for more details RegardsShaun
The code generated by CubeMX uses 2 spaces as an indentation. I think it is safe to say that the overwhelming majority of developers are expecting 4 spaces or a tab for indentations.Is there any way to change this configuration in CubeMX? This seems like an incredibly easy change for ST to make, or allow it to be configuration.I see in the code generator settings there is something about templates, but no explanation as to what it is or what type of file is used as a template. Is this configuration encoded in there somehow?Thanks!
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.