Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Hello everyone,I have problem with my univeristy project and I'm trying to find some help.I'm using Nucleo64 STM32F411RE.The most important setting in CubeMX:In ADC every rank have 3 cycles, and Rank 1-4 Channel 10, Rank 5-8 Channel 11, Rank 9-12 Channel 12, Rank 13-16 Channel 14My code:Global Variables:#define length 32768 uint16_t reciver[length]; union u_type { uint16_t prepare[(length/4)]; uint8_t sender[(length/2)]; } temp; uint16_t where1, where2; //uint8_t sender[(length/8)]; int taskcounter1 = 0; int taskcounter2 = 0; int taskcounter3 = 0;int main():int main(void) { HAL_Init(); SystemClock_Config(); MX_GPIO_Init(); MX_DMA_Init(); MX_ADC1_Init(); MX_TIM3_Init(); /* Create the semaphores(s) */ /* definition and creation of myBinarySem01 */ osSemaphoreDef(myBinarySem01); myBinarySem01Handle = osSemaphoreCreate(osSemaphore(myBinarySem01), 1); /* definition and creation of myBinarySem02 */ osSemaphoreDef(myBinarySem02); myBinarySem02Handle = osSemaphoreC
Posted on November 07, 2017 at 10:09Hi,I'm using STM32F4 Discovery board with its base-board extension that has a micro-sd card slot. I'm using the STMCubeMX and its current latest F4 firmware which is STMCubeMX FW F4 1.17.0.There is no SD card example for STM32F4 Discovery board but I found an example code for another discovery board which is located at the following directory:STM32Cube_FW_F4_V1.17.0\Projects\STM32469I-Discovery\Applications\FatFs\FatFs_uSDI've tried many different combinations of possible solutions using the libraries offered in STM32CubeMX with the help of that example project, but I have been getting errors although it mounts succesfully as the error code suggests.Here are the important parts of my code:/* USER CODE BEGIN 0 */FATFS SDFatFs; /* File system object for SD disk logical drive */FIL MyFile; /* File object */static uint8_t buffer[_MAX_SS]; /* a work buffer for the f_mkfs() */FRESULT res; /* FatFs function common result code *///
I'm using 24C512 EEPROM with my STM32F1, i initialized the project with stm32cubemx and defined my SCL and SDA pins as I2C, when i try isDeviceReady function i never get HAL_OK.I've also grounded A0,A1,A2,Wp of the eepromMy Codeint main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration----------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_I2C1_Init(); MX_I2C2_Init(); /* USER CODE BEGIN 2 */ /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while(HAL_I2C_IsDeviceReady(&hi2c1,0xa0,64,HAL_MAX_DELAY)!=HAL_OK){}
Hi,I made same configuration http server netcon api example in stm32cubeh7 fw for ethernet communication.There is not error,but it's not work.
I need to re-install STM32 CubeMX 4.19 as the latest version 4.24 is not compatible with my existing code base. I inadvertently migrated to 4.24 but need to return to 4.19. Where can I find an archive installer for the older version?
Hello all.I would like to install the STM32CubeMX using Docker file for Ubuntu. How shall I do this?I know how to use the X-server, and GUI under docker with Ubuntu, however, when downloading the STM32Cube one has to register. I would like to automate the downloading and installation process.Please, advice me, what is the best way to do this.Lyubomyr
This bug didn't exists before, only started to appear in 4.27.0.(Left: Before regenerating, working version | Right: After regenerating, corrupted version)
In the FreeRTOS configuration in the Cube GUI, I am able to create queues. Cube generates code to create these queues, following the CMSIS-RTOS API (`osMessageCreate`, etc.)Is it possible to generate mail queues as well? (`osMailCreate`, etc.)? I see that the API is already available in `cmsis_os.c`, but I see no way to tell Cube to generate a mail queue rather than a message queue.https://os.mbed.com/handbook/CMSIS-RTOS#mail-queueThe workaround for now is to manually write the code to create the mail queues, but of course this is more complicated than relying on Cube to manage the configuration for us.
CubeMX generated code to enable RTC Wakeup starts with HAL_RTC_Init but the examples in the HAL library 'unlock' the RTC via the PWR module using HAL_PWR_EnableBkUpAccess.Which is correct? CubeMX or Example code in HAL?
Hi everyone,I use stm32 discovery and external sensor ("pulse sensor which used to measure the beats heart") connected to the card. I want to read the samples in the output of ADC. More precisely, I use cube MX for configuration. But, I need to modify the frequency of sampling (because it is very higher). should I use a timer to control the sampling rate and how I can fix the timer settings such as prescaler, counter according the desired sampling frequency?
when I creat a new project ,it come out nothing just a white windous...
When I open the resultant project in SystemWorkbench, there's an entire DSP_Lib folder that is full of sources that I don't want or need. My current project doesn't use DSP. Is it safe to just delete these or exclude them from the build? Why would I want the source for this entire middleware layer in my project tree? Is there an option to disable generation of these sources in CubeMX?
Hi,currently, I am trying to debug an empty project created with STM32CubeMX (ver. 4.26.1 and 4.27 tested) in combination with SW4STM32 IDE (ver. 2.5 and 2.6) tested.But before the empty while(1) loop in main.c is reached the output of the debugger console is the following (see the attached screenshot):Program received signal SIGINT, Interrupt. 0x080016ce in main () at ../Src/main.c:98 98 MX_USART2_UART_Init();I have several Nucleo-F303RE boards tested on different computers with Windows 7 and 10 and use the HAL libraries ver. 1.10 (and 1.09 tested).Since I have debugged a project in the same way successfully a few weeks ago, I think the error should not be very complex.Can anybody please help me to understand the reason for the SIGINT interrupt?Thanks in advance
Hello, I've brought a new stm3220xG eval board for some development purpose. while going through examples code of STM32CubeMX all of them working fine individually but when I'm trying to use some parameter/functions and files into another code those newly added functions and files isn't working at all. In my project I've added "USART3 printf" example's files and all other initialization related functions into "LWIP TCP/IP ECHO SERVER" as I need a debug port. so does anyone has any idea or knowledge about what possibly could goes wrong? either I'm missing something or improper initialization.?Thanking with regardsAatif shaikh
Hi,In STM32CUBEMX software version 4.27.0 , when I generate code for keil, it changes compiler setting from my own -O0 parameter to -O3. If I change back this parameter in keil, in next code generation of stm32cubemx it changes this parameter again. It is very annoying. V4.26.0 is OK.Thanks,
I try to configure this module from STM32CubeMX, but I can not find how can I do it. It is not clear how can I starting a design with this module...
STM32CubeMX and the L4 HAL 1.13.0 now sport an option to change the number of supported USB configurations.I am trying to implement a USB interface that allows the host to choose between a CDC configuration that draws 500mA and one that draws 100mA. I have a battery powered device, and I want to present a CDC interface whether or not the battery can be charged.It seemed like USBD_MAX_NUM_CONFIGURATION would help here. It seems to be a step in the right direction. I see two identical configurations enumerated. But I don't see any code in the USB layer that does anything with the configuration number when the host is enumerating or which would allow an application to alter or set a specific configuration.Is there any documentation or example code illustrating how to make use of this new feature?
For more details check the screenshot.Thanks!
Hi. I have created app with SDMMC+FreeRTOS+FatFS for STM32H743 Eval board using CubeMX 4.26.1 and STM32CubeH7 Firmware Package V1.3.0 . And found some weird thing: every time when f_write function called also called funcction HAL_SD_ErrorCallback with error code SDMMC_ERROR_CMD_RSP_TIMEOUT. This happened when HAL SD driver send STOP TRANSMISSION command after WRITE SINGLE BLOCK complete. In code this is line 1460 in stm32h7xx_hal_sd.c file:/* Stop Transfer for Write Single/Multi blocks or Read Multi blocks */ if((context & SD_CONTEXT_READ_SINGLE_BLOCK) == 0U) { errorstate = SDMMC_CmdStopTransfer(hsd->Instance); if(errorstate != HAL_SD_ERROR_NONE) { hsd->ErrorCode |= errorstate; HAL_SD_ErrorCallback(hsd); } }SD card continue work fine, but spend time for handling this command.Maybe don't need send STOP TRANSMISSION command (CMD12) after WRITE SINGLE BLOCK command (CMD24)?
I generated a project using the LL libraries for the STM32L011 as the HAL is far too bloated to use with this part. After porting some known working DMA TX code from an old F103 StdPeriph project, I couldn't get anything to transmit out. What I found was missing was that the initialization function never sets the peripheral address to be the UART's TDR. Calling the following line solves the problem and I believe it should be done in the intialization instead of during the TX function where I have it now from debugging:LL_DMA_SetPeriphAddress(DMA1, LL_DMA_CHANNEL_2, (uint32_t)&LPUART1->TDR);My DMA TX function for reference:void LPUART_DMA_TX(uint8_t* data, uint8_t size){ LL_LPUART_DisableDMAReq_TX(LPUART1); // Disable DMA requests from LPUART LL_DMA_DisableChannel(DMA1, LL_DMA_CHANNEL_2); // Disable DMA channel LL_DMA_SetPeriphAddress(DMA1, LL_DMA_CHANNEL_2, (uint32_t)&LPUART1->TDR); while (DMA1_Channel2->CCR & 0x01) // While EN bit is high __NOP(); // Wait for dis
Hello,I'm independent developer involved in a STM32H7 project.I need to activate traces in SWV console of TrueSTUDIO. I've attached my .io CubeMX project, I think it is well configured.I've configured in the debugger tab of TrueStudio : SWD // SWV checkbox I've checked the port 0 of "ITM Stimulus ports" zone in the "Configure Trace" window and activated "Start Trace" button. Finally in the main loop of my program i've added : ITM_SendChar('T');Nothing appear in the SWC console, is anybody can help ?
Hello, I can`t figure out how to achieve the following with STM32Cube HAL.I need to setup a timer, that counts to a specific value and generate an Interrupt. After this, the timer needs to keep counting up, until it overflows. This Overflow should alos generate an Interrupt. I can`t figure out, how to do this. I also tried PWM -no output but it is not working. I don`t want to set a GPIO, I only need a Timer that acts like a PWM. Count to a value -> Interrupt, keep counting till overflow-Interrupt.Thanks
I develop an app with ETH interface and static IP address based on the STM32F207 MCU. The IP address shall be derived from status of input pins, like DIP switch. CubeMX allows to set the static IP address however does not accept user constants. This IP address is then set to LwIP internal variables in the lwip.c MX_LWIP_Init() routine. I would need to change the IP address in the routine before the LwIP stack gets initialized. I would expect some /* USER CODE BEGIN x */ section there, like in the ethernetif.c low_level_init() routine for easy changing the MAC address (section /* USER CODE BEGIN MACADDRESS */). Any ideas how to do it without my code being overwritten each time CubeMX re-generates the code? Maybe I miss something. I tried a few hacks (like #undef the #define ip_init()) without success. Would be nice to be able to define own USER CODE section. CubeMX version: 4.27.0
Hi, colleges! I use Nucleo-144 STm32F767 development board to learn USB.Now - Application example - device USB MSC.How can I write/read to/from MCU from the PC?Do I need some software on PC? Or can I do it by file manager (f.e. Total Commander)? Please, reveal me the process? Or where can I read about it?
whenever i open cube mx, this error message make me be nervoushow i can solve this problem please help me
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.