Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
Posted on August 14, 2016 at 02:53Hi Everyone,I'm trying to do a simple read or write into a usb pendrive (TOSHIBA 4Gb ) using a custom board with a STM32F207VGT6 mcu on it...I developed the firmware with STMCubeMX, by using USB_OTG_FS as HOST_ONLY, with Mass Storage Host Class and FATFs...Here's a part of the code that I used.../* Includes ------------------------------------------------------------------*/&sharpinclude ''stm32f2xx_hal.h''&sharpinclude ''fatfs.h''&sharpinclude ''rtc.h''&sharpinclude ''tim.h''&sharpinclude ''usart.h''&sharpinclude ''usb_host.h''&sharpinclude ''gpio.h''&sharpinclude ''ff_gen_drv.h''&sharpinclude ''usbh_diskio.h''/* USER CODE BEGIN Includes *//* USER CODE END Includes *//* Private variables ---------------------------------------------------------*//* USER CODE BEGIN PV *//* Private variables ---------------------------------------------------------*//* USER CODE END PV *//* Private function prototypes ---------------
Posted on February 20, 2018 at 11:27Hi,Kindly help me to find out the example code for read/write the SD card via SPI. I am trying to write or copy the files both USB disk and/or SD card. Please advice.https://community.st.com/tags♯/?tags=stm32f4%20debug%20systemworkbench4spi &sharpstm32f4 hal driver https://community.st.com/tags♯/?tags=iar%20embedded%20workbench‌#stm32f4-debug-systemworkbench #sd-card-mmc-stm32cubemx #iar-embedded-workbench #sd-spi-sdio
A while back, I found a bug in the osTimer implementation (relating to the callback parameter), and reported it here:https://github.com/ARM-software/CMSIS-FreeRTOS/issues/9only to discover it has been fixed in v2 and the version that ships with the STM32 SDK is very old, according to cmsis_os.h: * $Date: 5. February 2013 * $Revision: V1.02Given the numerous fixes and improvements made since this release, when might we see an upgrade shipped officially as part of CubeMX etc?Oh and FWIW the workaround I ended up for the callback problem using was to have a singleton controller class and calling a static accessor method in the callback (and ignoring the parameter).
I try enable sdio+fatfs without freertos and every things work fine.when i enable freertos+sdio+fatfs , my fatfs doesn't work.I enabled Dma.(stm32f4cube_v_1.23)(cubemx 5.0.1)(stm32f407zg)
Hello STM32CubeMX developers,I am using STM32CubeMX to rapidly setup applications for STM32, including the generated HAL and RTOS initialisation code (I am using STM32CubeMX v5.0.1 with its freeRTOS v10.0.1 as a third-party middleware).I greatly appreciate the options STM32CubeMX offers me to configure the basic-to-mid-level parameters ~MX allows me to define in a project-specific way, especially the selection of RTOS features required and the static allocation policy relevant for many embedded SW areas.The generated code for freeRTOS also implements the CMSIS RTOS API in its version 1, allowing me at the same time to port existing CMSIS projects to the "low-level code" generated by STM32CubeMX.Sadly, this only holds for version 1 but not for CMSIS RTOS v2, which has been released in 11/2016 and integrated to freeRTOS firstly in 03/2017.Are there plans to support CMSIS RTOS v2 on top of freeRTOS in the near future?I'd like to build an application on top of CMSIS 5.x (RTOS v2) using sta
I want to flash STM32Cube_FW_F4_V1.23.0 example application code on STM32f429 Nucleo 144 board using eclipse IDE this work with the systemworkbench.How use STM32CubeMX with eclipse ?
Hello everyone.I've expirienced an interesting problem today.I've created simple project for STM32F407: just RCC, SW Debug, and couple GPIO Pins (3 for EXTI, 4 for output).But, when I generate project from this file to TrueStudio format, it falls down with error (the one, that's on attached screenshot). As far as I understand, it starts with line 300(314) in arm_math.h:#else #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS or ARM_MATH_CM0"#endifIf I use some of older projects, TrueStudio complies it well.No matter, what CubeMX library I pick, latest (*.23), or earlier-one (*.22), it results the same.But, if I generate it to MDK-ARM format, and run project with Keil, it compiles with no problems (no errors or any warnings).I've attached my project to post, if it's needed.
I have used CubeMX to create the exact same project starting with basic board Nucleo L496ZG but varying the USB device middlewares for CDC, HID and Custom HID. The CDC and HID examples enumerate 'out of the box' in windows. The custom HID does not. What is missing in Custom HID to complete basic enumeration on windows? My only mod to the code out of the box was to disable IWDG() to allow debug.Thanks.
Hi.I am trying to save .txt files to USB memory with USB HOST MSC and FATFS to STM32F401RB.STM32F4-DISC and examples.So I wrote the code with reference to CUBEMX and the examples I searched.I entered USBH_Path in the * path of f_mount.However, an error occurred during the build. f_mount (& USBDISKFatFs, (TCHAR const *) USBH_Path, 0)The above code is where the error occurs.Error [Pe020]: identifier "USBH_Path" is undefined.Please help me.
I have an STM32F0DSCOVERY and I have successfully configured it with CubeMX and TrueStudio to read a single touch input. I can read out the data in STM Studio and it graphs the measurement and the delta and the StateId and everything is beautiful. However, when I try to add a second touch input the second input always reads as zero while the first continues to work.In my working configuration (with one input) I have G6_IO3 (PB13) configured as my first basic touchkey (IO_TOUCHKEY_B1) and G6_IO1 (PB11 with sampling capacitor attached) configured as the sampling input. In main() I run the following code: /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ status = tsl_user_Exec(); TSL_tkey_Process(); } /* USER CODE END 3 */This works fine and I'm happy with it as long as I'm only looking at one input. To add my second input, in CubeMX, I configure G6_IO4 (PB14) as my second basic touchkey (IO_TOUCHKEY_B2) and inc
Hi,We are trying to evaluate STM32CubeMX, I can launch it and use it normally, but I have some troubles: it won't generate code when clicking "Generate Code" button. Instead, it produces this error and doesn't do anything more: "Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at com.st.microxplorer.plugins.projectmanager.engine.MainProjectManager.startGenerateCode(MainProjectManager.java:932)"I have found several posts asking to use Oracle official java instead of OpenJRE, however, I tried many versions of Java, including the following ones:java-8-openjdk-amd64java-8-oraclejava-11-oracleI am running Linux (Debian Jessie base) with STM32CubeMX 5.0.1, and I always get the exact same error with all java version tried.(note that I tried STM32CubeMX 4.27.0 too, and with this version I can generate the code. It seems a bug has been introduced with version 5.0.1? Any other though?)Details on the error I get:2019-02-19 09:19:43,641
SDIO DMA read operations appear to work fine. I suspect a configuration error, but I'm not sure where to start. DMA controller configured with CubeMX software. Device is running only one task under FreeRTOS. Any suggestions would be appreciated.
Hello,will there something be done in the future to integrate FreeRTOS 10 and also FreeRTOS+TCP (like lwip) in the STM32CubeMX generator or will there be a handy integration support for the FreeRTOS+TCP package in the future?I think it would be good for many people and they would be get easier into programming with your devices (and also the decision to choose them from your company would be easier). RegardsPhilipp
I have installed the newest version from STM32Cube (5.0.1) and want to use the X-Cube-SPN1 software expansion. The expansion I have downloaded from st.com, so I want install it from local as a zip-file. (I use the menu Help/manage embedded software...) But the STM32Cube gives an error message:This package version is not managed on this version of stm32cubemx.What can I do?
I'm trying to program the STM32F446 using the CubeMX code generator and the uVision 5 IDE on Windows 10 in order to use the CAN bus.I've configured my CubeMX project for the STM32-F446RE Nucleo board. I have PA12 configured as CAN1TX and PA11 configured as CAN1RX. The rest of the pins are on default for the STM32-F446RE Nucleo board. I've generated the code for the uVision 5 IDE.To get started, I'm trying to follow the instructions on how to use the HAL and driver by following the instructions in the comments of stm32f4xx_hal_can.c as well as the instructions on page 120 of the HAL documentation DocID025834 Rev 5. This page gives the following instructions:Enable the CAN controller interface clock using __HAL_RCC_CAN1_CLK_ENABLE() for CAN1, __HAL_RCC_CAN2_CLK_ENABLE() for CAN2 and __HAL_RCC_CAN3_CLK_ENABLE() for CAN3 In case you are using CAN2 only, you have to enable the CAN1 clock.CAN pins configuration **Enable the clock for the CAN GPIOs using the following function: __GPIOx_CLK_
I want to include Arduino ADXL345 C++ library (ADXL345.cpp/ADXL345.h) in STM32 CubeMX generated C project.I'm getting the following compilation errors with CubeMX C project with .cpp header file having 'Class' type declaration in Atollic -unknown type name 'class' ADXL345.h /STM32_SPI/Inc line 115 C/C++ ProblemHow to resolve this?
Hi am new to STM32,I had generated USB device CDC example using STM32CubeMX 5.0.0 for STM32F427II and once i connect my DUT it show enumeration warning with following error, kindly see what i am doing wrong or can someone please share me just USB CDC device bare metal example code Port1] : USB Serial DeviceIs Port User Connectable: noIs Port Debug Capable: noCompanion Port Number: 0Companion Hub Symbolic Link Name: Protocols Supported: USB 1.1: yes USB 2.0: yes USB 3.0: no ---===>Device Information<===---String Descriptor for index 2 not available while device is in low power state.ConnectionStatus: 
HiRegarding STM32Cube version:I launch my STM32CubeMX and do Help About Which gives the following:Version 5.1.0STM32Cube V1.0Q1: Is this the “latest & greatest�? STM32Cube version?Regarding STM32Cube code generation (do I get new code?):I launch the STM32CubeMX project file (.ioc) I re-configure some TIM1 parameters (see attached picture):I then want new code to be generated for this new configuration.I do I File Save Project followed by a File Exit.I cannot see that any of the source code catalogs have a new, updated time/date.Q2: Do the STM32CubeMX really generate a new, updated (HAL, LL, …) software for my project?Regarding TIM1 used as PWM generator while ADCs are in use:I want to add a feature to my project: A need a fixed/constant 200kHz output-pulse.I try to configure TIM1-CH2 (PA.09) for this purpose, but no pulse is generated (tried lots of “TIM1-variations�?).Q3: Can I use TIM1-CH2 (PA.09) for this “PWM-purpose�? when I already are using ADC1 channel 1-16 (I assume t
I setup a project with STM32L476 and a SD card. The principel SD card is working if I use the demo project from the EVAL Kit. Now I wanted to build it with the CubeMX. I read the UM1718 and generated a SD code (for Keil MDK). The BSP_SD_ReadBlocks_DMA works, but unfortunately the ReadbackCall doesn t. So I always ran into the timeout, cause the ReadStatus never gets true.1.) Is there some documentation available, which describes, how to enable the Callback features ?I would highly appreciate some information about this.....
In my project for our STM32H743 board we need to access an SD-Card (SDMMC1) with FatFs. The supplied sample code for the eval boards is not created with CubeMX and therefore the structure is different and does not really help.I tried to implement a simple read directory function, but the SD-card state is not turning to "Ok". Card-Detect is working, Clock is output at 25 MHz, Signals look ok when booting the system (400 kHz, 25 MHz), CMD signals are coming, but then the file systems fails.Has anybody tried to implement this using STM32CubeMX? Is it enough to simply activate the MDMA Transfer1 for SDMMC1 data end using the default entries? Any recommendations for the Request Settings?Any help is very much appreciated!
Hi, Is there any support for the STM3240G _EVAL using SPI? I tried with the C:\STM32Cube_FW_F4_V1.23.0\Projects\STM32F4-Discovery\Examples\SPI\SPI_FullDuplex_ComPolling as there is a document that state this can be used for STM3240G_EVAL board but it doesn't work, is there any support for it?Besides I have tried the example from C:\STM32Cube_FW_F4_V1.23.0\Projects\STM324xG_EVAL\Examples\UART\UART_Hyperterminal_DMA but the example doesn't work properly. The aRxBuffer doesn't store any of the data from the keyboard.Is there any example or support?Thanks,SKY
I am trying to perform a multi-channel ADC read from the Nucleo-F091RC board and having difficulties, see attached for my efforts. I observe floating read values for all channels, see attached for description & example -Attached Debug Info:'main.c' - main routine from project'TestKit_ADCDebug - project.zip' - the project'demo generation notes.txt' - detailed debug description'Debug Read Example.png' - example debug resultHow can I make this successful? What is the issue here?
USE_SD_TRANSCEIVER is set to 1U by default when generating code for STM32H743. But I need it to be 0. I have to manually edit the "stm32h7xx_hal_conf.h" file every time after generating code and reset the flag to 0, which is annoying! I checked almost every setup page but I could not find where to set this flag. I use current version 5.0.1 of STM32CubeMX.Thank you for any hint!
I am trying to get the internal CPU temperature on an STM32H743. Source is generated with STM32CubeMX V. 5.0.When reading the internal temperature sensor (ADC3) I get different and too high values depending on the setting of the sampling time.When set to 810.5 = 68.1 °C 367.5 = 66.9 64.5 = 88.74I took the calculation formula from the manual which says:Temperature (in °C) = (110 °C – 30 °C) / (TS_CAL2 – TS_CAL1) * (TS_DATA – TS_CAL1) + 30 °CHere is my source code for reading the temp:called in main: HAL_ADC_Start(&hadc3);#define TEMP110_CAL_ADDR ((uint16_t*)((uint32_t)0x1FF1E840))#define TEMP30_CAL_ADDR ((uint16_t*)((uint32_t)0x1FF1E820))double adc_ReadInternalTemp(void){ static double dTemp; static uint32_t raw_value; static uint32_t T1_30; static uint32_t T2_110; raw_value = HAL_ADC_GetValue(&hadc3);
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.