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
In STM32Cube_FW_L0_V1.12.1\Middlewares\ST\STM32_TouchSensing_Library\src\tsl.c, the value TSL_Globals.DelayDischarge is initialized in TSL_Init() as:TSL_Globals.DelayDischarge = (uint32_t)((TSLPRM_DELAY_DISCHARGE_ALL * (uint32_t)(SystemCoreClock /1000000)) / 72); It is noticeable that :- 72 is used as magicNumber- DelayDischarge also changes when the SystemClock is changed, i.e. when the main clock of the STM32 is changed, the behavior of the touch evaluation could change unexpectedly.- What is with IAR Compiler?TSL_Globals.DelayDischarge is only used for the SoftDelay() function tsl_acq_tsc.c/** * @brief Software delay (private routine) * @param val Wait delay * @retval None * @note Measurements done with HCLK=72MHz and Keil/MDK-ARM compiler * val = 500: ~ 63us * val = 1000: ~126us * val = 2000: ~251us */ void SoftDelay(uint32_t val) { volatile uint32_t idx; for (idx = val; idx > 0; idx--) {} }This is therefore only a software delay. The commentary shows that the approxi
Here's my FILEX configuration:It works with 128kB pool size, but if I set the size to 64kB, it doesn't, I get hard faults while trying to write a file on ExFAT formatted media (USB disk). It works with even smaller pool on FAT32. How should I estimate / calculate the pool size properly? Now I just guessed the working value.
The specific message is LNK1107: invalid or corrupt file cannot read at 0x3F8
Dear reader,I am trying to get the CAN peripheral on my STM32-NUCLEO board working. To start off i wanted to test the loopback mode before I hooked up my transceiver circuit.Heres my init code for the can peripheral generated by CubeMX:Heres my CAN MSPinit code:Heres my main where im attempting to send a messaeg through the peripheral:I also used the CAN Bit Time Calculation (can-wiki.info) to find the correct settings for my CAN perpheral aswell as shown here: And this is the output from my logic analyzer, i of course checked that the bit rates matched aswell:The callback function to receive messages is never called as the RX pin on the CAN peripheral is always high, im very stumped by this and have seen various tutorials online and cant figure out if im missing something.Any help would be greatly appreciated!
Hello!I am building a project for the STM32G071B Disco board.I am struggling to understand why there are duplicate functions in stm32g071b_discovery_usbpd_pwr.c and usbpd_pwr_user.c, for example - BSP_USBPD_PWR_VBUSGetVoltage().This function is fully and correctly implemented for the board in stm32g071b_discovery_usbpd_pwr.c - it uses the I2C part that senses VBUS.However the code that is actually called is in usbpd_pwr_user.c and has an empty implementation for BSP_USBPD_PWR_VBUSGetVoltage() and according to manuals it is expected to be implemented there.As the functions share exactly the same name I can not defer the call from one module to another.What is the correct STM32 Cube IDE "way" to deal with this without deleting generated code which seems an incorrect approach.Thank you!
We're using the stm32wb55rg as the core MCU in a project requiring decently high-frequency BLE notifications to a mobile device (100Hz update rate on the characteristic). In testing this I found that, with default settings, the bluetooth connection was unstable and frequently dropped with a Connection Timeout error from CPU2. This seemed to be alleviated when I reduced the publishing frequency, however publishing at 100Hz is a requirement of the project. Given this, I researched and found a way to configure the 2M PHY as the default for transmissions, and wrote code to attempt to configure this (TlWrite with opcode = 0x0031, and a payload specifying the 2M PHY for transmissions). The response from CPU2 indicates that it does not recognize this opcode, despite the fact that the firmware I flashed onto it should support it according to the docs (I'm using the latest version of the BLE full stack coproc firmware)Why is CPU2 not recognizing the SetDefaultPHY command? And what modifications
Hello STM-Team,I use USB OTG with switching between host and device mode (STM32F777 with HAL driver 1.15.0). With the falling ID pin state the device mode is deinitialized and host mode is initialized and vice versa with rising edge.But there seems to be a problem in the deinitialization of host mode:The function USBH_LL_DeInit() (generated by CubeMX in usbh_conf.c) is called nowhereUSBH_StatusTypeDef USBH_LL_DeInit(USBH_HandleTypeDef *phost) { HAL_StatusTypeDef hal_status = HAL_OK; USBH_StatusTypeDef usb_status = USBH_OK; hal_status = HAL_HCD_DeInit(phost->pData); usb_status = USBH_Get_USB_Status(hal_status); return usb_status; }I think the correct place to call this function would be in function USBH_DeInit() in usbh_core.c because prototype for USBH_LL_DeInit is also defined in usbh_core.h (USBH_LL_Init() is also called in USBH_Init())USBH_StatusTypeDef USBH_DeInit(USBH_HandleTypeDef *phost) { DeInitStateMachine(phost); if (phost->pData != NULL) { USBH_LL_Sto
Hello,I'm opening a new conversation to address another issue(Issue with VCP and RNDIS ). Previously, I successfully implemented RNDIS on an MCU, and I can see the Remote NDIS based Sharing Interface in the device manager. However, after about 20 seconds, it changes to a "Failed Enumeration Device" state.Here is my device descriptor:I also checked USBView details before and after the error, and it happens consistently after every reboot. I want to mention that I haven't implemented any IP stack. Could this be the cause of the issue? "Trwa identyfikowanie..." in Polish means "Identifying..."
Hi, I would like to enable RNDIS + VCP on this MCU. Is there an option to do that?I do not know how to enable only RNDIS for this MCU too (I do not see this on drop down with Class for FS IP).
When I enable UCPD1 in Sink mode on STM32L552 using CubeMX the clock generator tab still lists the IP as being disabled. How do I manage to get it enabled properly?
I develop a FreeRTOS / LwIP based application which throws a configASSERT error because of a bad priority.Only when the Nucleo is connected to the LAN, the debugger gets stuck at:Line 744 of port.c (FreeRTOS source)configASSERT( ucCurrentPriority >= ucMaxSysCallPriority );Trace (see image below): The origin of the interrupt is the ETH_IRQHandler() respectively the HAL_ETH_RxCpltCallback()I have been searching for this issue and understand that it has something to do with interrupt priorities. Why does this error occur? As I see it, the function call causing it is auto generated by HAL or implemented in the CMSIS source (osSemaphoreRelease).Can anyone give me a hint where to change something?There are a dozen different priorities in the STM32/FreeRTOS System, which one do I need to change to avoid this assertion fail?NVIC Interrupt Priorites are all below the RTOS max of 5 (see image below)Changing then does not change the configASSERT error. I am referencing this solution
IDE : STM32CubeIDE Version 1.12.1firmware Package: FW_F1 V1.8.5Device : STM32F103C8T6I found that when I set MX -> Pinout & Configuration -> System Core -> Sys -> Debug = No Debug, I can't use some pins, especially those associated with JTAG. I discovered that in the file stm32f1xx_hal_msp.c the HAL_MspInit function does not put __HAL_AFIO_REMAP_SWJ_DISABLE to configure the AFIO_MAPR register (SWJ_CFG) and this register in the STM32F103C8T6 after the reset is put in Full SWJ mode (JTAG-DP + SW-DP) (information obtained from section 9.4.2 of the RM0008 manual. )I force the code as follows:void HAL_MspInit(void){/* USER CODE BEGIN MspInit 0 *//* USER CODE END MspInit 0 */__HAL_RCC_AFIO_CLK_ENABLE();__HAL_RCC_PWR_CLK_ENABLE();/* System interrupt init*//* Peripheral interrupt init *//* PVD_IRQn interrupt configuration */HAL_NVIC_SetPriority(PVD_IRQn, 0, 0);HAL_NVIC_EnableIRQ(PVD_IRQn);/* USER CODE BEGIN MspInit 1 */#if defined(RELEASE_VERSION)__HAL_AFIO_REMAP_SWJ_DISABLE();
Hi to all!I want to know, if is possible, to translate one code from stm32l1xx to STM32F401.I've attached the main file.ps: The reason is, i have that ic in hand
Hello,using the STM32H7 Ethernet with FreeRtos and LWIP results in not sent packages as the Optimization is Turned higher than -O0. The lwip Stack ,for example, tries to send UDP Packages. Those packages never leave the STM32 and UDP data packets are not received either. Here the Error clearly lies in the Interface between HAL and LWIP ST provided. i already disabled D-Cache and used some other proposals from the forum. Are there any plans to rework this in the Future? Does the HAL at least work, so we can write our own Interface?
Not sure if this is a bug or something I do not completely understand, but in the generated ethernetif.c file (HAL V1.9.0) there is the line:LWIP_MEMPOOL_DECLARE(RX_POOL, 10, sizeof(struct pbuf_custom), "Zero-copy RX PBUF pool");Which always uses, if I understand correctly, a fixed magic number of 10 for the pbuf-count. I would think that number should be tied to something like PBUF_POOL_SIZE. Or am I missing the point of this?
I have been trying for months to figure out how to copy a project from one workspace to another using CubeIDE. I would appreciate a response from an ST employee who can actually verify that any recommendation they offer actually works.Here's what I have tried.I have developed a custom project by importing an example project from one of the "expansion packs" available for download. In this specific example I imported the Nx_TCP_Server application contained in the en.x-cube-azrtos-h7-v3-0-0\Projects\NUCLEO-H723ZG\Applications\NetXDuo\Nx_TCP_Echo_Server that I downloaded from the ST website. So this project exists in workspace1.Now I want to copy this project into a different workspace (i.e. workspace2).HOWEVER, when I "Import" the project from "Existing Projects in Workspace" into my current workspace2 (without checking the option to "Copy projects into workspace...more on this below), most/many of the files are "linked" (linked resources) back to the main expansion pack files. Thus, any
As of version 1.12.0, HAL_RTC_Init uses a macro named __HAL_RTC_IS_CALENDAR_INITIALIZED. It is defined as follows:#define __HAL_RTC_IS_CALENDAR_INITIALIZED(__HANDLE__) ((((RTC->ISR) & (RTC_ISR_INITS)) == RTC_ISR_INITS) ? 1U : 0U)I suppose it should rather be #define __HAL_RTC_IS_CALENDAR_INITIALIZED(__HANDLE__) (((((__HANDLE__)->Instance->ISR) & (RTC_ISR_INITS)) == RTC_ISR_INITS) ? 1U : 0U)
Hi guys.Im trying to port an application from STM32F4 over to U5A5.On the F4 i used an external usb hs phy. I was extremely delighted to find out that the new U5 has an integrated hs phy, only to see that:1. No more ST stack in cubemx. Ok, found a github repository that contains something approximating an usable template.2. No example for HS Phy (Host mode) for this particular family of microcontrollers. Is there *any* (and I mean *any*) kind of sample out there? Usb high speed - host mode - for this MCU? Im sure there must be something out there I haven't been able to find. Thanks!
Hello,According to the Reference Manual v8 of STM32H753 one has to to flush the FIFO to perform a cipher operation: The STM32Cube source code example is not doing this flush for AES-GCM (it does the flush for DES and TDES)I implemented my code like the example and it seems to work fine. 1) is the flush needed or not for AES ?2) why flushing the fifo in the nominal case anyway? Best regards
hi..I have tried all the ways to read ADC values as I found that using PA11(ADC_IN15) and PA12(ADC_IN16) is the issue.I tried setting up non configured mode with polling and also DMA (as per CubeG0 examaples) I couldnt able to read the values. Can any one help with this please.To confirm this Out of 7 channels I needed I tried with 5 channels sequencer fully configuarable mode and that works fine if I add these two channelsPA11(ADC_IN15) and PA12(ADC_IN16) I am getting same values for all the channels
I have programmed STMG030k8T6 MCU in a prototypeChannels used ADC_IN_0 as T_sense ADC_IN_15 AS BattMonif I am calling any one of the function I am getting exact values what i measure in hardwareBut if i called them both only reading values from CH 0 please help me to sort it out stuck for a long in thisNote:When i used conversion with DMA ,also getting the same issuesReading channel_0reading channel_15but when read bothAlready I have tried maximum of suggestions by the people but still struggling to get the solution void Get_Tsense(void) { ADC_ChannelConfTypeDef sConfig = {0}; sConfig.Channel = ADC_CHANNEL_0; sConfig.Rank = ADC_RANK_CHANNEL_NUMBER; sConfig.SamplingTime = ADC_SAMPLINGTIME_COMMON_1; if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) { Error_Handler(); } HAL_ADC_Start(&hadc1); HAL_ADC_PollForConversion(&hadc1, 1000); Tsense_raw=HAL_ADC_GetValue(&hadc1); Tsense=(Tsense_raw*3.3)/4095; HAL_ADC_St
Hi,I am working on the OV7670 FIFO camera module with NUCLEO-H745ZI-Q board. My purpose is taking the image data and saving SD card via BMP format. I tried a lot of codes from github and Youtube but it didn't work. Finally I found the Udemy course video and he explained all the things clearly. But for the wiring part, there are some not clear points. I shared two pictures from the video. In the first picture he checked the schematic and after the second picture he did all the wiring and it works fine. But the problem is, in the schematic 6th and 10th wire is HREF and OE. But for the wiring picture has no HREF and OE pins but it has extra WRST and REN pins. So the question is, are there any relation about the HREF&OE pins and WRST&REN pins? If yes, what is the correct wiring for four of them?The schematic picture: https://www.haoyuelectronics.com/Attachment/OV7670%20+%20AL422B(FIFO)%20Camera%20Module(V2.0)/OV7670%20+%20AL422B(FIFO)%20Camera%20Module(V2.0)%20Schematic.pdfThe
Hello, I want to store the stack frame when an exception happens into a no-init section of SRAM to analyse exceptions.So I wrote a Hardfault handler to do this. I did the same for STM32F429 controller and it worked just fine but on STM32F756 it only works when I have my debugger connected. If it's not connected the handler doesn't store the data to the section. I tried to turn off optimization, disable the DCache and tried various ways to store it (with memcpy or via pointer) but all didn't help. The Hardfault_Handler assembly is derived from this site: Cortex-M Fault - SEGGER WikiI do a branch jump to my Hardfault_Handler_C routine. File is attached. What do I miss here? Thanks in advance!
Looking at the file "syscalls.c" I found the following line:The implementation of "_exit()" calls "_kill(status, -1)".Shouldn't it be "_kill(-1, status)" instead?Note: Because "_kill()" is implemented as dummy by default, this line has no effect unless the "_kill()" function is replaced by a real implementation.
Hi, I am currently trying to implement a bootloader that runs from the internal flash and performs the following functions:1. copy application binary file to the SDRAM ( 0xC0000000)2. Jump to main application.So far I can copy the binary from the external flash to the SDRAM but when I try to jump to the SDRAM I am getting a hard fault error.I have configured the MPU region to enable all access but I get the same result.There are 2 points that are for me not clear:- Does the SDRAM application have to be compiled with a specific linker configuration?- Do I have to de initialize all the peripherals?
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.