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
The composite device implementation (CompositeBuilder) provides more reliable method to define USB descriptors and methods but I think it lacks some documentation on how we use it. Moreover, there must be some additional changes required for individual class methods (initialization) to make it work, as described below: There is no concrete example to show how a composite device can be registered as well as operations for each class. Consider an example in which an audio and a cdc class is defined in a composite build. Then (following the Cube architecture) the interface function MX_USB_DEVICE_Init in ../USB_DEVICE/App/usb_device.c should make the following calls:static uint8_t AUDIOEpAddr[] = {..}; static uint8_t CDCEpAddr[] = {..}; /* Init Device Library, add supported class and start the library. */ if (USBD_Init(&hUsbDeviceFS, &FS_Desc, DEVICE_FS) != USBD_OK) { Error_Handler(); } /* USB Audio */ USBD_RegisterClassComposite(&hUsbDeviceFS, USBD_AUDIO_CLASS,
Please explain the custom Bootloader using FDCAN for STM32H72xx or any documents to develop.
..
I have a project I'm taking over where it appears the last developer ignored the fact there was an IOC File. So when I added spi, the code generation had many conflicts. I have no choice now to do this all manually. When I add all the SPI init code it complains about error: unknown type name 'SPI_HandleTypeDef'; did you mean 'TIM_HandleTypeDef'?Guessing because there is no header included. I also have no stm32f1xx_hal_conf.h file, is this a cube thing? Should I not have that?So what do I need to include to use SPI_HandleTypeDef'
STM32L5x2xx processor.STM32CubeIDEVersion: 1.10.1Build: 12716_20220707_0928 (UTC)Program structure:Main.c calls CPP_LINK (a C++ routine) that enables system level drivers (with ThreadX mutexes), then starts main ThreadX task.C++ classes own ThreadX objects (mutex, queue, task pointer). Class init routine creates ThreadX objects. ThreadX task is not inside class, but is outside.Packet class owns TX_QUEUE, initializes it. Queue object size is less than 16 32 bit words. Instance of packet class creates queue properly (using common byte pool in processor memory). When packet class instance runs, all is good until packet is placed on queue. Thread monitor immediately shows entire allocated stack for that task as occupied. This is regardless of actual number (2046 fills up as does 24000).Rest of system behaves badly after this.Actual problem can be isolated to the macro where the ThreadX queue actually transfers from the source (which is correct), to the destination (which matches pointers i
I am struggling to establish robust UART communication using HAL. It also seems I am not alone, there were many similar questions here, all closed without an answer. Here are some of them:https://community.st.com/s/question/0D50X00009XkfAH/handling-uart-errors-with-halhttps://community.st.com/s/question/0D50X00009XkfFg/stm32-hal-uart-error-managmenthttps://community.st.com/s/question/0D50X00009XkgNBSAZ/hal-uarts-and-overrun-errorshttps://community.st.com/s/question/0D50X00009Xkfom/stm32f407-uart-error-handlingIn our system we have multiple UART channels between several MCUs. The data is passed in packets with variable length using standard DMA for transmission and circular DMA for reception. Since low latency is important for us, we also have RTO enabled to read partial buffers when there are pauses in reception.Problem 1: Recently updated HAL treats RTO as an error and stops communication. We sort of solved this by adding user code to USARTx_IRQHandler() and clearing flag before defau
Hello,The linker script in the demo example specifies:/* Specify the memory areas */ MEMORY { FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 499K Memory_B1(xrw) : ORIGIN = 0x2007C000, LENGTH = 0xA0 Memory_B2(xrw) : ORIGIN = 0x2007C0A0, LENGTH = 0xA0 } /*..*/ { .ARM.attributes 0 : { *(.ARM.attributes) } .RxDecripSection (NOLOAD) : { *(.RxDescripSection) } >Memory_B1 .TxDescripSection (NOLOAD) : { *(.DMATxDscrTab_section) } >Memory_B2 } However, after compile:So the .RxDescripSection is correctly located in Memory_B1But it seems that .TxDescripSection does not end up in Memory_B2I have no clue why the linker seems to discard the spec to relocated TxDescripSection to Memory_B2 (According to RM0410 page 76, locations do exist as SRAM2 in the processor)Thanks for any advice,Johi.
Hello,I am developing a functional safety project in IEC 61508 standard, which requires static and unit testing of all of the functions in the project. My question is, "Can I use auto-generated CubeMX configuration functions or the HAL library in my project since they are not tested with respect to the standard?" If not, what would be the best way to configure the peripherals? Should I just copy the corresponding register values from CubeMX? Any suggestions is appreciated.Thanks.
I am writing a bare-metal ADC driver from scratch and the issue that I am getting is on reading the value from PA1.Here is my adc.c lib that I wrote.#include "adc.h" void ADC1_ADC_Init(void) { RCC->APB2ENR |= (1U << 2U); // IOPAEN I/O port A clk en // rm 146 GPIOA->CRL &= ~(1U << 5U); // MODE1 input mode // rm 171 GPIOA->CRL &= ~(1U << 4U); // MODE1 input mode // rm 171 GPIOA->CRL &= ~(1U << 7U); // CNF1 analog mode // rm 171 GPIOA->CRL &= ~(1U << 6U); // CNF1 analog mode // rm 171 RCC->APB2ENR |= (1U << 9U); // ADC1EN ADC1 interface clk en // rm 146 ADC1->SQR3 &= ~(1U << 4U); // SQ1 ADC_CH1 first conversion in reg seq // rm 249 ADC1->SQR3 &= ~(1U << 3U); // SQ1 ADC_CH1 first conversion in reg seq // rm 249 ADC1->SQR3 &= ~(1U << 2U); // SQ1 ADC_CH1 first conversion in reg seq //
Currently, I use an STM32H757I-EVAL Board, on which I have running a CDC ECM driver for USB to Ethernet capabilities. I have noticed that there are a significant amount of IN tokens being sent out of the Eval Board during a transfer of packets (as per TCP protocol), yet I cannot seem to find where in the drivers this correlated with. Is there a specific place in the drivers I should be looking to find the configuration for this? I am mainly trying to find where tokens are sent via the Evaluation Board, but I am not sure where to look anymore.I had searched for the keywords "IN," "Token," "Send," and "Receive," but had no luck with any of these searches. Any help or guidance would be appreciated.Thanks!
Hi,I'm trying to push through a lot of data over Ethernet using TCP. It's working for a while and then the TCP checksums disappear, IPv4 checksums are still there. This happens after 1-2MB -> 25GB depending if there's a python or C client on the PC, python happens more frequently, don't think this is relevant though.In RM0090 there's a statement "You must make sure the Transmit FIFO is deep enough to store a complete frame before that frame is transferred to the MAC Core transmitter. If the FIFO depth is less than the input Ethernet frame size, the payload (TCP/UDP/ICMP) checksum insertion function is bypassed and only the frame’s IPv4 Header checksum is modified, even in Store-and-forward mode." <- this describes exactly what I'm seeing, the problem is that when it starts to happen, it never recovers on its own. Same thing happens with one 60byte packet a second.How can one make sure the FIFO is deep enough?Or this is always true because I'm using TCP, 1460byte MSS -> 1516byt
I am working on STM32H745 discovery board. I have the following peripherals configured on both cores-Cortex M4- FreertosCortex M7- Freertos, Ethernet, LWIP, USART, QSPI, SDRAM.In M4 core there is a default task in which LED is blinking. When I enable ethernet on M7 core, ethernet is working properly but M4 core gets stuck in the assert on the following line during kernel initialization./* Check something was actually defined before it is accessed. */ configASSERT( xTotalHeapSize );I have added the following lines in linked script file .lwip_sec (NOLOAD) : { . = ABSOLUTE(0x30000000); *(.RxDecripSection) . = ABSOLUTE(0x30000080); *(.TxDecripSection) . = ABSOLUTE(0x30000100); *(.RxArraySection) } >RAM_D2When I disable the code in the MPU configuration which protects the ethernet sections (MPU_REGION_NUMBER3) , then M4 core starts working but as expected ethernet stops. The MPU configuration is void MPU_Config(void) { MPU_Region_InitTypeDef MPU_InitStruct = {0}; /
Hello,can someone confirm that line 890 /* Disable External interrupt for next Frame */ EXTI->IMR &= ~EXTI_EMR_MR3;is not correct in 'stm32f4xx_hal_uart_emul.c'?Everywhere else it is written something like this EXTI->IMR |= huart_emul->Init.RxPinNumber;EXTI->IMR |= huart_emul->Init.RxPinNumber;'Thank you
There is a little error on documention at the following lines#define ADC_LOW_POWER_NONE (0x00000000UL) /*!< Both Low Power Auto Off and Deep Power Down is Disabled*/ #define ADC_LOW_POWER_AUTOFF (ADC4_PW_AUTOFF) /*!< Low Power Auto Off Enabled and Deep Power Down is Disabled*/ #define ADC_LOW_POWER_DPD (ADC4_PW_DPD) /*!< Low Power Auto Off Disabled and Deep Power Down is Enabaled*/ #define ADC_LOW_POWER_AUTOFF_DPD (ADC4_PW_AUTOFF | ADC4_PW_DPD) /*!< Low Power Auto Off Disabled and Deep Power Down is Enabaled*/Line 3 has to be corrected, from "Enabaled" to "Enabled"Line 4 has to be corrected with the following sentence : "Both Low Power Auto Off and Deep Power Down are Enabled"
I'm trying to generate a project using the AzureRTOS software expansion package. When generating code through STM32CubeIDE the correct files are generated (I'm using a GNU ARM compiler), however when I set the Makefile option in CubeMX some files are generated for the IAR system instead of GNU. This causes compilation error. Is there a setting to make sure that the GNU files are generated instead of IAR?
I want to implement authorization on STM32 and LWIP.I took this examplehttps://github.com/particle-iot/lwip-contrib/blob/master/examples/httpd/post_example/post_example.cbut it doesn't work. Session.html is available without authorizationWhat could be the problem?Or maybe somewhere exist a working example of authorization on the site?
I am confused on the topic of new lib reentrant and RTOS.I use C++ and do some std::make_unique calls so malloc it's probably getting called under the hood.I have enabled the setting configUSE_NEWLIB_REENTRANT for RTOS and I am using heap_4 memory scheme. I am using a single core microcontroller from the family STM32L4.Is this enough to avoid problems ?I got confused by the posts on this topic by "nadler" and "mcuoneclipse"
For the last week, I've been trying to get asynchronous USB Audio 2.0 to work.I have dissected the descriptors from a Focusrite Scarlett 2i2 and crafted my own with the usb audio 2.0 docs at hand. I've modified the CubeF4 audio example and kept most of the scaffolding in tact.Thus far, my device device enumerates as a High Speed device, shows up and I can also stream audio to it, great! The OUT endpoint is working for the output channels, but the IN feedback endpoint does not.The tricky thing with the feedback endpoint is that the host sends a IN transfer to poll it every 8 microframes (= 1ms). Because I don't know at which frame (odd or even SOF number) the host will first request the feedback value, I have the following trick:Prime the feedback endpoint with 1st feedback value when the interface is first opened (alt_setting = 1) by calling USBD_LL_Transmit().IsoINIncomplete callbacks are made for every frame that the host didn't poll the data. Every time this happens, I flip the odd/
I'm using Keil (Scatter file, not lnker) and I have a bootloader and a place for two images (one active and other is for the over the air update).i use Cortex M0 processor where there is no Vector Table Offset Register and i used to copy the vector table from flash to sram.The problem here:1. I do the ota update using the application and not using the bootloader.2. I build the firmware for a specific location and when the ota update is happening the active application (which is in slot A) is downloading the new image in Slot B (but the image is built using the linker script for slot A).3. When I jump from bootloader to app using the function pointer (I see the function ptr is holding the right address.)4. But when jumping it is creating a hard fault. 5. So the image built for a specific place should only be used there? Can't I use it for other slots (I also look for page alignment)? if not what can be the possible reason for hard fault?
Hi, i have recently purchased an STM32F746G-DISCO.i am very new to STM and compontents, but my manager would like me to try and build an interest with it. I followed a tutorial online, and i have followed the exact routes but i keep getting this error when debugging video here (Get started with STM32 microcontroller programming) Error in final launch sequence:Failed to execute MI command:target remote localhost:61234Error message from debugger back end:localhost:61234: Connection timed out.Failed to execute MI command:target remote localhost:61234Error message from debugger back end:localhost:61234: Connection timed out.localhost:61234: Connection timed out.
Hi,I studied the RM0091 (page 55). There UART, I2C is listed as supported interfaces for the internal bootloader.I was wondering why the CAN isn't supported. Is this the case?Thanks
In the callback I buffer the input read by the USBD_CDC_ReceivePacket() call and exit My_CDC_Receive_FS() asap, processing the incoming data in the backgroundSometimes, my input buffer fills, & I can't easily make it any larger or empty it any quickerHow can I hold-off the incoming data without upsetting the USB driving code?(i.e. simply not calling the USBD_CDC_ReceivePacket() fn if my buffer is full is not an option as it seems to close the USB connection / upset the USB driver)?
I have a training project going on at school. The task is to make an Azure RTOS Guix demo interface for an STM32H753i-EVAL2 device. I have done a lot of research but I have not succeeded yet. Could you please help me? Grateful for any advice.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.