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
6.11 now supports USBX baremetalAre there any examples of this?All I could find still use ThreadX
while(1) { TX_MEMSET(data_buffer, '\0', sizeof(data_buffer)); /* allocate the packet to send over the TCP socket */ ret = nx_packet_allocate(&AppPool, &data_packet, NX_IPv4_TCP_PACKET, TX_WAIT_FOREVER); if (ret != NX_SUCCESS) { printf("aaaa1\r\n"); break; } /* append the message to send into the packet */ ret = nx_packet_data_append(data_packet, (VOID *)data_buffer, sizeof(data_buffer), &AppPool, TX_WAIT_FOREVER); if (ret != NX_SUCCESS) { printf("aaaa2\r\n"); // nx_packet_release(data_packet); break; } ret = nx_tcp_socket_send(&TCPSocket, data_packet, 30000 ); if (ret != NX_SUCCESS) { printf("tcp send error:%#x\r\n",ret); break; } }hardware:STM32H747I-DISCOi want send TCP data continuously in a while ;but this is a problem; Error message after sending 5 data;errcode is 0x38 ;But I'm sure the Internet is good;so i check code i find ;HAL_ETH_Transmit_IT -- > ETH_Prepare_Tx_Descriptors retur
Hi ST community, I'm struggling to get required transfer and accumulate rate from ADC to an array, I'm focusing at the moment to the data transfer phase, which seems the slowest one.Situation:using STMCube IDE Version: 1.14.0using 3 ADC: ADC1 ADC2 ADC4 to simultaneously acquire 3 signals, ADC start conversion is triggered by timer event.Transfer of data is in the form of array[idx] = array[idx] + ADCdata in the HAL_ADC_ConvCpltCallback callback. When ADCx_seqPhase == 0, ADC data is transfered directly ( zeroing phase ).Array indexes are managed outside of this function.code is void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc) { if(hadc->Instance == ADC1) { if (ADC1_seqPhase == 0) { S.array[ altArrayACQ_ADC1 ][Array_Pointer-1] = ADC1->DR; } else { S.array[ altArrayACQ_ADC1 ][Array_Pointer-1] += ADC1->DR; } } if(hadc->Instance == ADC2) { if (ADC1_seqPhase == 0) { S.array[ altArrayACQ_ADC2 ][Array_Pointer-1
Hello.Im tring to make an rcc configuration for my stm32f429i discovery board for 48mhz HCLK with ahb1 prescaler is 1.According to STM32CUBEMX ,pllm is 4,plln is 192,pllp is 8 for 8Mhz HSE.wHEN I DEBUG THE CODE,HCLK still showing 180Mhz and this never changes with different configurations.I have tried everything but no result.You have any idea? #include "stm32f4xx.h" #include "stm32f429i_discovery.h" void rcc_config(void) { RCC->CR=0x00000000; //resetting Control register RCC->CR |= (1<<16); //HSEON enabled while (RCC_GetFlagStatus(RCC_FLAG_HSERDY) !=SET); //wait until flag rises RCC->APB1ENR |= 1<<28; PWR->CR |= 3<<14; FLASH->ACR = (1<<8) | (1<<9)| (1<<10)| (5<<0); RCC->CFGR &= ~(1<<4); RCC->CR |= (1 << 19); // CSS On RCC->PLLCFGR= 0x24003010; //Resetting PLL register //This function must be used only when the main PLL is disabled. RCC->CR |= (0<<24); //Disabling Main PLL RCC->PLLCFGR |= (0&l
This is an umbrella topic where I will collect the key problems and solutions to finally get networking on STM32 working. The issues formatted as bold are the most critical ones.HAL ETH drivers have been significantly reworked since the following firmware packages: CubeF4 v1.27.0, CubeF7 v1.17.0, CubeH5 v1.0.0, CubeH7 v1.10.0Series: F1, F2, F4, F7, H5, H7 (all STM32 with Ethernet)lwIP driver Tx deadlock. [reworked drivers]Missing compiler and CPU memory barriers. [legacy drivers]RMII mode not enabled because of lacking SYSCFG synchronization. [legacy drivers]Unwanted interrupts not masked.CubeMX generates wrong PHY configuration. [legacy drivers]Not possible to use a custom PHY driver in CubeMX. [reworked drivers]Wrong clock source and PLL configuration. [examples]lwIP driver zero-copy Rx PBUF pool size is inappropriate. [reworked drivers]CubeMX generates broken lwippools.h file for C++.CubeMX generates a dysfunctional lwIP application without RTOS.Unnecessary delay in LAN8742_Ini
Hello everyone,I’m working on a project where I’m using a NUCLEO-F446RE board to control an AC servo drive via MODBUS RTU. I’m using an RS485 board converter to handle the communication. The problem I’m facing is that I'm not getting the echo of data i send.Here’s the setup I'm using:Controller: NUCLEO-F446REConverter: RS485 boardMODBUS Communication: USART2 (PA2 Rx, PA3 Tx, PA1 RSE)Servo Drive Baud Rate: 38400, no parity, 2 stop bitsI’ve attached my program below, and I’d appreciate it if anyone could help me identify where the issue might be./* 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 softw
Hello, I am trying to make the HTTPD webserver working in a custom board using STM32F407VET6 and LAN8720AI.I made some progress (see previous post). The state of the art is the following.- ping works;- TCP echo server works;- HTTP ST example page works when pages are managed as in the "LwIP_HTTP_Server_Netconn_RTOS" example. This example does not use the full LwIP code but pages are managed via a custom function.When I try to use the LwIP code which is based on the following calls MX_LWIP_Init(); httpd_init(); the interface goes up, ping works but as soon as I open the http page the network rx/tx system geos down.The problem is that netconn_write_partly();never returns. I made a project using the NUCLEO-F439ZI board using CubeMX and everything works as expected. When I generate the same code for my board (same clocks, same memory configuration, it changes the MCU and the LAN8720 driver), httpd does not work.Microchip says that if the link is
Hi,Please see attached video: This is a image based slider in LVGL, with nothing going on except for the main loop asking the slider value to increment its value by 15. (it also updates the label control text)It has around 1 second main loop time doing this. We are using an STM32H743 with a 1024x600 display and QSPI to hold the images, and no 2DDMA enabled yet but we are using SDRAM for the frame buffer doing partial redraws.https://drive.google.com/file/d/1B4m83vbpDUJo0WOrwqf6w6WYg6NocDal/view?usp=sharingCan LVGL do a decent frame rate when using graphic (image) based slider controls on this resolution? (RAM at 240Mhz, MCU at 480Mhz)Is there a pathway we can take from this start point (i.e typical optimisations?)We have a few ideas but unsure of their impact - are we missing anything else? Which of these would likely give the most benefit if any?1. Move images to SDRAM at start-up instead of calling from QSPI2. D2DMA activation3. Frame buffer sizes/ partial redraw?Thanks,Matt&nbs
Dear all,I'm coming to you with a very simple problem, after not being able to wrap my head around it. I'am trying to design a board using the STM32H753VIT6 (V revision) and a USB3320 ULPI interface. While writing firmware for the custom board, I noticed that sometimes, the USB33RDY flag does not get asserted. Thus I suspect the USB regulator does not run correctly. The thing is, it is very moody... It works one day, than stops the other. There is not much mentioned about this in the datasheet so after peeking into it today, I figured it probably has to be an power issue with my board and I went to try it on the NUCLEO-H753ZI. I uploaded a very simple test code that just enables the USB reguator and the voltage level detector, the code is as follows:#include "main.hpp" #include "stm32h753xx.h" #include "core_cm7.h" #include "cmsis_compiler.h" extern "C" void SystemInit(void){ } extern "C" int main(void){ //Enable the USB regulator and wait for it to be ready PWR->C
I have set up a project with the STM32H7B3 where I want the LPTIM1 to generate a synchronization signal that triggers a DMA driven SPI trancieve of 6*11 bits. The SPI is set up with wordsize 11. The DMA for both rx and tx is set up in circular mode with half-word data alignment. DMA number of request is set to 6. In the process of getting it to work I started with only one request and it works. Increasing to 6 leads the DMA or the SPI to go into overrun. When reducing number of request to 4 it is working. Is there a limit to the number of request the DMA streams can handle?The AHB1 is running at 200 MHz and the SPI clock frequncy is 20MHz. I have tried lowering the SPI clock with the same result.
Hello, I am unable to make httpd server. I am working with the following platform: CPU: STM32F407VET6 (Cortex-M4)LAN PHY: LAN8720AISO: FREERTOS V10.3.1 I configured the LWIP and FreeRTOS using CubeMX tool. The ping command works fine. I defined in fsdata.c a very simple webpage, a sort of "hello world" html. I checked possible stack overflow and MallocFailed from freertos. When I try to open the webpage I see from debugger that the TCP connection is set ESTABILISHED. But there is no packets sent from the board toward the client. As soon as I try to open the webpage the whole LWIP stack stop working and also the ping fails until the next reboot. I tried also to increase the MEMP_NUM_PBUF to 64 (from 16). LwIP is initialized calling from DefaultTask():MX_LWIP_Init() The httpd server is initialized calling from DefaultTask(): httpd_init(); Enabling the LWIP_DEBUIG I cannot print everythink since the sprin
OK, first, I'm not including code quite yet because I want to see if anyone has heard of this problem. Code is available, though.What I want: USART to act as a console USART driving a queue for reception, and being fed by a queue for transmission.Details: FreeRTOS latest in the packs, STM562VETQ processor, custom hardware. CubeMXIDE 14.1.Software, from the archives/examples, the one that uses the LPuart and L5 processor.Copying the software (direct blocking transmit, circular DMA buffer scanned and read out to external buffer) and running it (changing LPUART to UART1) works perfectly. This is the direct bare metal application transported over with the USART changed. NO FreeRTOS used. So far, so good.Main Program from CubeMXIDE, sets up tasks, etc, calls bridge program (C++) which starts main program task (C++). For this test, main program task is disabled. DMA example moved into separate C module. FreeRTOS running.Program does not w
I am trying to move some some working "domestic" DSP routines to the CMSIS library in hopes of them executing faster. The first one is a fairly simple 64-tap FIR filter on 160 samples of 16-bit fixed point data. I generated it using the Tfilter website, a pretty neat website.I'm following the example from Phil's Lab (https://www.youtube.com/watch?v=lDskXTR6psY) with the variation that I'm including the libarm_cortexM7l_math.a library instead of either floating point library. I'm using current versions of STM32CubeIDE (1.16.1) and the H7 Library (1.11.2).I get a compile error ... (my).elf uses VFP register arguments, ... libarm_cortexM7l_math.a(arm_fir_q15.o) does not.For starters, I'm only using fixed point DSP, so kinda weird, but even so I am compiling with Floating Point ABI set to hardware (-mfloat-abi=hard), so this seems not quite right. The compiler should be using "real" floating point even though I am not.Just for debugging I tried setting the ABI to so
Hello,I would like to use software timers with FreeRTOS but the Add button is disable. The others button (add semaphore, mutexes, Events, ..) are all available...The target is STM32L431.Do you have any suggestion?Best regardsMich
Hello,I am using STM32F303RBT on a custom board and am trying to communicate through SPI with LTC6811-1 with code generated through CUBEMX.I am able to send and receive the data fine when the data is not required to be sent in one burst (LTC6811 can handle pauses between bytes except when it is trying to write I2C data over SPI and then requires tight clocking).Can the pauses be eliminated by using bare metal for HAL_SPI_TransmitReceive()?Does someone have a simpler (faster) version of this function?Below are clock and MOSI signals aforementioned with 15 us pauses between.The code which calls HAL_SPI_TransmitReceive(...) is also attached.Pauses between bytes___________________________________________________________________________________________ #include "BMSDriver.h" /*******************************************************************************/// MICROCONTROLLER SPECIFIC FUNCTIONS FOR CONTROLLING : void cs_low(){HAL_GPIO_WritePin(BMS_CHIP_SELECT_GPIO_PORT, BMS_CHIP
This simple question was interested by me for this reason: for uint32_t type uwTick can only count up to 4294967295 ms. It is only 49 days. In practivce it realy achievable value of or working time without reboot. In any applications it may be not enought. The HAL library may be more useful if user will can change uwTick type on CubeMX project level to uint64_t. Please can you add this feature in next releases?P.S. I know that all STM32 have embedded RTC and it can obtain timebase for longer periods. But if the application is very simple, using of RTC will be overkill for it.
I want to solicit the advice of those more experienced with the STM32 processors. I'm experienced in general with embedded software and peripherals such as SPI but only about 6 months in on the STM32 processors and only in the last few weeks have I been delving into the SPI and DMA. My first dives were into timers and USB. In specific, I'm using a STM32H723.I'm using a 4 channel SPI based ADC. The TI ADS131M04 in specific. SPI communication is 6 words with a default word size of 24 bits. The word size can be changed to 16 or 32 bits but initial size after reset is 24 bits. It has a data ready line to indicate samples are available.I realize 24 bits is an awkward size but so many ADC's support it. I would assume there are efficient ways for the STM32 to handle this size of SPI data. While it isn't absolutely mandatory in this application for data to be handled the most efficient way, I have future projects that will need the efficiency.&nbs
Dear STM32 Community,I am currently working on a project using STM32CubeIDE, and I need to perform calculations that involve floating-point numbers. Specifically, I would like to extract exactly two decimal places from a float number without rounding. For example, if the value is 1.61859652354, I want to obtain 1.61 (not 1.62).I have tried rounding methods, but they do not meet my requirements as they round the value up or down. Instead, I need a way to truncate the value after two decimal places for further use in my calculations.Could anyone suggest the best approach or method to achieve this in STM32CubeIDE?Thank you in advance for your help!
Hello everyone, I'm encountering a problem with the development of my timer on a STM32G474VE. I have to use the TIM2 in encoder mode + index. I'm using a custom board. I started with a cubeMX project, initialising the timer in encoder + index mode. Due to hardware specification i need to use pins PA0 for TIM2_ETR, PD3 for TIM2_CH1, PD4 for TIM2_CH2. Using these pins, i have a problem with my counter. I have too many resets on a mechanical turn of my encoder. I enable the index interrupt and it is called more than once per turn. I have already checked my signals on a scope and my signals A, B and Z from the encoder are perfectly clean and correct. I temporarily change the configuration to connect TIM2_CH1 to PA5. In this configuration, the timer is perfectly working, so i suppose that I haven't got any problem with my clock configuration or with my hardware since i haven't got any difference in the mapping of PA5 and PD3.In the STM32G474 documentation I've seen that in the al
So my stm32h7 works fine using regular interrupts. But when doing it via DMA, void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *adc)is never called.I enabled ADC global interrupt and BDMA channel0 global interrupt.circular buffer,continuous conversion mode enabled, conversion data management mode is at DMA circular mode as well.My other DMA for i2s, SAI and UART work perfectly fine?I call dma using : HAL_ADC_Start_DMA(&hadc3, (uint32_t*) Battery_read, sizeof(Battery_read));
I have a TFT display which outputs 320 X 240 pixels and I want to control the display brightness from the command itself which I found in the datasheet of the TFT display controller IC, so with the reference from the datasheet I have to trigger the WRDISBV in 51h and WRCTRLD 53h registers and in the 51h register I can vary the brightness from 0x00 to 0xff by passing any values in between, however after passing the command nothing is happening, I don't see any change in the brightness of the display.How can I make this work using the command itself and not use any hardware to control the brightness?Suggestions and ideas are welcome!The link for the datasheet: https://www.rhydolabz.com/documents/33/ST7789.pdf
Hi,I have a custom loader and am using STMCube32 IDE and QSPI. I have the linker etc all setup such that my assets (.c files of the BMPs) is loaded into QSPI and used by LVGL.My question is - given loading via the STLink 5MB of images takes ~2 mins every time I want to build/run/debug etc, is there a more efficient method? Loading only the images once for example? Any advice welcome!Thanks,Matt
Hello,I've been trying to make USBx (device_only mode) MSC work on my NUCLEO-U5A5ZJ-Q for 2 weeks now, and I don't know what I'm doing wrong.I've tried to run the tinyUSB MSC example and it works fine so the hardware is ok.When using USBx, after some hours of digging around, I've managed to make windows recognize the device as a USB Mass Storage, but after some time (probably 20s) the device manager shows this:If I look at the USB frames in wireshark I see this:The first descriptor response string appears to be malformed according to wireshark, but that doesn't seem to bother windowsThe real problem seems to be in the SCSI Inquiry: it took the device 20s to reply to the frame number 307 (host -> device URB_BULK in). The setup:- STM32CubeIde 1.16.1- The ioc file attached to this post- In USBx/App/ux_device_msc.c the USBD_STORAGE_GetMediaLastLba function returns 63 and the USBD_STORAGE_GetMediaBlocklength function returns 512- In the main function I called MX_USB_OTG_HS_PCD
I am using a custom board based on the STM32H750VBT6. I have set up the board as a USB FS device and added some test code to blink and LED based on the serial data sent over USB. I have gotten it to function properly on my Ubuntu machine, however, when I plug the board into my Windows machine I get:This device cannot start. (Code 10){Operation Failed}The requested operation was unsuccessful.Any help is much appreciated.
Hello everyone I want to interface ads115 Adc with stm32f446re nucleo. All the necessary connection between ads1115 and stm32 are made with I2c Can I get the example source code to read multiple channels. As I am not able to get values from adc Is any ads115 library has to be added to ide for working. Thank you
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.