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,Just wondering if anyone knows the reason for the duplicate writes to the following registers in the HAL Ethernet code please?ETH->MACCRETH->MACFCRETH->DMAOMRETH->DMABMRIn the example shown below (from HAL code) the DMA0MR register is written to, then read back, 1 msec delay and then written to.I've taken note of the need for the 4 clock cycle delay, however is it necessary to perform the duplicate writes?Thanks in advance.Edit: I'm using Cube FW F4 v1.28. /*----------------------- ETHERNET DMAOMR Configuration --------------------*/ /* Get the ETHERNET DMAOMR value */ tmpreg1 = (heth->Instance)->DMAOMR; /* Clear xx bits */ tmpreg1 &= ETH_DMAOMR_CLEAR_MASK; tmpreg1 |= (uint32_t)(((uint32_t)((dmaconf->DropTCPIPChecksumErrorFrame == DISABLE) ? 1U : 0U) << 26U) | ((uint32_t)dmaconf->ReceiveStoreForward << 25U) | ((uint32_t)((dmaconf->FlushRxPacket == DISABLE) ? 1U : 0U) << 20U) | ((uint32_t)dmaconf->Transm
Hey all, I'm attempting to implement the EEPROM emulation library into a pre-existing project with little success. I've added the eeprom.c file to the project as well as the header include to the main.c but even prior to implementing the code, attempting to compile/build throws an error that the "FLASH_Status" identifier is undefined. This variable is found inside the stm32f10x_flash header. I've added it from the StdPeriph file into the project but the compiler can't seem to locate it. This process if fairly new to be so I presume I'm missing some simple step to implement the library, any assistance would be appreciated. processor is an STM32F103programming in IAR Embedded Workbench
I want to know which Wakeup pin or Reset pin wakes up the microprocessor that enters standby mode. I have 2 wakeup pins.I am monitoring SR1 and SR2 variables with Live expression in Debug mode, but when I wake up from standby mode, the value of the variables does not change.Is there a method other than the code block below?I am grateful in advance./* USER CODE BEGIN 2 */CheckWakeupPins();/* USER CODE END 2 *//* USER CODE BEGIN 4 */void CheckWakeupPins(void) {// Ensure the PWR clock is enabled__HAL_RCC_PWR_CLK_ENABLE(); // Read the wakeup pin status from PWR_SR1uint32_t wakeup_status = __HAL_PWR_GET_FLAG(PWR_FLAG_WU); // Check individual wakeup pins - adjust mask as per your device's definitionsSR1 = (wakeup_status & PWR_FLAG_WUF1) ? 1 : 0;SR2 = (wakeup_status & PWR_FLAG_WUF2) ? 1 : 0;HAL_Delay(3000); // Clear the wakeup flags after processing to avoid retriggering__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);}/* USER CODE END 4 */
Hello,We have a custom board based on the STM32U5A5ZJ, and are in the process of writing a zephyr driver for the two analog comparators on the MCU. Our use-case requires the driver to support interrupts on both comparators. Looking at the reference manual, it seems that the two comparator instances have dedicated interrupt lines going into the EXTI (lines 17 and 18). However, neither of these EXTI lines are mapped into the NVIC. Instead, the NVIC has a single IRQ line (no. 72) for COMP1/COMP2.As a stop gap, we have enabled interrupts on COMP1, but are forced to use polling for detecting state changes on COMP2 (non-ideal). Hence, we were wondering how one could possibly use/enable both comparator interrupts simultaneously from a zephyr context?Any tips/suggestions would be appreciated. Thanks!
Hi, I am working with a Robomaster Development Board Type-A https://www.robomaster.com/en-US/products/components/general/development-boardFrom the picture you see on that website, I plug LiPo into the 24V Power input.I am trying to do a project in which I get the remaining battery life from the STM32. How would I do this?From reading the datasheet for the F427IH6, I can see that VDD = VDDA. However I'm not sure how to read VDDA or VDD.It seems like the ADC1 pin can read an interval value called Vrefint Which i gather from research has some linear relationship with VDDA but I don't know what it is.I would also like to get some clarification on what exactly VDD, VDDA, Vrefint, and other related values mean. Thank you!
What code works for the STM32L412 device?I want to load an RTC calibration value into flash memory and retrieve it on subsequent running of the firmware. I've got the reading of specific calibration values working in a different IC, for ADC calibration, ICTempCal1 = (*((volatile uint16_t*)(0x1FF8007A))); Will this work with the L412 IC? But I cannot get programming of a page to work. I tried 'HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, 0x080E0000,1000);'But that fails within the routine. I'm assuming the Erase routine worked, but I haven't got far enough to check. I tried the 'STM32CubeL4/Projects/NUCLEO-L4P5ZG/Examples/FLASH/FLASH_FastProgram' code and found it to fail in the last section, the GetBank routine.Different IC also. Can anyone give me the code for these operations?
Hi,I'm having trouble understanding the radio IRQs on STM32WL55. According to the reference manual NVIC section, there is one interrupt line for two interrupt sources (which are ORed together) for the radio:The 3 IRQs from the Semtech module ORed together, which can be configured using Cfg_DioIrq, via EXTI44The RFBUSY signal from the radio module via EXTI45According to the EXTI section, the EXTI44 line is a "Direct" one and the "EXTI45" one is a "Configurable" one. This means the EXTI45 can be enabled/disabled via the EXTI_CnIMR2 and cleared via the EXTI_PR2 register. The EXTI44 signal however can not be masked or cleared via the EXTI's registers, correct?Additionally, both EXTI44 and EXTI45 can be used to wake-up the CPUs from standby. This can be enabled via the EWRFIRQ/EWRBUSY bits in PWR_CR3 and PWR_C2CR3 registers. However, this wakeup does not cause an interrupt to be called, only a power-on of the CPU, correct? If the CPUs never enter standby mode, the E
First of all..... is anyone actually using the Azure RTOS package? I'm drinking the cool-aid provided by STM marketing. But, geez! ....how do you get started? I've been reading...and reading...and reading...but can't seem to crack the code (so to speak...:)Specifically, I have been trying to figure out how the modify the NX_Tcp_Echo_Server example so that it DOESN'T echo the data received from the network. Instead I am forwarding the received data_buffer array ("command") to USART2 which goes to a second board. The second board then responds to the command with a 64 byte "response". I use the HAL_UART_Transmit and Receive functions to do this, which (after fixing the USART2 bug in the example code) works fine. The Receive function returns the 64 bytes in the same data_buffer that was used to send the command. My problem is....how to I "inject" this data_buffer response into the nx_tcp_socket_send() function? I'm sure there must be a simple process for this, but the information provide
Hello everyone I'm working with Uart on STM32F411RE Nucleo board. It gives a code error, but no data is provided through USART2. Can anyone help me with this problem? The code is as follows: void Delay(int time); static void uart_set_baudrate(uint32_t periph_clk, uint32_t baudrate); static uint16_t compute_uart_bd(uint32_t periph_clk, uint32_t baudrate); static void Uart_Write(int ch); int __io_putchar(int ch) { Uart_Write(ch); return ch; } int main(void) { RCC->AHB1ENR |= (1U<<0); GPIOA->MODER &= ~(1U<<4); GPIOA->MODER |= (1U<<5); GPIOA->AFR[0] |= (1U<<8); GPIOA->AFR[0] |= (1U<<9); GPIOA->AFR[0] |= (1U<<10); GPIOA->AFR[0] &=~ (1U<<11); RCC->APB1ENR |= (1U<<17); uart_set_baudrate(16000000, 115200); USART2->CR1 = (1U<<3); USART2->CR1 |= (1U<<13); while(1) { printf("hello\n\r"); for(int i=0; i<100000; i++) {} //Delay(10); } } void Delay(int time) { for(int i
Hi, I've got an issue with TCPM stack running on STM32G431 with USBPDTCPM_PD3_FULL_CM4_wc32 library.The issue is related to the configuration of FUSB307B IC registers to enable SOP messages receiver at very first SOP reception. I've posted the detailed description of the issue on OnSemi forum: https://community.onsemi.com/s/question/0D54V00007dSZ0MSAW/fusb307b-rxstat-alert-is-not-signaled I was able to determine that you have to write RXDETECT (0x2F) register at least twice to workaround this issue. I also investigated by logic analyzer the initialization sequence of FUSB307B IC in OnSemi EVK with preloaded FW and noticed that it also does the same.. Since TCPM core is provided as a lib file I can not make changes in the related part of PE code. Thus I have to make some kind of workaround monitoring for Power State change notification and writing RXDETECT register manually.I would appreciate if this issue could be checked in ST internally and it would be fine t
Hello, I am a beginner trying to use STM32CUBE IDE to programme my board to record audio using the pdm interface of SAI and I have many questions about the MEMSMIC1 example before I can begin. Instead of using the CCA02M2, I am using independent digital pdm microphones (IM73d122).I want to start as simple as possible, with maybe 1 microphone pair and advance to two after i understand it more.- Because my pin configuration is likely different from the example, in which file do i adjust this? There are so many subfolders and header files that I cannot find the location to do this.- The description mentions that when using SAI there is a need for a software step for the pdm to pcm data acquisition. I guess this is not already included in the example? what do i need to do additionally for this?- The description also mentions using Audacity to record the audio, but again this is applicable to usb streaming from the cca02m2. How can I get the data recorded in a similar way using ju
The FatFs version "R0.12c" provided by STM32CubeIDE is too old and buggy.I would like to ask if there are any plans to upgrade to FatFs latest version in STM32CubeIDE. As I know, FatFs used by STM32CubeIDE is open source from the site below,and the latest version is already "R0.15".http://elm-chan.org/fsw/ff/Mar 04, 2017 : FatFs R0.12cNov 06, 2022 : FatFs R0.15 (latest release) I manually ported FatFs "R0.15" to my project and tested its operation,and the latest version has fixed many bugs and operates much more stably.
Hi! I wonder if it is possible to set up the STM32H7B3 µC as a synchronous usart slave with the usart1 peripheral. From the reference manual it seems that it is only possible to set it up in 'SPI-mode'. The functionality I want is a USART slave that transmits data packets at a fixed rate(i.e. 1kHz) with no NSS, at the bit-rate determined by a continuous clock provided by the master. Any clarification would be appreciated!
STM32Cube_FW_L4_V1.18.0\Projects\NUCLEO-L476RG\Applications\FreeRTOS\FreeRTOS_MPUI am trying to debug the usage of FreeRTOS_MPU using the NUCLEO-L476RG board.But the code failed at HAL_Init() - if (HAL_InitTick(TICK_INT_PRIORITY) != HAL_OK){status = HAL_ERROR;} Anyone has any idea ? p.s.I loaded up the other FreeRTOS example and works OK.STM32Cube_FW_L4_V1.18.0\Projects\NUCLEO-L476RG\Applications\FreeRTOS\FreeRTOS_ThreadCreation
Diference between the below 2 funtions:HAL_StatusTypeDef HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t* pData,uint16_t Size, uint32_t Timeout);HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t* pData,uint16_t Size, uint32_t XferOptions);When should I use the below functions?HAL_StatusTypeDef HAL_I2C_EnableListen(I2C_HandleTypeDef *hi2c);HAL_StatusTypeDef HAL_I2C_DisableListen(I2C_HandleTypeDef *hi2c);HAL_StatusTypeDef HAL_I2C_Master_Abort(I2C_HandleTypeDef *hi2c, uint16_t DevAddress);void HAL_I2C_EV_IRQHandler(I2C_HandleTypeDef *hi2c);void HAL_I2C_ER_IRQHandler(I2C_HandleTypeDef *hi2c);there are many library functions as such, but we don't get to use all of them but where should we search to find the exact use of the the HAL functions and how to find the correct application for it?
Hi guys,I want to know whether the device meets the 100Mbps full duplex need how to test?My own test is as follows:The device ip is 192.168.1.10, pc ip is 192.168.1.135.(The ip of pc is different in wireshark(135) and test software(25), because it is not the same pc and same test, just for your information)First of all, when connecting the device to PC via RJ45, the Ethernet link shows 100Mbps. I used the speed test software on PC, when sending arp, icmp, tcp, udp packets to the device at the same time, the device won't reply to some of the packets, especially not to ICMP packets.In this case, is the device considered to meet the 100 megabit full duplex? Or do all requests have to be replied by the device.
Hi, I am unable to interface with a sensor over RS485. I have a uart->RS485 converter hooked up to pins for USART1 (Tx on PD8, Rx on PD9) on a Nucleo-F439ZI.I also have a USBtoRS485 converter with which i'm able to communicate to the sensor fine. I have a scope connected onto the B- line and can compare the data.The sensor prescribes the following UART settings:Data bits: 8Number of stop bits: 1 bitParity: evenBaud rate (bps): 57600 (factory setting)and I have set USART1 t initialize with the following settings:huart1.Instance = USART1;huart1.Init.BaudRate = 57600;huart1.Init.WordLength = UART_WORDLENGTH_8B;huart1.Init.StopBits = UART_STOPBITS_1;huart1.Init.Parity = UART_PARITY_EVEN;huart1.Init.Mode = UART_MODE_TX_RX;huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;huart1.Init.OverSampling = UART_OVERSAMPLING_16; An image looks as can be seen in the attached scope3.jpg picture where RefA (grey) is the recorded (working) signal from the USBtoRS485 converter and CH1 (yellow) is t
HAL timebase set to use TIM6. ThreadX uses SysTick.My code is minimalistic for the test-project when debugging this issue. ThreadX is set up to have 1000 ticks/second as opposed to the default 100 ticks/second.I have one thread printing out HAL_GetTick() and _tx_time_get() after a tx_delay of 1000 milliseconds.HAL_GetTick as we all know returns uwTick, which gets incremented by the TIM6 interrupt callback.ThreadX returns the correct time, while GetTick() returns a value that gets incremented by about 15 for every 1000 ms. My only explanation for this is that ThreadX disables the interrupt that calls the TIM6 IncTick function while it does scheduling work in the background, but I have a hard time believing this as I can't find anyone else facing the same issue online.
Hi all,I want to increment the lap_marker variable only once when the lap_button is pressed, but when I press the button, it increments multiple times, untill I let go of the button (when I put a breakpoint in the loop it works fine).I only want to increment once, Have I done something wrong? Is there another logic?The pin is PC13, in input mode and the internal pull-down resistor activated.Here is the code: //Read lap buttonif(HAL_GPIO_ReadPin(lap_button_GPIO_Port, lap_button_Pin)){lap_marker++;}
Hallo,I struggled already two days with the implementation of USB_OTG_FS on a STM32F401 board. The most prominent error concerns the Virtual Com Port on the Windows PC: whatever I try, there is always a message saying "USB device not recognized", with as addition "Device Descriptor request failed".In a final attempt I stepped my debugger through the initialization process and encountered the function 'USB_DevConnect(...)', located in the file: "ProjectName>>Drivers>>STM32F4xx_HAL_Driver>>Src>>stm32f4xx_ll_usb.c", line 76. I considered the statements in that function a bit strange, until my eye fell on the function 'USB_DevDisconnect(...)' right below the former one. The body of both functions are exact copies of each other!At first I thought I messed up this file myself, so I checked the "master" file in the Repository for STM32F4xx targets, with the same result. Still I couldn't believe this came from ST, so I downloaded the most recent version, the "STM32Cube_
STM32L4에서 오디오 재생 에 문제가 있습니다 . 이는 IAR 컴파일러의 경고 메시지입니다. 경고[Lt009]: 일관성 없는 wchar_t 크기 mp3d_htab_armv4.o(lib_mp3decoder_cortex_m4_v2.2.0.a)에는 wchar_t 크기 16비트 Audio_player.o 및 164개의 다른 개체가 있으며, 그 중 일부는 dl7M_tlf.a에 있고 90개의 다른 라이브러리에는 wchar_t 크기 32비트 Mobile_Laser.out이 있습니다. lib_mp3decoder_cortex_m4_v2.2.0.a 여기에서 다운로드했습니다 https://www.st.com/en/embedded-software/x-cube-audio.html 오디오가 재생되지 않는 이유는 해당 경고 메시지와 관련이 있는 것 같습니다. 이 문제 좀 도와줘 감사합니다
Hi Folks I am porting some code from an old project where i was using FreeRTOS 10 to AzureRTOS.At the end of an ISR callback i used to call portYIELD_FROM_ISR(yield) to give back to the OS(Scheduler) the control on the next valid tick. Is there any equivalent for AzureRTOS ? I tried to search but i found nothing relevant. RegardsDavide
When I try to compile stm32 image processing library by using the compiling toolchain provided by stm32cubeIDE.I met an error which tell me " inconsistent operand constraints in an 'asm' "The detailed error information is shown in following two pictures:----------------------------------------------------------------------------------------------------------------------Please guide me to know how I can resolve the this issues
Hey folks. My question up there is probably a bit vague.I'll try to formulate it more precisely and what I've done so far.So first of all, I don't use RTOS.I have a few data mapping and sending functions in my main loop. Actually, I should also put MX_LWIP_Process() there to check whether I have received a new UDP packet. To make this somewhat periodic, MX_LWIP_Process() is called in a timer interrupt at 50kHz.It could be that I receive a flood of data via UDP and have to buffer them away. So I#m currently testing this with a Python script on a Raspberry Pi which simply sends me 150x 6Byte data in a UDP message as fast as it can.At the moment everything works fine and i'm able to process the Data.But from 195x 6Byte data I suddenly miss packets, so my recv_callback apparently did not trigger. (I checked its, its gotten only called 191times)(and i checked if the pi actually send 195x a package, he does)I assume that even if MX_Process () is not executed, UDP packages will be received an
Hi ST Microcontrollers Team, We are looking to Transmit/Receive UDP data over Ethernet on board NUCLEO-H745ZI-Q NUH745ZIQ$AT1.I have found a LWIP example stack for ping the device from the below git hub link,https://github.com/stm32-hotspot/STM32H7-LwIP-Examples From the above code I was getting board was pinging. Further I need to transfer/receive udp data over Ethernet. Kindly share me the Example code for transfer/receive udp data. Thanks in advance,Regards,A. Ajith Kumar
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.