Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hi,I am unable to find a SPI_FullDuplex_ComDMA_Master/Slave examples for the NUCLEO-H563ZI board in CubeMX (v6.11.0). Can you please point where this example can be found?Thanks in advance
Hello,we had a play with the memory tool to configure the memory regions (the linking to the OCTOSPI configuration, etc is neat), however we ran into the following issue:When using the tool, the internal RAM is configured as `Device` memory, rather than normal memory. Which in turn disallows unaligned accesses to memory.Unfortunately, even with `-mno-unaligned-access` we still get some register-indirect unaligned accesses to malloced memory.Also we deal with some packed structs, so need unaligned access to RAM.In the Cortex configuraiton I can see the configuration options, but they are all greyed outHow can I change the memory type in the memory tool from device to normal?
I'm use 2 of RAK3172 moduls. Is there a step by step user manual of how to setting up Simplest Low power LoRa P2P mode for RAK3172 with STM32CubeMX?
I created a project based on stm32h743 ,ARM M7 in keil through cubeMX, so my problem is, i need to run the code in debug ,for that i need to press the run button 3 times , then only my code execution is starting ,otherwise it does not , so please provide me a solution to runs the code execution when i press run button only one time .thank you,,,,,
I change the flash memory in the linker file from 0x8000000 to 0x8006000 and size from 512k to 484k.My program crash on HAL_Delay i think the issue is from the address that i change it from the linker so what else i have to change to my programme will run normaly.I am working with stm32F103ZET6.
hello,"I need some help on how to build an 8x8 relay matrix and how to control it with my STM32 board."
I am using SPI with DMA as shown in the screenshot. DMA is using Data Handling to truncate data from SPI's 16bit buffer into 8 bit values.The following part of the code errors out. Commenting this code out makes my application work, but every time I change things in CubeMX it is rewriten. Why does this check even exist?/* Packing mode management is enabled by the DMA settings */ if (((hspi->Init.DataSize > SPI_DATASIZE_16BIT) && (hspi->hdmarx->Init.DestDataWidth != DMA_DEST_DATAWIDTH_WORD) && \ (IS_SPI_FULL_INSTANCE(hspi->Instance))) || \ ((hspi->Init.DataSize > SPI_DATASIZE_8BIT) && (hspi->hdmarx->Init.DestDataWidth == DMA_DEST_DATAWIDTH_BYTE))) { /* Restriction the DMA data received is not allowed in this mode */ errorcode = HAL_ERROR; /* Unlock the process */ __HAL_UNLOCK(hspi); return errorcode; }
I'm using a BSEC static library for BME688 sensor. My application project builds fine. As soon as I reach the first BSEC function (which is provided by the "libalgobsec.a" static library), program goes to hard fault interrupt handler.My best guess would be that stack/heap size is insufficient. I have tried increasing both from 0x200 (heap) and 0x400 (stack) to 0x1000 (both) then also 0x8000 (both) through my linker file. However I see no difference - program hits the hard fault handler as soon as program enters the "bme68x_bsec_update_subscription" function.It's also worth noting that I used proper "libalgobsec.a" static library - the one under Cortex-M7 folder (since my MCU uses this core).Maybe there are other reasons I should consider in this case? Under BSEC examples, I have found one Readme (in the appendix) file which states the algorithm inclusion process. I didn't follow the exact rules because (I think) they are meant for Arduino platform (and I'm using STM
I am currently using HAL_UARTEx_ReceiveToIdle_DMA and getting results that don't make sense to me. My main function is very simple: int main() { MX_DMA_Init(); MX_UART4_Init(); HAL_UARTEx_ReceiveToIdle_DMA(&huart4, rxDmaBuffer, sizeof(rxDmaBuffer)); __HAL_DMA_DISABLE_IT(&hdma_uart4_rx, DMA_IT_HT); while (true) { if (tcpToSendQueue.size() > 0) { size_t length = tcpToSendQueue.front(); tcpToSendQueue.dequeue(); fwrite(tcpToSendBuffer, length, 1, stdout); } ThisThread::sleep_for(5ms); } } And my HAL_UARTEx_RxEventCallback is also minimal. void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef* huart, uint16_t size) { if (huart->Instance == UART4) { std::memcpy(tcpToSendBuffer, rxDmaBuffer, size); tcpToSendQueue.enqueue(size); HAL_UARTEx_ReceiveToIdle_DMA(&huart4, rxDmaBuffer, sizeof(rxDmaBuffer)); __HAL_DMA_DISABLE_IT(&hdma_uart4_rx, DMA_IT_HT); } } I am receiving ASCII data at 5Hz to test, and the very first message is coming
Here is a (possibly incomplete) list of threads affected by this CubeMX issue:https://community.st.com/s/question/0D50X0000BVnBhASQV/bug-report-dma-and-adc-initialization-order-changed-in-stm32f4-hal-v1241-causing-incorrect-adc-operationhttps://community.st.com/s/feed/0D50X0000BZFWRISQ5https://community.st.com/s/question/0D50X0000BbKaA5SQK/haluarttransmitdma-doesnthttps://community.st.com/s/question/0D50X0000BbMcnpSQC/dma-adc-doesnt-workhttps://community.st.com/s/question/0D50X0000BWqGdtSQF/haladcstartdma-init-msp-bughttps://community.st.com/s/question/0D50X0000BcS7tSSQS/stmcubeide-110-cubemx-540-switch-initialization-orderhttps://community.st.com/s/question/0D50X0000BVnBhASQV/bug-report-dma-and-adc-initialization-order-changed-in-stm32f4-hal-v1241-causing-incorrect-adc-operationhttps://community.st.com/s/question/0D50X0000Bfs7MvSQI/stm32f3-adc-with-dma-bughttps://community.st.com/s/question/0D50X0000Bh6PntSQE/bug-mxdmainit-wrongly-placed-by-code-generator-haluarttransmitdma-does-not-w
I have installed STM32CubeMX version 6.10.0 in Ubuntu 22.04 (through Windows Subsystem for Linux 2), but when I start it and click "INSTALL/REMOVE" to install the X-CUBE-AI extension, I get the following error message and nothing more happens: [ERROR] CheckServerUpdateThread:123 - Unexpected exception CheckServer ThreadCannot invoke "com.teamdev.jxbrowser.browser.Browser.mainFrame()" because "this.browser" is null I have tried manually installing Chromium and restarted the system after that, but I still get the same error.How can I get the installation procedure to work?
Hi We are using product STM32H56 series , I am encountering problem while building my project .I am STM32cubeIDE , trust zone enabled .I enabled X-CUBE-FREERTOS M33non secureIn software package I installed -STm X-CUBE-FREERTOS -CMSIS RTOS2-TZ_non_secure and desired Heap configuartion .I am getting the error as below .Please help me to resolve this issue.
Hello,i was looking for some library to simulate UART on STM32 F4 MCU and i came across Application note AN4457. The note is clear in explaining how STSW-STM32156 firmware package provide such emulation and it looked really perfect for my case. Problem is that it's really difficult for me to understand how to implement such software in my project. Is there a way to import this middleware library inside CubeMX?There are exemples in the package but informations how to import and include files are missing and links are dusted inside 20 files, that's really driving me crazy.Thanks a lotFilippo
I've been confused for days and am unable to make the ADC work on F103RC and have to seek for help.The test consists of ADC1 with 6 channels, an UART for printf and an I/O port that drives an LED. The ADC configuration: The test code: /* USER CODE BEGIN PD */ #define DMA_NOT_COMPLETED 0 #define DMA_COMPLETED 1 #define DMA_NOT_STARTED 2 #define VREFINT_CHAN 0 #define TEMP_SENSOR_CHAN 1 /* USER CODE END PD */ /* USER CODE BEGIN PV */ uint8_t dmaTransferStatus = DMA_NOT_STARTED; uint16_t convertedData[2] = { 0 }; int Vrefint =0; int Tmcu = 0; int Vsense = 0; int tick = 0; uint32_t startTick; /* USER CODE END PV */ /* USER CODE BEGIN PFP */ #define PUTCHAR_PROTOTYPE int __io_putchar(int ch) /* USER CODE END PFP */ int main(void) { HAL_Init(); SystemClock_Config(); /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_DMA_Init(); MX_ADC1_Init(); MX_UART5_Init(); /* USER CODE BEGIN 2 */ HAL_ADCEx_Calibration_Start(&hadc1); HAL_ADC_Start_DMA(&h
Hello,I am trying to use an H7 with USB OTG as host/device. Only 1 will be enabled at any given time. The issue is that with Cube, if I set the FS PHY to OTG/Dual_Role_Device, I get nothing but the IO set. Which is, obviously, the opposite of what I want. Ideally when I setup dual role I want dual role not 0 role. The HAL doesn't generate PCD or HCD files, instead of generating both. The NVIC tab doesn't allow me to manually enable the USB IRQ, let alone have it automatically enabled. Middleware is also completely disabled.This is what I would like to have seen when I set the PHY for OTG:Parameter settings for Host and DeviceIO for host and device (meaning include the ID pin)NVIC capabilityUSB_HOST and USB_DEVICE middlewares able to be usedAs of right now it is impossible to use the functionality of the FS OTG PHY as truly OTG while also using the IOC configuration, as manually changing the HAL config gets overwritten on code generation.Thank you
HI everybody,i am using STM32G0B1 and in an older project i used successful ADC multichannel DMA conversion of 8 channel. I started a multichannel ADC conversion of 8 channel and a ADC callbacksets the finished bit and later on i read the result for 8 channel from DMA buffer and start a new 8-chan conversion again. It works well.For a new project i want to keep this method for 10 channel but unfortunately i can only convert 8 channelone after another, the Number Of Conversion in ADC Paramter Setting in MXCube is maximum 8,I guess, due to the ADC channel selection register, reserved only for max. 8 channel.Now my question, how can i setup a DMA multichannel ADC conversion for 10 channelwithout reprogramming Channel and Rank before each conversion ?Possibly by an injected conversion of the 2 upper channel - if yes, pls with a hint for setting it right in CubeMXand possible HAL code.Thanks in advance,Kai
I copied a cubemx ioc file successfully compiled by keil mdk to another empty folder and generated the file, but a link error was reported.This is cmakelist:#THIS FILE IS AUTO GENERATED FROM THE TEMPLATE! DO NOT CHANGE!set(CMAKE_SYSTEM_NAME Generic)set(CMAKE_SYSTEM_VERSION 1)cmake_minimum_required(VERSION 3.27)# specify cross-compilers and toolsset(CMAKE_C_COMPILER arm-none-eabi-gcc)set(CMAKE_CXX_COMPILER arm-none-eabi-g++)set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)set(CMAKE_AR arm-none-eabi-ar)set(CMAKE_OBJCOPY arm-none-eabi-objcopy)set(CMAKE_OBJDUMP arm-none-eabi-objdump)set(SIZE arm-none-eabi-size)set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)# project settingsproject(CtrBoard-H7_Manipulator C CXX ASM)set(CMAKE_CXX_STANDARD 17)set(CMAKE_C_STANDARD 11)#Uncomment for hardware floating pointadd_compile_definitions(ARM_MATH_CM4;ARM_MATH_MATRIX_CHECK;ARM_MATH_ROUNDING)add_compile_options(-mfloat-abi=hard -mfpu=fpv4-sp-d16)add_link_options(-mfloat-abi=hard -mfpu=fpv4-sp-d16)#Uncomment fo
STM32CubeMX 6.9.2:STM32CubeMX 6.11.0:
Hi,after updating to STMCubeIDE 1.15.0 the Linker Script (-T) settings are reset to default.Best regards,Jens
what happened last time (2 years.-) ? why can't I change a lot of things ?I am working on CubeMx for STM32H745ZITx ...I have loaded default project for Nucleo-144 STM32H745ZITx, and want to customise for me unfortunately many options are grey ... are not editable ....?
Hi,I think I may have found an error.When generating a project for STM32L412K8TX (not a board) the default linker file define a RAM LENGTH of 40K.The STM32L412K8TX have 40K divided in two parts, 32K in RAM1 (0x20000000) and 8K in RAM2 (0x10000000).Package STM32L4 version 1.17.2CubeMX version 6.8.1Here is the header generated, also wrong:** @brief : Linker script for STM32L412K8Tx Device from STM32L4 series** 64Kbytes FLASH** 40Kbytes RAM** 8Kbytes RAM2 "SRAM1_SIZE_MAX" in stm32l412xx.h is ok, with a value of 0x8000. Have a good day !
We want to use the X-cube-NFC4 3.0.0 library for programming the STM32WB5MMG with the ST25DV04 NFC tag. We included:Board Part NFC (NFC4 / ST25DV)Wireless lib_nfc with core and Interface (Template)Board Support STM32Cube_Custom_BSP_Drivers (Custom / NFCTAG)Mode is selected ( Board Part NFC and Wireless lib nfc the Board Support STM32Cube Custom BSP Drivers is not enabled because we have the TSSOP-8 case of the chip. So this is not supported. In first compile the error happenC:/_work/_CubeIDE/Repository/Packs/STMicroelectronics/X-CUBE-NFC4/3.0.0/Middlewares/ST/lib_nfc/lib_NDEF/Core/inc/lib_wrapper.h:26:10: fatal error: common.h: No such file or directory26 | #include "common.h"How can I fix this error.
I created a project in CubeMX for a Nucleo board and configured the SPI1 interface.Now I get this red little error symbol in front of the Pinout and Configuration tab. When I click on GPIO it vanishes (and reappears on any other tab).Does it have something to do with the GPIO warning 'Warning: Some signals are not used in any IP's mode. However, you can still generate code.'?I'm totaly not sure what signals Cube is referring to and it does not give any more information...
Hi STI am using STM32CubeMX v6.10.0 with selected MCU STM32H563ZITx.When configuring FDCAN1 I may have found a bug in the tool. The below two Nominal Time Seg1 and Seg2 say that the lowest value is "2" and the tool is limiting setting it to "1" which I think is a valid setting.The RM0481 Rev 1 says that the minimum value that is interpreted by the hardware of that value is "1" (when register segment is set to "0")Can someone please verify my findings?BrImre
I am using STM32CUBEMX to generate code for the STM32F769I-DISCO dev board. I configured it so 4-bit data transfer mode is enabled, however, SD_WideBus_Enable() fails because SD_FindSCR() returns an SCR that is all zero. I simply commented out the SCR wide bus check and everything works fine i.e. I am able to use 4-bit data transfer mode:Just thought I'd let ya'll know.
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.