Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
I am trying to install on a MacBook Pro, but keep getting this error:“SetupSTM32CubeMX-6.7.0�? cannot be opened because the developer cannot be verified.
I realised there was such a problem, when I was trying to convert ADC temperature sensor data to degrees in Celsius. After many hours of trying to find a formula that works I found this one from the repository examples: ADCxConvertedData_Temperature = (((ADC_Data - 0.76)/(TS_CAL2 - TS_CAL1)) + 25);So far so good, but when I run the code I get values around 27 - 28 degrees, which is not impossible, but seems too high for it to be room temperature, so I wrote another formula which seems to be also accurate for temperature conversion:temp = (uADC_DR_val[6] / ((TS_CAL2 / 110 + TS_CAL1 /30)/2));But with this one I also get values from 26 to 28 degrees.So I decided to try and calculate these formulas with pen and paper using the ADC value that the MCU got and it turns out, I got lower numbers as a result. For example, using the first formula, where ADC_Data = 585, according to my calculations I get a result of 25.27 degrees, but my code calculates the same formula as 27.204. I also saw that
Hello STM, currently, I am confirming the AN4636 documentThis document is about LC sensor. My require is as follows,I want to know how to use the firmware provided.I am currently trying to use the firmware provided using stm32cubeMX or stm32cubeIDE, but it does not work.I am testing with a nucleoboard based on the stm32L4xx series, and I have tried many times to use the provided firmware 'STM32CubeExpansion-LC-Sensor-L4-V1.0.0' but I found it impossible.I want to know what kind of environment I need to configure to use this firmware.Thanks
when code generate, in function void MX_LWIP_Init(void)osThreadDef(EthLink, ethernet_link_thread, osPriorityBelowNormal, 0, configMINIMAL_STACK_SIZE *2);in this line,using configMINIMAL_STACK_SIZE, not the TCPIP_THREAD_STACKSIZE parameter in the �?key option“ in the STM32Cubemx LWIP pageis a bug?
I am using some UTF-8 characters in my code that shows messages to the user, and some of them get converted to some other code page when I regenerate the code. This happens when generating code both from CubeIDE ioc editor and CubeMX.This is how my code looks before generation:And after generation: The characters �?, Ę and Ń get messed up.CubeIDE version: 1.11.0CubeMX version: 6.7.0
Hi.I am test external SDRAM with STM32H747.SDRAM chip is IS42S8640D-7TLII set SDRAM1 in FMC of Connectivity as followedClock and chip enable : SDCKE1+SDNE1internal bank number : 4 banksAddress 13bitsDAta 8 bitsnumber of column address bits : 10 bitsnumber of row address bits : 13 bitsAfter I generate code, 'SystemInit_ExtMemCtl(void)' is not in sytem_stm32h7xx_dualcore_boot_cm4_cm7.cThe function is not anywhere.Other example project for SDRAM has the functionWhat should i do more?I added this code for testing SDRAM as below /* USER CODE BEGIN 4 */ #define SDRAM_ADD 0xd0000000 uint8_t wdata[] = {0x1, 0x2, 0x3, 0x4, 0x5}; uint8_t rdata[10]; /* USER CODE END 4 */ void StartDefaultTask(void const * argument) { /* init code for USB_DEVICE */ MX_USB_DEVICE_Init(); /* USER CODE BEGIN 5 */ vAppCmdTaskInit(); int cnt=0; memcpy((uint32_t *) SDRAM_ADD, wdata, 5); memcpy(rdata, (uint32_t *) SDRAM_ADD, 5); /* Infinite loop */ for(;;) 
When I try to set the pin PA3 the choice is ADC1-IN8And PA4 can be mapped to ADC1-IN9, but I need it GPIO_EXTI4. This is for the STM32L443CCT
Is not a new installation of CubeMX v6.6.1, it has been working so far, untill today i try to File>New project.... and stays here forevertrying to unzip "cube-finder-db.zip"
Hi there,For a number of years my team has used the MII Full Duplex Only mode in CubeMX for the Ethernet configuration with the STM32F767xxxx as shown in the screenshot below from CubeMX 6.5.0: We recently updated to CubeMX 6.7.0 and found that the options had changed and the MII Full Duplex Only was removed in favor of just an MII option as shown in the screenshot below: I saw in the release notes that the STM32CubeF7 HAL was updated to v1.17 starting with CubeMX v6.6.0 and that one of the changes was a re-write to the Ethernet HAL library. I'm assuming these changes are related?With the removal of the full duplex only option it seems that CubeMX is now forcing us to allocate pins for the ETH_CRS and ETH_COL signals which are unneeded for our HW design. Unfortunately we need those pins allocated for other purposes so this has become a blocker for us to be able to upgrade to the latest version of CubeMX.My understanding is that the CRS and COL signals are only needed when wor
As some background information, we used STM32CubeMX version 6.5.0 to generate the drivers for a custom hid device that runs on a STM32L4R9AI processor. When the usb cable is inserted, MX_USB_DEVICE_Init() is called which is stm’s code in a file called usb_device.c.When the usb cable is removed, MX_USB_DEVICE_DeInit() is called, also in the same file. I would expect that as a result, the sleep current would be the same as it was before inserting the cable. But instead, the current draw remains roughly double.I have also noticed that when using the debugger, for both insertion and removal of the usb cable, HAL_PCD_IRQHandler triggers twice first to call a suspend callback and then to call a resume callback. And for both insertion and removal, the order is the same. Why does the interrupt trigger twice, and why the same order, suspend then resume?When measuring the current, I remove the debugger so that it is not the influencing the current draw.
The code generated by the STM32CubeMX is using the UART rather than the USART.How do we generate the code using the USART driver lib via the CubeMX?
Hi Guys,STM32L475RGTXI have a device whith USART2 (PA2 and PA3) connected to a RS485 transceivers and i would like use the PA1 pin as DE, as below: This works correctly and the DE PIN is toggoled correctly.From the reference manual, I have seen that I can set the DEAT and DEAD fileds in the USART_CR1 register which should raise/lower DE with a certain advance/delay.Although I set these registers to the maximum value however I don't see any difference on the oscilloscope, I am attaching a screen:Do you have any idea what could be the reason? I am also attaching the project files.Thank you for the support!
I wrote an application configuring the USART for DMA transmission. The first call to HAL_UART_Transmit_DMA works correctly and the expected bytes are sent. However, every subsequent call fails with HAL_UART_STATE_BUSY.It appears that the uart state is not set back to ready when the DMA transmission ends. I added a line in UART_DMATransmitCplt to set the state back to ready (below) and this appears to fix the problem but I wondered if there is a better solution than modifying the provided HAL code.FWIW, UART_DMAReceiveCplt does set the state back to ready in the non-circular case. It seems like Transmit should do the same.static void UART_DMATransmitCplt(DMA_HandleTypeDef *hdma) { UART_HandleTypeDef *huart = (UART_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; /* DMA Normal mode*/ if ((hdma->Instance->CR & DMA_SxCR_CIRC) == 0U) { huart->TxXferCount = 0x00U; /* Disable the DMA transfer for transmit request by setting the DMAT bit in the UART CR3 regist
I've updated the question as the answer was not suffient.Using version 6.7.0 of STM32CubeMX and I want to set the SPI SCK and MOSI signals to open drain when in master mode. What I can see, this is not possible and I have to manually modify the configuration file.The reason for this non-SPI standard configuration is that I'm using the SPI to access a LCD controller that don't speak SPI, but the protocols are similar enough on the logical layer, but not on the physical layer. So it would be great if the Cube could set a SPI master to "Alternate Function Open Drain".
Dear allI'm using STM32G070KBT in my product, as it has 4 UARTs.I want to use the 4 UARTs in asynchronous mode, no HW control, UARTs 1 and 2 use RX/TX, while UARTs 3 and 4 use only RX.When defining all those UARTs in STM32CubeMx, I've some warnings that I do not understand.USART1 : PA9 and PA10USART2 : PA2 and PA3USART3 : PA5 and PB9USART4 : PA0 and PA1- First warning is on USART2, Asynchronous mode conflicts with UART4 asynchronous mode, I cannot see in datasheet and other docs a limitation about using those 2 UARTs in async mode, this waring is yellow flagged.Another red flagged warning for this UART2 is observed in front of HW control, even if it is configured as disabled.Second warning is on USART3, While HW control is disabled, I still see a conflict with another GPIO PA6 used for another purpose. Why do I observe a conflict here when HW flow control is disabled ?Thanks for any help.
Hello,I am using the NUCLEO-F401RE with the NUCLEO-IDB05A2 bluetooth low energy expansion board. I am trying to run the sample demo code that is part of the X-CUBE-BLE1 software package (SensorDemoBLE). I followed the instructions in this video below:https://www.youtube.com/watch?v=jGljm6nxW9sWhen I follow this video, I am unable to build the project because the build option is greyed out. Additionally, when I try to import the project from the File System or Archive, it shows the Bluetooth_SensorDemo\STM32CubeIDE Exlipse Project is not opened. If I select it and hit finish, it does not do anything. Does anyone know what causes this?STM32CubeIDE Version: 1.11.0STM32CubeMX Version: 6.6.1
My code initialises the RTC using the standard CubeMX code but before setting the clock it tests for a valid year > 2018. This works perfectly and the time and date are preserved through resets of the uP. However, it appear that either the reset or the call to HAL_RTC_Init zeroes the fractions of a second stored in the RTC registers. This can be proven by repeated resetting the processor each time withing a second which causes time to stand still.Is there a solution to this so that the fractions of a second are preserved through resets and power cycles?Thanksstatic void MX_RTC_Init(void) { /* USER CODE BEGIN RTC_Init 0 */ int up=RTC_SMOOTHCALIB_PLUSPULSES_RESET; int calibrate= -Option.RTC_Calibrate; /* USER CODE END RTC_Init 0 */ RTC_TimeTypeDef sTime; RTC_DateTypeDef sDate; /* USER CODE BEGIN RTC_Init 1 */ /* USER CODE END RTC_Init 1 */ /** Initialize RTC Only */ hrtc.Instance = RTC; hrtc.Init.HourFormat = RTC_HOURFORMAT_24; hrtc.Init.Async
How to test only the HAL_Delay (...). Thank you for your helps Regards
Hello,We are currently evaluating the STM32L073 series in terms of the possibility to configure the USB device as either:3x interfaces, all serial (COM) ports.3x interfaces, 2x serial (COM) port and 1x mass storage device.In the STM32 studio I have noticed initially that in theory there is the possibility to define from 1 to 255 interfaces?But then when set the USBD_MAX_NUM_CONFIGURATION and USBD_MAX_NUM_INTERFACES to 2, I had no way to configure more than 1 interface in the software GUI. I right now don't have the hardware to check that physically.Are multiple USB interfaces possible for this one? I would appreciate all help.
Hello,I am new to STM32 MCU and right now using a 170MHz STM32G474 MCU for my project. I did a test today and found out the float number calculation speed of the MCU is quite slow.It takes 6.3us to finish the calculation in Fig.1. (I set a GPIO pin high before the calculation starts and set it to low after the calculation). ADC_Value[] is integer and the rest variables are float. The speed is just too slow to believe. The clock is set to be 170MHz. Am I missing something in the project setting (shown in Fig2 and Fig3)? Is this the real calculation speed for the MCU? I know that in TI C2000 DSP, we can include a Scalar Factor Optimizer Library header to speed up the float calculation (SFO_V8.h). Does the STM32 DSP have the similar headers? Thanks.
..
I tried to update an existing and working STM32F7 project to the new ethernet driver.(MCU STM32F777BIT6 / STM32Cube FW_F7 V1.17.0 / CubeMX 6.6.1)But there are some problems with this new driver:1. A Bug in generated function "ethernet_link_thread" in module "ethernetif.c": ETH not started with interruptvoid ethernet_link_thread(void const * argument) { : if(linkchanged) { /* Get MAC Config MAC */ HAL_ETH_GetMACConfig(&heth, &MACConf); MACConf.DuplexMode = duplex; MACConf.Speed = speed; HAL_ETH_SetMACConfig(&heth, &MACConf); // [BUG] // ETH not startet with enabled interrupt // same start procedure in function low_level_init is correct, but correct function is important at this place! //HAL_ETH_Start(&heth); HAL_ETH_Start_IT(&heth); netif_set_up(netif); netif_set_link_up(netif); } : }2. A Bug in generated function "low_level_output" in module "ethernetif.c": return code of transmit function not evaluated and following while loop runs into deadlock
I'm trying to use STM32F730 for MODBUS communication. The datasheet and reference manual both shows support for MODBUS. However the problem is :when i use cubemx for configuration purpose it generated following message "This peripheral has no parameters to be configured".Further i generated the code when i check code using IDE the USART initilization function has no code and it appears as follows:static void MX_USART1_Init(void){ /* USER CODE BEGIN USART1_Init 0 */ /* USER CODE END USART1_Init 0 */ /* USER CODE BEGIN USART1_Init 1 */ /* USER CODE END USART1_Init 1 */ /* USER CODE BEGIN USART1_Init 2 */ /* USER CODE END USART1_Init 2 */}As per my understanding this initialization function is not correct.So all of you are requested to help me to understand what is the issue.Regards
Hi everyone,Like most of embedded work, our project aims to have the smallest size possible.Looking at what I can optimize, I came across the LL_USART_Init function that is generated by CubeMx.This function uses LL_USART-SetBaudRate which needs to use Division for unsigned long (_udivmoddi4). On a STM32F4 project, _udivmoddi4 takes 720 bytes of flash space!!Does anyone have a simple trick to get around this apart from getting rid of CubeMX initialisation and never use LL_USART_SetBaudRate ?
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.