Developer support experience survey - We value your feedback
Ask questions and find answers on STM32Cube packages, including HAL, LL and middleware, and expansion software.
Most recent activity
Hi, in CubeMX 6.1.1 with FW package 1.16.0. If I choice in SDMMC with DMA template enable and shared DMA channel CubeMX doesn't generate proper code. In BSP_SD_ReadBlocks_DMA and in BSP_SD_WriteBlocks_DMA miss setting for change DMA direction. Solution:__weak uint8_t BSP_SD_WriteBlocks_DMA(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks) { uint8_t sd_state = MSD_OK; __HAL_DMA_DISABLE(hsd1.hdmatx); hsd1.hdmatx->Init.Direction = DMA_MEMORY_TO_PERIPH; hsd1.hdmatx->Instance->CCR |= (uint32_t)DMA_CCR_DIR; /* Write block(s) in DMA transfer mode */ if (HAL_SD_WriteBlocks_DMA(&hsd1, (uint8_t *)pData, WriteAddr, NumOfBlocks) != HAL_OK) { sd_state = MSD_ERROR; } return sd_state; }__weak uint8_t BSP_SD_WriteBlocks_DMA(uint32_t *pData, uint32_t WriteAddr, uint32_t NumOfBlocks) { uint8_t sd_state = MSD_OK; __HAL_DMA_DISABLE(hsd1.hdmatx); hsd1.hdmatx->Init.Direction = DMA_MEMORY_TO_PERIPH; hsd1.hdmatx->Instance->CCR |= (uint32_t)DMA_CCR_DIR;
I'm on STM32CubeIDE Version: 1.9.0 Build: 12015_20220302_0855 (UTC), MCU STM32L4A6ZGTx, Firmware STM32Cube FW_L4 V1.17.1. I'm using a NUCLEO-L4A6ZG.I'm trying to get FatFS working on SDMMC, with DMA, and having problems. First, the bundled version of FatFS seems to be ancient. It is so old that it doesn't resemble the documented API at http://elm-chan.org/fsw/ff/00index_e.html. Is there a way I can update it such that my changes won't be wiped out each time I run or update the Device Configuration tool? The big problem is that it won't work if I select "Use dma template" in Device Configuration Tool/Pinout & Configuration/FATFS/Advanced Settings. If I disable "Use dma template", it works OK (with polling). With DMA enabled, it gets hung up here:SD_write() at sd_diskio.c:351 0x80081c8 disk_write() at diskio.c:104 0x800837c f_mkfs() at ff.c:5,661 0x8008af0 test() at test.c:23 0x80011fc main() at main.c:103 0x8000914 where I seeif(BSP_SD_WriteBlocks_DMA((uint32_t*)buff, (uint32_t)(se
I am having trouble integrating LevelX into FileX using the on board eMMC on the STM32H745I-DiSCO eval board. I am using standalone mode (no AzureRTOS). I have successfully implemented FileX to format, write and read the eMMC card in standalone. I am having trouble now integrating LevelX using the IOC file as a basis to generate code. When I try to format the eMMC card with the following call, it returns a status of 144. status = fx_media_format(&mmc_disk, fx_stm32_levelx_nand_driver, /* Driver entry */ // (VOID *)CUSTOM_DRIVER_ID, (VOID*) 0xEEEE, mmc_memory, /* Media buffer pointer */ sizeof(mmc_memory), /* Media buffer size */ "EMMC_DISK", /* Volume Name */ FX_EMMC_NUMBER_OF_FATS, /* Number of FATs */ FX_EMMC_DIRECTORY_ENTRIES, /* Directory Entries */ FX_EMMC_HIDDEN_SECTORS, /* Hidden sectors */ FX_EMMC_TOTAL_SECTORS, /* Total sectors */ FX_EMMC_SECTOR_SIZE, /* Sector size */ FX_EMMC_SECTORS_PER_CLUSTER, /* Sec
Hey folks. So for a beginner DIY fixed-wing flight controller, I am trying to incorporate servo values from an external receiver via SBUS [by FrSky (0-> Low, 1-> High; contrary to the standard SBUS by Futaba)] into my software.I found a good amount of code for the sum frame decoding, but appear to not receive any UART communication at all from the receiver.A UART RX Callback function generates an interrupt whenever there's a new frame received. The function is supposed to write a message via another UART to my Putty-terminal (which works fine), upon calling.Further into it, the SBUS frame gets torn apart and the individual channel values generated - but I'm not even at this stage, and by the looks of it, it should work fine. My code:/* Private user code ---------------------------------------------------------*/ /* USER CODE BEGIN 0 */ uint16_t failsafe_status; uint8_t buf[25]; uint16_t CH[18]; int lenght=0; uint16_t USB_Send_Data[]={0}; char msg[25]; void HAL_UART_RxCpltCallba
I'm using STM3G0B1 as I2C SLAVE device with NVIC+NoStretchMode since I2C Master device doesn't support the clock stretching.When HAL_I2C_AddrCallback is called (Read request from Master device), HAL_I2C_Slave_Seq_Transmit_IT seems not working because 0xFF is transmitted, not the expected value held by I2C_REGISTERS.I guess 0xFF is the default value with NoStretchMode to respond immediately to the request.How to resolve this issue? Is there a way to transmit the correct data with NoStretchMode for Read request? hi2c2.Init.NoStretchMode = I2C_NOSTRETCH_ENABLE; ... void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode) { if (TransferDirection == I2C_DIRECTION_TRANSMIT) { if (HAL_I2C_Slave_Seq_Receive_IT(hi2c, &regAddr, 1, I2C_FIRST_FRAME) != HAL_OK) { DBG_LOG("%s(%d): Error Receive Data", __func__, __LINE__); return; } } else { if (HAL_I2C_Slave_Seq_Transmit_IT(hi2c, I2C_REGISTERS + regAddr, 1, I2C_FIRST_FRA
Hello,I have a custom board setup with an STM32G071GBUxN and a TCPP03-M20.I have followed this STM guide for setting it up as a DRP device.It is able to negotiate as a sink with Source only devices, and it is able to communicate over LPUART1 to show the current contract and trace messages. The problem is most of the rest of the UCPD GUI doesn't work and during device startup one of the messages that shows up in the trace is "GUI Memory is corrupted". The line of code that throws the "GUI Memory is corrupted" message is located in bsp_gui.c on line 89 where it checks for a magic number located at 0x801F800 in memory. When I inspect the memory upon debug startup (before any user code is run) that memory location does not have 0xDEADBABEDEADF00D. There are, however, two other memory addresses that have the magic number stored correctly, but the code doesn't check those locations. It would be especially nice to have the VBUS and current plot portion of the UCPD GUI working for when I start
Hello!Recently I had problems with ping to my STM32 + LwIP + DP83848 + RMII. But the latest FW version 1.27.1, it works very well! But now I have problems with HTTP. Follow me and I show you how to create this bug.First of all I'm using:STM32CubeIDE 1.10.1STM32F407VGTFW 1.27.1To reproduce this bug, do the following steps.Step 1: Enable RMII by going to ETH -> RMII (Rx Buffer length 1524, MAC address 00:80:E1:00:00:00, Rx Mode = Interrupt, NVIC settings = Ethernet Global Interrupt)Step 2: Go to FREERTOS and enable CMSIS V2 and go to Task & Queues. Change the Stack Size (Words) in defaultTask from 128 to 1024.Step 3: Inside CMSIS V2, go to Advanced settings and set USE_NEWLIB_REENTRANT = Enabled. Leave everything else as default.Step 4: Go to LWIP and enable it. Set LWIP_DHCP = disabled in General Settings and then write in the fixed IP address. In my case it is 192.168.1.35.Step 5: Inside LWIP, go to HTTPD and set LWIP_HTTPD = enabled. Inside LWIP go to Key Options and set MEM_SI
Hello,I am trying to get USBX to work on my NUCLEO-U5A5ZJ-Q board independently from the example provided. I can copy and paste the project into the same directory location as the example (inside the firmware package) and it works absolutely fine. When copying the project to another location outside the firmware directory and reroute all the files that use the relative directory position of files to the true location of the files (done inside the project preferences window and inside the .project folder), the project builds without errors or warnings but the USBC does not enumerate.All of the project settings, IDE settings and file contents should be identical to the example.Is there anything I have missed because I don't understand why it wouldn't work exactly the same as the example. If anyone has experienced this problem before or has any ideas on why this might be happening / how to fix this issue I would be very grateful.(I'm using firmware version 1.7.0 & STM32CubeIDE ve
Hi,I am trying to use the internal DMA mode on USB_HS as a device mode. Can I get relevant USBD_LL_x api's which support it. And a sample example code which uses this DMA bus for configurations. Thanks,Srinath
I'm working with the STM32F769 microcontroller and I've defined a new section in the linker script using instructions from https://www.openstm32.org/Using%2BCCM%2BMemory : /* Emulated RAM in the JPEG peripheral */ HACK_RAM_JPEG_HUFFENC_AC0 (rwx): ORIGIN = 0x40024000, LENGTH = 352 /* JPEG->HUFFENC_AC0 */ .hackRamJpegHuffencAc0 : { . = ALIGN(4); KEEP(*(.hackRamJpegHuffencAc0)) *(.hackRamJpegHuffencAc0 .hackRamJpegHuffencAc0.*) } >HACK_RAM_JPEG_HUFFENC_AC0 /* Used by the startup to initialize data */ _sidata_HACK_RAM_JPEG_HUFFENC_AC0 = LOADADDR(.data_HACK_RAM_JPEG_HUFFENC_AC0); /* Initialized HACK_RAM_JPEG_HUFFENC section * * IMPORTANT NOTE! * If initialized variables will be placed in this section, * the startup code needs to be modified to copy the init-values. */ .data_HACK_RAM_JPEG_HUFFENC_AC0 : { . = ALIGN(4); _sdata_HACK_RAM_JPEG_HUFFENC_AC0 = .; /* create a global symbol at data start */ *(.data_HACK_RAM_JPEG_HUFFENC_AC0) /* .data sections */ *(.data
I'm very new to FileX, but I have been able to format an eMMC drive (FAT32) on a STM32H745-DISCO eval board along with being able to write a file to it and read from it.Question: since the eMMC drive needs to be formatted one time only (at lease I'm hoping only one time) at first power on, how does one detect whether or not the drive has been formatted successfully? I've reviewed and tried several FileX media API calls, but none seem to detect properly whether or not the eMMC has been formatted.Any help would be appreciated!!Thank you
Hi everyone,I’m currently working on interfacing the MX25R6435F NOR flash memory with the B-L475E-IOT01A development board using Quad SPI (QSPI), but I’m facing some challenges.I’ve followed the https://www.st.com/content/st_com/en/support/learning/stm32-education/stm32-moocs/stm32l4-hands-on-workshop.html but am facing issues with memory detection, QSPI initialization, and write/erase operations.
Hi everyone,I am working on implementing the Peak Current Control Method for a boost converter. As an initial step, I am trying to interface the sawtooth waveform for my ramp signal.I have followed the ST YouTube video on this topic:"STM32G4 Series Video App Note: DAC Sawtooth waveform generation for peak current mode buck converter",but I am still unable to generate the sawtooth waveform successfully.I would be really grateful if someone could help me with this. Any guidance or suggestions would be highly appreciated!Thanks in advance! :smiling_face_with_smiling_eyes:
Disclaimer: I don't normally use HAL, but I was trying to learn more about USB hosting so I decided to try out the demonstration application STM32Cube_FW_H7_V1.12.0 STM32H743I-EVAL USB_Host/CDC_StandaloneAs I don't have that board, I tried to hook up the LCD output to UART7, but I was surprised to find the baud rate as half what I intended.The baud rate was set with huart7.Instance = UART7; huart7.Init.BaudRate = 115200; huart7.Init.WordLength = UART_WORDLENGTH_8B; huart7.Init.StopBits = UART_STOPBITS_1; huart7.Init.Parity = UART_PARITY_NONE; huart7.Init.Mode = UART_MODE_TX_RX; huart7.Init.HwFlowCtl = UART_HWCONTROL_NONE; huart7.Init.OverSampling = UART_OVERSAMPLING_16; huart7.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE; huart7.Init.ClockPrescaler = UART_PRESCALER_DIV1; huart7.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT; if (HAL_UART_Init(&huart7) != HAL_OK)and my code for void HAL_UART_MspInit(UART_HandleTypeDef* huart)includes the lines P
Hello,program that is used to flash STM32H753VI processor (powered over USB) asks to disconnect and then connect again of USB connection to start with flashing. I found also a possibility to start with flashing without reconnecting USB, and that is with reseting mCU via NRST pin. I'm searching for an option to perform the same functionality programmatically. Would calling a function below do the same as reseting mCU via NRST pin?NVIC_SystemReset(); Many thanks.
Hi, I'm working on project, and as a part of it I need to establish an Ethernet connection between the 2 devices. The device is powered by STM32H7 MCU which is connected to Microchip LAN8670 PHY (10BaseT-1s). On the other side there is or another device, or the LAN8670 bases EVB LAN8670-USB dongle. from the EV side, Microchip provides driver for windows, and the dongle seems working. But from the PCB side it's more complicated - there is no driver for this PHY. As I understand, all the STM boards with ethernet have the same LAN8742 PHY, and HAL ETH drivers (also LwIP), are based on BSP driver LAN8742 (from ST or Microchip, both have it in their GitHub repositories). But the only 2 drivers I could find for LAN8670 are the Microchip Harmony driver for their MCUs (see their GitHub), and the oryx driver for cyclone TCP stack. So the only way I see, if someone hasn't did it yet, is to port thos
Hi everybody! I have searched almost half of the Internet and couldn't find any working example of these kind of technology combination: STM32H7 SDMMC IDMA + MDMA. I must say that without MDMA, everything works good (I'm aware of cache problems). But in my project I keep important variables in DTCM_RAM and I need that data that I read from SD-card directly goes to DTCM_RAM. That is why I need MDMA. I have found some settings for CubeMX that initialize MDMA controller, but don't know what to do next. So my question is: Is there at least one example, that can be shared with this great Community, that utilize SDMMC, IDMA and MDMA on STM32H7 µC? Please do not reply if your answer is "Check ST's example folder". I've already done it. There are lots of very useful examples there, but I didn't find a example that uses all three parts: SDMMC, IDMA, MDMA. Thank you for all your kind help!
Hello there,I am new to STM32 MCUs and been experimenting with different examples. I have below questions regarding WWDG.1. If you look commented section at line# 101 below. I understand the role of counter and window value but wondering where values 4096 and 64 are coming from?/** ****************************************************************************** * @file WWDG/WWDG_Example/Src/main.c * @author MCD Application Team * @brief This sample code shows how to use the STM32F769xx WWDG HAL API * to update at regular period the WWDG counter and how to simulate * a software fault generating an MCU WWDG reset on expiry of a * programmed time period. ****************************************************************************** * @attention * * Copyright (c) 2016 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 component. * If no LICENSE file comes with this
Hi,Can someone explain me why I have to use "+1" in vector table of STM32F103C8T6: vectors: .word STACKINIT @ stack pointer .word _start + 1 @ reset vector .word _nmi_handler + 1 @ .word _hard_fault + 1 @ .word _memory_fault + 1 @ .word _bus_fault + 1 @ .word _usage_fault + 1 @ instead of: .word STACKINIT @ stack pointer .word _start @ reset vector .word _nmi_handler @ .word _hard_fault @ .word _memory_fault @ .word _bus_fault @ .word _usage_fault @I thought that STM32F103C8T6 is 32bit processor and thus I can use: .code 32 .cpu cortex-m3 .syntax unifiedBut it is NOT true. I can use only THUMB (code 16) instructions.
Originally a comment on this Knowledge Base article - moved to the main forum for better visibilityHi @B.Montanari, @Lucas_Costa,I'm following your tutorial and trying to implement a web server on an STM32H747IIT6.In your post regarding the Ethernet settings, there is no field for setting the RX buffer address. Where should the RX buffer be placed?My code is running, but my device never gets an IP address assigned. I also tested this on a Nucleo H755ZI with the same issue.I'm using the latest version of CubeIDE (1.17) and the latest version of the middleware for the H7 series (Azure RTOS 3.3.0).Best regardsOskar P.
Hi,I'm currently working on a project involving the STM32H573 microcontroller and the LAN8742A Ethernet PHY. My goal is to implement a simple Ethernet loopback test to verify the basic functionality of the Ethernet interface. Could you please provide if you have anything? Thanks,Ravi.ch
I've been trying to set up TCP communication with NetX Duo on an STM32H563 now for several days with little success. I can receive one packet, but every packet sent after fails. I've gotten UDP, ICMP, DHCP, etc. to work fine, but TCP for some reason eludes me. Does anyone know of a step by step guide for what exactly is required to set up a listening socket for TCP with NetX Duo? Done extensive research and can't seem to find much helpful information. Thanks in advance.
I'm migrating source that has run for quite a while successfully on H755 to a new project so we can swap to the H733 micro for the increased memory security features.The project is not currently using the external OCTOSPI, building a reduced version that will fit in the onboard memoryI am having a run time hang with the UART8 at the very beginning of our app code after the FRTOS and main.c initialization.The situation is that the interrupt for the TX fifo watermark fires once correctly, I send the contents of the fifo, but then never fires again. If I set a breakpoint in the ISR, then hitting that breakpoint changes the behavior and we hit the interrupt repeatedly as expected when I manually run each time.The break changing the behavior made me think of interrupt contention or tasking, no sign we ever leave our main task and I have tried setting the uart8 interrupt priority from 5 to 0 and 16, no change in behavior.Obviously there are a lot of things that could be going on, but I
Hi, i am a student and quite beginner to STM32i want to use STM32U575RITX with both FreeRTOS and USBXi already tested this rebositoryhttps://github.com/ST-TOMAS-Examples-USB/U5_USBX_Device_CDC_ACM_Standaloneand it is working fine but it doesn't support FreeRTOS and the .ioc is different than the code itself. whatever i do it still doesn't work.thanks for advance
I think const-correctness is an important-enough concept to call this a bug report.In the HAL Driver for STM32F1xx, much of the codebase is not const-correct. For G4xx, I see that I2C is not.What is const-correctness in C?If a function that accepts a pointer to some data doesn't change that data, the function can tell the calling context that fact by declaring the buffer pointer to be const, like so:void i_do_not_change_the_data(const void * data_ptr);Then the calling context can be sure that the function will not attempt to write to the buffer, and can take advantage of compiler and language optimizations surrounding const arguments. One such (poor) example is a string literal, which can serve as a const char * argument, but not a char * argument.Most (all?) of the HAL functions that take pointers to buffers take non-const pointers, even if those functions don't write to the buffer. That means that I cannot write my own code to be const-correct without casting a
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.