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
HII am using the STM32G474 MCU and ran into a problem with my code stopping execution.In my application, I have a level 0 priority interrupt that takes 1.34us to execute that occurs once every 6.66us. In the final code, I will need 3 of these running, 1 every 2.2us (still leaving about 37% of the MCU bandwidth for other tasks).When I have 2 of these interrupts every 6.66us, all seems to work fine, but when I add a third, my code stops executing. After a lot of debugging, I have found that my code is stuck at the following line of code: ATOMIC_SET_BIT(huart->Instance->CR3, USART_CR3_TXFTIE); in the HAL_UART_Transmit_IT() function. Normally, when writing low level interrupt handlers for serial I/O, when I need to change the UART interrupt flags, I would disable interrupts make the change then enable the interrupts again. Doing that, it is very clearly safe for a single core MCUs like the STM32G474. However, when I examined the STM driv
Hello Devs,I already configured X-CUBE-SUBG2: SPI1: USART1: But program still wait for tx done at line 228 in app_custom_s2lp_fifo_tx.c Please help me how to integrate s2lp and my stm32u0. Thank you. Regards,Zan
Hi all,I have a STM32F730I8K6 that handles USB comms (internal PHY, high-speed mode, 480 Mbps). The firmware is the 100% stock firmware generated by STM32CubeIDE, with only the USB peripheral enabled.Connected to an Intel Mac, USB comms are reliable: performing GET_STATUS device requests in a tight loop works reliably.Connected to an ARM (Apple silicon) Mac, USB comms are flaky: performing GET_STATUS device requests in a tight loop fails sporadically (kIOReturnNotResponding).When the failure happens, the STM firmware is getting a USB_OTG_DIEPINT_TOC interrupt, which is described by the Reference Manual as:"Indicates that the core has detected a timeout condition on the USB for the last IN token on this endpoint."I'm not sure what to do with that information though. After several days experimenting, the only thing that's made a difference is forcing the device to enumerate as a full-speed device, using the OTG_DCFG.DSPD register; USB comms are reliable when doing that.Does anyone have a
Hello,I am trying to use FMC on an STM32U5G9J-DK2 to communicate with an LCD (ST7789). I am trying to send initialization commands to the device as follows define FMC_BANK1_REG ((volatile uint16_t *)0x60000000) #define FMC_BANK1_DATA ((volatile uint16_t *)0x60000002) void write_command(uint8_t data) { volatile uint16_t *p = FMC_BANK1_REG; *p = (uint16_t)(data); } void write_data(uint16_t data) { volatile uint16_t *p = FMC_BANK1_DATA; *p = data; } // Ex: write_command(0xFF)However, when I write 0xFF to memory at address 0x60000000, I don't just see the value written to the single memory address. Instead, it appears to be writing to many subsequent memory addresses. What I see is FF00FF00 written to all addresses between 0x60000000 and 0x600001CC. I understand that the memory is little endian, so FF00 is expected. However, I am unsure why it is repeating to other addresses. I am using the default, CubeMX generated code for FMC initialization, shown below./* FMC initialization
The chip I use is STM32G031G8U6, and there seems to be no HAL_GPIO_EXTI_Callback () function in STM 32G00xx _ HAL _ GPIO. C file. What's the matter? The general function of my code is to eliminate the jitter generated when the rotary encoder rotates. Please take the trouble to answer your questions. If there is anything wrong with the following code, please correct it! ;) /*注意! 单片机上电后A、B相默认输出高电平,第一次转动后A相先产生下降沿再产生上升沿,所以应当先判断A相的下降沿, 再判断A相的上升沿。如果先判断上升沿并检测这时候的B相电平就会导致第一次向新方向旋转时无效! */ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) // 通用EXTI回调用于判断旋钮左转or右转 { static uint8_t B_last_level = 0; // 检查中断源是否为 KEY3_EXIT15_Pin if (GPIO_Pin == KEY3_EXIT15_Pin) { // 获取当前A相电平 uint8_t currentA = HAL_GPIO_ReadPin(KEY3_EXIT15_GPIO_Port, KEY3_EXIT15_Pin); if (currentA == GPIO_PIN_RESET) /* A相先下降,触发第一次中断,检测并记录B相的电平状态 last */ { // 记录B相旧的电平状态last B_last_level = HAL_GPIO_ReadPin(KEY5_Input_GPIO_Port, KEY5_Input_Pin); } else if (currentA == GPIO_PIN_SET) /* A相后上升,检测此
Hello, I wanted to try I2C communication on my Nucleo board since I'm planning to use it in one of my designs. I connected together pins of I2C1 and I2C2, turned on internal pull-ups on both sides for all the pins and wanted to transmit "HELLO" from one to the other.Code for transmitting:HAL_I2C_Slave_Receive_IT(&hi2c1 ,(uint8_t *)RX_Buffer, 5);status = HAL_I2C_Master_Transmit(&hi2c2, 72 << 1, *data, 5, 80000000);After receiving the data however, even though status is set to HAL_OK it is completely garbled: I looked at the signal waveforms on my osciloscope with the logic analyzer enabled, and it shows that it's exactly what was transmitted:After that I thought that it might be an issue of the internal pull-ups not being strong enough, so I added 1K resistors on both data and clock lines, but the data in the receiving buffer is exactly the same. Does anybody know what am I doing wrong?
According to manual below, function should SEND out a SOLICIT message.Function returns NX_SUCCESS (0x00) means SOLICIT message successfully sent. Actually code, after some checks, just set nx_dhcpv6_state variable in DHCPv6 to NX_DHCPV6_STATE_SENDING_SOLICIT value and returns ALWAYS NX_SUCCESS, regardless of what DHCPv6 thread will do. Therefore we will get NX_SUCCESS before actual sending the SOLICIT packet and even if this packet is not sent at all by DHCPv6 thread for any reason, e.g. no packets available in packet pool. Also very critical, there is no high level function that user can use yo check for status end errors in DHCPv6 thread, no way to implement correctives actions unless to access global variables and void any quality certification. nx_dhcpv6_request_solicitSend a SOLICIT messagePrototypeUINT nx_dhcpv6_request_solicit(NX_DHCPV6 *dhcpv6_ptr);DescriptionThis service sends a SOLICIT message out on the network. If the message is successfully sent,
In AZRTOS - NetXDuo ver 6.4, netx-duo-dhcpv6-client library,if NX_DISABLE_ERROR_CHECKING is not defined (i.e. calling first _nxe_dhcpv6_client_create()),function nx_dhcpv6_client_create() should check for valid input parameters and return errors according to error type. From manual:"nx_dhcpv6_client_createCreate a DHCPv6 client instancePrototypeUINT nx_dhcpv6_client_create( NX_DHCPV6 *dhcpv6_ptr, NX_IP *ip_ptr, CHAR *name_ptr, NX_PACKET_POOL *packet_pool_ptr, VOID *stack_ptr, ULONG stack_size, VOID (*dhcpv6_state_change_notify)( struct NX_DHCPV6_STRUCT *dhcpv6_ptr, UINT old_state, UINT new_state), VOID (*dhcpv6_server_error_handler)( struct NX_DHCPV6_STRUCT *dhcpv6_ptr, UINT op_code, UINT status_code, UINT message_type));DescriptionThis service creates a DHCPv6 client instance including callback functions.Input Parametersdhcpv6_ptr: Pointer to DHCPv6 control blockip_ptr: Pointer to Client IP instancename_ptr: Pointer to name for DHCPv6 instancepacket_pool_ptr:
Hi, I'm having trouble getting my application to run at a different firmware address. The end goal is to be able to have the application running, receive new firmware over the UART. The new firmware will be saved higher in Flash (0x08100000, LENGTH = 992K). On reset the bootloader will check this location for newer valid firmware, if valid move it to Bank1 (0x08008000, LENGTH = 1008K ) and run from Bank1. If the firmware isn't new, just run from Bank1.Something things that may be relevant is the real application is using FreeRTOS and TouchGFX. For testing I just have an LED blink app.In the debugger settings for the bootloader application I added the blink LED application under the "startup" tab. I'm flashing the firmware with the debugger.Also, the LED does blink, even though the app reset values don't match. So I'm not sure yet if I'm chasing the correct issue, or the LED blink app is simple enough that it doesn't crash. My real app end
Hi there,I am trying to set up UART3 to receive and transmit using Interrupt.My setup is simple to verify the issue. These are the steps that I did:1. Add Uart3 in .ioc file with the configuration as:2. In main(), before entering while(1) loop, I start receive_IT as:HAL_UART_Receive_IT(&huart3, bufTemp, 1); 3. Add Callback function as:void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) {HAL_UART_Receive_IT(huart, bufTemp, 1);}The problem that I am running into that is if I send "1234\r\n", my HAL_UART_RxCpltCallback() only triggers twice, and I can see "1" and "2" in my buffer. I also verified ErrorCode before HAL_UART_Receive_IT() is called in the callback function. It turned out the error was an Overrun Error.Could someone please give me some suggestions on how to solve this issue? Sincerely,
Hi,I'm using the CMSIS-DSP library for FFT calculation, using build-time configurable FFT lengths in the range 64 - 1024. The CMSIS-DSP documentation recommends that, when the FFT length is known, using an appropriate initialisation function such as arm_rfft_init_512_q15() for a 512-length real FFT is preferred over the generic initialiser arm_rfft_init_q15(), since the former allows unused tables to be removed by the linker.I can only find arm_rfft_init_q15() in the repository.I'm using STM32Cube_FW_H7_V1.12.1 but I can't see how to determine which version of CMSIS-DSP that includes (having searched include files for a define, which I'm sure must be hidden there somewhere!).Does anyone know whether those additional FFT init functions have been deliberately excluded from the H7's repository?Advice about how to check the CMSIS-DSP version would also be appreciated.Thanks in advance.
Hello,I have been facing this issue of "No source available for "<signal handler called>() at 0xfffffffe"" on a nucleo-h753zi board. Following are few logs obtained from STMCube Programmer.1. Fault that is eesca;ated to a hard fault (forced)2. Faulty called function address: 0x1BB166083. Fault on instruction access (IACCVIOL)4. MMFAR: 0x05. R0,R1,R2,R3,R12: 0x0 SP:0xFFFFFFFC LR:0xFFFFFFFF PC:0xFFFFFFFE XPSR:0x10000036. Debugger issue: As soon as disassembly is clicked, debug is stopped. Note: I am trying to test CAN communication between two nucleo-h753zi boards. Code works on one of the boards. Any help would be much appretiated.Thanks in advance
HiI need guidance on how to write the logic for interfacing the STM32F407 with the IIS3DWB vibration sensor after installing the X-CUBE-MEMS1 package and selecting SPI2 to generate the code.
Hello,I am using the STM32F413ZH model. In fact, there is no problem in the code I wrote below, everything works correctly, but if I call the HAL_ADC_START function outside the while and do not use the HAL_ADC_STOP command, this time it only makes one reading, what is the reason for this? In this case, he has to read continuously, doesn't he?Thank You.
Hi,when I increase the size of the ThreadX trace buffer above 30k the RTT output is not working anymore (Below 30k RTT works fine). static uint8_t trace_buffer[1024*64] __attribute__((section(".trace"))); My guess is that the RTT viewer can't find the RTT control block anymore. I can't explain myself why this is the case.When checking the map file I find the control block near the end of SRAM1, which should not be a problem I think?Anyone some idea, how to fix the RTT output? Any help is appreciated :)Thank youRegardsJohn
Hi, I'm using en.x-cube-eeprom-v7-0-0 on a STM32L476 and I got a problem during my validation phase.I do lot of write on the EEPROM to be sure my code works well (so lot of CleanUp).Actually, on the step 4 of the EE_Init(), I have a EE_WRITE_ERROR on the last step:if (SetPageState(ubCurrentActivePage, STATE_PAGE_ACTIVE) != EE_OK)When FLASH_Program_DoubleWord is called, the register FLASH->SR: - is set to 0x8 after the Program first word - then set to 0xA8 after Program second word I take a look to the content of the flash at the write address (0x8066008):There is already a Data 0xAAAAAAAAAAAAAAAA so it's normal the error is set.What can be done to have the init working (without loose of data if possible) ? Thanks a lot for advise.
Hello everyone,I am developing firmware for the STM32F7469I discovery board, and I'm utilizing TouchGFX for the GUI aspect of the project. However, I am encountering a problem when enabling USB-FS HOST functionality. The GUI and other peripherals such as UART and I2C are functioning correctly. However, as soon as I connect a device to the USB port on the discovery board, the device is in START state, but subsequently, the entire board freezes. Specifically, the USBH_UserProcess callback is invoked, and the HOST_USER_CONNECTION line is executed, but afterwards, the system becomes unresponsive. The device doesn't go into ready state. I am set proper clock, i have attached the image of my clock setting. I would greatly appreciate any insights or potential solutions to address this deadlock issue.
Hi everyone..I am using USB host for communication CDC along with touch GFX for grafix which will use RTOS, The usb is not getting ready after the start state of usb what will be the issue, but when I configure only USB CDC HOST with out touch GFX it is getting ready and communication is happing. After the touch GFX even though for same usb configuration it is not working My clock configuration is set to 48mhz ans other clocks are maintained with in the limit, stack size is also increased, priority is also included Please suggest some reasons and solution why it is not getting ready
Hello,Apologies if this is posted in the wrong location. I am trying to control an LCD (ST7789) with my STM32U5G9J-DK2 using FMC. In CubeMX, I configured the NOR Flash/PSRAM/SRAM/ROM/LCD 1 to use NE1 and A0 with 16 bits of data. I also ensured to configure the NOR/PSRAM timing according to the ST7789 datasheet.To my limited understanding of FMC, I believe that writing to the memory bank I have FMC set up at will cause the STM to automatically handle my control signals (FMC_A0, FMC_NE1, FMC_NWE, FMC_NOE, and data). Because I am using NE1 and A0, I have my memory locations defined as: #define FMC_BANK1_REG ((uint32_t *)0x60000000) #define FMC_BANK1_DATA ((uint32_t *)0x60000002) And I am using the functions below to read and write: void write_command(uint8_t data) { *FMC_BANK1_REG = (uint32_t)data; } void write_data(uint8_t data) { *FMC_BANK1_DATA = (uint32_t)data; } uint16_t read_data() { return *FMC_BANK1_DATA; } // Example write_command(0xFF
I'm using HRTIM Timer F to create two complementary outputs at TF1 and TF2 with deadtime. I'm finding conflicting examples of how to set the output configuration of the two outputs.Which of these code segments is correct? pOutputCfg.SetSource = HRTIM_OUTPUTSET_MASTERCMP3; pOutputCfg.ResetSource = HRTIM_OUTPUTRESET_TIMCMP1; if (HAL_HRTIM_WaveformOutputConfig(&hhrtim1, HRTIM_TIMERINDEX_TIMER_F, HRTIM_OUTPUT_TF1, &pOutputCfg) != HAL_OK) { Error_Handler(); } pOutputCfg.SetSource = HRTIM_OUTPUTRESET_TIMCMP1; pOutputCfg.ResetSource = HRTIM_OUTPUTSET_MASTERCMP3; if (HAL_HRTIM_WaveformOutputConfig(&hhrtim1, HRTIM_TIMERINDEX_TIMER_F, HRTIM_OUTPUT_TF2, &pOutputCfg) != HAL_OK) { Error_Handler(); } or: pOutputCfg.SetSource = HRTIM_OUTPUTSET_MASTERCMP3; pOutputCfg.ResetSource = HRTIM_OUTPUTRESET_TIMCMP1; if (HAL_HRTIM_WaveformOutputConfig(&hhrtim1, HRTIM_TIMERINDEX_TIMER_F, HRTIM_OUTPUT_TF1, &pOutputCfg) != HAL_OK) { Error_H
Im using USBx as my USB driver for the STM32U599VJT6Q.This driver has 2 functions: "usbx_cdc_acm_read_thread_entry" and "usbx_cdc_acm_write_thread_entry" each of which runs in their own thread.The problem im having is the thread running "usbx_cdc_acm_write_thread_entry" gets semaphore suspended whenever interference occurs on the USB transmission line.The problem appears to be related to the function "ux_device_class_cdc_acm_write" as i have not been able to recreate the issue after removing it from the function.I haven't found any functions that can circumvent a semaphore suspension, so instead i have attempted to delete the thread and recreate it periodically, this works before interference occurs, however after the interference occurs it does manage to create a new thread but it still does not run.Transmit function: VOID usbx_cdc_acm_write_thread_entry(ULONG thread_input) { /* Private Variables */ ULONG tx_actual_length; UX_SLAVE_DEVICE *device; const char
I'm working with a STM32H723ZG and trying to set up SPI2 communication.I tracked down the issue where my LL_SPI_SetMode(SPI2, LL_SPI_MODE_MASTER) call does not set the Master bit in SPI2_CFG2 to 1, as intended (see Test #1 below). However, if I call the function twice, the second one does set the Master bit to 1 (see Test #2 below).Does anyone know how that could happen?Test #1: /* Configure SPI2 communication */ LL_SPI_SetBaudRatePrescaler(SPI2, LL_SPI_BAUDRATEPRESCALER_DIV4); LL_SPI_SetTransferDirection(SPI2,LL_SPI_FULL_DUPLEX); LL_SPI_SetDataWidth(SPI2, LL_SPI_DATAWIDTH_8BIT); LL_SPI_SetNSSMode(SPI2, LL_SPI_NSS_SOFT); LL_SPI_SetMode(SPI2, LL_SPI_MODE_MASTER); //this first call does nothing? Disassembly block when debugging for the last 2 lines: 1629: MODIFY_REG(SPIx->CFG2, SPI_CFG2_SSM | SPI_CFG2_SSOE, NSS); 0x08001D2E 68C1 LDR r1,[r0,#0x0C] 0x08001D30 F0215110 BIC r1,r1,#0x24000000 0x08001D34 F0416180 ORR r1,r1,#0x4000000 0x08001D38 60C1 STR r1,[r0,
Hello,I'm working to add the STL Library to my existing project, I'm trying to run the function StlSingleTest but it fails (STL_FAILS) executing the STL_SCH_RunFlashTM(&StlFlashStatus) section.micro: STM32F446ZETFlash:Bootloader: 0x08000000 - 0x0800FFFFApp: 0x08010000 - 0x0807FFFThe StlSingleTest is called from the APP,config file (stl_user_param_template.c) STL_ROM_START_ADDR (0x08010000UL)STL_ROM_END_ADDR (0x0807FFFFUL)TEST_FLASH_SECTION_NB 4Can someone help me?Thank you in advance.Mauro
I am trying to interface a SPI flash from Winbond (W25Q64JV) with FATFS.I have no previous experience with FATFS.I initialize FATFS in CubeMX with the option "used-defined" and modified the MAXIMUM and MINIMUM Sector Size to 4096, as it is the smallest possible erase sector dimension.I Got a Sample github code. This is It.https://github.com/maxiufeng258/SPI_Flash_Uart_Led_Polling_V1.0.i got w25Qxxx file from this github file which contain spi command to interact with w25q64.Now i know i should edit User_diskio or diskio,c as mentioned in the gitcode.i done it and got hardfault error at HAL_SPI_Transmit() function.i know that so many done and success it before . but i dont get a clear picture of how it done. anyone guide ASAP
I have a NUCLEO-L432KC that I am trying to configure such that a LPTIM interrupt fires at a set time period in the future. To simplify calculations, the future time is 2048 low frequency clock ticks away (62.5 ms).I can achieve this with relative simplicity, using the single shot mode of LPTIM1 and a CMP register value of 2048.I am measuring the timer period by pulsing a GPIO after the timer is enabled, and inside the the Compare Match interrupt. For a prescaler value of 1x, this works as I expect (I am assuming the slight difference from 62.5 ms is due to the execution overhead of the interrupt)My problem is that when enabling the prescaler, simply dividing the CMP register by the prescaler ratio does not result in the interrupt occurring with the same period. For example, setting the prescaler ratio to 16x and CMP to 128.The interrupt period has increase from 62.6 ms up to 64.3 ms. The timer resolution decreases by enabling the prescaler, but that should only account for a change of
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.