Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Posted on July 06, 2018 at 13:47I use Rowley (personal favorite), IAR and Atollic depending on the customer's requirements. I have a project which I am trying to work on now in Atollic. I have in Atollic the STM32CubeMX perspective version 4.25. Outside for the other environments, I have upgraded to 4.26, and have worked on a project there which I now need to put into Atollic. I am forced right now to work on it in the stand-alone STM32CubeMX, because the upgrader in Atollic is telling me that I have the latest version. but when trying to load the project complains that it was made with a newer version and to please upgrade first.#stm32cubemx. #atollic-truestudio-windows
Posted on April 17, 2018 at 13:13Hi All,I am working on Ethernet in STM32H7 and I am unable to understand two things :1) What is the need to avoid memory allocation of ETH_Tx and ETH_Rx Desc in D1 SRAM ?I have seen an example in 'STM32Cube/Repository/STM32Cube_FW_H7_V1.2.0/ Projects/STM32H743I_EVAL/Applications/LwIP/LwIP_TFTP_Server' where they have allocated memory of ETH_TX and ETH_RX Desc in D2 SRAM3 (Address: 0x30040000) so why cannot i choose* D2 SRAM1( Address: 0x3000000) or* D2 SRAM2 ( Address: 0x30020000) or* D3 SRAM ( Address: 0x3800000) ?2 ) Also, I have seen in the repository example that they have used MPU_Config() but its not too much clear as i have seen a related doc which is again quite hard to understand so kindly put 'enough' light so that we can understand the significance and use case of it in this example.Sincerely,Manish#stm32cubemx-ethernet
Generation without migration deletes all sources.New projects created will not function the second canbus is enabled.This has stopped all development on the 6 computers that were upgraded so far.
Posted on June 28, 2017 at 22:16I am using CubeMx (HAL driver)for initialization code generation and using HAL libraries/functions after that. The MCU is https://community.st.com/message/97161?sr=search&searchId=101014d1-ce3e-4537-930e-04009467924a&searchIndex=2 I am having problem with the mailto:I@C peripheral. It is a custom board and for the time being, no external device is attached to the I2C pins. The pins are just pulled up using pull-up resistors. I am trying to use it in master transmit/receive mode. After MX_I2C1_Init() is executed : - Observations: Using an oscilloscope, i can see that there is no clock signal on SCL pin. The voltage at the SCL pin is always LOW. The voltage on the SDA pin is always HIGH. And I2C1 -> ISR-> BUSY flag is SET.Below I have copied portion of the code from main() function:int main(void){ HAL_Init(); /* Configure the system clock */ SystemClock_Config(); /* Initialize all configured peripherals */ MX_GP
Posted on July 11, 2018 at 07:31HelloI want config STM32F107vct6 in cubemx to use RMII+DP83848+LWIP without oscilator(I connect PA1 and PA8 to X1)but in STM32CubeMX->Configuration->ETH->External PHY configuration->PHY is LAN8742A_PHY_ADDRESS and can not find DP83848If i must define User PHY , how do it?My DP83848My Config#rmii #cubemx #lwip #dp83848
Posted on July 12, 2018 at 20:57I have a SPI device that I want to operate in 8-bit mode during configuration, but then switch over to running in 16-bit mode with DMA during normal operation.Is there a way to get CubeMX to generate more than one MX_SPIx_Init() function so that I can re-initialize the peripheral between config and normal operation?#configuration #cubemx #reinit
Posted on April 19, 2018 at 18:11Hi,i have working HID example with me. But i was trying to integrate CDC class in the existing HID class. I am using cubemx code. After initializing and flashing i got the error as 'Device Descriptor Request Failed' .I am confused to initialize the USB driver for HID and CDC as well at the same time. Is it fine if i initialize the code for HID and CDC separately? Or i will have to initialize both code at the same time. Do i have to use different USB structure that is USBD_ClassTypeDef . ?Here is my usb descriptor file./* USB HID device Configuration Descriptor */__ALIGN_BEGIN static uint8_t USBD_HID_CfgDesc[USB_HID_CONFIG_DESC_SIZ] __ALIGN_END ={ 0x09, /* bLength: Configuration Descriptor size */ USB_DESC_TYPE_CONFIGURATION, /* bDescriptorType: Configuration */ USB_HID_CONFIG_DESC_SIZ, /* wTotalLength: Bytes returned */ 0x00, 0x03, /*bNumInterfaces: 1 interface*/ 0x01, /*bConfigurationValue: Configuration value*/ 0x0
Posted on July 10, 2018 at 19:25Hello, can somebody share the most efficient steps to convert non-MX project to a STM32CubeMX structured one? Most (or all?) of the Cube examples are not MX-generated hence they are not structured accordingly. So far my procedure has been : start from generating my board configuration main template, then manually bringing the code which I need from Cube examples. After the imported code works I test it in terms of ability to reconfigure in CubeMX and it breaks the compilation quite often . This requires painstakingly go through the code yet again making changes, sometimes even in the driver files.Is there any documentation or a post on the best practice to convert a working code to STM32CubeMX generated project?#stm32cubemx #code-migration
Posted on July 05, 2018 at 10:42Greetings everyone, I encountered a problem with CAN bus during individual work with STM microcontrollers. First of all I would like to give you some information on what I use.-I am using a microcontroller STM32f091CCTx-I use CubeMx software. What I want to do is to view the CAN data from the CAN output of my card with PCAN Viewer.However, I can not get a result despite my long efforts and I open this post to discuss its reasons. First I want to share my CubeMx settings.I set the PB8 and PB9 outputs to Can Rx and Can Tx in the microcontroller schematic.I have chosen HSE crystal in the RCC as a clock because I have always seen it in similar cases.When I look at the clock settings, I learned that FCLK is used for the CAN bit rate setting. I set the clock rate to be 36Mhz according to the settings in the prescalar table because the bit rate I want to work is 500kbit/sec.To adjust the CAN settings, I made the Prescaler sett
Posted on July 11, 2018 at 10:15Dear Community,I am new to the STM32, have used the Renesas platform in the past, it seems to me that the STM32 HAL is using precious (S)RAM memory for information that could be considered constant.For each peripheral that you configure in Stm32cubemx there will be a handle in main.c like so:/* Private variables ---------------------------------------------------------*/UART_HandleTypeDef huart2;UART_HandleTypeDef huart3;The size of UART_HandleTypeDef turns out to be 128 bytes, each one of them... And no, this memory is not used as a data buffer to read/write to the uart. B.T.W. DMA_HandleTypeDef is 120 bytes as such using a UART with RX and TX DMA will cost you....Looking at the definition of UART_HandleTypeDef it turns out that some fields are indeed used to keep track of dynamic information (transfer state etc). However a lot of them could be considered constants, so why are they in RAM?Would it not be more efficient/flexible to generate multiple str
Posted on October 14, 2016 at 11:19References : STM32CudeMX 4.16.0 STM32Cube_FW_F1_V1.4.0 STM32F103CBT6 The project uses FREERTOS. Hi All, Once CAN is configured and filters are set, I call HAL_CAN_Receive_IT : OK On receiving a CAN frame, HAL_CAN_RxCpltCallback is called : OK In HAL_CAN_RxCpltCallback, a signal is sent to a thread to handle the frame. The thread receiving the signal, reads the frame an then calls HAL_CAN_Receive_IT for next frames : OK At some time, the application calls HAL_CAN_Transmit_IT to send a frame : OKWhen the frame is sent, HAL_CAN_TxCpltCallback is then called : multiple times... It is not only called when the frame is sent, it is also called when a frame is received, because in stm32f1xx_hal_can.c, the function HAL_CAN_Receive_IT enables ''Transmit mailbox empty Interrupt'' ( CAN_IT_TME ). I think it should not ! All CAN IRQ Handlers generated by STM32CudeMX calls the same function HAL_CAN_IRQHandler in stm32f1xx_hal_ca
Posted on July 09, 2018 at 12:32 STM32Cube V1.0 / Version 4.0 It does this: LL_ADC_REG_SetSequencerRanks(ADC1, 1, LL_ADC_CHANNEL_TEMPSENSOR); Should be : LL_ADC_REG_SetSequencerRanks(ADC1, LL_ADC_REG_RANK_1, LL_ADC_CHANNEL_TEMPSENSOR); Fix: Insert in 'ADC-STM32F1xx_DefMapping.xml' the following lines at the end of the file before </HALvsLL>: <Item Name='Rank' NewName='Rank' NewValue='LL_ADC_REG_RANK_1' Type='RefParameter' Value='1'/> <Item Name='Rank' NewName='Rank' NewValue='LL_ADC_REG_RANK_2' Type='RefParameter' Value='2'/> <Item Name='Rank' NewName='Rank' NewValue='LL_ADC_REG_RANK_3' Type='RefParameter' Value='3'/> <Item Name='Rank' NewName='Rank' NewValue='LL_ADC_REG_RANK_4' Type='RefParameter' Value='4'/> <Item Name='Rank' NewName='Rank' NewValue='LL_ADC_REG_RANK_5' Type='RefParameter' Value='5'/> <Item Name='Rank' NewName='Rank' NewValue='LL_ADC_REG_RANK_6' Type='RefParameter' Value='6'/> <Item Name='Rank' NewNa
Posted on July 09, 2018 at 23:48generating STM32cubeMX from existing eclipse-project#generating-stm32cubemx-from-existing-eclipse-project
Posted on June 30, 2018 at 23:23Hello,I have a custom PCB with a STM32F042F4P6.The STM32 keeps resetting at a rate of 2.5 Hz. I measured this with a scope on the NRST pin.After a long search i found out that the IWDGRSTF flag is set after each reset. This is strange, because i never enabled the IWDG or WWDG in CubeMX v4.23. I also do not see anything about a set up of a watchdog in the generated code. Further, after i erase the chip in ST-Link utility, the STM32 is still resetting (at a constant rate of >600hz).NRST pin is pulled up on the PCB with an 43k ohm resistor.Attached a screenshot of the IWDG and the CSR register.What I tried so far: I Striped down my PCB; I removed the external oscillator and other IC's.I soldered a brand new STM32 on my PCB (couple of times)In CubeMX i made the most basic configuration possible.I swapped the pull up resistor for a 4.7k and 10k resistor.But still the STM32 keeps resetting..Is there something i overlooked?Many thanks,Thomas#clock #pll
Posted on July 08, 2018 at 11:54Hi,i am facing some basic problem while working with cubmx. i had used cubemx earlier and it was working fine.after month i again started using it, i am facing problem.before month i configured usb, uart and adc as well it was working and now even led is not blinking.please help me with this what am i missing.attached is the configurations.#stm32f103-hal #cubemx
Posted on July 03, 2018 at 07:41After upgrading to STM32CubeMX 4.26 I found, that System Workbench project generated by CubeMX, doesn't produce .bin file during build. Output directory contains .elf and .hex file. In previous versions there was also .bin file. What happens when such project is executed? Does it burn .elf file to device flash memory? For the same project, bin file has 90 KB size, and elf file is 2900 KB size.Project generated by old CubeMX version prints this during build:arm-none-eabi-objcopy -O binary 'rcu.elf' 'rcu.bin'Project generated by CubeMX 4.26 prints:arm-none-eabi-objcopy -O ihex 'rcu.elf' 'rcu.hex'Steps to reproduce: Create new STM32CubeMX project, select any board or MCU, in my case this is STM32469I-EVAL. Select SW4STM32 toolchain.Generate code. Import generated project to System Workbench for STM32. Build the project. Output Debug directory doesn't contain .bin file.Environment: STM32CubeMX 4.26.0, STM32Cube_FW_F4_V1.21.0, System Workbench for STM32 Vers
Posted on July 08, 2018 at 03:39Hello, there are two approaches outlined in the UM1718 user manual using STM32CubeMX to migrate a project to another MCU of the same family:1. CH. 7.9 Importing a project to another MCU in the CubeMX by creating a new project with targeted MCU and then modify / tune up all the components before generating a project and then manually update all user code spread over the project files.2. Ch. 11 By exporting: Open the available project in CubeMX, change it to a compatible MCU from the list, make necessary changes and then generate update to the project.The end result of both is the same yet the sequence is different. Board/chip related generated code in the project is changed the same way in both approaches and user code should be changed accordingly if pins / clocks have been changed after the project has been generated.What approach is recommended for what scenarios? Consider the migration of the Cube HAL example code and another more i
Posted on June 06, 2018 at 07:57I want to generate center aligned pwm in stm32f030k6tx but when i am chosing the option of center aligned in counter mode than it is converting it in edge aligned mode.So can any help me in how to generate central aligned pwm.#stmcubef0 #stmcubemx #tim-pwm #stm32f030k6tx
Posted on June 25, 2018 at 17:16I have configured CubeMX to backup files before generating any new code and now not only has it not backed up anything but it deleted all my custom libraries as well! Also all the code under the 'USER CODE' delimiters is also gone. The only change I made was enable the ADC and it just wiped everything off resetting it to its original creation state. Is there any way to get my code back? That is almost a week's work. I use TrueStudio and I've attached the project folder here.#cubemx-4.26
Posted on July 05, 2018 at 12:44I have used CubeMX (version 4.26.0) to generate my project for an STM32F746ZET (on a custom board) and as part of that I have enabled SDMMC. When I run my project the generated function MX_SDMMC1_SD_Init fail with a timeout when there is no SD card inserted (if a card is inserted the init works correctly).I wasn't expecting this to fail as surely is shouldn't be mandatory for an SD card to be fitted, this will be user fitted if required.I believe our custom hardware is correctly setting the detect line based on whether the card is inserted or not. So my guess is that I need to configure something in CubeMX to use the card detect pin, is this correct? If so what do I need to do?Thanks.#cubemx-4.26 #card-detect #sdmmc #sd-detect
Posted on June 21, 2018 at 15:20Hi friends;I using CubeMx 4.26.0 and Atollic TrueSTUDIO� for STM32 Version: 9.0.0When I create a project, it creates it with a virtual folder.How can we solve this problem?#virtual-folder #cubemx
Posted on April 25, 2018 at 10:17We encountered a problem with CubeMx and I2C Low Layer libraray on an STM32F413RH.The code fall in an assertion.The initialization from CubeMx : I2C_InitStruct.PeripheralMode = LL_I2C_MODE_I2C; I2C_InitStruct.ClockSpeed = 100000; I2C_InitStruct.DutyCycle = LL_I2C_DUTYCYCLE_2; I2C_InitStruct.OwnAddress1 = 0; I2C_InitStruct.TypeAcknowledge = LL_I2C_ACK; I2C_InitStruct.OwnAddrSize = LL_I2C_OWNADDRESS1_7BIT; LL_I2C_Init(I2C1, &I2C_InitStruct);The assertion in stm32f4xx_ll_i2c.c, line 173:uint32_t LL_I2C_Init(I2C_TypeDef *I2Cx, LL_I2C_InitTypeDef *I2C_InitStruct){ LL_RCC_ClocksTypeDef rcc_clocks; /* Check the I2C Instance I2Cx */ assert_param(IS_I2C_ALL_INSTANCE(I2Cx)); /* Check the I2C parameters from I2C_InitStruct */ assert_param(IS_LL_I2C_PERIPHERAL_MODE(I2C_InitStruct->PeripheralMode)); assert_param(IS_LL_I2C_CLOCK_SPEED(I2C_InitStruct->ClockSpeed)); assert_pa
Posted on July 03, 2018 at 11:25Hi All; Now I create my project for lower consumption. I would like to know about Step Duration. How should I set it?. #stm32 #power-consumption #power-consumption-calcurator
Posted on July 03, 2018 at 10:15 Hello, I'm using a STM32F303RB on a project. I need to rotate a small and low power BLDC motor. I don't need high speed rotation, I only want to controll it as a stepper and use the 6 step commutation solution in open loop, so without any back EMF. My brushless driver is a very simple three pairs of power MOSFETs arranged in a bridge structure. I connected the 6 gates of the MOSFETs on 6 output of the stm32 like this: I'm using the timer 1 which is an advance timer. As I understood, it's correct to configure it as PWM Generation CHx, CHxN for BLDC driver. But I don't totally get it, because for example CH1N is not suppose to be the opposite signal of CH1. It's suppose to follow the commutation order as for example this picture: If I'm not wrong, the purpose of the PWM is not to make the switch between the differents 6 step, but to apply a voltage on the motor proportionnal to the duty cycle. And then the PWM on each MOSFET switch between OFF and
Posted on November 23, 2016 at 07:17Hello all, has anyone successfully installed CubeMX 4.17.0 on Mac OSX Sierra (10.12.1)? Every time I doubleclick the install it just bounces and then nothing happens. Any suggestions? #cubemx-macos-sierra
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.