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
Hello,When I try to read USART status register (RXNE bit), the execution stucks upon while loop which means no data have been readen: char uart2_read(void) { while(!(USART2->ISR & USART_ISR_RXNE)){} return USART2->RDR; } I think I initialized everying neccessary to receive (and transmit) data: void uart2_rxtx_init(void) { RCC->AHBENR |= RCC_GPIOA_ENABLE_FLAG; RCC->APB1ENR = RCC_USART2_ENABLE_FLAG; //PA2 ALTERNATIVE FUNCTION SET GPIOA->MODER &= ~(1U << 4); GPIOA->MODER |= (1U << 5); //AF7 GPIOA->AFR[0] |= (1U << 8); GPIOA->AFR[0] |= (1U << 9); GPIOA->AFR[0] |= (1U << 10); GPIOA->AFR[0] &= ~(1U << 11); //PA3 ALTERNATIVE FUNCTION SET GPIOA->MODER &= ~(1U << 6); GPIOA->MODER |= (1U << 7); //AF7 GPIOA->AFR[0] |= (1U << 12); GPIOA->AFR[0] |= (1U << 13); GPIOA->AFR[0] |= (1U << 14); GPIOA->AFR[0] &= ~(1U << 15
Hi there,I am seeking some guidance regarding the connection of the STUSB1602 to the STM32L031G6U6 microcontroller for a low-power application with a small footprint.Currently, I have already connected the STUSB1602 to the microcontroller using the I2C interface. However, I am uncertain about the compatibility of the MCU, also wether do I need to connect the SSI pin interface. Given that I am relatively new to designing circuits, I am seeking clarification and advice on this matter.Could you please provide insights into how I can properly connect the STUSB1602 to the STM32L031G6U6 microcontroller using the SSI pin interface? Additionally, I would appreciate any recommendations or resources that could assist me in ensuring compatibility and optimal performance. I have also attach the schematic I'm talking aboutThank you very much for your time and assistance.
Hello, I'm trying to determine the source of the wakeup flag, whether it's the power being turned on or the trigger of wakeup pin 2.So this is my shutdown function:After i changed my shutdown function : when I try to determine the reason for the wakeup, the register `PWR->SR1` is always 0 when I turn the power on and when I trigger wakeup pin 2. Is the `PWR->SR1` register reset after waking up from shutdown mode ? I tried something just for testing : I enabled the wakeup pin in low polarity before checking the register. So, when I trigger the wakeup pin, the `PWR->SR1` is 0, and when I power on the device, it is 2. With this, I can determine the wakeup source, but I don't think it's a good solution : Can you please give us some feedback about this issue ?Thank you in advance.Regards
Hello ST Community,I am currently working on a project using the Nucleo-H753ZI without an RTOS, and I have followed a tutorial by Controllers Tech to set up TCP/Ethernet. I am using Static IP assignment.I can Transmit and Receive data though Hercules Tool. However, when I try to use the ModbusTool for TCP connection, the STM32 does not seem to receive any data.Problem Description:Ethernet setup is successful, and data transfer works with Hercules software.Using ModbusTool for TCP connection results in no data being received by the STM32.Configuration Details:While following the Controllers Tech tutorial, I noticed some differences in the CubeMX configuration options compared to what was shown in the tutorial. Despite these differences, I managed to configure the Ethernet settings and get it working for data transfer using Hercules software.Differences:I have used RMII instead of MII.I do not have Rx Buffer Address option in Ethernet Parameter Setting.Steps Taken:Followed the Controller
Hi,I would like to create a gamepad that is recognized by the computer (windows), and have the Virtual Com Port (CDC) to send en receive data with the computer. For that, I want to create an USB Composite with HID+CDC. I found an exemple on this website https://www.programmersought.com/article/18127793400/, I followed the guide, correct the warning and error and now my STM32 is recognized ! In device and printer I see the Jubeat Controller, and in device manager I see the serial USB (COMX). To test both, I simulate button push every 1s for the HID and look the button state in device and printer, and for the VCP I open putty, configure the port com and make an echo of what I write on the keyboard. My problem is that when I write something on putty, I have an hardfault. The problem was that the buffer receive in static int8_t CDC_Receive_FS(uint8_t* Buf, uint32_t *Len) was not the value in RxBuffer but a strange address. I try to correct it by replacing different thing abo
i use stm32f407vgt chip with my own board designand working on STM32CubeIDE_1.3.0 void USART3_IRQHandler(void) { /* USER CODE BEGIN USART3_IRQn 0 */ //USART3->SR &= ~USART_SR_RXNE; LL_USART_ClearFlag_RXNE(USART3); static unsigned char iteration,buffer[4],validation; unsigned char data; data = USART3->DR; // the character from the USART1 data register is saved in t dat3 = data; dat6 = validation; if(data == 'Z') { validation = 1; iteration = 0; } else if(validation == 1) { if(data == 'Y') { validation = 2; } else validation = 0; } else if(validation == 2) { buffer[iteration]=data; iteration++; if(iteration == 4) { //move to global variable acc_y = buffer[0]; acc_x = buffer[1]; gyro_p = buffer[2]; gyro_r = buffer[3]; //convert to signed integer if(acc_y >= 128) acc_y -= 256; if(acc_x >= 128) acc_x -= 256; if(gyro_p &g
Hello,I have created my own board in zephyr (using STM32U575).Now I would like to configure the power mode pins (CSLEEP, CDSTOP, SRDSTOP ) in the devicetree of the board.I have therefore implemented the configuration for the pins in the .dts file: &pinctrl { csleep: csleep { pinmux = <STM32_PINMUX('A', 5, AF0)>; }; cdstop: cdstop { pinmux = <STM32_PINMUX('A', 6, AF0)>; }; srdstop: srdstop { pinmux = <STM32_PINMUX('A', 7, AF0)>; };};However, the pins are not set correctly with this setting alone.Normally, the pins should now be assigned to a periphery.If I now assign these pins to any periphery, it works: &lpuart1 { pinctrl-0 = <&lpuart1_tx_pa2 &lpuart1_rx_pa3 &csleep &cdstop &srdstop>; pinctrl-names = "default"; current-speed = &l
hello,expertorI wanted save lillte data about 2K,to stm32F407_ve internal flash.but,i study demo about FLASH_EraseFlash,it only have erased sectores.F407 ve have 4(16K) sectores,1(64K) sector and 3(128K) sectores.its waste for only 2K data.have others ways?why not have erase page(2K)?in HAL api fuctoionesthanks
Hello everyone,Now I am trying to test the Ethernet on our custom board with STM32F765 and MAX24287 via MII mode. Firstly I configure to test the transmit receive raw data with diagnostic loopback mode. From oscilloscope I saw the the data output from TX[0..3], TX_EN, RX[0..3]. RX_DV and all of them are correct with my test setup data. So this is sure that there are data signals come to RX pins of STM32. However, from SW side, I can not read the received data.In main function:" char message[64] = {0}; struct pbuf *p_tx = NULL; for(int i=0; i<64; i+=8) { message[i+0] = 0x01; message[i+1] = 0x23; message[i+2] = 0x45; message[i+3] = 0x67; message[i+4] = 0x89; message[i+5] = 0xab; message[i+6] = 0xcd; message[i+7] = 0xef; } p_rx = pbuf_alloc(PBUF_RAW, sizeof(message), PBUF_RAM);&nb
Hello, ST expert STM32F407 is used for our custom design. And htim2 play the role of precise timing base.When htim2->Instance.CNT = xx is used for setting a new counter start value for timer2, it seems that the new counter value does not functions immediately, I mean that the next counter value does not appear one clock period later. Is there any timing diagram when TIMx_CNT register is written by user program? BRYang
Hello together,even this is freeRTOS related, i hope this is the correct place for my problem.I have the following Board with an STM32F407VET:I started from a github repo with a working configuration:https://github.com/art103/JZ-F407VET6I removed everything I don't need in my .ioc file, created the code and added the following files to the while()-loop in the main function:HAL_GPIO_TogglePin(GPIOE, LED1_Pin);HAL_Delay(500);HAL_GPIO_TogglePin(GPIOE, LED2_Pin);HAL_Delay(500);HAL_GPIO_TogglePin(GPIOE, LED3_Pin);HAL_Delay(500);and I can see that the LEDs are changing, so I expect the basic setup is correct.But as soon as I add freeRTOS to my project, create the code again and add the following code to my only task:for(;;){osDelay(100);HAL_GPIO_TogglePin(GPIOE, LED1_Pin);osDelay(100);HAL_GPIO_TogglePin(GPIOE, LED2_Pin);osDelay(100);HAL_GPIO_TogglePin(GPIOE, LED3_Pin);osDelay(100);} nothing happend, it looks like this Task is never started at all.I use CMSIS_V2 interface for freeRTOS, c
Hello,I'm contacting you regarding a support request concerning the wakeup from shutdown mode of the STM32C031C6T6: The issue we're facing is that __HAL_PWR_GET_FLAG(PWR_FLAG_WUF2) returns True when I power up my STM32, even though I haven't triggered the wakeup flag (which is tied to a button). I solve this issue by adding a delay of at least 5 ms before calling this macro.Does anyone know if this delay is always necessary? Thank you.Best regards.
hi I want to implement mass storage class in STM32H743BG controller. but there is no SDIO pin, we arrangement for SD card and external flash.it is possible to implement it on external flash(IS25lQ128).thanking you
I am trying to read multiple ADC channels using the Stm32l072 microcontroller, but in CubeMX, the options for rank assignments, which I normally use to read the channels, are not available. After manually adding these rank assignments to the init functions, I noticed that when I try to read multiple channels in normal mode, both channels show the same values, indicating that I am unable to perform multi-channel reading.I then attempted to perform this ADC reading using DMA, but observed that my reference voltage, which should be around 4095, was divided by the number of channels I was reading. For example:Number of channels to read: 4 -> VREF ADC value: 1.023Number of channels to read: 3 -> VREF ADC value: 1.365Normally, my VREF should be 3.29V, which is very close to 4090. This observation led me to realize that I am unable to read even a single channel correctly. How can I perform multiple ADC readings with this microcontroller?
Hi, I'm using an STM32L4R9 on a custom board with USB.The project has the Host Only and Device Only implementations of the CDC Device and a MSC Host stacks.As we don't have a USB-ID pin, we can't really use the normal OTG behaviour, so the project is configured for Host Only mode.In my default FreeRTOS task I start out in one mode, and after being disconnected for a certain timeout, I will switch to the other mode, to see if that one does find a device/host. The default task looks a bit like this:void StartDefaultTask(void *argument) { appState.isUSBDEVICE = false; MX_USB_HOST_Init(); for(;;){ if (appState.isUSBDEVICE) { // Running CDC Device stack if ((hUsbDeviceFS.dev_state == USBD_STATE_DEFAULT) || ((hUsbDeviceFS.dev_state == USBD_STATE_SUSPENDED))) { // No active connection if( timeout ){ USBD_Stop(&hUsbDeviceFS); USBD_DeInit(&hUsbDeviceFS); appState.isUSBDEVICE = false; MX_USB_HOST_Init(); } } } else { // Running MSC Host stack if( hUsbHostFS.
Hi,I recently created a custom board based on STM32G030 IC and programmed it via UART to run my application. Now, I want to make some changes to my firmware, but I can not connect to the CubeProgrammer. I have tried connecting it via UART and ST-LINK. Below are the errors i get when I try to connect the board via different methodsvia UART- "Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again... "via ST-Link- "Error: No STM32 target found! If your product embeds Debug Authentication, please perform a discovery using Debug Authentication". The interesting thing here is that CubeProgrammer reads the board as a Nucleo-F303RE(I am using the ST-LINK from this board and have removed the necessary jumpers i.e on CN2)I have tried to give 3.3V to pin 19(PA14) of the IC which is the Boot0 pin and restarting the board, but I am still not able to program the board. I can confirm that the IC is running the
Hello everyone, the STL_programmer currently calculates the CRC only for the in-use memory or up to the binary file size. Is there a way to fill the remaining flash memory with zeros and calculate the CRC for the entire flash area, eliminating the need to constantly update the section value based on the binary size?" Basically how i can run the STL flash test for the complete flash area even the unused portion, Anyone suggest some way please.
Hi, I am trying to create a connection through ethernet with lwip however I stuck at netif down I guess it related with flags which are checking the connection. I am using STM32H735 board. lwip.c file codes are taken from the github (https://github.com/stm32-hotspot/STM32H7-LwIP-Examples/blob/main/STM32H735_Disco_ETH/LWIP/App/lwip.c) that is recommended in the forum for IDE 1.9. (FreeRTOS is being used.) netif_add(&gnetif, &ipaddr, &netmask, &gw, NULL, &ethernetif_init, &tcpip_input); while(1){ netif_set_default(&gnetif); if (netif_is_link_up(&gnetif)) { netif_set_up(&gnetif); break; } else { netif_set_down(&gnetif); }netif_set_link_callback(&gnetif, ethernet_link_status_updated); }
CONTEXT:I have been working with an STM32F429ZI Nucleo, trying to connect a USB thumb drive, to update the user application firmware. I have started with the MSC_Standalone project as it exists as an example for the F429ZI and I have been integrating relevant files from a firmware upgrade project (FWupgrade_Standalone) available for other controllers. I have not been using the Adafruit TFT shield, which the example relies on, and have removed/modified code related to it.PROBLEM:From my while(1) loop in main.c I'm calling the USBH_Process() function in the usbh_core.c file, and I am getting stuck with USBH_BUSY in the HOST_CLASS_REQUEST case. I followed the function calls down through the layers, and have found while debugging in the USBH_HandleControl() function (in file usbh_ctlreq.c) that the condition required (URB_Status == USBH_URB_DONE) to set the status to USBH_OK is true, yet it never enters the conditional code to set the status to USBH_OK. URB_Status = USBH_LL_GetURBState(pho
Hello,I have a SEPLOS brand battery management system card, and I want to read temperature and voltage data from this card. Initially, I will use an STM32F407VGT6 board to read data from the SEPLOS battery management system card via RS485. I am sending the commands first to get the data, but although the data is being sent, I cannot perform the reading operation. What do you think could be the reason for this problem?The PDF I will send below contains an information sheet about how I should read data from the SEPLOS brand battery management system via RS485. Please look at the PDF and my code to see if you can find where I might be making a mistake. thank you for answer
Hello Community,I am encountering an error after my STM32H7ZIT6 device runs for a few hours. The device is intended to send and receive data from AWS. The error logs show repeated instances of mbedtls_ssl_read_record() returned -27648 (-0x6c00), ultimately resulting in net_recv failed - -109Error Logs:./Middlewares/ST/STM32_Connect_Library/services/net_mbedtls.c:484 mbedtls_net_recv() : error -21 in recv() - requestedLen=50x2403b150 => ../Middlewares/Third_Party/mbedTLS/library/ssl_tls.c:3957: mbedtls_ssl_fetch_input() returned -27648 (-0x6c00)0x2403b150 => ../Middlewares/Third_Party/mbedTLS/library/ssl_tls.c:3820: mbedtls_ssl_read_record_layer() returned -27648 (-0x6c00)0x2403b150 => ../Middlewares/Third_Party/mbedTLS/library/ssl_tls.c:7006: mbedtls_ssl_read_record() returned -27648 (-0x6c00)ERROR: ../Middlewares/ST/STM32_Connect_Library/services/net_mbedtls.c:383 failed! mbedtls_ssl_read returned -0x6c00ERROR: iot_tls_read L#208 net_recv failed - -109AWS Firmware Version: 1.
hello all, when I use HAL_FLASHEx_Erase() to erase sectors, it is ok! But when I use HAL_FLASHEx_Erase_IT() interrupt mode to erase sectors, it fails! It seems the interrupt not occuring! if I need to do more settings for flash interrupt mode? Following is my code : {HAL_FLASH_Unlock();EraseInitStruct.TypeErase = FLASH_TYPEERASE_SECTORS;EraseInitStruct.Banks = 2;EraseInitStruct.Sector = (DEMO_FLASH_ADDRESS - FLASH_ONCHIP_BASE) / FLASH_SECTOR_SIZE;EraseInitStruct.NbSectors = 1;//HAL_FLASHEx_Erase(&EraseInitStruct, &SectorError);HAL_FLASHEx_Erase_IT(&EraseInitStruct);HAL_FLASH_Lock();}void FLASH_IRQHandler(void){ HAL_FLASH_IRQHandler();} }
I am starting a personal project where I will be designing custom hardware and software for a device that would be be similar to a smartphone. I want it to be able to connect bluetooth, wifi, have speakers and use USB-C(power, data transfer, etc.). I was thinking that it might be a fun challenge to try to use a STM32 microcontroller for the project. I have not selected any parts yet but I want it to be power efficient, able to interface with a touch screen and be around the size of a smartphone. Does anyone have ideas of which STM32 products I could look into for this project?
Is there any way at all in PC software (Either the ST libraries or things like libUSB) to identify whether a device in DFU/Bootloader mode is an F407 or F411? Everything I can find in the USB properties is identical between the two (Same VID/PID, same bcd identifiers, same device and control descriptors etc). I need a way to determine which firmware version to load on based on the device itself, but there doesn't seem to be any identifying properties for them.Anyone know if there is something that can be used to figure out which device is plugged in?
I'm trying to achieve a UDP communication with STM32H753IIT6 and LAN8720A.I use STM32CubeIDE 1.14.0.According to the ST Ethernet and LwIP example: Adam BERLINGER edited on 2023-12-07 , I create a project, and change the pin layout according to my PCB design. In the .ioc, I set the ip addrass as 192.168.0.10 and I did the other things described in the ST example, except for"(Optional) Adding simple Hello UDP message" . Everything's fine at this point : I can ping 192.168.0.10 and get replies. Then I want to send some simple Hello UDP messages as the ST Ethernet and LwIP example describe.However, after I Modify the StartDefaultTask in main.c , I can't ping the device and get some debug information from uart : How to deal with "core lock " in the debug information ? This is the StartDefaultTask code modifyied: void StartDefaultTask(void *argument) { /* init code for LWIP */
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.