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
I started learning about it while playing with WWDG_Example from STM32446E_EVAL.I can enable WWDG and tie it to my EXTI button on my Discovery board.The board will reset when the button is pressed and __HAL_RCC_GET_FLAG(RCC_FLAG_WWDGRST) == RESET.What I have NOT been able to do is preempt the reset even though I also set WwdgHandle.Init.EWIMode = WWDG_EWI_ENABLE;I addedvoid WWDG_IRQHandler(void){ HAL_WWDG_IRQHandler(&WwdgHandle);}to my stm32f4xx_it.c file and set breaks at various locations, but the handler never seems to be reached, but rather it goes straight to Reset_Handler:I'm using the HAL in v1.24.
I'm a bit of a novice at programming, but I'm trying to develop an application that sends a continuous stream of data out of the USART using DMA, taking advantage of the DMA Transfer Half-Complete, and Transfer-Complete interrupts. I've got a circular DMA USART transmission working, but when I enable either of the interrupts, my code goes into an InfiniteLoop: handler. I'm using a BluePill (STM32F103C8) and writing in VSCode / PlatformIO with the Arduino-ststm32 framework.I can't figure out how to tell the code where I want it to go when either of these interrupts fire.I'm doing a lot of this programming "bare-metal" because I don't really know how to determine what core and/or library tools I have available to utilize. I see a lot of examples on the internet, but invariably they are using a different setup (framework etc) than I am, so their code doesn't really port to my IDE.Help?!Here is my code (couldn't figure out how to attach it)#include <Arduino.h
Hello, I'm using an smt32u545re in GPDMA mode. I followed the videos "STM32U5 workshop - 07 GPDMA in practice - coding and debug in STM32CubeIDE" on YouTube. I am obtaining an array of 64 values in total, 16 values for each adc channel I am reading from (4 channels in total). Now, I would like to obtain a better resolution and precision on the values from ADC. Can I use de oversampling function if I am using ADC on GPDMA mode? I have been doing some tests, and using a single channel from ADC, no GPDMA mode, and reading some other posts, is it correct to use an oversampling configuration of 4 bits right shift, and ratio oversampling x16, in order to obtain a better resolution equivalent to 16 bits ADC (stm32u545re has 14 bits ADC). If I use this oversampling configuration when using GPDMA mode, I don't obtain the values. Another question is about SMPS, in Pinout&Configuration, PWR, I don't see anything related with SMPS, but in datasheet it says that has an inte
Hello team, Is there any way to format the external flash of microcontroller, the reason is that that flash is acting as USB MSC Device. As soon as it connects to PC a popup will arise for disk format. Am planning to do complete mass erase of flash , along with that do i need FATfs system so that windows can recognize it as a device. Kindly guide me sample code or example for the same. Thanks & regards,Shikamaru
Hello, I have a problem with unaligned access, which generates a hard fault when the software is started without bootloader.When running the same software from mcuboot bootloader, there is no hard fault on unaligned access.The MPU and TrustZone configuration is the same in both cases.So I know that CM33 in STM32U5 supports unaligned memory access, since it is working when started from the bootloader. Now the question is, what is the difference? What do I need to do to enable unaligned memory access?SCB->CCR is already set to not trigger faults on unaligned access.The access should go to address 0x30000d8dSCB settings:CPUID = 0x410fd214,ICSR = 0x456803,VTOR = 0xc000000,AIRCR = 0xfa050300,SCR = 0x0,CCR = 0x201,SHPR = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf0, 0x0},SHCSR = 0x80004,CFSR = 0x1000000,HFSR = 0x40000000,DFSR = 0x1,MMFAR = 0x30018e1c,BFAR = 0x30018e1c,AFSR = 0x0,ID_PFR = {0x30, 0x210},ID_DFR = 0x200000,ID_AFR = 0x0,ID_MMFR = {0x101f40, 0x0, 0x1000000, 0x0}
Why doesn't ST provide LWIP support for H5 series. Otherwise is there any option to add any other IP stack directly configurable from StmCubeIDE?
Hi i am using STM32H753z, now i am trying to access SD card but i getting some error in stm32h7xx_hal_sd.c file of static uint32_t SD_PowerON(SD_HandleTypeDef *hsd) API,s in this /* SEND CMD55 APP_CMD with RCA as 0 */ errorstate = SDMMC_CmdAppCommand(hsd->Instance, 0); (errorstate is 4(return)) if (errorstate != HAL_SD_ERROR_NONE) { return HAL_SD_ERROR_UNSUPPORTED_FEATURE; } it return in HAL_SD_ERROR_UNSUPPORTED_FEATURE is any region to this, if i need to use old SD card is process?
I am using a bootloader as STM32F405.Before Jump_to_application(), I want to keep the GPIO status in API, but what should I do?After the GPIO PIN is output "high" from the current boot firmware, it runs the jump_to_application().The parameters are initialized at API run, and the GPIO PIN is output to Low.Is there any way to keep the GPIO PIN "High"?The code is as follows.JumpAddress = *(__IO uint32_t*) (APPLICATION_ADDRESS + 4);Jump_To_Application = (pFunction) JumpAddress;HAL_RCC_DeInit();HAL_DeInit();__set_MSP(*(__IO uint32_t*) (APPLICATION_ADDRESS));Jump_To_Application();
Hi! I am developing a project which uses the satel-Vl53l8cx. I found many examples in I2C but none in SPI.The only one would be in VL53L8CX_ULD_driver_2.0.0 but this one was coded for the X-nucleo-Vl53l8A1. A wiring is shown in AN5945 in SPI but in the CUSTOM->simpleranging folder the example is in I2C. Could this be a mistake? I can't find any example for my satel-vl53l8cx in SPI.ThanksAntonin
Hello Community,I'm working with an OV5640 camera module interfaced to an STM32 microcontroller, capturing JPEG images to store on an SD card. I'm facing a peculiar issue where JPEG images with (quality settings lower than 0x0C in the OV5640's JPEG CTRL07 register) cannot be opened after storage; they appear corrupted or unsupported.The datasheet for OV5640 indicates that we should be able to set the quality control register (JPEG CTRL07) to values as low as 0x02 to increase compression. However, when I use values between 0x02 and 0x0B, the stored images cannot be opened, suggesting file corruption. It's noteworthy that images are stored and accessed without any issues at less compressed settings (0x0C or higher).I suspect this might be related to the file handling system on the SD card, or buffered during writing.How might one tackle this discrepancy between the datasheet specifications and practical outcomes? Insights into buffer management, SD card file system intricacies, or firmwa
I have been using this solution to jump to the ROM bootloader and that is working fine. However, it only works if the chip is coming out of reset and none of the peripherals are initialized, FreeRTOS scheduler not running, etc. Basically the chip needs a fresh restart in order for this method to reliably get to the bootloader. This means I need to write a magic number to a RAM location, call NVIC_SystemReset(), then invoke the linked code. However, in my application, I would like to leave on external circuit enabled while this happens, which means I would like to leave one GPIO pulled high while in bootloader. When I call the reset function, it (obviously) resets all the GPIO to high-impedance input and I lose the state of the external circuit.Is there any way to 1) call some version of NVIC_SystemReset() that is less aggressive about resetting everything, or 2) modify the linked code so I can jump to the bootloader from the FreeRTOS task?Thanks,Jamie
Hello all, I have not been able to get the DFSDM_AudioRecord example to work on STM32H735G-DK.I am using CubeFW v1.11.2 and Cube MX 6.11.1. Furthermore, I tried debugging and noticed that the DMA Callbacks for Half and Full complete are called. Then I checked the buffers to notice that the values in it were always, 32768. The example BSP, also does not playback any recorded audio (through MEMS loopback), but is able to play the stored audio. So, the Line-Out is working fine. It has to be the MEMS. I wanted to confirm if the examples are configured correctly, or if something on my board is faulty.Can someone from ST or User Community please confirm that this example is working?
HelloI tried to implement I2S on the chip in question to send the data acquired by the on-board ADC (I tried both 8-bit and 12-bit) with DMA active on a curved buffer and half-word data size. The data should be read by an ESP32, connected to it on the ws, bclk and din lines configured as I2S Master that provides the clock and the ws and that should momentarily only print the received data on the serial monitor. However, despite having set the I2S channel of the STM32 to 8Khz 16 bit only right with Philips standard, equating it to that of the ESP32, I do not get the expected data, I can print only zeros or numbers that apparently are not synchronous data. I also tried to transmit static arrays with predefined values instead of the ADC to have a clear feedback on the receiving end but nothing. I wonder if the STM32G431KB core is the right board to do these tests or should I look at another model? /* USER CODE BEGIN Header */ /** ***************************
Hello,Are there any resources similar to AN3364, that describe the migration directly from F4 to F0?Thanks.
Hi,I am using a custom board integrating a STM32L071kzt6 MCU and have an issue to wakeup the MCU with uart start bit detection if the MCU uart rx line was no more pullup by the device with which the MCU communicates (A FT230XS USB to RX bridge).It is the case when the USB which powered the FT230XS chip is disconnected.When the USB is then reconnected, the FT230XS chip re pull-up the MCU uart rx line as expected, but communication is no more possible.If the UART RX pin is internally pulled up, the problem disappear as the RX line does't get low when USB is disconnected, but I don't know if it is a relevant solutionIn fact the MCU wakeup with UART start bit detection when USB is disconnected the first time, then a frame error appears, and then the MCU re-enter stop mode.But it is not possible to wakeup again the MCU with UART start bit detection.(It is still possible with other way as EXTI, or I2C on match address detection for exemple)There is no problem if the
AN2606 does a very good job of describing communication peripheral usage by the bootloader, but not so much GPIO pins.Can I get a description of how each of the GPIO pins on the ST32U545REI6Q is configured by the bootloader? This could be important in determining behavior when new chips arrive from the factory and are placed on our custom circuit boards.Thank you!
I use CubeMX to generate the set up code for clocks and peripherals in the STM32H7A3 I'm currently using for my current work. I'd like to calculate the timer and low-power timer call back periods programmatically without having to type in magic numbers I set in CubeMX. I've been able to figure out how to mostly do that for timer1 but have a few questions.Q1) If there is a HAL or LL function that gives the clock frequency going into each timer module? If so, can someone point me at it because I sure haven't been able to find one. If there is a function like that, please ignore the next 2 questions. If there really isn't one, the next 2 questions are about how to roll my own. And if there really isn't a function like that, shouldn't there be?Q2) Here's a snip of the CubeMX clock configuration tab for the timers on the APB1 and APB2 timers. In order to calculate the clock frequency being fed to those timers, I need the values for SYSCLK, CDCPRE Prescale
Hello, I am trying to send and receive data with LoRa using STM32. I will leave the codes below. The LoRa connections are made correctly. I was able to communicate using a similar code with another board, but it didn't work with the STM32. The reason for turning on the LEDs in the code is to check if the data is being sent via UART. Additionally, as stated in the LoRa documentation, I first send the address value, then the channel value, and finally the data. Can you help me? Transmit:uint8_t adressandchannel[] = {0x00, 0x00, 0x32}; // --> 1. Adress High, 2. Adress Low, 3. Channeluint8_t data[] = {'H','E','L','L','O',' ','W','O','R','L','D','\n'};HAL_StatusTypeDef st;HAL_StatusTypeDef st1; int main(void){HAL_Init(); SystemClock_Config(); MX_GPIO_Init();MX_USART3_UART_Init();MX_USB_OTG_FS_PCD_Init();MX_USART2_UART_Init(); while (1){st = HAL_UART_Transmit(&huart2, adressandchannel, 3, 250);st1 = HAL_UART_Transmit(&huart2, data, 12, 250);if(st == HAL_OK
STM32H753 UART Baud is 15% low. I set it to 115200, but it's running at 98400. Is this a misconfigured clock?
/* add the network interface (IPv4/IPv6) with RTOS */ netif_add(&gnetif, &ipaddr, &netmask, &gw, NULL, &ethernetif_init, &tcpip_input); /* Registers the default network interface */ netif_set_default(&gnetif); if (netif_is_link_up(&gnetif)) { /* When the netif is fully configured this function must be called */ netif_set_up(&gnetif); } else { /* When the netif link is down this function must be called */ netif_set_down(&gnetif); } /* Set the link callback function, this function is called on change of link status*/ netif_set_link_callback(&gnetif, ethernet_link_status_updated); I am using open source lwip.c and I realized my ethernet connection breaks and reconnects time to time. I was wondering if it is okey or expected behaviour in ethernet connections or it shouldnt be disconnecting at the first place.
I want to do UDP communication using ThreadX and NetXDuo on an STM32H563ZI.I searched for STM32Cube Examples and found a sample project for STM32H5, but because FW_H5_v1.3.0 does not exist, an error occurs.The following page is set up as an example of using TrustZone, but I cannot find any examples of not using TrustZone.https://community.st.com/t5/stm32-mcus/how-to-create-a-ipv4-netxduo-ethernet-udp-application-for/ta-p/636588 Are there any simple examples or setup instructions?
I'm using stm32flash (https://sourceforge.net/projects/stm32flash) as my host on a raspberry pi. It's connected to the STM32H750 using I2C.Steps:Upload the code onto the STM32./stm32flash -a 0x4E -w stm32-blinky.bin -v -R /dev/i2c-1 stm32flash 0.6 http://stm32flash.sourceforge.net/ Using Parser : Raw BINARY Size : 15612 Warning: Not a tty: /dev/i2c-1 Error probing interface "serial_posix" Interface i2c: addr 0x4e Version : 0x12 Device ID : 0x0450 (STM32H74xxx/75xxx) - RAM : Up to 128KiB (16640b reserved by bootloader) - Flash : Up to 2048KiB (size first sector: 1x131072) - Option RAM : 1b - System RAM : 122KiB Write to memory Erasing memory Wrote and verified address 0x08003cfc (100.00%) Done. Resetting device... Reset done.Obviously the same result can be achieved withst-flash --serial $SPI_BOOT_DUT --reset write build/stm32-blinky.bin 0x08000000 st-flash 1.7.0 2021-12-07T15:51:38 INFO usb.c: Unable to match requested speed 1800 kHz, using 1000 kHz
I'm writing my own USB BOT device driver, and I'm receiving the SCSI opcode 0xA1, which isn't defined in SPC or SBC, but rather in the ATA Command Pass-Through specification. Even WireShark doesn't recognize it.What exactly is the significance of this command? From what I'm getting, it's to bypass protocols or something, but I'm not exactly fluent in IT terminologies or 90s history here. I'm on Linux Mint 21.3, if that's of any relevance.
MCU : STM32F411CEU6 Hello everyone. I have an application in which I want to get image end address from linker. Here is a full context of what I want to do, I have a struct living in start of my image, which basically tells the bootloader usefull info, if bootloader want to inspect the image, the struct looks like this (BTW this struct is not yet implemented and this feature I made for when working with TI CC series so I am trying to replicate it for STM as well) const imgHdr_t _imgHdr __attribute__((section( ".image_header"))) = { .imgID = OAD_IMG_ID_VAL, .crc32 = DEFAULT_CRC, .imgCpStat = DEFAULT_STATE, //!< Image copy status bytes */ .crcStat = DEFAULT_STATE, //!< CRC status */ .imgNo = 0x1, //!< Image number of 'image type' */ .imgVld = 0xFFFFFFFF, //!< In indicates if the current image in valid 0xff - valid, 0x00 invalid image */ .len = INVALID_LEN, //!< Image length in bytes. */ .softVer = SOFTWARE_VER, //!< Software version of the i
I am trying to make a USB HID self powered device with STM32G473 without VBUS. I understand that I will require VBUS sensing on reconnection but even when I have already connected the USB then power up my device I only get reset request from host after that it only raises the USB error interrupt. where could be the problem? Is VBUS sensing required in this case as well ?This is my clock configuration:RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; RCC_PeriphCLKInitTypeDef PeriphClkInit = {0}; /** Configure the main internal regulator output voltage */ HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1); /** Initializes the CPU, AHB and APB busses clocks */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSI48; RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;RCC_OscInitStr
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.