Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
I am able to read the fixed length fname.But the pointer to the long filename is always 0. this is how im reading trough the list of filesFRESULT detect_binariesFolder(){ fresult=f_opendir(&dir, "lu"); fresult=f_readdir(&dir, &filinfo); fresult=f_findfirst(&dir, &filinfo, "lu", "*.bin");//http://elm-chan.org/fsw/ff/doc/findfirst.html while (fresult == FR_OK && filinfo.fname[0]) { /* Repeat while an item is found */ fresult=f_findnext (&dir, &filinfo); } fresult=f_closedir(&dir); return fresult; }I tried the three different cubeMx options for long filenames :static buffer on the BSSdynamic buffer on heapdynamic buffer on stackNone of them works. My setup:stm32f105RBt6 custom board.SD Card trough SPI2, sandisk ultra 16GB.CubeMx version 6.4.0, STM32Cube_FW_F1_V1.8.4 package which uses FatFs version R0.10c, Nov 09, 2014.CubeIDE Version: 1.8.0
STM32CubeIDEVersion: 1.9.0Build: 12015_20220302_0855 (UTC)Win11one cannot set a custom firmware path, checkbox and path entry are missing, see attached screenshot.Same works on CubeMX 6.5.0hthKnarfB
When I attempt to create a task with a name longer than 15 characters, CubeMX seems to truncate to 15 characters max. How do I name a Task in CubeMX longer than 15 characcters?
I run a generated code from stm32cube IDE with LL drivers, and the debug process stops.
I need to use the ADC ISR to set a FreeRTOS semaphore. It seems that hadc1.ConvCpltCallback is the perfect feature to do this except it's not enabled unless USE_HAL_ADC_REGISTER_CALLBACKS is set. For the life of me I can't figure out how to make MX set this flag. Is it possible?
Hi, My ADC2 has only one conversion channel INT2 as analog input and want to converse continuously. But ADC2 cannot be enabled to continuous conversion mode in CubeMX.
I hope someone can help me with my problem. In a recent post I talked about my problems getting DMA work with the ADC. This does work, sort of.Now to my problem: The ADC is triggered by a timer update event. Then the data is transferred via DMA to a buffer. The problem is, that the values in the DMA buffer are random (?) values. I verified with an osilloscope that the timings of the measurements are correct:The yellow line is toggled after the buffer is filled completely, the blue line is the signal to be measured. The sampling frequency (and the frequency of the timer) is 500kHZ, so well within the ADC spec (event the slow ones have a sample rate of 1MHz). The buffer has a size of 256, so the frequency of the yellow line fits this as well.This is what the first 100 values in the ADC buffer actually look like: Looks like a sine wave with a really low sample rate, doesn't it? But if the HAL_ADC_ConvCpltCallback-interrupt is called at the right time, then this should
i have tried TIMER PWM DMA in STM32F0103C8T6TR and BLUEPILL STM32F103C8T6 but i cant get variable PWM at CH1 in any one of them. is there any bug in cubeMX generated code?my code is attached below.
I'm using a SPI1 as a master, SPI2 as a slave, SPI1 provides the clock to SPI2, SPI2 uses the SPI1 clock reference, and when I use __HAL_SPI_ENABLE(&hspi1), the SPI1 clock line pulses, which is fine.but when I call uint32_t tmp = 0x12345678;HAL_SPI_Transmit(&hspi2,(uint8_t*)&tmp,4,100);When using SPI2 to output data, the clock line of SPI1 does not output pulses. I did not turn off SPI1, and SPI2 did not output data. I checked the status register and found no flags. The hardware connection has been connected to SPI1 and SPI2. Excuse me How could something like this happen?
Hello,I have seen that it is possible to use templates to modify the output code generated by STM32CubeMX. However, I'm having difficulty to get some examples.Also, I was wondering if with the help of templates the two following points can be achieved:1.- Peripherals like timers init function can accept arguments and not just be: e.i. MX_TIM1_Init2.- If main function can be renamed, in order for me to use the autogenerated code on several projects with others main function. Inother words only use STM32CubeMX to configure hardware.Thank you,Best regards !
I have a ethernet module "LAN8720" and I have STM32H743VIT8. But MCU has only "LAN8742" driver. Is it possible to add the "LAN8720" driver to the list of drivers?
in stm32cube mx settingsmin heap size = 0x200min stack size = 0x400i am using freertos v2 in my application memory management heap_4.How to solve this issue?/* ****************************************************************************** ** ** @file : LinkerScript.ld ** ** @author : Auto-generated by STM32CubeIDE ** ** @brief : Linker script for STM32F030C8Tx Device from STM32F0 series ** 64Kbytes FLASH ** 8Kbytes RAM ** ** Set heap size, stack size and stack location according ** to application requirements. ** ** Set memory bank area and size if external memory is used ** ** Target : STMicroelectronics STM32 ** ** Distribution: The file is distributed as is, without any warranty ** of any kind. ** ****************************************************************************** ** @attention ** ** Copyright (c) 2022 STMicroelectronics. ** All rights reserved. ** ** This software is licensed under terms that can be found in the LICENSE file ** in the root directory of this software comp
HelloThe STM32G0B1CCU6 running into a hard fault caused by SPI2.After activating EXTI3 at the Pin PB3 (as interrupt) the controller is running into a hard fault. We think, that the hard falut is comming from the SPI-line because the MISO-pin is on the same EXTI-Line!?Note: MISO Pin at SPI2 uses the same EXTI3 - Line.Question:Why runs the controller into the hard fault? Is it, becuase the MISO-Pin is not defined?Is there any restriction about the EXTI3 - Line and using SPI2?Is there any workaround for this issue?thanksRoland
I found this issue whilst troubleshooting a couple of other issues - device target is STM32L152REx using low-level (LL) libraries.CubeIDE Version: 1.9.0CubeMX Version: 6.5.0-RC4STM32Cube_FW_L1_V1.10.3If I use lots of ADC channels (22 in my case) the generated code is wrong and the ADC does not function correctly;CubeMX generates:ADC_REG_InitStruct.SequencerLength = 22;Which does not work (22 needs to be shifted left to the correct location in the register), it should generate:ADC_REG_InitStruct.SequencerLength = LL_ADC_REG_SEQ_SCAN_ENABLE_22RANKS;Which I had to create my own defines for:#define LL_ADC_REG_SEQ_SCAN_ENABLE_17RANKS (ADC_SQR1_L_4) #define LL_ADC_REG_SEQ_SCAN_ENABLE_18RANKS (ADC_SQR1_L_4 | ADC_SQR1_L_0) #define LL_ADC_REG_SEQ_SCAN_ENABLE_19RANKS ( ADC_SQR1_L_4 | ADC_SQR1_L_1 ) #define LL_ADC_REG_SEQ_SCAN_ENABLE_20RANKS ( ADC_SQR1_L_4 | ADC_SQR1_L_1 | ADC_SQR1_L_0) #define LL_ADC_REG_SEQ_SCAN_ENABLE_21RANKS ( ADC_SQR1_L_4 | ADC_SQR1_L_2 ) #define LL_ADC_REG_SEQ_SCAN_ENABLE_2
STM32CubeMX version 6.5 is crashing on Fedora 34. This is also the case for everyone else on my team, who are also using Fedora 34. When it crashes, it also takes out Chrome and VS Code, if they are open. It generally happens when I am selecting different pin mux settings or just coasting the mouse over the MCU graphic and the tooltip text boxes pop up. I did not notice this on version 6.4. I have since reverted back to version 6.4 and have not experienced any issues.
..
hey thereI have set a pin in CubeMX as EXTI, namely PA1. the thing is when I use HAL_GPIO_EXTI_Callback(),for performing interrupt actions, it does not enter to HAL_GPIO_EXTI_Callback() but if I use EXTI0_1_IRQHandler() which is in stm32g0xx_it.c, it enters and works... why? whats the difference?another question is that does anyone have a library for RF remote controllers for stm32? any links or help are appreciated
Hello. We chose STM32L071 CPU without realising that it does not have Scan conversion mode for multiple ADC channels.Can someone confirm if it is possible to read multiple ADC channels using this CPU?Please suggest what is the most convenient way to do this.
the driver generated by stm32CubeMX compiles with no error but the device's peripheral dont work such as svc ,I2C, DMA, UART. However, I substitute HAL driver with example project's HAL files, all seem well.
According to MX Cube there are 2 timer clocks, APB1 and APB2. At max APB1 is 108MHz and APB2 is at 216. I can't anywhere where it shows which timer gets which clock.
Hello everyone,I was wondering what might be the reason for the MX_FMC_Init() function to cause a Hard Fault on the NUCLEO-L552ZE-Q. The code was generated for MDK-ARM IDE by CubeMX 6.4.0 and latest firmware package for that series. Right now, the NUCLEO board is not connected to anything at all. And I have tested with a brand new project with only the most basic peripherals/middlewares enabled like RCC, GPIO, and of course the FMC. After spending two hours to figure it out, I found that the code throws hard fault interrupt only when the type of memory selected is "NOR Flash". What follows is the initialize code for the FMC:/* FMC initialization function */ static void MX_FMC_Init(void) { /* USER CODE BEGIN FMC_Init 0 */ /* USER CODE END FMC_Init 0 */ FMC_NORSRAM_TimingTypeDef Timing = {0}; FMC_NORSRAM_TimingTypeDef ExtTiming = {0}; /* USER CODE BEGIN FMC_Init 1 */ /* USER CODE END FMC_Init 1 */ /** Perform the NOR1 memory initialization
After setting RCC and Clock configuration as below, if you run the program, it moves to Error_Handler.ECS-250-10-33B and ECS-327-34B What is the problem?
I am trying to us my STM32F072B-Disco board as an HID keyboard. I've followed tutorials like this one, (https://www.instructables.com/STM32-As-HID-USB-Keyboard-STM32-Tutorials/) that have gotten the transmission of characters to work, but only partially. When the code is running on the board, the characters are transmitted, but at a rate much faster than they should be. The characters should be transmitted extremely fast, with no stopping, despite the program transmitting the empty characters that should prevent this. I think the issue might be in the Clock Configuration, as my board and the boards in all the tutorials have different configurations that might not be interchangeable. I attached a picture of my clock configuration.Any ideas? Thanks in advance!
We are using STM32H745I-DISCO which has a 16 MByte SDRAM. We can read and write 32 and 16 bit values but when we try to read 8 byte arrays we get corrupt data and do not understand how to fix it.// -------------------------------- TEST CODE // t1 struct is placed in external memory (code works when put in RAM_D2 but no external ram void SDRAM_Test8() { int result = 1, i; uint32_t adressStart = 0; for(adressStart; adressStart < (8*1024*1024-(BUFFER_SIZE8*4)); adressStart += BUFFER_SIZE8) { /* Fill the buffer to write */ Fill_Buffer8(t1.aTxBuffer8, BUFFER_SIZE8, 0x00); /* Fill the Read buffer */ memset(t1.aRxBuffer8,0,BUFFER_SIZE8); for (i = 0; i < BUFFER_SIZE8; i++) { *(__IO uint8_t*) (SDRAM_BANK_ADDR + i + adressStart) = t1.aTxBuffer8[i]; } for (i = 0; i < BUFFER_SIZE8; i++) { t1.aRxBuffer8[i] = *(__IO uint8_t*) (SDRAM_BANK_ADDR + i + adressStart); } for (i = 0; i < BUFFER_SIZE8; i++
if(HAL_I2C_IsDeviceReady(&hi2c1,0xA6,3,100)==HAL_OK) { HAL_GPIO_WritePin(GPIOA,GPIO_PIN_5,GPIO_PIN_SET); HAL_Delay(500); HAL_GPIO_WritePin(GPIOA,GPIO_PIN_5,GPIO_PIN_RESET); HAL_Delay(500); } DATA_BUFF[0]=0x2D; //addr of POWER_CONTROL regiser DATA_BUFF[1]=0x08; //set bit3 for measure mode 0000 1000 HAL_I2C_Master_Transmit(&hi2c1,0xA6,DATA_BUFF,2,100); memset(DATA_BUFF,0,6); DATA_BUFF[0]=0x31; //address of data_format reg DATA_BUFF[1]=0x02; //set the device +/-8g range 0000 0010 //by puting range as 10 HAL_I2C_Master_Transmit(&hi2c1,0xA6, DATA_BUFF,2,100); memset(DATA_BUFF,0,6); //HAL_I2C_Master_Transmit(&hi2c1,0x32, (uint8_t *)20
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.