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
The issue is that I am able to create a bin file, write data into the SD-Card properly. But when I read data, it is not proper, and the data is corrupted. It worked well previously but the same code is not working now. Could you please check where I am wrong. I am using STM32L496ZGT6. I am using a Micro SD Card adapter.WRITING FUNCTION void push_to_stack(data *newData) { fres = f_mount(&fs, "", 0);if (fres == FR_OK) {transmit_uart("Micro SD card is mounted successfully for writing!\n");} else if (fres != FR_OK) {transmit_uart("Micro SD card's mount error!\n");} fres = f_open(&fil, "log-file.bin", FA_WRITE| FA_OPEN_ALWAYS );if (fres != FR_OK) {transmit_uart("Failed to open file for writing.\n");f_mount(NULL, "", 1); // Unmount before returning}fres = f_lseek(&fil, f_size(&fil)); if (fres != FR_OK) { transmit_uart("Error seeking to the end of the file.\n"); &
Hi,I am trying to write, read and erase properly on a 4 GB Insignis EMMC (NSEC53K004-IT/-AT) with up to 250 MB/s read and 14 MB/s write.I currently use the STM32Cube FW_H7 V1.9.0 and am unsure regarding the adjustments that need to be done to the generated code, as there have been fixes to described issues that I found here in the forums in other threads.e.g. https://community.st.com/s/question/0D50X00009sVjaySAC/stm32h753-sdmmc-driver-not-working-properly-sdk-v130(where a DTMODE adjustment is described for DDR)Would that still be necessary? The mode 3 still is not officially defined.// in stm32h753xx.h #define SDMMC_DCTRL_DTMODE_2 (0x3U << SDMMC_DCTRL_DTMODE_Pos) //in stm32h7xx_ll_sdmmc.h #define SDMMC_TRANSFER_MODE_BLOCK_STOP SDMMC_DCTRL_DTMODE_2 // in stm32h7xx_hal_mmc.c // in read/write dma function set transfermode to: config.TransferMode = SDMMC_TRANSFER_MODE_BLOCK_STOP;I am also unaware what is the current situation with this remark from the thread, as I don't
Currently using STM32L4R9I-Discovery. I want to pass an entire buffer to a sd card using idma sdmmc double buffer mode.The main goal is to pass a large amount of data into a small buffer divided in sub-buffers (in a circular way) to save memory.In my case, I start with a small buffer just to try the sdmmc idma. My code fills a buffer with dummy values.I define 16 sectors of 4800 bytes (length of each IDMA buffers) (16*4800=76800).I launch the sd write for a 76800-byte long (multiple of 512 so no zero-padding needed).When the current idma buffer is filled, the HW switches address buffers (IDMABASE0 to 1 or IDMABASE1 to 0).So I increment the inactive IDMABASEx by 2*IDMA_BUF_SIZE_BYTE so the whole buffer is passed through.SDMMC is clocked at 120MHz/5=24MHz (but it shouldn't be relevant in this case study).Here is my code: #include "main.h" #define BUF_LEN_BYTE (320*240) // 0x12c00 #define BLOCK_SIZE 512 // in byte #define IDMABNDT_VAL 150 // see SDMMC_IDMABNDT #define IDMA_
I found senduvdm callback in usbpd_vdm_user,c "USBPD_VDM_SendUVDM(uint8_t PortNum, USBPD_UVDMHeader_TypeDef *pUVDM_Header, uint8_t *pNbData, uint32_t *pVDO)"; and just found one interface,USBPD_StatusTypeDef USBPD_PE_UVDM_RequestMessage (uint8_t PortNum, USBPD_SOPType_TypeDef SOPType ), which can't set my data,and how to send an uvdm package after call a "send interface" ?
Hey folks,I need assistance with resetting an Analog Devices ADC. I need to generate high output for 1000 or 4000 ns from my Nucleo F401RE board.As shown in the attached image, I need to set the pin low, then high for a specific duration, and then low again. I tried using TIM4 with Output Compare CH1 and One Pulse Mode, as well as other modes, but it does not seem to provide the required low-high-low sequence. At least, I was unable to achieve this.I had slightly more success with PWM generation on CH1, where the curve appears correct, but it is repetitive. However I can stop the timer but the goes high again.Could someone with relevant experience provide a roadmap? Any advice would be greatly appreciated.Thanks!
Hello there, I've been stuck for hours on setting up a simple UART transmission of the character 'A' on myNucleo L053R8 Board.Thing is, my oscilloscope does not show anything on my PA2 pin. It should be HIGH in idle state though.Am I missing something, because this is a low power board and it needs special configuration?My other fear is that I'm missing some linking options, since I'm not using HAL libaries and have configuredit myself. I've checked the registers like 100 times. Both pins PA2 and P3 are configured for AF4, justas the datasheet says.So here is my reduced code: #include <stdint.h> #include <ctype.h> #include <stm32l053xx.h> void UART2_Transmit(char data) { while ((USART2->ISR & (1<<7)) == 0) { } USART2->TDR = data; // Write the character to the TDR register for transmission } int main(void){ /*Initialisierung GPIO + Takt*/ RCC->IOPENR |= RCC_IOPENR_GPIOAEN; // Anders auf diesem STM32 sonst AHBENR RCC->IOPENR |= RC
I see ST released long awaited Code for their bootloader compatible with STLINKV3+CubeProgr/CubeCLI...What about the Host side?, a STM32 hosting the bootloader process for another STM32, standalone.Any links or fingers pointing to people putting effort into this Bootloader Hosting stuff would be appreciated.
Hello, I am trying to add the webusb descriptor to this code snippet to include the landing url but I cannot see a get device descriptor request for the webusb url in the request handling part of the code.__ALIGN_BEGIN uint8_t USBD_FS_BOSDesc[] __ALIGN_END ={0x05, // Length0x0F, // Binary Object Store descriptor0x1D, 0x00, // Total length0x02, // Number of device capabilities// WebUSB Platform Capability descriptor (bVendorCode == 0x01).0x18, // Length0x10, // Device Capability descriptor0x05, // Platform Capability descriptor0x00, // Reserved0x38, 0xB6, 0x08, 0x34, 0xA9, 0x09, 0xA0, 0x47,0x8B, 0xFD, 0xA0, 0x76, 0x88, 0x15, 0xB6, 0x65, // WebUSB GUID0x00, 0x01, // Version 1.00x02, // Vendor request code0x06, //iLanding page index}I tried to debug to see if a request is being made with the vendor Id of 0x02, but I don't get any device request for the urlUSBD_StatusTypeDef USBD_StdDevReq(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req){USBD_StatusTypeDef ret = USBD_OK;switch (req->
In my system, I initialised two interrupts for wake-up from STOP2 mode, after exiting STOP2 mode, how do I know that the system is waking up by RTC timer or interrupt pin? Is there any variable that I can check after waking up to find the reason why the system is wake?
..
I do have problem to check wake up flag after wake-up from RTC timer or interrupt pin. This is my code block to check flag after wake-up: void InitiateMode(int timeValue) { turnOffPeripherals(); timeValue = getTimeValue(timeValue); printf("\ngetMilSecBInSecond : %d\ntimeValue : %d\n\n", getMilSecBInSecond(), timeValue); HAL_SuspendTick(); HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, timeValue, RTC_WAKEUPCLOCK_CK_SPRE_16BITS); printf("Boot : "); printf("%d\n", bootCount); printf("Sleep mode Start\n"); printf("Enable deep sleep, Will wake up in %d seconds\n\n", timeValue); /* Enter STOP 2 mode */ // HAL_PWREx_EnterSTOP0Mode(PWR_STOPENTRY_WFI); // HAL_PWREx_EnterSTOP1Mode(PWR_STOPENTRY_WFI); getTotalTime(); // betol2 sebelom HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI); printf(" 2\n"); // Check RTC Wake-Up Timer Flag if (__HAL_RTC_WAKEUPTIMER_GET_FLAG(&hrtc, RTC_FLAG_WUTF) != RESET) { // Wake-up event detected, clear the flag __HAL_RTC_WAKEUPTIMER_CLEAR_FL
Hello,I was trying to understand the leakage in my STM32L073 based board. After programming with this code for 3 different boards I am now unable to connect to board both using the programmer and IDE. I have tried BOOT0 and nRST combo to connect but have failed. What could be the reason and how do deal with this? #include "stm32l0xx_hal.h" void main() { // Configure PC10 and PA12 as pull-downs GPIO_InitTypeDef GPIO_InitStruct = {0}; __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); // Configure PC10 as input with pull-down GPIO_InitStruct.Pin = GPIO_PIN_10; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; GPIO_InitStruct.Pull = GPIO_PULLDOWN; HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); // Configure PA12 as input with pull-down GPIO_InitStruct.Pin = GPIO_PIN_12; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); // Disable SysTick interrupt HAL_SuspendTick(); // Clear wake-up flag PWR->CR |= PWR_CR_CWUF; // Enter Stop Mode HAL_PWR_EnterSTOPMode(PWR_LOWPO
Hi, we are developing a custom board with the STM32F405 as main micro-controller.Actually We can communicate with some flash drives and create directories and files , but with others we simply get "FR_DISK_ERR".Some of them are detected by the Host because we can detect that current is being delivered to them, but others do nothing. For example with some flash drives (Kingston) it works nice but with others It doesn't. (Doesn't matter if they are 2.0/3.0).It seems to be relqted to the certification of each USB stick. For exampleKingston 2.0 64GB works excellentKingston 2.0 16GB doesn't workSandisk 2.0 16GB doesn't workKingston 64GB 3.0 works excellent Maybe some of them aren't original , (just clones, IDK)All of them are formated to fat32. (Also tried exFat)So it seems to be a problem with uncertificated USB sticks. The question is: how can we solve it so the board can work with a huge variety of them? Is there any library or solution that improves this? Or how wo
Hello,We are looking for recommendations regarding the use of the following repository/software package: I-CUBE-USBD-Composite https://github.com/alambe94/I-CUBE-USBD-Composite to implement USB composite functionality (Mass Storage + USB CDC).Currently, we are using it on an STM32U5 MCU, and it is working as expected.Thank you in advance for your insights!
I have a project that uses DMA in circular mode, and i've implemented the half and complete interrupts necessary to manage the transfer. I'm using just 2 nodes, and I've noticed that I get a complete interrupt to start the transfer, and then the expected half-complete-half-complete-etc pattern I'd expect. I've definitely enabled the HT interrupt, but i still always see the TC hit first to start the process.What is that? Is it a nuance of circular mode?
Hello,I observed how is going after HAL_PWR_EnterSTOPMode() execution without setting by HAL_RTCEx_SetWakeUpTimer_IT().Then strange phenomenon occurred.I presumed that power stop mode continues till interrupt and systick works even under power stop mode before experiment.But after dozens of seconds from entering stop mode, MPU wokeup through reset and systick stopped.How could I realize that systick works normally under power stop mode and not to wake up till interrupt?Thanks,
I want to receive data from my host PC through USB. I'm using the STM32C0 series nucleo board as USB HID device. I have assigned the value of capslock to the user button. and when the button is pressed i want to turn on the user led on the board. the problem is that when i press the user key on stm32 it glows the led but when i press the capslock key on another hid keyboard attaced to my pc then the output is not reflected on the stm32 board. that means it is not receiveing data from host properly . if it's not receiving data properly then why it is turned on by user button . my endpoint settings are as follows. /* USER CODE BEGIN USB_Device_Init_PreTreatment_1 */HAL_PCDEx_PMAConfig(&hpcd_USB_DRD_FS, 0x00, PCD_SNG_BUF, 0x0C);HAL_PCDEx_PMAConfig(&hpcd_USB_DRD_FS, 0x80, PCD_SNG_BUF, 0x4C);HAL_PCDEx_PMAConfig(&hpcd_USB_DRD_FS, 0x81, PCD_SNG_BUF, 0x8C); // EP1 INHAL_PCDEx_PMAConfig(&hpcd_USB_DRD_FS, 0x02, PCD_SNG_BUF, 0xCC); // EP1 OUT/* USER CODE END USB_Device_
Hello @ASEHST , Your fix worked for me, suspend systick before entering into STOP3 mode. But currently I'm working with Zephyr RTOS and using STM32 HAL drivers to enter into STOP3 mode, with zephyr 3.2.0 version we got same issue as control is coming out from STOP3 mode immediately, but after suspending systick it worked fine. we currently migrated zephyr version from 3.2.0 to 3.6.0, after migration now control is not coming out from STOP3 mode. Since above fix worked fine with zephyr 3.2.0, we raised one ticket in zephyr forum to understand issue with zephyr 3.6.0, but we didn't get any support from them, since we are using STM32 HAL driver, and they suggested us to get help from ST. Attaching the zephyr ticket for your reference. With Zephyr 3.6.0 control is not coming out from STOP3 mode · zephyrproject-rtos/zephyr · Discussion #83521 Can you please help me to figure out the issue. Attaching two patch file one for zephyr 3.2.0 version and one for zephyr 3.6.0, you can run
HiMy board is STM32F407G so I want to understand the tx mailbox callback once interrupt hit I am sharing project in which I am sending CAN1 to CAN2 and CAN2 to CAN1 in loop back mode same ID.So rxindication is working fine and this is the project I got from one of your technical executive ,so how will "hcan->TxMailbox0CompleteCallback(hcan);" get called because in above line we are clearing "/* Clear the Transmission Complete flag (and TXOK0,ALST0,TERR0 bits) */__HAL_CAN_CLEAR_FLAG(hcan, CAN_FLAG_RQCP0);"which also clears "if ((tsrflags & CAN_TSR_TXOK0) != 0U)" TXOK0 bit also so if condition will not satisfy . please guide me /* Transmit Mailbox empty interrupt management *****************************/ if ((interrupts & CAN_IT_TX_MAILBOX_EMPTY) != 0U) { /* Transmit Mailbox 0 management *****************************************/ if ((tsrflags & CAN_TSR_RQCP0) != 0U) { /* Clear the Transmission Complete flag (and TXOK0,ALST0,TERR0 bits) */ __HAL_CAN
I'm trying to set up USB host on the STM32F411CEU6 (blackpill board). It's been hard to find examples specifically for this chip so I have put together my current code based off of other F4 chip examples with some modifications for this specific chip, but I'm having an issue where the CPU will hang due to interrupts once it makes it to the enumeration phase (I'm pretty sure 100% of the CPU is being used by the interrupts).When I connect a device, it succesfully detects the device and runs through the state machine up until the `HOST_ENUMERATION` state, at which point it will just hang completely. Following the usb host function chain all the way, specifically once `phost->Control.state` is set to `CTRL_DATA_IN_WAIT` will it hang (in `USBH_HandleControl`). I have stepped through the code using the debugger and I have found that it gets permanently stuck in the `HAL_HCD_IRQHandler` function. It specifically always takes the `Handle Host SOF Interrupt` and `Handle Host channel Interrup
I need to connet usb camera to stm32h743. But I can't find UVC(USB VEDIO CLASS) in STM32Cube_FW_H7_V1.11.x\Middlewares\ST\STM32_USB_Host_Library\Class. There is no UVC in cubemx too. Any idea to achieve ti?
Hello everybody,i have a strange behavior when doing the linear calibration in ADC1 of the STM32U585.When the bit is not set while calibrating the ADC the result is pretty good. I average the DR value 16 times and the average result is about 3698 which results in a temperature of about 32.21°CSo far so good. Unfortunately when the ADC_CR_CALLIN bit is set the measurement result is "wrong" what means the average is about 1643. The resulting temperature is -142 °C, which is wrong. Anyone an idea why this fails ?I compared the registers before measurement and they are pretty much the same except the CALLIN bit.Side note: this is a custom board where VDDA and VREF+ pins are connected to a 3.3V source.Thanks in advance.
Where can i find the firmware upgrade application? I downloaded the most recent (1.28.1) stm32f4 package but under projects there's no FW_Upgrade folder.I have an older package (1.1.0) and i can effectively find the firmware upgrade application there but i was looking for something newer, if it exists, to run the project smoothly in STM32CubeIde.Thanks a lot and have a great day!Omar
hey how to use printf in stm32f429i-disc1 board and my mcu is stm32f103cbt6
Hi community, I´m using an STM32F411RE with which I plan to create a custom bootloader with specific functions located on sector 7 of flash memory. These functions will read the data stored in an external EEPROM that contains a .hex file, which should then be read and written to address sector 0 of the flash memory. Once this is completed, the new program will be executed. (Perhaps it may be better to switch up the sectors?)In other words, the idea is to update the STM32 firmware whenever there is a new update by querying a webpage, which will then respond to the STM32 and send the .hex file to be stored in the external EEPROM. The STM32 will enter bootloader mode once all data has been sent, load the new firmware into the flash memory, and execute the new program. I’ve attached an image to reinforce the idea.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.