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
Our project is run on the STM32F411E-DISCO board running under Segger Embedded Studio. All Timers TIM2/TIM5/TIM9/TIM10/TIM11 are being used. Under a debug session everything runs correctly. If we leave the board programmed with the debug code and power it up without the J-Link connection attached everything runs correctly. However, if we run a release build then the 32-bit timers run correctly but the 16-bit timers do not. From what we can see the 16-bit timers are running too fast as if the check we do for the rollover TIMx->SR & TIM_SR_UIF is always returning true. We looked at the RCC register settings in a debug session and none of the RCC or APB1/2ENR registers appear to have any bits enabled that weren't set by our code. This issue was actually solved while this post was being written, so this is being posted anyway in case someone else runs into the same issue. Our initialization code runs generically for all timers and
I am trying to use a comparator on my NUCLEO-STM32G474RE dev board.The issue I am encountering is that while the external COMP1 output is correct when measured with an oscilloscope, the output due to HAL_COMP_TriggerCallback is simply a 370 kHz signal, no matter what inputs the comparator has, or what is measured on the external comp output. /* 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. * ****************************************************************************** */ /* USER CODE END Header */ /* Inclu
Most I2C EEPROM (eg M24M01E) need some time after a write command to transfer the written data into the internal EEPROM. During that time (eg max 3.5 ms) the device does not respond to I2C.My question is about the timeOut parameter in the HAL_I2C_Mem_Write (and other HAL_I2C_Mem_xxxx) :Is this timeOut intended or suited to deal with this unavailability of the device after a write operation ? If I want to do 2 write operations (and I do not insert a delay between both HAL calls myself), will the second call automatically retry until timeOut, and so if I set timeOut to 4 ms, I could in the application simply ignore the needed delay after a write operation.
Body:Hello STM32 Community,I'm encountering an issue with an Ethernet application I'm developing on an STM32 platform, where I can't seem to send UDP packets to a specific IP address within my local network. Broadcast UDP packets are sent and received successfully, but directed packets do not reach their destination.Here's a summary of the setup and issue with github gists going into deeper details below:Deelopment Board: H563ZIMAC Address: Manually set to 0:80:e1:0:0:0Target IP: 192.168.1.99 (my notebook)Broadcast IP: 192.168.1.255 (Broadcasts work fine and are received by nc -lu PORT & wireshark)LwIP version: 2.1.3Router: Linksys e2500 v4 router, with DHCP range 192.168.1.100 to 192.168.1.149Firewall: Disabled on both router and my notebook.Wireshark captures the broadcast packets, but not the packets directed to 192.168.1.141. However, when I use the broadcast address 192.168.1.255, the messages are received and visible in Wireshark and on the nc -lu 6543 listener on my not
Hi @STTwo-32Apologies to anyone that would have seen this topic elsewhere on the ST community forum. I was advice to create a new topic.The first time I reported this bug I thought it was a red herring as I did not know how reproduce the bug at will so I recommended that the query was closed only to discover that the problem persisted.Some additional information on the platform I am runningWindows 11STM32WL55 nucleo boardUsing STM32CubeIDE for buildingSTM32CubeMX Version 6.10.0STM32CubeIDE Version 1.14.0So just to recap the reported bug here for your convenience.If I create a project based on the SubGHz_Phy_Per project generated by the Example Selector using STM32CubeMX. A project is created which builds fine and can be programmed and even debugged.See image below In the project explorer pane highlighted in blue you can see the default data structure that STM32CubeMX generated when the Example Selector option was used by default.When the project is ge
Hello,Newbie here, need help getting printf() to write to USART2.Using IDE : IAR EW for ARM 9.50.1Board: NUCLEO-F401REExample Project:The example project is called UART_Printf. Here is a screen shot of the directoryThis example code can be found here: https://www.st.com/en/embedded-software/stm32cubef4.htmlThe example code seems to run fine except the printf() output goes to the Terminal I/O window in the IDE. Not out the UART or Virtual USB com port. I want printf() to send data out USART2. And if it did, think I would also see the data on the Virtual USB Com Port too. In device manager I do get this: So that is a good sign. And I do see that USART2 has been configured: But when I run the code, the Data Register on USART2 is never written to. I set a break point on a data write to 0x04000'4404 (the DR register) and it never gets written to. I also put a scope on the USART_TX signal (pin 16, PA2 of the MCU) and it is not active. But as I said. Printf
I have a complex system comprised of one STM32G474RE that serves as a USB to I2C bridge. The G4 communicates with about a dozen STM32G051F8 chips over I2C. I designed the board with the ability to independently control the BOOT pin of each G0 so I can boot a single device into the system memory and utilize the built in I2C bootloader. I've read AN2606 and AN4221 and understand how to send data to the G0.I am currently stuck trying to understand what bytes to pull out of the output file (currently I've generated .bin, .hex and .elf files from STM32CubeIDE). I also do not know what the starting address for the data should be. This is a STM32CubeIDE standard project, I've only modified "main.c" so you can assume default addresses. I would also like to know if there are size limitations for writing flash. I know the I2C protocol in AN4221 says I can write a max of 256 bytes at a time but I am trying to understand if there is a minimum amount that must be written to in flash at a time.I've
Hi!I'm having some troubles in configuring the I2C bus on my STM32H747 evaluation board.I've configured it in CubeMX as in the image below, using DMA buffer (rx and tx). Gpio pins are configured as open drain (no pull) and hardware is ok.It seems like the peripheral is not correctly initialized because I can't see any toggle of SCL pin on my scope (both SCL and SDA go low during initialization but, after that, they don't move anymore).Can someone help me please?Thanks
Hello all, I want to take ADC reading at regular intervals based on timer 1 (used OC mode). The timer must trigger the ADC to take a reading and the ADC in turn will trigger the DMA to transfer the ADC reading to memory. To check that the timer is running I am toggling a GPIO_PIN. This pin toggles but conversion is not getting triggered. I have enabled one OC1 output pin toggle and that is toggling. One more point is, the following call triggers one conversion. HAL_ADC_Start_DMA (&hadc1, (uint32_t *)adc_buf,ADC_BUF_LEN); I am missing the link to TIM1 OC1 and ADC start conversion whenever the OC1 match occurs. Can someone help please? Below is the ADC init code. void MX_ADC1_Init(void) { __HAL_RCC_ADC1_CLK_ENABLE(); hadc1.Instance = ADC1; hadc1.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV8; hadc1.Init.Resolution = ADC_RESOLUTION_12B; hadc1.Init.ScanConvMode = DISABLE; // hadc1.Init.ContinuousConvMode = DISABLE; // hadc1.Init.DiscontinuousConvMode = ENABLE; // hadc
Hi every one, I am not able get Free RTOS SDK and support for STM32F469 eval - kit to interface with SD card, Graphical LCD and USB - c type. Kindly help me if it is available. Thanks and Regards Pankaj Jharbade
I am working with an STM32F107VCT6TR MCU to communicate with an M95M04-DRMN6TP component over SPI3.The pins are set up as follows:PB7(93) -> HOLD(7)PB6(92) -> W(3)PA15(77) -> S(1)PB5(91) SPI3_MOSI -> D(5)PB4(90) SPI3_MISO -> Q(2)PB3(89) SPI3_SCK -> C(6)Hardware NSS Signal is disabled, in preference to running the NSS signal via Software using PA15 low when I want to communicate with the component, and high otherwise, per the M95M04-DR datasheet. I've tried enabling the hardware NSS signal, but that approach did not seem to work well for me (and elsewhere on the forum, people seemed to not recommend this approach). I have no other components that require communicating over SPI3, so I thought it might work for me, but... oh well.Clock parameters are set CPOL low, CPHA 1 Edge. Data Size is 8 bits, with the First Bit set as MSB First. Frame Format is set to Motorola. This matches the first SPI mode supported by the M95M04-DR, to include ensur
Hi,I'm trying to use an interrupt with CMSIS_RTOS2. The user button is configured to use as an interrupt source:When I push the button, the system freezes. I suspect the interrupt flag doesn't get cleared but I have no idea why.There is nothing (yet) in the callback function:This works fine in normal working mode but it freezes when I'm working in CMSIS-RTOS2. I have no idea why this happens.I'm working on a 32F746GDISCOVERY board.
USB Device and FATFS not present in CubeMX. How can I add this in CubeMX (or in KEIL compiler )?Do you have a working sample for this processor ?
Hello everyone,I'm currently working with a custom board that utilizes the STM32U599 microcontroller, and I'm attempting to establish communication with an SD card. The IDE I'm using presents the option of FileX alongside ThreadX; however, my application is exclusively built on FreeRTOS. I've noticed through various discussions that FATFS is commonly implemented for SD card interactions, but I'm unable to find this option, even after perusing the uninstalled packages in the IDE. My familiarity with integrating SD card functionality with STM microcontrollers is quite minimal. Could anyone provide some guidance or recommendations on how to proceed with this setup? Thank you in advance.
Description: I'm facing an issue with the HAL_UART_Receive function in an STM32 microcontroller application when used within the netxduo.c thread. Below are the details of the problem:Overview: I'm using an STM32 microcontroller along with a SIM modem for communication purposes.Issue: The HAL_UART_Receive function works correctly in the main thread, allowing me to receive responses from the SIM modem. However, when calling the same function from the netxduo.c thread, I'm not receiving any responses.Application Hanging at HAL_UART_Receive
Hello STCommunity, I'm looking for bootloader code for the Nucleo-32F091RC board as the existing one has been erased. Could someone kindly provide assistance or guidance on how to rewrite the bootloader for this specific board? Any help would be greatly appreciated. Thanks and Regards,Santhosh K
Hi,I want to creater a telnet server but can't even get the board to respond to a ping. I followed the following sequence:Crearted a new projectselected my Nucleo-F439ZI boardselected to initialize the peripherals to their default modeGot the following clock config (note I changed the HSE to 25MHz):Enabled FreeRTOS CMSIS_VChanged Timebase Source to TIM14 (in SYS config)Enabled USE_NEWLIB_REENTRANT (In FREERTOS config)Confirmed that ETH is enabled with RMII & confirmed all the pins are routed correctly (no changes needed)Enabled LWIPChanged the Driver_PHY to LAN8742Disabled DHCP Set IP to 192.168.000.123 with 255.255.255.0 as subnetCtrl+s to create the sources!compiled & loaded the application & tried to ping the above IP (.123) from my laptop (set to 192.168.0.111) but do not get any response.I realized that it appears to get stuck in MX_LWIP_Init(). Why is this and how can I fix it?
If there is an EVM that meets all or part of the following conditions, I would appreciate your recommendation. * I am looking for a possible EVM because I want to check whether a file that should not be played with SPDIF in due to license restrictions is played or not. 1.Is it possible to input the following file to USB IN and pass it through the SPDIF out jack with the same extension without PCM format decoding? Also, is there any way to check the file extension that is being output to the SPDIF out? ogg, mp3, aac, wav, mp4, m4a, aiff, flac, m4a, 2.Is there any way to check the extension of the file that is inputted when I input these files (ogg, mp3, aac, wav, mp4, m4a, aiff, wma, flac, m4a) into SPDIF IN? Is it possible to input these files (ogg, mp3, aac, wav, mp4, m4a, aiff, wma, flac, m4a) to the SPDIF IN and pass through the SPDIF out with the same extension without being decoded to PCM? Also, Is there any way to check the file extension that is being output to SPDIF ou
Hello,I'm trying trying to setup an interrupt receive on the U5 MCU using the STM32U5GJ-DK2 development kit. The USART1_IRQHandler does not get triggered at all. Here's my CubeMX config for the USART1:I've sniffed the RX line, so I'm sure it's working as expected.Here's my main() code: int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* Configure the System Power */ SystemPower_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_GPDMA1_Init(); MX_ICACHE_Init(); MX_DCACHE1_Init(); MX_DCACHE2_Init(); MX_CRC_Init(); MX_LTDC_Init(); MX_DMA2D_Init(); MX_GPU2D_Init(); MX_
Hi all, I'm trying to adapt a STM32F4 project to SMT32WL project. STM32F4 project example is here as you can see the projet use FreeRtos.So for the moment I've built radio driver example for my nucleo jc1 board like here everything works well. But for now I'm trying to add manualy FreeRtos directory to my project without succes.What I've tryied is to create Middlewares directory copy FreeRtos in it add click Add/remove include path...But when I want to include FreeRtos.h I have to do #include "Source/include/FreeRTOS.h" how can I do to only have #include "FreeRTOS.h" ? Thanks
Hello, I am able run successfully mqtt example on my stm32f4 MCU and on my local network.I want to run the same code on a cloud platform. However there is a link provided by mqtt cloud provider not an IP address like 192.168.0.10Can I directly use the below link instead of the IP address ? If not, then How can I ?1f87a053302042c7a0ccb2dac5d1263b.s1.eu.hivemq.cloudBest Regards
Hi,I am not able to run my FreeRtos in Non secure region when trust zone is enabled.When I did the debugging it's going to the infinite loop ,getting message as "No source available for <signal handler called>() at 0xfffffffe"The above are the configuration setting I have enabled.I am getting the above message when I did the debugging. */ void MX_FREERTOS_Init(void) { /* creation of defaultTask */ defaultTaskHandle = osThreadNew(StartDefaultTask, NULL, &defaultTask_attributes); } void StartDefaultTask(void *argument) { /* USER CODE BEGIN defaultTask */ /* Infinite loop */ for(;;) { HAL_GPIO_TogglePin(LED_GPIO_Port,LED_Pin); osDelay(1); } /* USER CODE END defaultTask */ }I am doing simple LED_toggle in FreeRtos task in Non secure region.
Hello, i configured FreeRTOS to enter STOP2 mode on idle task, my wakup source are RTC and LPUART. when the mcu is waked up by RTC according to ulExpectedIdleTime, every think is ok but when it is waked up by the LPUART the tick count is not updated correctly (so all my software timers are not executed with the right period) it should be an implementation on PostSleepProcessing() to modify the value of ulExpectedIdleTime according to RTC counter, but i cannot find how to do it ! any body have an idea ? where i can find the RTC counter for wakeup timer (i already checked all RTC register, i assume that it exist, but i cannot find it) void PreSleepProcessing(uint32_t *ulExpectedIdleTime){ //LPUART : //make sure that no LPUART transfer is on-going while (__HAL_UART_GET_FLAG(&hlpuart1, USART_ISR_BUSY) == SET); //make sure that LPUART is ready to receive while (__HAL_UART_GET_FLAG(&hlpuart1, USART_ISR_REACK) == RESET); //set the wake-up event:specify wake-up on
I try to debug how to set AZURE RTOS for 1ms tick timer. I debug this function:HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) in file "stm32u5xx_hal_timebase_tim.c": HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) { RCC_ClkInitTypeDef clkconfig; uint32_t uwTimclock = 0; uint32_t uwPrescalerValue = 0; uint32_t pFLatency; HAL_StatusTypeDef status; /* Enable TIM6 clock */ __HAL_RCC_TIM6_CLK_ENABLE(); /* Get clock configuration */ HAL_RCC_GetClockConfig(&clkconfig, &pFLatency); /* Compute TIM6 clock */ uwTimclock = HAL_RCC_GetPCLK1Freq(); /* Compute the prescaler value to have TIM6 counter clock equal to 1MHz */ uwPrescalerValue = (uint32_t) ((uwTimclock / 1000000U) - 1U); /* Initialize TIM6 */ htim6.Instance = TIM6; /* Initialize TIMx peripheral as follow: + Period = [(TIM6CLK/1000) - 1]. to have a (1/1000) s time base. + Prescaler = (uwTimclock/1000000 - 1) to have a 1MHz counter clock. + ClockDivision = 0 + Counter direction = Up */
Hi, I am working on a project doing realtime processing of FFT information on an audio signal on the STM32H730. In order to get better realtime performance I would like to optimize this process as much as possible.What would you recommend to optimize the following code block? Is there anywhere I can replace math operations with CMSIS or CORDIC functions, and/or just write something to be more computationally efficient? float32_t wrap_phase(float32_t phase_in){ if (phase_in >= 0){ return fmodf(phase_in + M_PI, 2.0 * M_PI) - M_PI; } else{ return fmodf(phase_in - M_PI, -2.0 * M_PI) + M_PI; } } void pv_analyze(void){ for(int i = 0; i < fft_size; ++i){ fft_in[i] = input_ring[(i + index) % fft_size] * window[i]; } arm_rfft_fast_f32(&fftHandler, fft_in, fft_out, 0); for(int i = 0; i < fft_size; i+=2){ float32_t amp = sqrtf((fft_out[i] * fft_out[i]) + (fft_out[i+1] * fft_out[i+1])); float32_t phase = atan2f(fft_out[i+1], fft_out[i]);
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.