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, I am trying to compile some USB examples for the Nucleo-STM32N657X0-Q board that is available with the STM32CubeN6, but they are failing. All USB examples at this location do not compile with IAR STM32Cube_FW_N6_V1.0.0\Projects\NUCLEO-N657X0-Q\Applications\USBX It seems to be related with the following library(USBPDCORE_NOPD_CM55_wc32.a) adding FPU instructions, when the MCU does not support it. Is there an updated version for the STM32CubeN6 SDK that solves this problem? Regards, wes_fflores
I'm trying to establish a TCP connection between my Nucleo-H753ZI and my PC.I'm using ThreadX and NetxDuo.First of all, i'm triggering a hard fault when activating Network Interfaces and then using the debug mode.I don't seem to have hard fault if i flash the program directly into the board (I have a thread that blinks an LED that still works)This is my cubeMX configuration :I installed the following, using the Software Packs Component Selector:STMicroelectronics-X-CUBE-AZRTOS-H7: ThreadX => Core NetXDuo => NX Core Network Interfaces => Ethernet Interface, Ethernet Phy Interface : LAN8742_Phy_Interface Board Part STM32Cube_BSP_Components : ETHPhy / LAN8742 I tried to ping the board using CMD in windows, but i'm guessting that wouldn't work because i haven't added any code in nx_app_thread_entry.Thank you
hello...i am newbie to STM and trying to play a wave file on STM32f469i discovery board using SAI on cs43l22 audio codec, i am not getting any example source for SAI can i get the working example code.
i am using stm32h523 mcu and using usb host msc feature for data logger. i generate code using cubemx and compiler keil. i want to know can i use usb host msc without external cyrstal
Hello,Now I mean to generate periodic wake-up by HAL_RTCEx_SetWakeUpTimer().But I'm not sure about arguments WakeUpCounter and WakeUpClock.For realize 50msec wake-up what value should be set to WakeUpCounter and which RTCCLK_DIV should be selected.Thanks
Hello everyone, Context : I am having troubles chaining the DMA1 and MDMA of the stm32h755, more precisely, I am looking for the following data flow when reading data from SPI, the SPI being regularly triggered : SPI -> DMA1 Channel3 -> SRAM -> MDMA Channel 3 -> DTCM. I transfer 4 halfwords between my SPI and my SRAM. I also want to move 4 halfwords between my SRAM and my DTCM thanks to the MDMA. The connection between the DMA1 Channel 3 and the MDMA Channel 3 being the DMA1 Channel Transfer complete request. Problem : I have no problem moving data from SPI to SRAM using DMA1 Channel 3 every time I read something on my SPI.However my MDMA is only working on the first transfer, then he's not transfering no more, even if my DMA1 Channel 3 transfer complete has triggered. I could not figure why.. Code : hmdma_mdma_channel3_dma1_stream3_tc_0.Instance = MDMA_Channel3; hmdma_mdma_channel3_dma1_stream3_tc_0.Init.Request = MDMA_REQUEST_DMA1_Stre
I'm currently working on sending an HTTPS POST request using NetX Duo. However, I encounter a TLS-related error during the process. i am using cloudflare CA cert(CA works ok i did mqtts). #define NX_SECURE_TLS_UNSUPPORTED_TLS_VERSION 0x110 /* An incoming record had a valid TLS version, but one that isn't supported. */ Below is the relevant part of my code: tls_setup_callback static NX_SECURE_X509_CERT trusted_certificate; static NX_SECURE_X509_CERT remote_certificate, remote_issuer; static UCHAR remote_cert_buffer[4096]; static UCHAR remote_issuer_buffer[4096]; static UINT tls_setup_callback(NX_WEB_HTTP_CLIENT *client_ptr, NX_SECURE_TLS_SESSION *tls_session) { UINT status; /* Initialize and create TLS session. */ status = nx_secure_tls_session_create(tls_session, &nx_crypto_tls_ciphers, crypto_metadata_client, sizeof(crypto_metadata_client)); /* Check status. */ if (status) { return(status); } /* Allocate space for packet reassembly. */ status = nx_secure_tls_session_p
Hi! I am trying to generate a sine wave on my CS43L22 audio codec chip and use the included stereo jack on my STM32F469I-DISCO board. I'm using the STM32Cube IDE. There is one .WAV player example that I can't get to build in the IDE that's closely related to what I want to do, but it doesn't use STMCube. The closest project that I found on the internet is something like this, but it's running on a different board and uses I2S instead of SAI:STM32F4 Discovery board - Keil 5 IDE with CubeMX: Tutorial 28 - I2S Audio Codec - CS43L22 - YouTubeBased on my research, I think the process of getting this running looks something like this:Assign pins in STMCube for Audio Reset, I2C2 (chip config), and SAI1 (clock)Configure I2C2 and SAI1 in STMCubeWrite code to utilize the chipAny resources, advice, or examples that I can look at? Much appreciated!
Hello,I want to trigger a SPI-transfer with a timer. Its like in this post:https://community.st.com/t5/stm32-mcus-embedded-software/stm32g4-trigger-dma-request-from-spi-to-memory-with-timer/td-p/726370but I want that an output compare of a timer that triggers an SPI-DMA transfer. The SPI in the STM should run as a slave.An external ADC is always triggererd from an other timer an sends his data on the SPI as a master. The SPI in the STM should read 1034x16bit values in an buffer.I began to try it with CUBE-IDE and HAL functions. Than I found this thread here and wrote it for my application (see code below) but also with these functions i could not start the SPI-DMA transfer. Is it not possible to start a spi-dma-slave for 1034 values?Many thanks. uint16_t circular_buffer[1034]; void acq_configure_adc_transfer() { // Read SPI1 data after rx to buffer DMA1_Channel2->CCR = 0x0; //Disable DMA stream DMA1_Channel2->CPAR = (uint32_t)&SPI1->DR; //Set periphe
Hi everyone,currently I am working with an STM32L431 on a project that timestamps incoming IEEE802.15.4 frames via an AT86RF233 radio. The radio module is configured to issue an interrupt when a message is received and this interrupt signal is connected to PC13, which is the timestamp interrupt on the STM32L431. To enable the basic timestamp functionallity is set the TSE bit in the RTC_CR register (nothing more) and im able to query the Timestamping Register (TR) to get the time at which the frame was received.However, I have a question regarding the timing precision of copying the Sub-Second Register (SSR), TR , and Date Register (DR) into their respective timestamp registers. Specifically, I am concerned about the duration of this process in microseconds, as I am implementing a time synchronization mechanism. Does copying these registers take a significant amount of time? Any insights or detailed timing information would be greatly appreciated. Or are there other sources of delay fro
I have a STM32F411 board connected with a GPS module connected onto USART2I also have Tim1 and Tim3 configured for PWM generation on their channels respectively.I am running a list of commands (from an array) to execute line for line.Most of the execution is in the form of assigning new values to the Timer channelsEg: __HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_2, motor1_speed); Motor speed is a variable assigned from the list. As the program executes the list (by iterating line for line, these variables get assigned those values.)The GPS on the other hand is being polled via USART2The problem is that I need both the execution of the array as well as the GPS to continue running.However, the array execution is causing a "blocking issue". I have about 15 lines of instructions in the executing array. The GPS will only work AFTER ALL the commands of the array has been executed due to its blocking issue.I investigated from many sources who advised:Use RTOS - this did not work. It st
in file app_netxduo.cfunction static VOID nx_app_thread_entry (ULONG thread_input){ ..../* wait until an IP address is ready */ if(tx_semaphore_get(&DHCPSemaphore, TX_WAIT_FOREVER) != TX_SUCCESS)blocks code executionas in function tx_semaphore_create(&DHCPSemaphore, "DHCP Semaphore", 0){"tx_semaphore_put(&DHCPSemaphore);" has been removed - was present in previous versions - nothing sets this semaphore
Hello there, I'm writing a STM32 update firmware function (using lwIP ) that accepts a HTTP Post Request to send a new .bin file.Spoiler (Highlight to read) After selecting a .bin file to transfer from the PC to the MCU. I use the following line to capture the request: netbuf_data(inbuf, (void**) &buf, &buflen); Here is the buf content: POST /index.html HTTP/1.1 Host: 192.168.2.158 Connection: keep-alive Content-Length: 176815 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryGhYpLxBOxGv1PE1D Accept: */* Origin: http://192.168.2.158 Referer: http://192.168.2.158/index.html Accept-Encoding: gzip, deflate Accept-Language: vi-VN,vi;q=0.9,fr-FR;q=0.8,fr;q=0.7,en-US;q=0.6,en;q=0.5,zh-TW;q=0.4,zh;q=0.3 You can see Content-Length is 176815 while buflen gets a value of 614.I have some questions and would appreciate an
Moved from MPUs forum as STM32F4 is an MCU. Hello, Im trying to write the USB code from scratch. I have written the code that enables and initializes the usb OTG and I can confirm that it receives SETUP packets in the RX FIFO. I am receiving the GET_DESCRIPTOR request and i am trying to respond to it but I am unable to write in the TX FIFO in order to respond to the packages. I have followed and executed the steps in page 1368 ( IN data transfers , packet write). When i try to write to the FIFO using the memcyp command i am unable to confirm that the packet is indeed written in my FIFO and there is no change in the USB behavior ( appears as :Device Descriptor Request Failed in device manager after 10-30 seconds). If i try to manually write the FIFO in 32 or 64 bits at a time, it doesn't work at all and i get to the Hard Fault Handler. The addresses i have tried to write packages to are 0x50001000 , 0x50002000 and 50001040 , nothing worked .
Hi All, trying to write data into flash with dynamical flash address selection approach but it fails but at same time if hash(#) define the address the flash programming all works fine, Please suggest me the best solution and explain me the issues choosing dynamical address for flash address. /*********************************************************************/Note: 1. this code where I'm trying to flash using dynamic address approach. 2. and yes the logic to choose the address working fine I can read the value in target address variable. typedef struct { uint32_t active_app; // 1 for App1, 2 for App2 uint32_t app1_valid; // 1 if App1 is valid uint32_t app2_valid; // 1 if App2 is valid } BootInfo; #define BOOT_INFO_ADDRESS 0x0802F000 int8_t UpdateFWBlueNRG(uint32_t *SizeOfUpdate,uint8_t * att_data, int32_t data_length) { int8_t ReturnValue=0; /* Save the Packed received */ if(data_length>(*SizeOfUpdate)){ /* Too many by
Hi there,I have an IIC sensor connected to the MCU. And I read the sensor data at 50Hz.However, there are sometimes some IIC communication errors present with HAL_I2C_ERROR_TIMEOUT.My project is based on FreeRTOS with 4 Tasks, the sensor data collection task is one of the tasks, and the priority of this one isn't the highest.I try to read the sensor data by the blocking API "HAL_I2C_Master_Transmit()" and "HAL_I2C_Master_Receive()".I want to know if is there any possibility that the HAL_I2C_ERROR_TIMEOUT is caused by the blocking API in the sensor data collection task being interrupted by higher-priority tasks.If yes, how to modify the code? Change to "HAL_I2C_Master_Transmit_IT()" and "HAL_I2C_Master_Receive_IT()" is OK?(Because the frequency of the error is very low, it's not easy to position the root reason by test.)(And can't include "HAL_I2C_Master_Transmit()" and "HAL_I2C_Master_Receive()" in "taskENTER_CRITICAL()" and "taskExit_CRITICAL()" to keep others task's realtim
Hello. I have STM32L031 nucleo board: https://www.st.com/resource/en/user_manual/um1956-stm32-nucleo32-boards-mb1180-stmicroelectronics.pdfAnd I am trying to write SHT40 driver for it. I have Adafruit SHT40 I2C temperature/humidity sensor:https://www.adafruit.com/product/4885 I follow simple steps to setup my STM32 board for I2C:Enable I2C peripheral on STM32CubeMX:Connect the Adafruit board to the STM32L031 Nucleo board: Write function to read temperature/humidity data from the SHT40 sensor: static void SHT40_measure(){ HAL_StatusTypeDef ret; uint8_t data_tx[1] = {0xFD}; uint8_t data_rx[6]; ret = HAL_I2C_Master_Transmit(&hi2c1, 0x44, data_tx, 1, 1000); if ( ret != HAL_OK ) { printf("Error Tx\r\n"); } else{ //read bytes HAL_Delay(10); ret = HAL_I2C_Master_Receive(&hi2c1, 0x44, (uint8_t*)&data_rx, 6,1000); if ( ret != HAL_OK ) { printf("Error Rx\r\n"); } else{ for(int i = 0; i < 6 ; i++){
I have a custom PCB with a STM32U575 for which I generate code using STM32CubeMX.I am now trying to get I2C to work. Both the I2C1 and I2C2 channels each have one I2C slave. But for both I get the same problem: the slaves do not acknowledge the master messages. The I2C transmission then returns with an error.For now I am testing with very basic code:const uint8_t source[1] = {0x00};HAL_StatusTypeDef status = HAL_I2C_Master_Transmit(&hi2c1, 0x64, source, 1, 1000);uint32_t errorCode = HAL_I2C_GetError(&hi2c1);Here status is HAL_ERROR and errorCode is HAL_I2C_ERROR_AF.I put a logic analyzer on the SDA and SCL channels and I can confirm the slave really doesn't send the expected ACK:In the yellow region the SDA should be pulled low.The CubeMX config:Both are set to 'open drain' as they should be.Just to try I made a little scan over all 128 I2C addresses, but I don't get an acknowledgement anywhere. I've also tried about all possible I2C configurations, but to no avail.It's odd bot
Hello all, I am using STM32H747 in my project, previously I was using HAL library for my project, but now I want to shift my code to standard peripheral library, my question is do STMH7 series support to standard peripheral library if Yes then can anyone share me the SDK for the same Thanks!!!!
Hello,Now I'm developing on STM32L052T8Y6TR and thinking to occur every 20msec WakeUp from systick interrupt.More concretely, after Entering Stop Mode (by HAL_PWR_EnterSTOPMode), I want to start wake-up at arbitrary time. in the SysTick_Callback.I know HAL_RTCEx_SetWakeUpTimer_IT as regular wake-up function, I'd know how to start wake-up immediately.Please tell me how to realize it.Thanks,
Hi, we are using dual bank mode for stable firmware update. We simply set bootaddr0 in option bytes to the opposite bank and reboot the new firmware. Everything works fine. Now we want to enable Level2 chip protection for security reasons. Now I read that one cannot change option bytes in Level2 protection mode. The question is if this still works in Level2 protection mode? And if not how do you implement bank switch in Level2 protection mode. Here the current code: // Check current setup and toggle boot address if( flash_getBankInfo() != 1 ){ obInit.BootAddr0 = BANK1_ADDR; } else { obInit.BootAddr0 = BANK2_ADDR; &n
Heyho,I'm about to start writing an ethernet bootloader for the H7.I found the F7's LwIP_IAP example, a good way to get ideas how to realize the bootloader, although I'll probably put the new bin into an external SPI flash.As I have an http-webserver with a few pages already up and running, I will use the http method.The example is using LwIP's "standard" fs_data.c file containing the STM32's webpage, prepared with makefsdata.But where can I find the original html-files which served as the fs_data source ?I don't want to learn any more html, the webserver is more or less a debugging tool, so it would be a great help if I could simply modify the original html-files to fit my purpose.Maybe @STea or @Peter BENSCH might helpThanks in advance!PS: I already checked the original F4 example on Github, no html there.
I am using a NUCLEO-G071RB, STM32CubeIDE v1.17.0, and STM32Cube_FW_G0_V1.6.0 with patch STM32Cube_FW_G0_V1.6.2. I compiled and downloaded the timer example TIM_OCActive.Please confirm that the four output signals turn permanently active (high) after the specified time period.If a pulse stream is needed (output is on/off at a specified frequency), is the example TIM_OCToggle the right code? Also, is a 'pulse counter' available that would stop a pulse stream after N active (high) pulses? Thank you!
I am looking for any advice to do with running the RTC Alarm as a wakeup source from STOP2 mode under ThreadX.I have used the Alarm many times before on different STM MCUs without any issues.1) Setting up the Alarm and using it within a WFI test loop without Theadx works perfectly, however the moment I use Threadx to wake from WFI I get an immediate hard-fault. No further code is executed, WFI -> hard-fault handler.2) I have other wakeup sources enabled, EXTI interrupts from GPIOs and that works fine. The problem is solely related to the RTC interrupt when whatever the Threadx wakeup situation is.3) I configured the Threadx Scheduler in ISR and Tread mode to see if it makes a difference -> Noop.4) I also tried waking from WFE within Threadx, using EXTI line 18 as per RM, had to set the ALARAIE bit but disabled the the RTC interrupt on the NVIC. Still hard-fault. Without setting ALARAIE no wakeup occurred.Not sure if that is the right way to go, seems counterintuitive t
In the generated code in main.c file, there are variables that are declared as "private variables" by the software, such as "ADC_HandleTypeDef hadc1"; "TIM_HandleTypeDef htim1". Since these variables are declared only in main.c and not in main.h, does that mean that the use of these variables in other modules is not encouraged? If I need to use them in other modules, can I declare these variable as extern in main.h or is there a better way to handle this?Thank you in advance!
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.