Ask questions on STM32CubeMX. Discuss code generation and configuration challenges, among other topics.
Most recent activity
J'ai un projet qui consiste à comuniquer deux cartes stm32f411, j'ai essayé de le faire par connexion "usart", mais je ne suis pas arrivé encore à les communiquer, j'utilise les fonctions Hal, pour la transmission et la réception, elles fonctionnent mais dans le même fichier main.c; Lorsque j'essaie de séparer le projet l'un pour la transmission et l'autre pour la réception et je fait la connexion de la carte à l'aide de câbles croisés, c'est-à-dire tx avec rx et rx avec tx, le projet ne fonctionne pas pour moi. J'apprécierais toute l'aide que vous pouvez m'apporter et guider sur ce sujet. Comment fonctionne la communication "usart" entre les deux cartes?, Dois-je activer une pin?, Lisez les pin usart avec la fonction "read"? ou que dois-je faire? Merci beaucoup.HAL_UART_Transmit(&huart2,myRxData,11,10);HAL_UART_Receive(&huart2,myRxData,11,100);
Hello:I have used CubeMX to generate base code for a USB storage device in host mode. The last I see of it in the code is the call in main: "MX_USB_OTG_FS_HCD_Init();"Now I would like to take the next big step and try to connect, and write/read. Is there an actual example anywhere that I could reference? Looks like my package (IAR EWARM) went out of their way not to include a single example. A search of the web, including this community returned nothing. Any reference or link would be just great, thank you.Gary
Posted on June 19, 2018 at 14:21 Hi, I've been dealing with the SD card problem since the CubeMX version 4. Here are the corresponding parts of my code: ... ... ... /* USER CODE BEGIN PV */ /* Private variables ---------------------------------------------------------*/ FATFS myFATFS = {0}; FIL myFILE; UINT testByte; /* USER CODE END PV */ ... ... ... /* USER CODE BEGIN 2 */ if(f_mount(&myFATFS, SDPath, 1) == FR_OK){ char myPath[] = 'WRITE1.TXT\0'; f_open(&myFILE, myPath, FA_WRITE | FA_OPEN_ALWAYS); char myData[] = 'Hello World\0'; f_write(&myFILE, myData, sizeof(myData), &testByte); f_close(&myFILE); HAL_Delay(1000); } /* USER CODE END 2 */ ... ... ... Here, the problem is in f_mount, it doesn't go forward. Debugging further, the code stucks in 'ff.c' file at the following bold line (line 3050): /* Find an FAT partition on the drive. Supports only generic partitioning rules, FDISK and SFD. */ bsect = 0; fmt = check_fs(fs
I just designed a board with the new STM32F730Z8 value line with embedded USB high speed PHY. I'm using a 16MHz external crystal and I am using the default code generated with CubeMX. It fails in the USBD_Init function. Following it through at first glance I found that in usbd_conf.c there is this line:hpcd_USB_OTG_HS.Init.phy_itface = USB_OTG_ULPI_PHY;I changed the interface to USB_OTG_HS_EMBEDDED_PHY but it still fails. I imagine there could be some other settings that may be wrong as well. Any guidance on this?
Hello, I use the STM32F767ZI card and I want to use USB OTG host communication. For that I tested the program provided by STM32CubeMX, "FatFs_USBDisk". The program worked well. But when I tried to redo the program using CubeMX. The program compiled. I started the program in debugger mode but couldn't create the file on the USB drive. Is there a reason that the program generate with CubeMX doesn’t work?I’m using STM32CubeMX v5 with package STM32Cube_FW_F7_V1.14.0. Parameter of CubeMX:RCC -> HSE : BYPASS Clock Souce LES : Crystal /Ceramic ResonatorSYS -> Serial Wire Timebase Source : SysTick
Dear AllI am trying to use one of the timers on F303RE to toggle a pin at every count-up overflow event (let us say I need a jitter-free pulse). From CubeMx I get the impression that a GPIO pin can be associated with a timer and toggled by the event directly, that is without an interrupt. However, CubeMx does not seem to be generating the code that would be needed for setting the GPIO pins that have been associated with the selected timers. I have tried both Tim3 (associated with PA6) and Tim15 (associated with PB14), but no pulse appears at the pins. Again, I am not surprised because no code gets generated by CubeMx for setting the mentioned GPIO pins or for calling any TogglePin function. By contrast, I am seeing the code for setting GPIOA and GPIOC (for the LED and the blue button, respectively) as well as a HAL_GPIO_WritePin function for the LED), but nothing similar appears in the code for PA6 or PB14! I am not sure why this is the case.Any insight will be greatly appreciated. Ami
I'm using stm32f429nucleo 144, using CubeMX V5.0.0 with truestudio eclipse project how to enable and file(eg: mp3) transfer through ethernet
I update my Stm32CubeMX to 5.0, and open an old project , regenerate the code with ToolChain SW4STM32I have some floder missing, I must recreate the floder and copy the files into it.The old version of Stm32CubeMX is OK.Is there a solution?
Hi,I have a STM32F042F4Px. I would like to swap PA9/10 to PA11/12, but I'm having a hard time finding the option to do that in STM32CubeMX v5. This option still exists? Regards,Helder
Hiwith STM32CubeMX 5.1.0 on STM32F746BGTx there is an issue when I enable RS485.Cube doesn't genrate all funtions related to RS485, for example the main inizialization function HAL_RS485Ex_Init is not present in the code generated by Cuce.Attached the simple project file that generate the issue.Best regard.Gianluca Costa
Hi Guys, I want to see the content of my SD card in pc using USB mass storage. I implement my project using stmcubemx version 4.21.0. The SD card works meaning that I can create a .txt file and write something into it. When I put the SD card into adapter and connect to PC, I can also see its contents, as expected. However, i can not see its contents using USB mass storage! In usbd_storage_if.c file, there is a STORAGE_READ_FS function to read SD card contents using USB. SInce it is originally empty, I modify it as follows: int8_t STORAGE_Read_FS (uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len){ /* USER CODE BEGIN 6 */ HAL_SD_ReadBlocks(&hsd, buf, blk_addr, blk_len,
Prefer to have versions older than the STM32CubeF3 v1.10.0 release. Scot over to the website to see if they have options to download previous versions but to no success. Please help!
STM Blog Post for acquisition of Atollic
When setting the primary slave address for I2C in cubeMX for the STM32F1xxThe generated code will be the address * 2. This created address is incorrect. The address should not be multiplied by 2.for example: Set I2c Slave address to 0x50Generated code sets the OwnAddress to : 160. which is (0x50 * 2)The st does not response to the address 0x50, because the ownAddress is set to another value.
Hi all, I'm trying to set-up a simple USB read/write on our STM32F746G-Disco board using the FullSpeed OTG... but so far it seems that the code generated by CubeMX does not really work...If I'm not wrong, CubeMX in case of USB MSD enable the DMA template by default, but then it does not copy the usbh_diskio_dma.c and usbh_diskio_dma.h in the project folder.After disabling the DMA, I can now detect when an USB key is attached and I can see that it is enumerated, but then It fails to open any file after the f_mount() with the error "FR_NOT_ENABLED".It seems that I'm having the same issue described in: http://www.openstm32.org/forumthread3205Below is a small log. Best Regards, Giampaolo-----------System initializedStartDefaultTaskAPPLICATION_STARTFatFs initialized!USB Device AttachedPID: 5571hVID: 781hAddress (#1) assigned.Manufacturer : SanDiskProduct : Cruzer FitSerial Number : 4C530001010701111474Enumeration done.This device has only 1 configuration.Default configuration set.Switching
In CubeMX when choosing fatfs middleware it seems to require a gpio pin. Is that just a limitation in CubeMX? Basically is there a reliable software card detect mechanism using the existing SDMMC lines (4 pin SD card) or must an extra gpio pin be used to the sd card detect pin?Thanks,-Fred
When Memory Allocation is set to Static, generated code should not contains heap_1.c.Regards.
Dear all,I'am using a Nucleo-L4RZi with the STM32l4R5ZIT in combination with the software OPENSTM with STM32CubeMX plugin. Thy system clock is 120MHz, same thing for the USART clock.If I set a baudrate of 460800 on the LPUART1, all works correctly. Instead USART1, 2,3 doesn't work with a baudrate more than 115200 (No signal on TX pin), instead with 115200 the USART1,2,3 work correctly. Why?If you need more informations please do not hesitate to contact me.Thank you very much in advance for your time and help.Best regards;Alessandro
I migrate my CubeMx project that is based on stm32l072cbtx to version 5.0.1 but in connectivity menu, LPUART1 NVIC settings doesn't appear. So I can't enable LPUART1 interrupts with code generation. Is there any problem? or I've missed something
I'd like to organise a software tree that'll accommodatebootloader for a custom board,application for the board,multiple ways of building the application,bootloaders and applications of future "next gen" boards, anda moderate body of application software I'd want to re-use in all the app projects.I'd like this in a single repository, without duplicating any source files.I'm using IAR Workbench and/or TrueSTUDIO for STM32.Both IDEs supportmultiple projects, i.e. one for each of bootloader for board X, app for board X,multiple build ways, e.g. IAR uses "Configurations" and TrueSTUDIO (Eclipse) uses "Build Configurations", andlinking other directories of source files.The only part I haven't completely solved yet is STM32CubeMX. UM2285 Rev 1 figure 3 shows an .ioc file in a project directory and the Drivers and Middlewares directories it generates located several directories higher at the root of the software tree. Can anyone share how to get STM32CubeMX to generate like this please?Having
Hello,I'm using a STM32L433CCU3 in my Application with STM32CubeMX.I'm download my hex-files with the STM32CubeProgrammer in UART serial download mode.If I start my application directly after download with the "Run after programming"-function of the STM32CubeProgrammer my software runs 30% slower than as a start from a cold-boot.Is there any reason for this behaviour.Best regards Andreas Fecht
Using FreeRTOS + LwIP 2.xIn the generated file ethernetif.c you have:err_t ethernetif_init(struct netif *netif) { LWIP_ASSERT("netif != NULL", (netif != NULL)); #if LWIP_NETIF_HOSTNAME /* Initialize interface hostname */ netif->hostname = "lwip"; #endif /* LWIP_NETIF_HOSTNAME */Anyone using DHCP typically needs to provide a distinct host name (for example productName-serialNo). Needs a user code block here; possibly just wrap above assignment with a user code block so its generated with an easily overridable default.Thanks!Best Regards, DavePS: Example IOC to generate this code is attached.
CubeMX detects some kind of conflict, and places a yellow warning triangle.Bug 1) Moving the cursor around the triangle sometimes flashes a description of the conflict. Mostly cursor twitches wildly and the conflict is not displayed. When it is displayed it usually disappears quickly. Kinda hard to read this way!!Bug 2) The displayed conflict box says "Ctrl-D for details", but this doesn't work.Bug 3) The conflicts are not included in the generated report.Please see attached example and look at timer 2.What exactly is the problem with timer 2?How is a customer supposed to find out?Thanks,Best Regards, Dave
Dear technical support I'd like to notify you that seems that there is an error in you CUBE version 4.24 until the latest one 5.1 (i checked one by one and there is an error with the DMA RX in circular) Before (with previous CUBE versions) I was using the Nucleo-STM32F767ZI and I was able to communicate continuously through the UART 8 in DMA mode (circular RX). However, now that I updated my .ioc file to the newest CUBE versions I'm not able to continues receive information in Rx, i.e. it only receive the information in Rx one time and the values are not updated (values sent by an external terminal), then if I press the reset button on the Nucleo board the value is updated. It doesn't matter if I select Rx as Normal or Circular mode, there are not changes at all. I'm attaching my CUBE file to take a look, I have to mentioned that I downgrade the version (Cube 4.24) in order to see if the problem was with the version Cube 5.1 but still the same not able to have changes wi
When internal clock selected for example a timer, CubeMX should display the clock used for the specific timer and frequency (ie APB1 42MHz). When a clock divisor is selected, show the resulting frequency. Do Not show "baud rate" for SPI, as SPI devices are always specified by frequency.
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.