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 I wan't to use the ethernet of my MCU with using Lwip module. For the moment I've connect a etehernet cable between my computer and my ethernet board I've used some example of ethernet example for test the ethernet communication. But I don't arrive to ping my board after settings the differnts parameters (GW address, Mask Address, IP Address).I've also debug my program for try to understand why I can't ping my card and I've remark that when I run my code and when I enter in my function MX_LWIP_Init() it's the function netif_set_down wich is called and not the function netif_set_up. I've the impression that netif is not well configured.Here is my Main.c file./* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2023 STMicroelectronics. * All rights reserved. *
Hi everyone,I'm working on a project where I need to interface a graphic LCD with an STM32L031K6 microcontroller. I have available GPIO pins are :- PA4, PA5, PA7, PA8, PB0, PB1, PB6, PB7, PA11, PA12, PB4, and PB5.I'm trying to print data on the LCD using the provided graphic_lcd.c and graphic_lcd.h files, along with font5x8.h. Could someone guide me on how to properly configure these GPIO pins and utilize the provided files to achieve this task?Any insights or code snippets would be greatly appreciated. Thanks in advance for your help!
Hi folks,I recently started my STM32 journey using a STM32WLE5JCxx (the LoRa-E5). After fighting with the SubGHz for a while, I managed to write a decent application, but I'm not completely familiar with all of the essentials yet.Currently, I am using the `HAL_Delay()` function, but after some testing found that it is highly inaccurate. My code snippet: int i = 0; while(1) { printf("%d\n", i++); HAL_Delay(100000); } The output I get (with the actual difference in milliseconds calculated afterwards): 13:26:41.925 > 0 13:28:22.323 > 1 (+398) 13:30:02.318 > 2 (-5) 13:31:42.309 > 3 (-9) 13:33:22.290 > 4 (-19) 13:35:02.236 > 5 (-54) 13:36:42.118 > 6 (-118) 13:38:21.961 > 7 (-157) 13:40:01.796 > 8 (-165) 13:41:41.623 > 9 (-173) 13:43:21.431 > 10 (-192) This means that on every 100 seconds, the clock drifts anywhere from -200ms to +400ms. A fixed value drift might've been OK, but this is quite unworkable.I did read that `HAL_Delay()
Hello dear ST community,I am making a PPS (sink) application based on NucleoG0B1RE + SNK1M1. As noted in various resources, the TCPP01-M12 doesn't include OCP protection. However, the USB Power Delivery Specification R3.2 on usb.org, strongly recommends OCP protection for sink operating with PPS.My question is what is the best approach to implement OCP int his context?According to the Engineering guide for current sensing (page 32-34) it appears one can use sense amplifier with alert pin, or just sense amplifier with comparator to drive a FET as an e-fuse. My initial thought was to add another FET, such as the STL11N3LLH6 (already part of TCPP01 solution) and use the alert pin to turn off the MOSFET. Additionaly, I would send a event flag to MCU where it could be further processed.However, I am bit concerned about how this might affect the UCPD stack. If the path is turned off (but not directly controlled by TCPP01), would this disrupt the UCPD communication? To which state it wi
I've started a project with HAL library using stm32cubemx. I'm using keil for my programming and I've added PC-Lint (MISRAC checker) to check C standards. But when I run PC-lint to check MISRA C rules, I will receive lots of MISRA C 2012 violation rules that arises from HAL commands. Note, I have not entered any other codes but those which generated by stm32cube.For example the generated files contains these two lines:HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); __attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int16_t __REVSH(int16_t value)but I receive these errors consequently:: Note 934: Taking address of near auto variable 'GPIO_InitStruct' (arg. no. 2) [MISRA 2012 Rule 1.3, required] __attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int16_t __REVSH(int16_t value)I also receive lots of more errors either. According to this , HAL is in compliance with MISRA C 2012. What is wrong?
Hello everyone, I'm having a hard time with the clock configuration on my NUCLEO board, which is probably related to my limited experience with STM32, so apologies if it's a dumb question.I was testing around with said NUCLEO board and the STM32CubeIDE. I loaded up the preset for the board and got my testcode working. Then I noticed, that the SYSCLK was set to 64MHz by default. Since the CPU1 can go up to 480MHz I tried increasing that value to 400MHz and let CubeIDE find a solution. I updated the prescalers for my peripherals and timers and uploaded the code again.But after the increased clock-frequency, most of my code broke. Timers 3-5 seem to work as expected, but for example Timer 2 is set to ellapse after 800 counts which at 200MHz should equal 4µs, seems to have a duration of 8µs when setting a pin and observing with an oscilloscope. Also lots of steps seem to be skipped, since my generated pattern is missing more than half of it's pulses (the toggling is done when Timer 2
Originally posted as a reply in this old thread:https://community.st.com/t5/stm32-mcus-products/using-sdmmc-sdio-and-fatfs-for-reading-sd-card-for-stm32l471vgt6/m-p/690770 How did you solve it in the end? I also encountered this problem
Hi,I am working on STM32F401VE, I recently wrote a bootloader program, which is doing its job of jumping to a specified location. Now my bootloader(at addr 0x08000000) is able to jump to my main application(at addr 0x08020000 ), but when I see my main application getting executed , It stops at the very first HAL_Delay() statement. (i try to remove HAL_Delay, but i have a problem on sleep mode)On Bootloader, my SCB->VTOR = 0x08000000, and on my application 0x08020000 ;If i launch my application without bootloader at addr 0x08000000, everything is ok.Can anyone please help me? Regards,Pascal
Hello STM32 community,I’m using FATFS, generated by CubeMX, in an STM32 project, and I would like to know which SD card types, speeds, and manufacturers are supported. Specifically, I’m interested in:Which SD card types are supported: SD, SDHC, and SDXC?Does the FATFS32 library natively support exFAT for SDXC cards, or does it require additional modifications?Are there any sector size limitations or best practices for configuring SD cards within FATFS32?What about SD card speeds (e.g., Class 10, UHS-I, UHS-II, UHS-III)—are there any recommendations for optimal performance?Are there any recommended SD card manufacturers that are known to work well with FATFS32 (e.g., SanDisk, Samsung, Kingston, etc.)?Any insights or recommendations regarding SD card types, speeds, and manufacturers for use with FATFS32 would be greatly appreciated.Thank you!
Even after setting up a DMA stream to a SPI_RX DMA request, the HAL_SPI_Receive_DMA() function return error code 1 when called. I've solved this problem by also setting up a DMA stream to the SPI_TX request, even though I won't use it. Problem occurred when using SPI1 on Full-Duplex Master mode in the STM32F412 uC, STM32CubeIDE Version: 1.16.1
I am currently working on calculating the FLASH CRC through DMA on the NUCLEO-H755ZI-Q development board. I've successfully read from flash and calculated the CRC using DMA in memory-to-memory.Now, I'm facing challenges while configuring DMA for DMA_MEMORY_TO_PERIPH. I attempted to read directly from flash into the CRC register using the following call:" HAL_DMA_Start(&hdma_dma_generator0, (uint32_t)flash_start_addr, (uint32_t)&CRC->DR, FLASH_BUFFER_SIZE); "Is it feasible to calculate the CRC using DMA_MEMORY_TO_PERIPH? I would appreciate any suggestions or insights you might have!Here are my current DMA configurations:hdma_dma_generator0.Instance = DMA1_Stream0;hdma_dma_generator0.Init.Request = DMA_REQUEST_GENERATOR0;hdma_dma_generator0.Init.Direction = DMA_MEMORY_TO_PERIPH;hdma_dma_generator0.Init.PeriphInc = DMA_PINC_ENABLE;hdma_dma_generator0.Init.MemInc = DMA_MINC_ENABLE;hdma_dma_generator0.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;hdma_dma_generator0.Init.MemData
Hardware:NUCLEO-F446RE, X-NUCLEO-CCA01M1, X-NUCLEO-CCA02M2Software: SMARTMIC1 V2.4.0 & V2.3.0 I am attempting to run the SMARTMIC1 program on the hardware list above but instead of using the microphones on the STEVAL-MIC001V1, I want to use the CCA02M2 onboard MP34DT06J microphones. In an attempt to achieve this on CCA02M2 I changed the position of J2 to position 1-2, removed J3, and installed the solder bridge on SB9.While Audacity will start recording, 0 microphone volume is recorded. I am now looking into the cca02m2_conf.h file and change the AUDIO_IN_CHANNELS from 4 to 2. In Audacity, channel 2 is 100% volume, and channel 1 is 0% volume. Is there any way to achieve what I am trying to do?
Hi,I'm studying a way to do OTA FW upgrade for a STM32U5A5 MCU using a LTE modem and SPI Flash external memory. My environment is: STM32CubeIDE v1.16.1 with STM32CubeMX v6.12 and FW_U5 v1.6.0. I'm also using FreeRTOS.I was checking the native Booloader by ST (Application Note 2606), but I understood I need an host programmer to use it, but my final application will not have it. I checked also the possible patterns for boot selection (Pattern 12 for U5) trying to imagine the BL reading autonomously from the SPI memory of a previously downloaded Firmware:Is it right that it is mandatory a host to use thi BL or my idea could be accomplished in some way?Then, I checked the possible IAP implementation and I reached the AN4657, but it seems quite old and without CubeIDE examples or latest STM32 MCU families implemented:Is there any update for STM32U5 IAP examples?As last result, I got the IAP_main and IAP_binary_template example for STM32U575 (mine is STM32U5A5) , but the second,
I have a question regarding the tutorial "Handling multiple TCP clients on STM32H563 with NetX Duo" written by @STea .See https://community.st.com/t5/stm32-mcus/handling-multiple-tcp-clients-on-stm32h563-with-netx-duo/ta-p/695030 In the first section "handling multilple clients on the same port", there is some example code. In the functionstatic VOID tcp_thread_entry(ULONG thread_input)there is an infinite loop, containing a tx_queue_receive call: /* Receive pointers to TCP socket and network packet from TCP callback */ ULONG msg[2]; status = tx_queue_receive(&g_tcp_q, msg, TX_WAIT_FOREVER);At the moment I try to create an application based on this tutorial. Apparently, the tx_queue_receive fails (returns TX_QUEUE_ERROR) which makes sense, since no one sends data into the queue "g_tcp_q". At which point should this happen? I can't find it in the example code. Furthermore, the tutorial states "You can find attached the file app_netxduo++clients_same_port.c that you can r
While implementing EEPROM emulation on an STM32G0 (although I believe this would apply to all supported families) I have discovered what I believe to be a bug in eeprom_emul.c:Although ConfigureCrc() is called at the beginning of EE_Init to turn on the CRC block clock, it is not similarly called at the beginning of EE_Format and I believe it should be.The effect of this is that if you call EE_Format first to configure the EEPROM emulation pages and then write some values in, the CRCs are all written to zero. On subsequent power/reset cycles, when usign EE_Init, ConfigureCRC is called, allowing the CRCs to be caculated correct from there on, although subsequent reads using EE_ReadVariablexxbits fail due to bad CRC, since the stored CRCs are all zero.Adding ConfigureCrc(); at the beginning of EE_Format fixes the issue.EE_Status EE_Format(EE_Erase_type EraseType) { uint32_t page = 0U; ConfigureCrc(); //***BUG FIX*** /* Check if the configuration is 128-bits bank or 2*64-bit
Hello everyone,I have a stm32h735g-dk evm. I am trying to send data through it using the canopennode stack structure. I connected my oscilloscope to the CN18 port. I put the jumper on when 120 ohms is required. I am trying to run the sample code on github. However, I could not see any change in the oscilloscope. I suspected the mcp2562 CAN transciever but the fd is compatible and works smoothly. I could not understand why I could not see a result. Can you help me?Thank you.I am leaving the github url.https://github.com/CANopenNode/CanOpenSTM32
I'm very beginner of programing and STM. I'd like to make it sound the audio line out with sine wave from STM32H735G-DK. I read the document(UM2679) and understood that SAI and I2C4 are connected to the audio. But I don't know how to use these. Especially, I couldn't understand how to set volume and start to play. Attached files are the one I tried and it doesn't work. I put a button on the screen and set the interaction with function name "startAudio" as it sounds when I push the button. Please tell me your advice. I couldn't attach the file Screen1View.cpp. So I put it down in text below. #include <gui/screen1_screen/Screen1View.hpp> #include "main.h" #include <stdio.h> #include <math.h> #define SAMPLE_RATE 48000 #define BUFFER_SIZE 1024 #define PI 3.141592 uint8_t audioBuffer[BUFFER_SIZE]; void generateAudioData(); Screen1View::Screen1View() { } void Screen1View::setupScreen() { Screen1ViewBase::setupScreen(); } void Screen1View::t
Hi, I'm playing around with lwIP on my Nucleo-H743ZI and I was able to make ping work, udp/tcp echo and snmp too. But when I enable HTTPd the project doesn't wont do compile I just get a lot of undefined references, I tried to make a new project and same thing happened. This are the compiler error messages that I get:Core/Src/main.c:113: undefined reference to `httpd_init' LWIP/App/lwip.o: in function `MX_LWIP_Init':LWIP/App/lwip.c:80: undefined reference to `lwip_init'LWIP/App/lwip.c:88: undefined reference to `netif_add'LWIP/App/lwip.c:91: undefined reference to `netif_set_default'LWIP/App/lwip.c:96: undefined reference to `netif_set_up'LWIP/App/lwip.c:101: undefined reference to `netif_set_down'LWIP/App/lwip.c:105: undefined reference to `netif_set_link_callback'LWIP/App/lwip.c:112: undefined reference to `ethernet_input'LWIP/App/lwip.c:161: undefined reference to `sys_check_timeouts'LWIP/Target/ethernetif.c:202: undefined reference to `memp_init_pool'LWIP/Target/etherneti
I am trying to use H5 as master and UNO(ATmega328p) as slave and transmit data from UNO and receive a character & print it in the COM using USART3. The baud rate I've set for both is 4 MHz. By connecting them together and I can see that the "Tx " LED in UNO is blinking but I can't figure out why there is no sign of my master receiving any data from the slave.This is my master code: /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2024 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 software, it is provided AS-IS. * ********************************************************************
After the device powers on, lwIP works properly. I reboot it once using the code below, and it continues to function correctly. However, if I reboot it a second time with the same code, it stops working. It goes through the PCB initialization, but no data reaches the callbacks. Normally, DHCP is enabled, but after the second reboot, it doesn't acquire an IP via DHCP either. What should I do to ensure the device reboots properly? void Reboot_Device(void){ close_udp(); taskDISABLE_INTERRUPTS(); netif_set_down(&gnetif); netif_remove(&gnetif); HAL_ETH_DeInit(&heth); NVIC_SystemReset(); }
Good afternoon, I'm writing this quick post to know if by any chance someone can help me figure out what is happening with a simple threading project I started on the H7S3L8 board. I'm using ThreadX and NetXDuo, to have a Modbus server on the ETH port.I have an additional thread processing data from other sensors. And when I debug the application, as soon as the second thread starts, I can no longer see the other thread running. Here's an screenshot when I enter the first thread: (all good, I2C1 and NexDuo thread are there)Once I enter the breakpoint on the second thread (I2C1) everything disappears (and I will never enter into the first thread ever again)I left the threads empty on purpose (I removed as much code as I could to pinpoint the issue)But right now, I'm a bit puzzled...could it be a configuration issue? (The project is attached as well)
Hi allI have used CubeMx to create an FMC interface to psram(nonmultiplex) 8-bit data 10-bit addressThe data is valid on the rising edge of the fourth clock To have correct data on the data pins the pointer to write data (psram64) must be a 64-bit pointer, if declared otherwise the data will not always be correct.This will lead to the loss of 3 PIN address. it means that I will need to declare a 13-bit addressto access 1024 bytes of dataCan I configure the address to 10 bits and still have a correct data valuedefinition:uint64_t * psram64 = (uint64_t *)0x60000000;uint8_t FMC_buf[5]={1,2,4,8,0x10};for(int i=0 ; i < 5; i++ )HAL_SRAM_Write_16b(&hsram1, &psram64[i], &FMC_buf[i], 1);The cubeMx configuration shows 10 10-bit addresses but needs to be a 13-bit address.
Dear all,I am using lwIP over STM32F4 and I would add REST API to my project.I try to understand how to do that, and the only way that I have found is to use CGI. The problem is the reply: I can reply only with a static file present in the SDCARD (the return of the following function is the address of the file.typedef const char *(*tCGIHandler)(int iIndex, int iNumParams, char *pcParam[],char *pcValue[]); Does someone return a JSON build at runtime?Does someone parse a GET REST request build with / and not with &? How? api/test/1/3 indeed of api/test.cgi?arg=1&subarg=3ThanksLaura
Hi, I have a problem. I want to store 262144 (256KB) bytes of data in a buffer from the integrated ADC on STM32H723ZG. However it fails when the buffer is too large. I started at an buffer size of 4096 elements (uint8_t) and doubled until 65536 where it failed (only output is 0, 0, 0...). I am using a circular buffer with continuous conversion on the DMA.Can anybody help me to find out what the cause of this problem is, and how to fix it? The total capacity on the RAM_D1 is 320KB, so 256KB should be enough... Thanks for all the help I get!
stm32h743iit6threadx + usbxuse USB_OTG_HS as CDC host ,USB_OTG_HS dma_enable = ENABLE and enable the dcachevscode gcc13.2.0when i used the usb_host and opened the dma and dcache, the usb cannot work I have divided the memory area used by USB DMA into RAM-D2,I have configured R2 MPU_ACCESS_NOT_BUFFERABLE , MPU_ACCESS_NOT_CACHEABLE , MPU_ACCESS_NOT_SHAREABLE andMPU_TEX_LEVEL1 and when I turn off DCAHCE, USB host and dma can be used normally,or I can use SCB->CACR |= SCB_CACR_FORCEWT_Msk And use __DSB() in the HAL_SCD_ShenfyURBChange_Callback function; It can also be used, but I'm not sure if it will affect performance. Is there any way not to turn off dcache and not to use SCB->CACR |= SCB_CACR_FORCEWT_Msk for dcache.But I use USB_OTG_FS dma enable=ENABLE and turn on dcache to make it work as a cdc device, It can work normally,I don't need to turn off dcache or use SCB->CACR |= SCB_CACR_FORCEWT_Msk, but usb_host can not work , i find when i open the dcache and dma in usb h
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.