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
Howdy,just as the subject line asks, I am trying to figure out where the ADF stores its Ambient noise level (ANLVL) or if there is already a callback for that value. I was having trouble locating where this value is stored. Is there a set register location I can call or a set variable? In addition, where would the sound level (SDLVL) be stored? Any help with this would be much appreciated.
Dear ST Support Team,I am working on the STM32H7S78-DK board and have successfully implemented a TouchGFX-based project. However, I am facing issues when trying to add Ethernet support to the project while using FreeRTOS.When I call MX_LWIP_Init(), the code gets stuck after entering this function. If I comment out or disable MX_LWIP_Init(), the TouchGFX functionality works perfectly. The same Ethernet code works without any issues in a standalone project (without FreeRTOS and TouchGFX).I have verified the Ethernet GPIO configuration and settings, and everything appears to be correct. The Ethernet code has been tested successfully without FreeRTOS. However, integrating the same code into the TouchGFX project with FreeRTOS results in the issue described above.Could you please help me identify the cause of this behaviour and provide guidance on resolving it?Here I attached some code for reference. #include "main.h" #include "FreeRTOS.h" #include "cmsis_os2.h" #inclu
Dear Community,I am working with an STM32F407 development board, using an ESP32 as a Wi-Fi modem controlled through AT commands. I am attempting to perform an MQTT test with AWS IoT using mbedTLS for the TLS handshake.I found the following mbedTLS implementation for STM32:https://github.com/eziya/STM32F4_HAL_ETH_MBEDTLS.Currently, I am observing that the mbedTLS handshake takes nearly 25 seconds. Can anyone share how much time the mbedTLS handshake typically takes with a server using this implementation or similar setups?Additionally, I am currently stuck on configuring mbedTLS. Could anyone guide me on the minimal and fastest way to establish a TLS handshake with an AWS server? Any suggestions to optimize the process for MQTT communication would be highly appreciated.Thank you in advance for your assistance.
Hello all, I try to make a differential ADC-measurment with the Zephyr work. The console tells me, that "Differential channels are not supported", so I'm not sure what the problem is (Wrong config of the device-tree, missing config in proj.conf or wrong software". In my opinion this measurment should work. I'm using the STM32H563RG and want to perform the measurment on PA0 (ADC1_INN1) and PA1 (ADC1_INP1)proj.conf: CONFIG_ADC=y CONFIG_ADC_STM32=y CONFIG_LOG=y CONFIG_GPIO=y Devicetree &clk_hse { clock-frequency = <DT_FREQ_M(25)>; /* STLink 25MHz clock */ /*hse-bypass;*/ status = "okay"; }; &clk_hsi48 { status = "okay"; }; &clk_hsi { status = "okay"; }; &clk_lse { status = "okay"; }; &pll { /* SYSCLK 240MHz (250) */ div-m = <5>; /* 5 (4) */ mul-n = <96>; &nb
I've been assigned the task of reducing RAM usage on an STM32F769 microcontroller running FreeRTOS. I've done the usual stuff (packed structs and specified the number of bits each member needs, made all the XXXX_InitTypeDef and other de facto constant data const/constexpr, and placed things in ITCM and backup SRAM). Can anybody recommend some storage that is easily forgotten, e.g. some peripherals that have built-in buffers or large register ranges, e.g. the CAN-buses' filter registers (CAN_TypeDef->CAN_FilterRegister_TypeDef), etc?
HIi have a question about printf. fprintf,scanf etci'm redirecting those functions to use a UART replacing the int _write(int file, char *ptr, int len) and int _read(int file, char *ptr, int len) functions. int _write(int file, char *ptr, int len) { HAL_UART_Transmit(&huart2,(uint8_t*)ptr, len, 1000); return len; } int _read(int file, char *ptr, int len) { __HAL_UART_CLEAR_OREFLAG(&huart2); HAL_UART_Receive(&huart2,(uint8_t*)ptr, len,HAL_MAX_DELAY); HAL_UART_Transmit(&huart2,(uint8_t*)ptr,len, 1000); return len; } now i'm using threadX and possibily call printf or the other function from multiple threadsis this approach already thread safe or i have to implement a mutex for the Uart?If i have to use a mutex is that possible to get and put the mutex inside the _write or _read function or i have to get the mutex before call printf?thank you
I have a board with stm32f407zgt6. I'm using freertos and fatfs. The board has a connection for an SDCARD, I'm using a 4GB SDCARD with fat32.For reading, F_open, f_read, f_close, everything works. When I use it to write, f_close takes a long time and returns FS_DISK_ERR.What do you need, files, the .ioc, the sources, no problem, to help me find the problem? I tried to configure it as correctly as possible, but I think I left something behind.The write process it's in the file ESP8266_HALL.cpp, this file I put in the body of the post, because the forum did not accept the file for a reason that I did not understand, but I will not fight with the forum, I really want help.Thank you very much.PS: f_write return the correct amount of bytes written, with what I ordered to be written. the file, after the f_close error, has 0 bytes on the disk. This happens both for already existing files and for new files /* * ESP8266_HAL.c * * Created on: Apr 14, 2020 * Author:
Can anyone please confirm that LevelX and FileX can only be used with AzureRTOS. Everything that I have read indicates as such. Both only available when AzureRTOS is enabled as well as using CubeMX.Thanks in advance!!!
Hi, I noticed several times that SVD files contain errors compared to what's documented in MCU RMs.The whole purpose of the https://github.com/stm32-rs/stm32-rs repository is basically to fix those errors and supply accurate SVD files for Rust embedded development on STM32 MCUs.How are these SVD files written/generated ? Are RMs and SVDs written from the same source ?Would it be possible to submit upstream patches to the SVD that would benefit to everyone, instead of submitting these patches to Rust cartes only ? Have a great day
I'm tying to setup TCP server using ethernet communications (Nucleo-F767ZI) and find that I can ping the board using the router allocated IP address but I'd like to do the same using Hostname. In STM32CubeMx .ioc file, under Network Interface Options, LWIP_ENABLE_NETIF_HOSTNAME is set to 'enable' and I've set the host name I want to use in LWIP_NETIF_HOSTNAME to 'my_lwip'. However, I still find that I cannot ping the board using the hostname. I know my router DNS is working Ok because I can ping a Raspberry Pi using it's host name.I realize that in STM32CubeMX generated lwipopts.h #define LWIP_NETIF_HOSTNAME is set to my_lwip by default but I change this to 1 manually. Otherwise, in ethernetif.c, the statement netif ->hostname - "my_lwip" is not enabled.I think mDNS has to be enabled in LwIP. However, under MDNS/TFTP tab in CubeMX, LWIP_MDNS is always disabled and there is no enable option in the drop-down list. I've seen a post that suggests to enable LWIP_MDNS, LWIP_UDP and
Hello Community, currently i am working on a project whose board involves board USB FS & USB HS where one USB port i.e. USB FS is used for Mass storage communication(i.e pendrive) & USB HS is used for HID devices i.e. Keyboard,printer. Microcontroller i am using for my project is STM32H747. When i am using 8GB pendrive on USB FS port it is failing to enumerate where as pendrive with volume 64 GB are able to enumerate. To verify if the same condition is occurring on STM32H745 Discovery board which uses USB FS as but found that the pendrive of 8GB is able to enumerate on Discovery Board. Similarly i checked with the STM32H747 discovery board which uses USB HS & able to enumerate both 8GB & 64 GB pendrive. Note :- Able to enumerate 8 GB pendrive on my current project board with USB HS port. I am doubtful what is causing the problem that 8GB pendrive is not able to enumerate on my board FS port. Attaching Schematic for reference. After Some debugging found that URB st
Some strange behaviour that I can't explain but like to understand :I am using an e-paper display via SPI, and to conserve power during sleep, I power down the display via a FET.After waking up, I enable the power to the display, then initialize the SPI to talk to it. gpio::enableGpio(gpio::group::enableDisplayPower); MX_SPI2_Init(); gpio::enableGpio(gpio::group::spiDisplay); However, this triggers a hard fault inside MX_SPI2_Init();If I add a 1ms delay between turning on the power to the display and enabling the SPI, then the hard fault never appears.. gpio::enableGpio(gpio::group::enableDisplayPower); HAL_Delay(1); MX_SPI2_Init(); gpio::enableGpio(gpio::group::spiDisplay); Of course, if I debug/step through MX_SPI2_Init(); the hard fault doesn't appear as this is also adding delays..Any idea what is going wrong or how I could further investigate ?
Hi I'm debugging the mentioned issue since quite a while.We use CubeMX to generate the configuration and working with the provided HAL libraries to access a 4GB SD-Card connected through the SDMMC adaptor over 4-bit SDIO bus.HAL libraries version is H7_V1.9.0 (for know we are stucked here, using a fixed tool chain).SD-Card and FAT-FS init is OK.In our application we are copying files from USB-Memory-Stick to the SD-Card, which works fine.The mentioned problem seems to occure only when reading large portions from the card, while writing to the card doesn't produce the issue.We are using FreeRTOS and wrote a FAT-FS interface with a mutex to make the FAT-FS access thread safe. Since the function BSP_SD_ReadBlocks_DMA() used by sd_diskio.c :: SD_read() is blocking in a while-loop (staying in the FreeRTOS context), I configured the SDMMC global interrupt to have higher priority than any FreeRTOS task (configured to 3, FreeRTOS max. is 5). But this didn't help out.I printed out the SDMM
STM32CubeIDE 1.17.0 - using the CMSIS headers - NUCLEO F411REI have the following function that is trying to use SYSTICK to give a delay in milliseconds, #include "stm32f4xx.h" // actaully contained in another header put here for question clarity /* SYSTICK defines */ #define CTRL_ENABLE (1U<<0) #define CTRL_CLKSRC (1U<<2) #define CTRL_COUNTFLAG (1U<<16) #define SYSTICK_LOAD_VAL 16000 void systick_delay_ms(uint32_t delay) { /* Register names are different in Cortex ref doc to those in CMSIS header */ /* Reload systick with number of clocks / ms - SYSTICK_RVR*/ //SysTick->LOAD(SYSTICK_LOAD_VAL); SysTick->LOAD(SYSTICK_LOAD_VAL); /* Clear systick current value register - SYSTICK_CVR*/ SysTick->VAL = 0; /* Enable systick & select to use internal clock src */ SysTick->CTRL = CTRL_CLKSRC | CTRL_ENABLE; for(int i = 0; i < delay; i++) { /* Wait until the COUNTFLAG is set - SYSTICK_CSR */ while((SysTick->CTRL & CTRL_COUNT
Hi, I am trying to implement basic DHCP Protocol using STM32F439ZIT6. But I am unable to get the IP being assigned by the DHCP Server. There are no errors in the code, but I am not getting the IP. Don't know why it is giving DHCP Timeout. I am attaching my code, please go through the code and let me know the solution. Am Struck here for a while!Thank you
MASTER SIDE uint8_t txByte_master = 0xA5; // Byte to send uint8_t rxByte_master = 0x00; // Received byte volatile uint16_t count = 0; uint8_t dummyTx = 0x00; uint8_t dummyRx = 0x00; volatile uint8_t spi_ready = 0; // Flag to indicate SPI transfer complete void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_USART2_UART_Init(void); static void MX_SPI1_Init(void); int main(void) { HAL_Init(); MX_GPIO_Init(); MX_USART2_UART_Init(); MX_SPI1_Init(); while (1) { spi_ready = 0; // Reset flag // Start SPI communication HAL_SPI_TransmitReceive_IT(&hspi1, &txByte_master, &rxByte_master, 1); // Wait until the transaction completes while (spi_ready == 0); // Check if received data is correct if (rxByte_master== 0xA5) { HAL_SPI_DeInit(&hspi1);// HAL_GPIO_TogglePin(GPIOC, GPIO_PIN_13); // Blink LED if correct } HAL_Delay(500); // Delay for visibility } /* USER CODE END 3 */ } void HAL_SPI_TxRxCpltCall
Hi guys, I was trying to implement HAL_UART_Transmit_DMA() since I am using freeRTOS. It auto trigger a reset for my stm32f427.Tried HAL_UART_Transmit(), everything works well. Only HAL_UART_Transmit_DMA() causing the reset, Did I missed anything? for (uint8_t j=1; j!=CPH_MAX_N_PORTS; ++j) // can change to +1 after disabling drone troubleshoot port { if(byte_1 == j) { if ((ports_handle[j-1])->hdmatx == NULL) { USER_LOG_ERROR("TX DMA not linked for UART!"); } HAL_UART_DMAStop(ports_handle[j-1]); // Stop RX DMA before TX ports_handle[j-1]->gState = HAL_UART_STATE_READY; __HAL_DMA_ENABLE_IT(ports_handle[j-1]->hdmatx, DMA_IT_TC); // TX Complete Interrupt __HAL_DMA_ENABLE_IT(ports_handle[j-1]->hdmatx, DMA_IT_TE); // TX Error Interrupt if (ports_handle[j-1]->hdmatx == NULL) { USER_LOG_ERROR("TX DMA not linked for UART!"); } if (ports_ha
Hello everyone!During programming for the MCU STM32G431CbTx, I want to write a function to change the value of the "Break filter" bit for "Tim_BRK" as follows: static inline void mcu_protection_ov_enable_filter(){ uint32_t tmpbdtr = READ_REG(TIM1->BDTR); tmpbdtr = (tmpbdtr & 0xFFF0FFFFU) | LL_TIM_BREAK_FILTER_FDIV2_N8; WRITE_REG(TIM1->BDTR,tmpbdtr); } However, after checking, the value of the BKF bit remains unchanged, while the LOCK bit is set to 00: LOCK OFF - No bit is write-protected. Meanwhile, I can use a similar method to change the DTG (deadtime) bit.Who can support me?Thanks,Locnv.Edited to apply code formatting - please see How to insert source code for future reference.
Dear community,I'm not a big expert of USB and I have a solution based on STM32C0 and I would like to extend it to use USB, STM32C071 is the prefect candidate, but for my big surprise the USB stack is based on Azure RTOS, this is kind of killer for us, actually it will be a nightmare to include it, so my question is there any solution offered by ST which include USB library without the layer of RTOS.Just another question out of curiosity why Azure RTOS was introduced in ST Package in first place.
Hello there,I have created my own project following the preconfigured project "ADC_RegularConversion_Interrupt". In my project I want to get the internal temperature sensor value and want to display it on the terminal thus using the UART example in this project as well.However, I stuck forever inside HAL_ADC_GetValue() function. I am aware about the fact the priority of adc needs to be >= 1 (since only systick can have the highest priority => 0).see adc config below with read temperature function:static void init_adc(void) { adc_handle.Instance = ADCx; if(HAL_ADC_DeInit(&adc_handle) != HAL_OK) { Error_Handler(); } adc_handle.Init.ClockPrescaler = ADC_CLOCKPRESCALER_PCLK_DIV4; adc_handle.Init.Resolution = ADC_RESOLUTION_12B; adc_handle.Init.ScanConvMode = DISABLE; /* Sequencer disabled (ADC conversion on only 1 channel: channel set on rank 1) */ adc_handle.Init.ContinuousConvMode = ENABLE; /* Continuous mode enabled to have continuous conversion */ adc_handle.Init.D
Hi everyone,I'm working on UART communication with an STM32F303RE, and I'm experiencing an issue with data reception. I'm sending the character 'A', but I'm receiving incorrect values (F8F8 instead of 0x41).I tried changing the APB1 prescaler, but the received data remains incorrect. Its sets exactly, how the IOC in IDE cube shows the prescaler with frequency. I dont have osciloscope. #include "stm32f303xe.h" #include "stdint.h" #include "stm32f3xx.h" #include <stdio.h> #define UART2_TIMER 500 #define LD4_ON GPIOA -> BSRR |= GPIO_BSRR_BS_5; #define LD4_OF GPIOA -> BSRR |= GPIO_BSRR_BR_5; volatile uint32_t Tick=0; #include "stm32f303xe.h" #include "stdint.h" #include "stm32f3xx.h" #include <stdio.h> #define UART2_TIMER 500 volatile uint32_t Tick=0; void config_UART(void) { RCC -> AHBENR |= RCC_AHBENR_GPIOAEN; RCC -> CFGR |= RCC_CFGR_PPRE1_2; //PA2_TXAF7 GPIOA -> MODER &= ~(GPIO_MODER_MODER2_0); GPIOA->MODER |= GPIO_MODER_MODER2_1; GPIOA
My firmware application is stored in external NOR flash which is memory mapped using XSPI and then loaded by a bootloader. However I also need to interface with the external NOR flash in command mode so I can e.g. store a filesystem there. I can't switch out of memory mapped mode because then my application can't run. How am I meant to get around this dilemma?
Software VersionsCubeMX 6.13.0 (used H7 MCU package v1.12.0)Issue:Hello everyone, we are encountering an issue that might be related to the HAL (although we think this is unlikely as it is a rather fundamental function of the HAL).We're developing software on a STM32H753BIT6 MCU on a custom PCB. We're making use of CubeMX and the STM32H7 HAL (provided by CubeMX). Currently we are measuring the baud rate of the UART4 that we are using to be half of the expected baud rate (115200). Upon code inspection is found that the uart prescaler is incorrectly calculated. It assumes a peripheral clock speed of 240MHz instead of the configured 120Mhz.See our CubeMX clock configuration:When inspecting the HAL implementation of the uart we see that the baud rate prescaler is calculated using the HAL_RCC_GetPCLK1Freq() function. You would expect the function to return 120000000, but instead it return 240000000.We've narrowed the issue down to the way that the PCLK1 frequency is calculated in the STM32C
We have an application that uses LWiP and FreeRTOS.The application has one UDP connection, for initial device discovery, which is managed through a UDP connection manager, on one FreeRTOS task. (Some by-the-by, background information)We are using default LwIP 8 connection limit of 8 TCP connections, for the main application protocol.The host side (PC) always opens, then closes a UDP device discovery probe connection first, then the main application TCP connection. Additionally the host application, may temporarily open a second TCP connection, only if a specialised configurator tool is used.For this reason that the host application, may occasionally use two TCP connections, we have a FreeRTOS task, which is a connection manager, whose provides, opens & closes connections, in a round-robin queue/dequeue from the 8 TCP connections pool.This connection manager, on a new UDP probe, closes any TCP connections left open in the queue, as a pre new TCP connection clean-up action.Additional
Hi!I'm using varadic in C and it seems that when I'm using float with va_args I get HardFault.I have a runable example here: https://onlinegdb.com/2c6Q1hR-ZBMy question is: Why does I get a hardfault here? How can I solve this? Is there any flags in the compiler I need to configure so I can use float? matrices[i] = va_arg(args, float*); <--- This gives HardFault Complete example: /****************************************************************************** Online C Compiler. Code, Compile, Run and Debug C program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include <string.h> /* For memcpy, memset etc */ #include <stdio.h> /* For printf */ #include <stdlib.h> /* Standard library */ #include <math.h> /* For sqrtf */ #include <float.h> /* Required for
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.