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,We are working on a project since some years so it begin to be quite big.We are running FreeRTOS under the cmsisOs2 API.Recently, we added an external flash on our SPI bus and started to experience timings issues:The SPI is using HAL with transmit/receive in IT mode (priority 5).We found that in receive mode, the CPU is quite stressed by ITs and the HAL IT handler.It results that our systick (priority 0) is missing 12 preemption over 13 (one every 13 ms) when we do these reads.I will configure DMA bus on this SPI to free CPU, but first i want to be sure i don't made a mistake in NVIC configuration.In my understanding, even if an IT is currently running, an IT with higher priority can preempt it and do its execution before returning to the previous IT context.Why in my case systick handler don't "ake the lead"? Even if the SPI IT has returned...In the traces below, i toggled GPIOs at IT contexts enter/exit. As you can see, systick is executing normally until SPI reads, where we cl
Good morning,I need to flash on a STM32F303ret6 uC a bootloader and a main Application. Application code works if I flash only this program into the uC, but when I flash both, I always have debug problems and many times the Application doesn't work.I want to know if CubeIDE messages are "normal" or if I really have a problem.Bootloader has this declaration about memory. Start address is standard, while length is reduced to 32Kb (bootloader is 11Kb). ApplicationApplication's start address is 0x8008000. Application length is 64Kb, so I put a flash length of 80Kb.Into the Application code, Vector table is modified to start at the same address 0x8008000. Then I flash the bootloader code first, and than the Application. While I flash the Application code, I obtained always the following message. I can't understand why.Is it normal?Thanks.
Calling HAL_TIM_OC_Stop_IT causes HAL_TIM_Base_Start_IT to also stop, is this normal? i want to stop a channel, not the entire base timer.How do i achieve this? re-enabling the base timer after stopping the Channel is not working.
In LwIP_HTTP_Server_Netconn_RTOS, MPU_Config has three sections:1) Mark the complete 4GB memory map as shareable, non-cacheable, and non-bufferable.2) Create a 16kB area starting at 0x20078000 for ethernet buffers, non-sharable, non-cacheable, non-bufferable3) Create a 1kB area starting at 0x2007C000 for ethernet descriptors, shareable, non-cacheable, bufferableFirst, is #1 actually needed?Second, #2 says that it is in SRAM2, but it is actually in SRAM1. SRAM2 doesn't start until 0x2007C000. The size makes me think that it should be marking all of SRAM2, but the base address is wrong. Having the region start at 0x20078000 for 16k will mark the top 4k of SRAM1 and the bottom 12k of SRAM2. An odd choice or a bug? #3 could actually be correct, but wastes a lot of memory for 2*0xA0 == 320 bytes of space.Finally, the symbol __estack is created in the linker file that points at 0x20080000, the top of SRAM2. But under this address is the ethernet buffers in SRAM2. This would cause some weird
Inspired from a beginner issues in this topic, I noticed a possible improvements. Let's take an example from a stm32f767xx.h definition file:#define VREFINT_CAL_ADDR_CMSIS ((uint16_t*) (0x1FF0F44A))The first improvement is to add a const qualifier for the referenced memory and remove the useless parentheses for the address:#define VREFINT_CAL_ADDR ((const uint16_t*) 0x1FF0F44A)The second is to make the macro access and actual data:#define VREFINT_CAL ( *((const uint16_t*) 0x1FF0F44A) )This way developers can just use it as a normal variable in their calculations, which is the typical usage of those values. And those, who do actually need the address for some purpose, can still take it with an & (address of) operator.Also it is clear what the "_ADDR" part of the name means, but the "_CMSIS" part is nonsense. If it is used for making the names more unique in the namespace, then it would be better to add some "ADCCAL_" or something like that at the beginning of all those calibration d
I am using the Fatfs to mount the SD Card. As soon as f_mount is called it puts the ticks in hang up state causing the HAL_Delay to be in infinite loop resulting in device hang up.I am using the STM32F407-Dicovery BoardFor SD Card I am using the SPI1 of the board.
Hi,I was trying for create a simple ssl server/client communication. I am running client now and monitor the Wireshark log. I am able to see the Client Hello message also verified the packet format ciphers and another parameters are correct in client side. but instead of server hello message I am getting "61 Alert (Level: Fatal, Description: Unrecognized Name) "I am not have any idea about the issue. Please give your guidance. Thank you.
Initialization sequence:hpcd_USB_OTG_FS.Instance = USB_OTG_FS; hpcd_USB_OTG_FS.Init.dev_endpoints = 9; hpcd_USB_OTG_FS.Init.speed = PCD_SPEED_FULL; hpcd_USB_OTG_FS.Init.dma_enable = DISABLE; hpcd_USB_OTG_FS.Init.phy_itface = PCD_PHY_EMBEDDED; hpcd_USB_OTG_FS.Init.Sof_enable = DISABLE; hpcd_USB_OTG_FS.Init.low_power_enable = DISABLE; hpcd_USB_OTG_FS.Init.lpm_enable = DISABLE; hpcd_USB_OTG_FS.Init.battery_charging_enable = DISABLE; hpcd_USB_OTG_FS.Init.vbus_sensing_enable = DISABLE; hpcd_USB_OTG_FS.Init.use_dedicated_ep1 = DISABLE; if (HAL_PCD_Init(&hpcd_USB_OTG_FS) != HAL_OK) { Error_Handler(); }HAL_Pcd_MSp_INIT():PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB; PeriphClkInitStruct.PLL3.PLL3M = 16; PeriphClkInitStruct.PLL3.PLL3N = 192; PeriphClkInitStruct.PLL3.PLL3P = 4; PeriphClkInitStruct.PLL3.PLL3Q = 4; PeriphClkInitStruct.PLL3.PLL3R = 4; PeriphClkInitStruct.PLL3.PLL3RGE = RCC_PLL3VCIRANGE_0; PeriphClkInitStruct.PLL3.PLL3FRACN = 0; PeriphClkInit
..
DMA transfer is not working, despite everyhing being setup correctly at first glance. Does anyone know what else could be wrong?DMA1->CCR5: is enabled (EN), MSIZE is 32bit, PSIZE is 32bit, mem. inc enabled, per. inc disabled, circ mode enabled, DIRection is per -> mem,DMA1->CNDTR5: 1 (transfer one unit)DMA1->CPAR5: set to the TIM5->CNT addressDMA1->CMAR5: set to uint32_t variable in ramDMAMUX->C4CR: DMAREQ_ID is 60 (TIM2_UP as per RM, table 91), DMA1->CCR5 DMA1->CNDTR5DMA1->CPAR5DMA1->CMAR5DMAMUX->C4CR TIM2
Hey,After debugging for a long time I still haven't been able to find the cause of ethernet interrupt not triggering for up to 1500 ms.What I'm doing is opening a socket on my STM32F4 + LAN8742A. I am running a script that sends an "heartbeat" every 50 ms from my machine, however after a random period of time (20 minutes to sometimes 2 hours) a few heartbeats fails to receive.I've noticed by resetting a timer in HAL_ETH_IRQHandler that the IRQhandler doesn't get called during the time that the heartbeats fail to receive.The error callback is not being called either.What I've tried to fix this issue:Clean project with only TCP/IP + RTOS + CMSIS1Fixed the Physical configurationChecking for errors/dma errors.Increasing/decreasing NVIC prioritySending heartbeats from a different machine / microcontrollerDisabling MMC interruptsUpdating CubeMX + firmwareThe issues occur on a Nucleo f429ZI as well as our custom board so I assume it's not something hardware related.Any help/tips that would he
Good day,I have a NUCLEO-STM32F767ZI and a problem with the STM32 CUBE IDE. When I create a project in version 1.5.1 with ETH, FreeRTOS and LWIP everything works fine. When I create the same thing in the latest version, the generated code falls into HardFault. I see the main difference is that in the older version you can select PHY Address 0 in the RMII, but in the new version this option is not at all, I only see the same settings as for the MII. Don't you know when there might be an error? I would like to use the latest version.
When jumping to bootloader from software for devices such as the stm32l4, why is it necessary to remap system memory to address 0x0000 0000 in address space by calling __HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH? On the contrary, the stm32H7 doesn't require this remapping so why can't I jump to system memory without remapping on the stm32l4 (or other stm32s)? I think it has something to do with the dual bank boot mechanism because AN2606 stated that the remapping is only necessary for devices with dual bank boot but I would like to understand what is happening under the hood that requires the remapping.
I am following an the example from MOOC;https://www.youtube.com/watch?v=nSLN_WM2TOc&list=PLnMKNibPkDnExrAsDpjjF1PsvtoAIBquX&index=59&t=889sI can't make it work, apparently LPTIM trigger interrupts continuously.I create a fresh project to reproduce problem. I tested two case, as you can see on code down below. Case 1 works fine and blink the led in a predictable frequencyCase 2 doesn't works, MOOCs example fashion, led blink at high frequency, but the video works fine, what is wrong ? some one can reproduce example as in MOOC? it is a bug was introduced on later version of something? or I am doing something bad?HAL_LPTIM_TimeOut_Start_IT(&hlptim1, 0xffff, 0); // case 1, works while (1) { //HAL_LPTIM_TimeOut_Start_IT(&hlptim1, 0xffff, 0); //case 2, doesn't work while(flag_lptim);// HAL_LPTIM_TimeOut_Stop_IT(&hlptim1); //case 2, doesn't work flag_lptim = 1; HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5); /* USER CODE END WHILE *
Hello again,Here's what I want to do:1) wait for the UART_FLAG_RXNE to be set2) receive one character3) switch based on that character (character is saved for further processing)4) receive the proper number of following characters based on the command in #3in the example below, when UART_FLAG_RXNE is set, no matter how I try, I only receive one character. In the command processing switch, I tried clearing various flags without effect. This is a simple example, the other part of the code where we receive a command from a GPS unit uses a switch statement for each returned value as they are received so we would really like to receive a select number of characters at a time. Polling is fine as we can't do anything until the commands are all processed. Also, there is a wide number of following characters based on the command. This is on a 32f769. Thanks in advance for any help and the help in the past.Jerry if(__HAL_UART_GET_FLAG(&huart1, UART_FLAG_RXNE)==SET){ // check if data is avail
My previous question was how to detect a cable and they said to use a EXTI to receive a VBUS detection. The customer wants to use USB to program a blank device (so nothing configured) and EXTI is a block of interrupts and could be multiple pins. Please provide more details on how the bootloader checks for a USB cable.Thanks,Sonya
I downloaded Azure-IOT example for STM32U5 which works on IAR. I am trying to add a c file to secure application. I am able to compile and even see that function is hit while I debug.After this function call, the board is getting rebooted with below logs[INF] Flash operation: Op=0x0, Area=0x0, Address=0x0[INF] Starting bootloader[INF] Checking BL2 NV area[INF] Checking BL2 NV area header[INF] Checking BL2 NV Counter consistency[INF] Consistent BL2 NV Counter 3 = 0x1000000I want to understand the way to add a source file to secure TFM application.
I'm wondering if i'm missing something here.I've hooked up BOOT0 to the 5V pin on CN2. I have nBOOT1 set to 1, and i'm connected to the device via the ST-LINK as the other usb port doesn't seem to be active. I've also installed the udev rules, and just to be sure i tried removing all of the non stm related udev rules. no luck.When i start up this way the normal application doesn't start up, so i appear to be effecting the bootloader somehow, but my computer doesn't recognize the device as a DFU device.Any ideas?
HI all,I need a sampling rate of 1K to collect the analog voltage.My chip is :STM32F103C8T6.I use Timer2's interrupt to enable collect and send data, after send disable.I use a plus at 100Hz to verify, find it will lost some data:ThanksBoone
Dear Forum, I am using STM32H735 with RTOS LwIP with a DP83826 PHY, and want to see at least a ping on the network. From HW point of view the PHY seems to work because I can communicate with it and read config registers. The strap pins are set to a valid default configuration. On the Rx0+Rx1 pins at the uC I can see some incoming frames (oscilloscope), but there are no output Tx0/Tx1 frames visible. I have checked my configuration against a Nucleo-STM32F439ZI configuration, where a ping works well. The LWIP_RAM_HEAP_POINTER was configured wrong, but I have set the address in the lwipopts.h file to 0x30004000, so no hard fault anymore. The function ETH_IRQHandler() is not called event though the NVIC init functions are set:void HAL_ETH_MspInit(ETH_HandleTypeDef* ethHandle){... /* Peripheral interrupt init */ HAL_NVIC_SetPriority(ETH_IRQn, 5, 0); HAL_NVIC_EnableIRQ(ETH_IRQn);...}I did also generate a code sample (just for comparision) with cube
Hi,I'm working on my STM32 project, having DFU mode on machine. (using UART bootloader)I just have failed to DFU my STM32L451RCT6, but with same logic, -RET6 has succeeded!When I send EER(Extended Erase) command (0x44, 0xBB) to RCT6, It send me ACK at first. Right after it, I send mass erase address and checksum (0xFF, 0xFF, 0x00) to it, but it sent me NACK back!I also checked bootloader version, and the version 3.1 provides EER function.Why is there such a difference? In datasheet, RET6 is just having twice as much flash as RCT6.I also added write unprotected and readout unprotected before Extended Erase, but it didn't work.Changing UART baudrate from 115200 to 57600 also didn't work.Can anybody help me?
The program jumps to the address but stuck in HAL_Delay() without HAL_Delay() its work perfectHere is the code...........static void goto_application(void){ printf("Gonna Jump to Application\r\n"); void (*app_reset_handler)(void) = (void*)(*((volatile uint32_t*) (0x08004000 + 4U))); __set_MSP(*(volatile uint32_t*) 0x08004000); // Turn OFF the Green Led to tell the user that Bootloader is not running HAL_GPIO_WritePin(GPIOC, GPIO_PIN_13, GPIO_PIN_RESET ); //Green LED OFF app_reset_handler(); //call the app reset handler}
Hi.I used USB_OTG_FS as Audio Device Class on STM32F407-discovery.I connected PC and STM32F407-discovery with USB device.When I played music, sometimes sound is not occurred on STM32F407-discovery.I found that epnum in USBD_LL_DataOutStage is always 0 if sound is not occurred. (It is not 0 if sound is occurred.)But I don't know what epnum is and how it is changed.Could somebody help me how to fix this issue?Firmware : STM32Cube_FW_F4_V1.27.0===================================================================USBD_StatusTypeDef USBD_LL_DataOutStage(USBD_HandleTypeDef *pdev, uint8_t epnum, uint8_t *pdata){ USBD_EndpointTypeDef *pep; USBD_StatusTypeDef ret = USBD_OK; uint8_t idx; printf("USBD_LL_DataOutStage %d\r\n",epnum); if (epnum == 0U) { pep = &pdev->ep_out[0]; if (pdev->ep0_state == USBD_EP0_DATA_OUT)
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.