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
Hi all,I spent hours but I cannot make UART work in DMA circular mode with RTOS (CMSIS V2).Can someone send me a simple example ?I would like to receive characters from PC (various length commands: 8-10 chars) and process them in another task parallel. Then save the position and next time start processing the commands in the buffer from the previous position.What I experienced is that ReceiveBuffer contains one only character. When I put a breakpoint at HAL_UART_Receive_DMA line and send the characters, in next iteration I see the whole string received.I guess somehow I have to wait till the streaming is finished.Finally a made it work. Hw issue is always the last thing what I'm suspecting...I haven't noticed this in device manager:Replacing the USB-UART converter solved the issue and uC receiving the incoming stream with DMA. This snippet seems working: void StartDefaultTask(void *argument) { HAL_UARTEx_ReceiveToIdle_DMA(&huart5, (uint8_t*)ReceiveBuffer, 256
Hello I am developing on the NUCLEO-H563ZI board a system in which I need to obtain an IP address via DHCP.I have implemented the client following the guidelines of the documentation provided by ST as well as THREADX and NETXDUO and, I have strange behavior.The system rarely completes all message transaction between the NUCLEO board and the DHCP server on my system. It usually stays alltime in a loop sending a DISCOVER and ignoring the server's OFFER response.From time to time, it succeds to perform the full message cycle DISCOVER-OFFER-REQUEST-ACK, but then remains in a loop continuously performing a REQUEST and ignoring the ACK.I think I have a runtime or thread priority problem. I've tried everything and I can't get out of this dynamic.The hardware works with other codes (not using DHCP).I'm stalled here. This is the code that I'm using:NX_PACKET_POOL dhcp_client_pool;NX_IP client_ip;NX_DHCP dhcp_client;TX_THREAD dhcp_client_thread;CHAR *pointer;UCHAR message[50] = "
I've been looking for a list of all of the STM32 MCUs which feature an integrated USB High Speed PHY, but haven't been able to find a list of all of the specific MCUs that have this feature to know what options I have to choose from for my project.I have used the ST MCU Finder, but the filters for searching for MCUs there only include a filter for USB OTG HS, which only filters it down to MCUs that support USB HS, which includes ones that only support it through an external PHY device connected to the ULPI. It doesn't look like there's a filter on the MCU Finder for MCUs with integrated USB HS PHY.The only MCUs that I've found that support USB High speed and feature a integrated internal USB High Speed PHY are the F733, F723, and F730(only packages with >=144 pin on the F730)A resource to find or a list of some of, if not all of the STM32 MCUs with internal USB HS PHYs would be greatly helpful and appreciated.
Hello. I am a SW engineer who is developing an electric vehicle charger.The headquarters is developing a slow charger with the STM32F1(STM32F103RCT6) series and is preparing for MET certification.Looking to prepare for UL 1998 functional safety, I need ST related libraries and manuals or data, where can I download them? And can I apply the library as an IAR development tool? It's my first time working on STM's chipset, so I have a lot to learn. I'll try to get used to it as soon as possible. Please answer. Thank you.ChanJin
I have been working on a project that intends to utilize the SPI ST bootloader to load code to a board. Using a Nucleo-H723ZG and Nucleo-G0B1RE dev boards, I made a driver to interface with the ST bootloader over SPI and was successfully able to get it to work. The actual project is intended to work with STML47s and STML49s, so the next step was getting a Nucleo-L476RG and after a little tweaking, I was able to get the driver working with this dev board. Finally, I'm now trying to get the driver to work with a Nucleo-L496ZG and for the life of me I can't get it to work. I'm pretty confident in the driver that I have made as it works with both the L476 and G0B1 Nucleo boards and the specific error I'm running into doesn't feel like an issue with my code.The specifics of what I'm seeing on the L496 is that the SPI protocol will never complete the synchronization sequence. No matter what I do, the L496 always sends 0xA5. I've tried increasing the amount of time that I wait for the 0x79 AC
Hello! I am another programmer that doesn't want to use the ThreadX and Microsoft Azure OS in order to implement device USB on an STM32U5 series processor, as I have some very time-critical real-time peripheral operation that I need to get working, I don't need an OS for my application, and I want to avoid all of the extra, highly complicated new code. I am fairly used to ST's USB libraries of old and would be much more comfortable working with the classic model.Our client is also not looking forward to writing custom Windows device drivers for a custom Vendor and Product ID, and I have read that it is difficult to get ST to sub-license a Product ID under the ST Vendor ID, let alone create another driver package for this (a CDC class), so I have chosen to implement a HID class. Even though it runs slower, it is less installation hassle and the problem of Vendor and Product ID's is less of a problem (we have our own Vendor and Product ID, and we don't even need to writ
Hi, I've been trying to debug my led toggle code. But I'm getting error like "Error in final launch sequence" and "Failed to execute MI command". I was using STM32F769-Disco board.
In the file "stm32g4xx_hal_rtc_ex.c" in the function "HAL_RTCEx_SetTamper_IT(...)" there is an if-statement: if (sTamper->Trigger != RTC_TAMPERTRIGGER_RISINGEDGE) { tmpreg |= (sTamper->Tamper << TAMP_CR2_TAMP1TRG_Pos); } And the corresponding .h file has: #define RTC_TAMPERTRIGGER_RISINGEDGE 0x00U /*!< Warning : Filter must be RTC_TAMPERFILTER_DISABLE */ #define RTC_TAMPERTRIGGER_FALLINGEDGE 0x01U /*!< Warning : Filter must be RTC_TAMPERFILTER_DISABLE */ #define RTC_TAMPERTRIGGER_LOWLEVEL 0x02U /*!< Warning : Filter must not be RTC_TAMPERFILTER_DISABLE */ #define RTC_TAMPERTRIGGER_HIGHLEVEL 0x03U /*!< Warning : Filter must not be RTC_TAMPERFILTER_DISABLE */ This becomes an issue if configuring for RTC_TAMPERTRIGGER_LOWLEVEL.The issue seems to be that the code inside the if-statement sets the TAMP1TRG bit to 1 if true. Since the defines for the different triggers are numbered from 0 to 3, TAMP1TRG will always be 1 so long as w
Hi, I’ve been trying to simulate a RAM ECC single and double error for testing on the STM32H753. I’ve seen these other two posts that have a similar issue to mine but with no clear solution:https://community.st.com/t5/stm32-mcus-products/how-to-test-handling-of-h7-ecc-in-sram/td-p/105854 https://community.st.com/t5/stm32-mcus-embedded-software/stm32h750-ramecc-testing/td-p/696069 I have referenced this example code to set up monitoring and configuration just for AXI SRAM. My RAMECC initialization and callback function look like this:static void MX_RAMECC_Init(void) { /* USER CODE BEGIN RAMECC_Init 0 */ /* USER CODE END RAMECC_Init 0 */ /* USER CODE BEGIN RAMECC_Init 1 */ /* USER CODE END RAMECC_Init 1 */ /** Initialize RAMECC1 M1 : AXI SRAM */ hramecc1_m1.Instance = RAMECC1_Monitor1; if (HAL_RAMECC_Init(&hramecc1_m1) != HAL_OK) { Error_Handler(); } /* USER CODE BEGIN RAMECC_Init 2 */ if (HAL_RAMECC_EnableNotification(&hramecc1_m1, (RAMECC_IT_MON
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 a TTL to RS485 converter to handle the communication. The problem I’m facing is that I get no response from my servo drive when sending MODBUS RTU frames from the NUCLEO board. I’ve already tried the same setup using an Arduino Mega, and everything works perfectly – I can communicate with the servo drive and control it without any issues. So, I believe the issue might be with my program or the way MODBUS RTU is being handled on the NUCLEO board. Here’s the setup I'm using: Controller: NUCLEO-F446RE Converter: TTL to RS485 converter MODBUS Communication: USART1 (PA10 Rx, PA9 Tx, PA8 DE, PA7 RE) Servo Drive Baud Rate: 38400, no parity, 2 stop bits I’ve attached my program below, and I’d appreciate it if anyone could help me identify where the issue might be. /* Includes ------------------------------------------------------------------*/ #include "main
I'm utilizing two nucleo f767zi boards with the goal to get them to ping eachother using Ethernet with lwip and no RTOS. Both their Ethernet cables are connected to a switch which is also connected to my PC. With cubeide I've successfully pinged the boards from my PC using the functions ethernetif_input->low_level_input() and ping in the command prompt (windows).Now i want to ping one board from the other board. The first board is set up as before and prints out the length och the packets received as well as a LED to identify successful transmission. With the other board i'm trying to utilize the function low_level_output(). It is setup so that when i press the user button the following code is executed.struct pbuf *my_package_2_send;const char data_2_send[] = "Hello, World!"; my_package_2_send = pbuf_alloc(PBUF_RAW , strlen(data_2_send), PBUF_POOL);pbuf_take(my_package_2_send, data_2_send, strlen(data_2_send));low_level_output(netif ,my_package_2_send); pbuf_fre
Hi,I try to enable the hardware ARP Offload in a STM32H745. The problem is, that it doesn't take the given IP adresse in die MACARPAR register regardless what the sequence of code is. I tryed it before and after enabling the ARPEN bit and before and after start the ETH. The adresse where the MACARAR register is, is staying at zero. Does anybody know, how to enable the ARP offload?Here is my code and debug phenomenon: // Enable ARP offload MODIFY_REG(heth.Instance->MACCR, ETH_MACCR_ARP, 1U << ETH_MACCR_ARP_Pos); // Set ARP protocol address MODIFY_REG(heth.Instance->MACARPAR, ETH_MACARPAR_ARPPA, htonl(0xC0A8000DUL));Best regards,JIahong
I'm currently facing an issue with my custom USART driver for communicating with the PZEM-004T module. I've successfully developed and tested this driver, and it works perfectly with other devices like the ESP32, where I receive responses without any problems. However, when I attempt to communicate with the PZEM-004T, the data sent appears correctly on the logic analyzer, but I receive no response from the slave, i also tried sending the command from pc using Tera Term 5 but same. I've verified that I’m using the correct settings: a baud rate of 9600, 8 data bits, 1 stop bit, and no parity. Additionally, I've checked the Special Function Registers (SFRs) to ensure everything is set up correctly. I've also tried changing the slave address and modifying the Modbus command, but none of these adjustments have yielded any results. Any guidance or suggestions on how to troubleshoot this issue would be greatly appreciated.I don’t believe the problem from my code as i said i already tested it
STM32Cube FW_H7 V1.11.2I previously posted an issue related to incorrect selection of the internal ADC paths on STM32H7 series (specifically I am using STM32H750). To work around the issue, I manually call LL_ADC_SetCommonPathInternalChAdd() as needed to enable the desired internal channel.I discovered that calling this function immediately before a conversion can cause the ADC polling function to block waiting for the IRQ (See the relevant while loop excerpt below). It seems the IRQ flag is never raised and the Timeout value = 0xFFFFFFFF and so the timeout mechanism never triggers to exit the while loop.HAL_StatusTypeDef HAL_ADC_PollForConversion(ADC_HandleTypeDef *hadc, uint32_t Timeout) { ... /* Wait until End of unitary conversion or sequence conversions flag is raised */ while ((hadc->Instance->ISR & tmp_Flag_End) == 0UL) { /* Check if timeout is disabled (set to infinite wait) */ if (Timeout != HAL_MAX_DELAY) { if (((HAL_GetTick() - tickstart) > T
- MCU : STM32U5F9VJT- HAL 驱动程序版本号:V1.6.0当 init dsi de flag DSI_FLAG_PLLLS始终为 0.检查 enable 寄存器时,标志是可以的。 PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_DSI; PeriphClkInit.DsiClockSelection = RCC_DSICLKSOURCE_PLL3; PeriphClkInit.PLL3.PLL3Source = RCC_PLLSOURCE_HSE; PeriphClkInit.PLL3.PLL3M = 4; PeriphClkInit.PLL3.PLL3N = 125; PeriphClkInit.PLL3.PLL3P = 8; PeriphClkInit.PLL3.PLL3Q = 2; PeriphClkInit.PLL3.PLL3R = 24; PeriphClkInit.PLL3.PLL3RGE = RCC_PLLVCIRANGE_0; PeriphClkInit.PLL3.PLL3FRACN = 0; PeriphClkInit.PLL3.PLL3ClockOut = RCC_PLL3_DIVP; if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { Error_Handler(); } //the clock of dsi hdsi.Instance = DSI; hdsi.Init.AutomaticClockLaneControl = DSI_AUTO_CLK_LANE_CTRL_DISABLE; hdsi.Init.TXEscapeCkdiv = 4; hdsi.Init.NumberOfLanes = DSI_TWO_DATA_LANES; hdsi.Init.PHYFrequencyRange = DSI_DPHY_FRANGE_450MHZ_510MHZ; hdsi.Init.PHYLowPowerOffset = PHY_LP_OFFSSET_0_CLKP; PLLInit.PLLNDIV = 125; PLLInit.P
Hello,I have encountered a peculiar problem and I am running out of ideas on what to do next.I'm working on a project with an stm32H563 mcu and lan8742 phy, using threadX and netXduo.When the code is first downloaded it runs fine, but after a power cycle it doesn't. Connecting a debugger shows that everything is running as expected except there are no ip_events generated. The condition if (ip_events & NX_IP_RECEIVE_EVENT) in "nx_ip_thread_entry.c" stops triggering (ip_events never changes.)The thing is, a few weeks ago everything was working fine, the application started up and ran as expected, it responded to pings and processed incoming UDP - it is still running on two of the boards I prepared back then (and I dare not touch those at the moment).Now that I do the same thing with any of the other boards, all of which were working previously, the application boots and runs after programming, but if I cut the power and restart, it doesn't. It's the same code
Hi everyone,I’ve noticed that STM32 drivers make extensive use of macros, and I’m curious about the reasoning behind this. Is the primary motivation is to increase performance / improve maintainability / are there other factors involved?
Hi :)I have a custom board where I need to use the ethernet interface. Starting with a NUCLEO-H563ZI I ported the NetXDuo TCP Server Echo example to my board.When I'm using the example as expected with a DHCP server connected (e.g. ethernet connection to a router or switch) then everything works. I can use the board in debug mode or in release mode. My goal is to connect the board directly to my Mac (or any other laptop) and assign a fixed IP address to the MCU. This works fine when I'm in a debugging session. In release mode I cannot establish a connection as a TCP client.Does anybody has an idea how to find the problem?As you can see in the following code of app_netxduo.c I just removed the DHCP things in the CubeMX configuration and added the IP address and net mask."app_netxduo.h" /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file app_netxduo.h * @author MCD Application Team * @brief NetXDuo applicat
Hello,I’m using two STM32 F4 boards to continuously send and receive data over SPI communication.The first board is configured as the Master and only transfers data, while the second board is configured as the Slave and only receives data.I have already manually checked my data using an oscilloscope and debug tools, and I receive exactly the data I transmit.Now, I use a checksum to verify the integrity of my data. I have two problems:On Master Side: The sprintf() function alters my data. When I use sprintf() on the Master side, I get different checksum values even if I transfer the same data. I resolved this problem by using memcpy(), but this complicates things when adding several parameter values into the buffer. Do you know a better solution if I want to do something like sprintf((char *)data_tx.msg, "IdFrame%d", IdFrame) where I can easily load the buffer with several parameters without altering it?On Slave Side: I compute the checksums directly f
Hi Folks,I have been spending quite a while trying to trace TCP_RST 's happening with the STM32H7, specifically H743.Raised the issue on individual mailing lists; folks there are quite frustrated with ST.I could sense a lot of frustration in different people. Some did have weird comments. :(In a situation, where I am running CubeH7 1.8.0 with FreeRTOS and LWIP.In a private email, by one of the LWIP folks, they pointed me to:https://www.nongnu.org/lwip/2_0_x/pitfalls.htmlhttps://www.nongnu.org/lwip/2_0_x/group__lwip__os.htmlandhttps://www.nongnu.org/lwip/2_0_x/group__lwip__opts__lock.html#ga8e46232794349c209e8ed4e9e7e4f011to even start debugging where the problem originates in the first place.The whole idea is to use NO_SYS 0,enable LWIP_TCPIP_CORE_LOCKING.This led to a whole lot of other issues.Looking into the ST port, it does not seem to have LWIP_TCPIP_CORE_LOCKING ported ?Any suggestions, folks ?ThanksManu
I am using FW_F7_V1.17.2 on STM32Cube to configure USB HS Device as a CDC. We are running with FreeRTOS and FatFS on a custom PCB. The external Phy is a USB3300. I am using MDK 5 IDE.The STM32 is connected to a Windows 10 host, using a simple protocol to transfer data. When receiving, the host sends blocks of ~1kB of data and the STM32 responds using a short reply packet of 3-4 characters. This works well initially, with good data throughput for maybe 180 blocks or so. The system then stalls because the Windows side is not getting replies.The reason for this is that CDC_Transmit_HS() returns USBD_BUSY continuously, because the flag TxState is non zero. Once in this state we are stuck. USB data can still be received, but we cannot transmit. There appears to be a bug in the ST USB Device stack, because this flag is not cleared by disconnecting USB, which I would have expected to reset the stack.Now TxState is cleared in USBD_
I have a project which is using the STM32H723 to communicate with host PC over ethernet (UDP/IP). Currently I am working with a nucleo development board. I followed the tutorials on the forum and example repos on github to get things working.I have very strict timing requirements and I am not using an RTOS. I have been benchmarking different parts of my code and have noticed that on occasion the UDP server that I have running takes much longer to send out a response (handful of ms instead of a fraction of a ms). I narrowed down the blocking code to the `HAL_ETH_Transmit();` call from `low_level_output` in the etherntif.c file generated by Cube.Reading through the HAL documentation I found that there exists a `HAL_ETH_Transmit_IT()` function which should send out packets without blocking. I enabled the ethernet interrupt in Cube code generation tool and then had to edit both the `low_level_output` and `ethernet_link_check_state` functions in ethernetif.c to use the interrupt
HI I HAVE ENABLED LOG LIKE THIS WHAT ELSE NEEDS TO BE DONE I HAVE SEEN OLD POST TO WRITE MAIN.C BUT STILL NOT SHOWING LOG? LWIP LOG WILL BE VISIBLE IN CONSOLE OR SWV CONSOLE WHERE? THANKS IN ADVANCE
I'm not much of an avid reader, but does this say what I think it says?When a channel x is programmed for a block transfer in memory-to-memory mode, rearbitration is considered between each single DMA transfer of this channel x. Whenever there is another concurrent active requested channel, the DMA arbiter automatically alternates and grants the other highest-priority requested channel, which may be of lower priority than the memory-to-memory channel. Does this mean that if I have a memory-to-memory DMA channel and a memory-to-peripheral DMA channel, the DMA arbiter will ping-pong back and forth between the two channel's transfers if their requests are activate at the same time? Even if the memory-to-memory channel is of higher priority than the memory-to-peripheral channel? Or am I misreading this?If I am right, why treat memory-to-memory specially?
Hi all,I'm working a project that utilizes the STM32H747, and specifically uses the ULPI outputs for USB 2.0 HS (using STM32 USB OTG DEVICE LIBRARY, our chip is USB3320--Same as Eval Board) communication. USB is having trouble outputting the data and specifically has an interrupt series that consumes 2ms to transfer from our buffer. This is interfering with another operation (in this case the initiation of a DMA mem2mem transaction). The buffer is 32kB in size. Setting the DMA transaction as a higher priority interrupt crashes the USB transaction intermittently.Below is a scope capture with USB as the highest priority interrupt. The blue waveform represents our USB interrupt routine, which we tied to a GPIO to track. Yellow is DMA completion for our memory copying operation. Note the heavy periods where little to no memory copy operations occur and how they overlap with the USB interrupt. The totality of the interrupts consume 2ms per submission.Has anyone ever encountered this?
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.