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
This is a super super weird one.My device (STM32F401RC) uses the latest HAL libs vs STM32CubeIDE. USB is configured as device-only, CDC.It works *perfectly* until i also enable one of the I2C peripherals (HAL, config'ed as I2C slave) and send/recv I2C data.When i do so the OS (happens with Win10/11, Linux and OS-X) occasionally (every 5-20 sec) drops and re-connects the USB connection to my device.What's stranger again, it'll only happen when connected via a USB hub. When connected directly to the PC it works ok.I've also tried different hubs, it happens with all of them.I've also tried connecting my device though a Total Phase USB analyzer. When its connected to the analyzer and the hub, the error no longer occurs (sigh).Any ideas??Thanks in advance!
I'd like to get ADC readings, implemented with DMA while running in an RTOS.The problem is that the ADC with DMA interrupts the RTOS... don't know what could be the cause maybe interrupts conflicting?
I was usig stm32f4 hal version 1.11 and in that version there was this code:void I2S_DMATxCplt(DMA_HandleTypeDef *hdma) { I2S_HandleTypeDef* hi2s = (I2S_HandleTypeDef*)((DMA_HandleTypeDef*)hdma)->Parent; if((hdma->Instance->CR & DMA_SxCR_CIRC) == 0U) { if(hi2s->Init.FullDuplexMode != I2S_FULLDUPLEXMODE_ENABLE) { hi2s->Instance->CR2 &= (uint32_t)(~SPI_CR2_TXDMAEN); } #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F469xx) ||\ defined(STM32F479xx) /* FullDuplexMode feature enabled */ else { if(((hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG) == I2S_MODE_MASTER_TX) || ((hi2s->Instance->I2SCFGR & SPI_I2SCFGR_I2SCFG) == I2S_MODE_SLAVE_TX)) { /* Disable Tx DMA Request for the I2S Master*/ hi2s-&
I'm using AzureRTOS to develop on the STM32H745. I've started with the CM7 core and I've generated some basic code using CubeMX. I've selected TIM6 as a time base for HAL, since AzureRTOS will take over systick for it's uses.I've made a couple threads. A main thread that does nothing more than output both tx_time_get() and HAL_GetTick() and a thread that listens on a TCP port. Of course, there is a NetX thread that is created by the NetX code to handle the networking.All is well. I've moved over to the CM4 to implement some code. I've created a different project using CubeMX using TIM7 as a time base. However, the timer interrupts do not seem to trigger on the CM4.tx_time_get() and HAL_GetTick() always return the same, respective, values. Trying to sleep a thread on the CM4 does not work at all. In fact, when a try to implement an infinite loop on the CM4 is actually causes the CM7 to stop processing it's threads. I feel this is all tied to the timers. But until I can solve the issue w
Hello!For a week i've been trying to configure my stm32f302cbt6 and the tlv320aic3254 codec to trasmit data to the mcu through i2s_ext_sd but HAL_I2S_Receive returns 0s to the buffer although i see data coming out of the codec. I have configured i2s2 peripheral, master clock in the pinout config, i configured the codec analog input and clocks to generate sample rate and all clocks and bit depths i've checked with the osciloscope seem to be within spec. i ve also called HAL_I2S_MspInit(&hi2s2); in the MX_I2S2_Init(void) function to set the default pins and played around wth the different setting but no luck.Is there something obvious i am missing?Any ideas would be enlightening!Best RegardsPatsaoglou P.Project resources: https://github.com/patsaoglou/AudioWayDSP
I'm running a STM32G473CB with 128kb flash, and I'm getting some issues erasing pages in bank2 of the flash. Using HAL_FLASHEx_Erase the way it's meant to be used, like in the following code that's supposed to erase pages 30 and 31 of bank2, I don't get any result. No errors arise, yet the pages remain unerased.HAL_FLASH_Unlock(); FLASH_EraseInitTypeDef EraseInitStruct; uint32_t PageError = 0; EraseInitStruct.TypeErase = FLASH_TYPEERASE_PAGES; EraseInitStruct.Banks = FLASH_BANK_2; EraseInitStruct.Page = 30; EraseInitStruct.NbPages = 2; if (HAL_FLASHEx_Erase(&EraseInitStruct, &PageError) != HAL_OK) { ... } HAL_FLASH_Lock();Whereas if I do the following (an erase through the bank boundary from bank1) the correct flash pages are erased and no errors are thrown.HAL_FLASH_Unlock(); FLASH_EraseInitTypeDef EraseInitStruct; uint32_t PageError = 0; EraseInitStruct.TypeErase = FLASH_TYPEERASE_PAGES; EraseInitStruct.Banks = FLASH_BANK_1; EraseIni
Hello,I am trying to connect the STM32F429ZI Nucleo development board to the AWS IoT Cloud using MQTT Protocol, with FreeRTOS and mbedTLS middleware v2.16.2 enabled.I am using DHCP and am able to get the IP. Without security, the code works fine with mosquitto broker. Now, I am trying to connect to the AWS IoT cloud which requires TLS authentication using certificates. I have created a thing on AWS IOT Console, auto-generated and downloaded the certificates for it, created a policy, and attached the thing and certificates to that policy. I have also copy-pasted those certificates in the code (in the format: "-----BEGIN CERTIFICATE-----\r\n"). The certificates used are- CA1, client certificate, and private key.The certificates are getting parsed, but I am getting a handshake failed error while connecting to the broker. The SSL states are getting incremented till 8, but, after that, it does not reach state== MBEDTLS_SSL_HANDSHAKE_OVER (which is the 16th stage), it get
I working on a STM32L462 project, which needs to invoke the bootloader from the user program. I don't have access to the Boot0 pin. I came across two methods of doing the same but not sure which one should i employ for clean transition.Method 1: - Set the system memory address in a pointer and set the main stack pointer after which invoke the system memory address.Method 2: Hardware manual says about writing the option bytes of FLASH_OPTR register to ignore the boot pin ( setting nSWBOOT0 to 0) and setting the nBOOT0(0)and nBOOT1(1) option bytes.How this two methods are different and which one to employ for a clean transition?
in usb library in the file generated by STM32CubeMx for the STM32G0B1 * @file : Target/usbd_conf.c * @version : v3.0_Cube * @brief : This file implements the board support package for the USB device libraryin function void HAL_PCD_ResetCallback(PCD_HandleTypeDef *hpcd)line 205 you have the test if (( hpcd->Init.speed != USB_DRD_SPEED_FS) ) || (hpcd->Init.speed != USB_DRD_SPEED_LS)) { Error_Handler(); }this is obviously always true, and you always go to Error_HandlerI modified the test if (( hpcd->Init.speed != USB_DRD_SPEED_FS) )) { Error_Handler(); }now it's running.Please can you check your library and give me a better solution, I don't like to modify manufacturer library.
Hi All,I want to start a project using TouchGFX, but it must also contain Audio Output on the headphone jack of my STM32F746G-DISCO board.I managed to get these two things to work separately: The TouchGFX part using TouchGFX Designer, and the Audio Output using CubeIDE and an example project.However, I cannot figure out how to get the sound output into my TouchGFX project! My approach is to call the appropriate BSP function (BSP_Audio_Out_Init / BSP_Audio_Out_Play) in the Model class of TouchGFX. Obviously, I need to include the necessary header files etc. - but that's where I run into problems. There are multiple dependencies so adding all manually is difficult and error-prone. And even if I manage to do all this, I'm getting compile/linker errors that I don't understand.So my question is: Is there any automated way I can set up my project so I can use the Audio BSP functions from my TouchGFX code?
I am using the NUCLEO-L476RG and I want to write to a .txt file on the USB Stick using FreeRTOS. For that, I have enabled FreeRTOS, USB_OTG_FS, Mass Storage Host Class and FATFS (USB Disk). When I generate the project, I see MX_USB_HOST_Init(); in my DefaultTask that the Cube generates.I have written a USB_Write function (see below) that works perfectly when I don't use FreeRTOS, so I already tested it. But when I add FreeRTOS to my project, it doesn't work.What I realized, is that, if I use it without FreeRTOS, there is a MX_USB_HOST_Process(); function in the while loop that then calls USBH_Process(&hUsbHostFS);. But when I add FreeRTOS to the mix, this function isn't there anymore, only the Init function in the defaultTask. So I tried to call USBH_Process(&hUsbHostFS); in the Task loop myself but I honestly don't know if that is the way to go. Without FreeRTOS, my while loop looks like this://USB variableextern ApplicationTypeDef Appli_state;USBH_HandleTypeDef hUsbHostFS;//U
Hello,I own a Nucleo-H723 and I would like to know how to update the MCU firmware using the ethernet port to transfer data. I want to send the bin/hex file over TCP (LwIP) and store the file in a external flash (QSPI), as I am not sure that the MCU flash is big enough. Which are the following steps?
I tried to flash Zephyr Firmware by DFU and I the firmware flashed as I expected.In the other hand, I tried flashing firmware by STLINK-V3MINI something raise an error.This is the contents of board.cmake file:# west flash -r openocd # west flash -r dfu-util board_runner_args(dfu-util "--pid=0483:df11" "--alt=0" "--dfuse") board_runner_args(jlink "--device=STM32L4R9ZIJ6" "--speed=4000") board_runner_args(pyocd "--target=STM32L4") board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw") include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake) include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake) include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)Also, this is the contents of openocd.cfg file:# source [find interface/stlink.cfg] source [find interface/stlink-dap.cfg] set WORKAREASIZE 0x8000 # transport select hla_swd # Tr
I'm trying to understand the register behavior of rw_wt.In the RM0090, Ethernet DMA transmit poll demand register (ETH_DMATPDR) has a register. this register declared as "rw_wt". But I don't know how rw_wt work.Could you please clarify the register behavior of "rw_wt"?
..
I have a usb HUB which is externally powered now i want to charge my HOST(Smart phone) through my HUB which seems not possible without using an PD controller.I stumbled upon STUSB4761 which seems like a perfect choice for me but i am not sure about it.What i want is some IC which i can add in my USB HUB which will take care of the power negotiation at HOST side and charges it instead of taking power from it and i want this to happen all the time.
I am configuring the following control registers. heth->Instance->MACCR |= ETH_MACCR_IPC; // INVERSE MATCHING heth->Instance->MACPFR |= ETH_MACPFR_IPFE; heth->Instance->MACL3L4C0R |= 1<<21;//ETH_MACL3L4C0R_L4DPIM0; heth->Instance->MACL3L4C0R |= 1<<20;//ETH_MACL3L4C0R_L4DPM0; heth->Instance->MACL3L4C0R |= 1<<16;//ETH_MACL3L4C0R_L4PEN0;This does not seem to be doing anything at all, since I am still getting packets from this source into application space. Does anyone have any ideas as to how to configure a filter to do this task?Thanks in advance.
I'm using a STM32L475. I have DFSDM data coming in. I'm using the AWD and have set high and low thresholds to trigger an interrupt. I cannot get the interrupt to occur. The DFSDM_FLT1AWSR flags get set. The DFSDM_FLT1ISR->AWDF flag also gets set. Any advise or example code?
MSI (without LSE/non-PLL mode) vs HSI48 with CRSWhich is the more accurate clock to use for STM32L496ZGT in USB slave mode and what are they relative accuracies?
Good day, Support TeamWe chose the STM32G484QET6 for our product development, and I have a question about programming in production time that I've listed below.In production, Can we dump the hex file into the controller(STM32G484QET6) via UART or SPI or Modbus?if have any documents regarding this so please provide them to usThanksHiren R. Thumar
I have an application running on an STM32L4P5. Initially, I programmed and debugged with J-Link on the micro 9-pin SWDIO connector. All worked great, I could use J-Mem to peer into sram or flash in real time. Then I built a bootloader over USB, using the protocols in the ST ap notes. Works great. Now I can program over USB cable. However, now I cannot use J-Mem to debug. I would guess that my erase from the bootloader erased the default L0 memory protection, setting L1. I can't make heads or tails out of the documentation to confirm this, nor to figure out how to set it back to L0 protection. Help? Thanks in advance!Addendum: I just added an in-code probe to look at the FLASH_OPTR at 0x40022020 and saw the default, 0xFFEFF8AA, which implies level 0 protection, so now I am more confused. (saw same in the flash area at 0x1FF00000).
This occasionally leads to (especially if only transferring one byte) the interrupt executing before the function has unlocked the process, leading to the function returning HAL_BUSY if you were to attempt to initiate another transfer in the transfer complete callback. Same goes for HAL_SPI_Transmit_IT(...) and HAL_SPI_Receive_IT(...). HAL_SPI_Receive_IT(...) even has this comment:/* Note : The SPI must be enabled after unlocking current process to avoid the risk of SPI interrupt handle execution before current process unlock */but then proceeds to not follow its own advice. So I think the unlock was accidentally removed at some point.This bug is present in latest versions of STM32F0, STM32F4, STM32L0, STM32L4 firmwares at the very least.
How does one set an STM32G4 MCU into a USB test mode? The reference manual (RM0440) does not indicate any way to do this. On the F4 series this could be done through the OTG_FS_HPRT register's PTCTL field.I need to be able to get a peripheral (NOT a host) device upstream facing port into USB 2.0 Test_Packet mode for eye diagram testing.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.