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
so basically im using stm32l4 as a dual bank, so essentially there are two apps and a bootloader, now im in either app1 or app2 , and i clear the other apps flash addresses, now when i write to that address the data sometimes get written and sometimes it shows as 0XFFFFFFFF which is empty but from the flash write double word and flash program i get as value as 1 in return which means it is writing to that addressfor a larger context im trying to do a ota, it happens sometimes and fails sometimes due to this issue
I have a custom board using the STM32G473CBT6 MCU. BOOT0 is pulled-down by a 100k resistor and is used as GPIO (output) at runtime. The firmware is generated by CubeMX, with the addition of a C++ file for the 'user' application. The board works fine, but is unable to jump to the bootloader from the main program. I use this function which works well with other boards:void __attribute__ ((optimize(0))) enter_bootloader() { HAL_Delay(500); // Wait a bit for the last USB packets to be sent. CDC_deInit(); GPIO_InitTypeDef GPIO_InitStruct; GPIO_InitStruct.Pin = USB_FWUPD_GPIO_DN | USB_FWUPD_GPIO_DP; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_LOW; HAL_GPIO_Init(USB_FWUPD_GPIO_PORT, &GPIO_InitStruct); USB_FWUPD_GPIO_PORT->BSRR = (USB_FWUPD_GPIO_DN | USB_FWUPD_GPIO_DP) << 16U HAL_Delay(2000); HAL_RCC_DeInit(); HAL_DeInit(); SysTick->CTRL = 0; SysTick->LOAD = 0; SysTick-
I have a Makefile project for an STM32L4 using FreeRTOS that I started with STM32CubeMx. I'm trying to enable one of the Thread-Safe strategies for FreeRTOS. I have tried both strategy #4 and #5, but both of them jump to the error handler on the `STM32_LOCK_BLOCK_IF_NULL_ARGUMENT` check in the `__retarget_lock_acquire_recursive` function in `newlib_lock_glue.c`It doesn't seem like the locks are being initialized in the Makefile project. Is there any additional setup needed for thread safe implementations of a Makefile project? Otherwise, are there any additional flags that I need to send to gcc (or any of the other arm-none-eabi tools)?Best regards,Cory
Hello!I am working on a project and I need to receive data over USB OTG using DMA, but I could not find any channel link to it. I have configured DMA but I don't know which channel to link with it ( __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__), somebody help me please....Regards,Waqas A
Hi, I am working on a project with the STM32H730 that needs DFU capabilities for users to update software from a website. This project boots from an external flash memory due to large size requirements for program memory.Is there a way the DFU feature can work with this setup? Is a custom bootloader necessary or is it possible with other configuration. My project is written in C++ using the STM32CubeIDE
I am working on freeRTOS CMSIS V1 on a project. I am using STOP mode to reduce the power consumption (since the device I am making is battery driven). When entering the STOP mode, I noticed that freeRTOS task is still running at the background on a slow speed. I read the reference manual several time to confirm that I am using the STOP mode correctly. Everything looks fine and I am able to put the MCU in STOP and wake it up using RTC and EXIT. However, the freeRTOS is not sleeping and it is consuming power. I have studied the Tickless modes and I am looking to use it but I have few questions.1) Do the STOP mode work with freeRTOS in a normal way as it is supposed to work without RTOS?2) IF STOP mode is supposed to work with freeRTOS then HOW I can put the freeRTOS on sleep in the background?3) I have just started learning Tickless modes. I wish to know if there is any example for STM32F4 boards where the Tickless STOP mode is being called by user? The examples I have looked on are usin
Hi amazing community.. I would be glad if someone can share an example of .ioc file (cube mx) working for the usb host function for the stm32f429disco1 (evaluation board with display) . I have tried many times so I would like to have a guide to create .. Can you please share it? Thanks a lot for your help and time
Using STM32CubeIDE 1.12.1 on a Nucleo G0B1RE. FreeRTOS 10.3 middleware. When I make the SYS timebase TIM6 then I don't get out of HAL_Init()0x1fff5bc6<signal handler called>() at 0xfffffff9__NVIC_EnableIRQ() at core_cm0plus.h:749HAL_NVIC_EnableIRQ() at stm32g0xx_hal_cortex.c:154HAL_InitTick() at stm32g0xx_hal_timebase_tim.c:95HAL_Init() at stm32g0xx)hal.c:161main() at main.c:107If I just use SysTick instead then I get through HAL_Init() but OsDelay() doesn't return - suggesting that vTaskDelay() ticks in FreeRTOS aren't running.If I take an example program from STM32Cube_FW_G0_V1.6.1 then those run ok. If I then base a new program on one of those .IOC files that uses FreeRTOS then I see the same hang or no ticks behavior.Any ideas what could be going wrong?
Hello,I am use Nucleo-F767ZI Board for TCP/IP Protocol in FreeRTOS. I try to ping my board but it not response.I Try TCP/IP without FreeRTOS it work well.What is difference between without RTOS & With RTOS ? If any Program for Nucleo-F767ZI please share Than you
I was debugging an application that works fine for hours. Suddenly it uses to enter in a hard fault error. I talked too much about the application but I would like to focus the post on how to trace some hard fault thas has been occurred. It doesn't uses RTOS, it uses HAL and Lwip stacks. I put a breakpoint on hardault handler. And the I see the next windows and tags: How should I read this graphical information?My guess:At left corner it is saiying me that hardfault is happening when it was executing time_update() function. But 3 kind of adress are appearing there: 0x2001ff88, 0x8000d78 and 0xfffffff1These addresses are a related address that disassembly shows me at right corner. But I don't know if there is any usefull information for me. What does it mean the 3 address? Which relation with hardfault event?Which is the link between hardfault and movs r0, r0 assembly instructions?
I'm about to start a new development based upon the new STMH563 device. I want to implement a simple ethernet interface (no RTOS) but am failing at the first hurdle...I'm using the Nucleo board and STM32CubeIDE. I've created a project for the Nucleo board but when I look in "Middleware and Software Packs" LWIP is not listed. Any one know why this is not there?
Hi everyone!Sorry if it's a newbie question, I just started learning this. I used USB_DEVICE middleware to make the code for the Audio Device Class. Even though I increased the heap to 2800h Windows doesn't recognise it as a sound device. I'm using the Nucleo F446RE. Am I missing drivers? Thanks in advance.
I send an ethernet packet to MAC address 00:80:E1:00:00:00 but no interrupt occurs in STMEnabled Ethernet interrupts in CubeMX.What could be wrong?Code:/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2023 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "string.h" /* Private includes ----------------------------------------------------------*
Hey there!I am currently working on a custom CAN IAP bootloader, using the STLink V3/SET as a USB to CAN bridge for programming FLASH. I am following the AN3154 doc for CAN protocol used in the STM32 bootloader and I am currently doing the erase command. I have been able to do the mass erase function, as well as sector erase functions. However, on some occasions (mostly after a just concluded sector erase command, where I erase multiple sectors at a go), STM Cube programmer displays "sector xxxxx does not exist" and sends the wrong sectors (see image), and my code responds as it should by sending a decline byte. I usually have to either reset the device/perform another operation before I return again to conduct a sector erase, this also does not occur with a full chip erase (only erases Application layer). I shall use the images below to buttress my point. Image 1- shows the first operation where I try to erase 10 sectors, and as shown it is successful (I have filled memory and tested
hi my software programmer is trying to set DMA on RAM, he passed the start address of the DMA RAM buffer from 0x20000000 to 0x20004100 and we got the error in the attached picture.he said that the LINKER of the CODE demands to define the pointers to the RAM, to prevent from other compiling commands takes that RAM area.the bootloader still refuses to write to RAM also in address 0x20004100 which was supposed to be accessible.please advice------------------------------------------------------------------------------------------------------------------------Hi,According to the application note AN2606 (Cf. Table 113), the bootloader is using 20 Kbyte starting from address 0x24000000. Thusyou can only start programming at address 0x24005000 to 0x2407FFFF. We can also find at table 174 the only accessible memory addresses: 0x20004100 - 0x2001FFFF0x24005000 - 0x2407FFFF Best regards, Pape----------------------------------------------------------------------------
Greetings, I am trying to use the USB HS (ULPI interface) on the STM32H747 board and I am struggling with it. I simply created a project via CubeMX where I configured the USB HS in Mass Storage mode but then when I connect my usb to the PC I get PC cannot recognize the device problem.What am I missing please ?Does anyone have any project examples of the USB HS working in Mass Storage mode ?Thank you.
Affected driver library: STM32Cube_FW_U5_V1.2.0File: stm32u5xx_ll_cortex.hFunctions affected: LL_MPU_ConfigRegion, LL_MPU_ConfigRegion_NSBug: The Parameter AttrIndx is not shifted to the correct bit Position.Current (wrong) implementation: "WRITE_REG(MPU->RLAR, ((LimitAddress & MPU_RLAR_LIMIT_Msk) | AttrIndx | MPU_RLAR_EN_Msk));"Fix: "WRITE_REG(MPU->RLAR, ((LimitAddress & MPU_RLAR_LIMIT_Msk) | (( AttrIndx << MPU_RLAR_AttrIndx_Pos) & MPU_RLAR_AttrIndx_Msk) | MPU_RLAR_EN_Msk));"By the way: The line "MPU->RBAR |= Attributes;" in function "LL_MPU_ConfigRegion" directly after selecting the region should be removed since it has no benefit. Function "LL_MPU_ConfigRegion_NS" does not even contain this line.
Need to memory map the framebuffer in the bootloader, this is done using bspMpuConfig. when this is done the framebuffer can successfully be written but when transitioning into the next state the routine /* RCC access done to identify the wakeup sources, we can switch to unpriviledged */ SFU_MPU_EnterUnprivilegedMode();causes a memory fault. Below are the memory mapping params. Any thoughts? /* Setup Memory Mapped LCD in Write-through (framebuffer) */ MPU_InitStruct.Enable = MPU_REGION_ENABLE; MPU_InitStruct.BaseAddress = 0x64000000; MPU_InitStruct.Size = MPU_REGION_SIZE_32MB; MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS; MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE; MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE; MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE; MPU_InitStruct.Number = MPU_REGION_NUMBER2; MPU_InitStruct.TypeExtField = MP
Hey,I am trying to send some sine wave signal over usb audio class to computer. I arranged usb descriptors so computer recognizes mcu as microphone but I am struggling to send sine wave. I create sine wave with dac and I read it with adc. what should I do to send this adc values to computer over usb audio class. I use audacity program to see if I receive something from mcu but I can't start record so I thought I can't send data.
I have a application with STM32F429 with RTOS and SPI µSD .I have a singke task forr write in SD card and some time goes in HardFault_Handler ()It is possible thei is caused by stack overflow ?How can I check if the stack pointer goes in overflow ?Thanks#define configMINIMAL_STACK_SIZE ((uint16_t)128) osThreadDef(sD_Task, SD_Task, osPriorityNormal, 0, configMINIMAL_STACK_SIZE); ......................... void SD_Task(void const * argument) { while(1) { HAL_GPIO_WritePin(GPIOC, GPIO_PIN_12,GPIO_PIN_SET); // debugga LED AUX2 update_file_log("NEW LOG \r\n", 22); HAL_GPIO_WritePin(GPIOC, GPIO_PIN_12,GPIO_PIN_RESET); // debugga LED AUX2 // HAL_GPIO_TogglePin(LD3_GPIO_Port, LD3_Pin); osDelay(1000); } } static uint8_t update_file_log(char * folder, char* s, int lunghezza) { uint8_t log_esiste=0; uint8_t return_value =1; BYTE writeBuf[256]; uint16_t st; st = HAL_GPIO_ReadPin(GPIO
is the stm32f207zg MAC controller able to run an UDP (or a TCP) server with multiple client connections using Lwip and HAL or is there any real computing/memory limitation? I have a server -HAL library based- implementation that seems works correctly with one client. Client application is made by python running on a windows 11. I have spent too many months trying to have a server working for several hours but it achieves some point that: a) disconnects client or b) launches hardfault. Server application uses LwIP, working with static POOL for pBuf defined in lwipoptions.h. First we were trying it with RTOS, but tried also with no RTOS -this way nowadays-. FreeRTOS: It first was made adding FreeRTOS and using netif API. It was made for UDP and TCP versions. But the same result when connects with more than one clients. After some working hours, we get a hardfault we are unable to track. As we are not FreeRTOS experts and our trying FreeRTOS methods were unuseful, we d
Hello, by using a STM32F429I-DISC1 I'm trying to read/write to a thumb drive.When I open and load the provided example in fw packet, it works without problem but that example is an old one and not a CubeMX example so it makes things rough for me.I tried to test STM32 USB Training 11.2 but it didn't work, I tried other examples I found over net but still no luck. As @GNico.2 mentioned in his this topic code never reaches to APPLICATION_READY state. A solution is proposed as upgrading USB Host V3.5.0 middleware from github, Is that also applicable for F4 series?
Hi everyone,I am developing a custom bootloader and before flash the new application image, the bootloader must ensure that the image corresponds to the board, so I think a simple way to do it is to store a specific value (constant uint32_t) into a specific flash memory location, so the bootloader can dig into the .Hex file and find it. How can I store a constant in, lets say 0x8030000 flash address?thanks in advance.
Hi community,I am desperately trying to implement a 3 interface device (DFU, AUDIO (shell become MIDI later) and CDC) using the most recent version of the usbd_composite_builder found at github -> /STMicroelectronics/stm32_mw_usb_device (v2.11.1 at the time of writing). Here is my approach:1) collect all the files generated by STM32CubeIDE 1.12.1 applying one USB Device class after the other. That way I get some worthful interface and device code generated into the USB_DEVICE folder in the hope I don't need to write everything from scratch using the empty templates2) patch the contents from the stm32_mw_usb_device into Middlewares/ST/STM32_USB_Device_Library3) apply some modifications to get things compiled:usbd_desc.c:/* USER CODE BEGIN INCLUDE */ #include "usbd_composite_builder.h" /* USER CODE END INCLUDE */ ... #define USBD_VID 1155 #define USBD_LANGID_STRING 1033 #define USBD_MANUFACTURER_STRING "STMicroelectronics" #if (USBD_CMPSIT_ACTIVATE_CDC == 1) #define USBD
hi all,I'm using STM32L562VETQ.I'm new to such topics but i want to implement OTA firmware update in which i want to divide the flash into 2 sections (ota0 and ota1).*The process in short is as following:1- The MCU image/firmware (.bin file) will be uploaded to a server2- A modem will download that image (.bin file) and send it over UART to the MCU (piece by piece)3- The MCU will receive those pieces and will flash them -using the "HAL_FLASH_Program()" function- to the target OTA section (if the current running ota section is ota0 then the target will be ota1 and vice versa)*The question is:1- What should i do in the linker-script file to divide the memory into two sections? and should i do that? or it's okay to leave the flash as one block and just determine the starting address of the new-image when flashing it?2- After flashing, How can i transfer the control-flow to the new flashed-image ? should i use pointer-to-function and manually call the reset-handler of the flashed image ? o
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.