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
HiThis is a general question regarding entering sleep, so whatever part you know and can explain will benefit greatly.The questions are much around the function LpTimerStart, which in general converts OS ticks to LSE clock ticks. The number 1e12 ( or 1,000,000,000,000) is used commonly, why is that specific number chosen?What is "ps" as referred to in CFG_TS_TICK_VAL_PS, time_ps ?Can you explain the formula : #define CFG_TS_TICK_VAL_PS DIVR( ((uint64_t)CFG_RTCCLK_DIV * 1e12), (uint64_t)LSE_VALUE ) #define CFG_TS_TICK_VAL_PS DIVR( ((uint64_t)CFG_RTCCLK_DIV * 1e12), (uint64_t)LSE_VALUE )And this: ( this one is from LpGetElapsedTime) time_ps = (uint64_t)((CFG_TS_TICK_VAL_PS) * (uint64_t)(LpTimerContext.LpTimeLeftOnEntry - LpTimeLeftOnExit)); time_ps = (uint64_t)((CFG_TS_TICK_VAL_PS) * (uint64_t)(LpTimerContext.LpTimeLeftOnEntry - LpTimeLeftOnExit)); Thanks
Hi, I'm using ADC1 and ADC2 of a STM32F303RE in dual regular simultaneous mode. Each ADC should sample 5 independent channels and a sampling cycle is triggered by software, so I don't use continuous mode.I do get DMA interrupts and everything seems to work fine, except that the buffer which should contain the ADC samples which got transferred by DMA is untouched - no results transferred.adc.c is: void MX_ADC1_Init(void) { /* USER CODE BEGIN ADC1_Init 0 */ /* USER CODE END ADC1_Init 0 */ ADC_MultiModeTypeDef multimode = {0}; ADC_ChannelConfTypeDef sConfig = {0}; /* USER CODE BEGIN ADC1_Init 1 */ /* USER CODE END ADC1_Init 1 */ /** Common config */ hadc1.Instance = ADC1; hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1; hadc1.Init.Resolution = ADC_RESOLUTION_10B; hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE; hadc1.Init.ContinuousConvMode = DISABLE; hadc1.Init.DiscontinuousConvMode = DISABLE; hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NON
I have a device with STMF412 processor.This device has UniqueDeviceID [1F 00 23 00 09 51 37 35 31 37 37 36 ]- Contents of the register "Unique device ID register: (96 bits) at address UID_BASE 0x1FFF7A10UL---------------------------------When I boot into the application (USB-CDC communication was generated in CubeIde)and I connect the device to the PC, so I read the following DeviceDescriptor for the USB-CDC deviceDevice Descriptor: bcdUSB: 0x0201 bDeviceClass: 0x02 bDeviceSubClass: 0x02 bDeviceProtocol: 0x00 bMaxPacketSize0: 0x40 (64) idVendor: 0x0483 (STMicroelectronics) idProduct: 0x5740 bcdDevice: &nbs
Hello, I've been using the RTC lately and it works correctly except for one thing, the alarm. Below you can see the function HAL generatedstatic void MX_RTC_Init(void) { /* USER CODE BEGIN RTC_Init 0 */ /* USER CODE END RTC_Init 0 */ RTC_TimeTypeDef sTime = {0}; RTC_DateTypeDef sDate = {0}; RTC_AlarmTypeDef sAlarm = {0}; /* USER CODE BEGIN RTC_Init 1 */ /* USER CODE END RTC_Init 1 */ /** Initialize RTC Only */ hrtc.Instance = RTC; hrtc.Init.HourFormat = RTC_HOURFORMAT_24; hrtc.Init.AsynchPrediv = 127; hrtc.Init.SynchPrediv = 255; hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH; hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN; if (HAL_RTC_Init(&hrtc) != HAL_OK) { Error_Handler(); } /* USER CODE BEGIN Check_RTC_BKUP */ /*if (HAL_RTCEx_BKUPRead(&hrtc, RTC_BKP_DR1) != 0xBEBE) { // Write Back Up Register 1 Data HAL_PWR_EnableBkUpAccess(); // Writes a data in a RTC Backup data Register 1 HAL_RTCEx
Hello community,I have went around the latest X-CUBE-AZRTOS packs of several MCU series to do some benchmarking and started to install a few software examples to use them in STM32CubeIDE 1.14.0.I found out that for some of them, the tool fails to copy through the Target Example Selector and therefore they are impossible to build. I digged a little what could be wrong and discovered that all these examples need some files that are not present in the X-CUBE-AZRTOS pack itself, whereas they are present in the related STM32Cube_FW pack !Middlewares/ST/STM32_AudioUtilities/FontsThis problem exists for the following packs / examples:X-CUBE-AZRTOS-F4 version 1.1.0STM32469I-Discovery/Applications/FileX|ThreadX|USBX/* (13 examples)X-CUBE-AZRTOS-G0 version 1.1.0STM32G0C1E-EV/Applications/USBPD|USBX/* (7 examples)X-CUBE-AZRTOS-WB version 2.0.0STM32WB5MM-DK/Applications/FileX|ThreadX|USBX/* (3 examples)The easy workaround for me is to copy these 2 folders from STM32Cube_FW to X-CUBE-AZRTOS,
Im working on STM32F401CB microprocessor and im trying to read potentiometer value and according to the value turn on the led.Thats my aim but i think that i cannot read the value of pot because my led is not turning on any condition.I have used pa0 as analog input and pb0 as general purpose output.My ADC converted variable is potentiometer_value which is a 16bit variable because of i make a adc process in 12 bit resolution.I am trying to read adc converted potentiometer value with the read_adc function but my led is not turning on anyway,as a proof of that my if else condition is potentiometer value>0 but it still does not turn on. I have linked my proyeus schematic down below.My atollic code is this:#include "stm32f4xx.h" void rcc_config(void) {RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA,ENABLE);RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB,ENABLE);RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1,ENABLE); } void gpio_config(void) {GPIO_InitTypeDef gpio_init_struct;gpio
Hi there!Experimenting FLASH reading/writing I done a fanny test that is giving an unexpected (to me) result.Basically:1) I defined 2 32 bytes buffers (aRbuff for read, and aWbuff for write) u32t aWbuff[8U] = { 0x00010203, 0x04050607, 0x08090A0B, 0x0C0D0E0F, 0x10111213, 0x14151617, 0x18191A1B, 0x1C1D1E1F }; volatile u32t aRbuff[8U] = {0}; 2) I implemented my read, write and erase function and i integrated them into the main infinite loop if(bIsErase == TRUE) { EraseFLASHsectors(uiADRtest, uiSect2Erase); bIsErase = FALSE; } if(bIsWrite == TRUE) { printf("Writing FLASH memory...\r\n"); WriteFLASHdata(uiADRtest, aWbuff, 32U); bIsWrite = FALSE; } if(bIsRead == TRUE) { printf("\r\n"); printf("Reading flash...\r\n"); ReadFLASHdata(uiADRtest, aRbuff, 8U); printf("0x%08X, 0x%08X, 0x%08X, 0x%08X,\r\n", aRbuff[0], aRbuff[1], aRbuff[2], aRbuff[3]); printf("0x%08X, 0x%08X, 0x%08X, 0x%08X,\r\n", aRbuff[4], aRbuff[5], aRbuff[6], aRbuff[7
Hello everyone,I am using the STM32F407 µC and would like to create a web interface. A few functions, such as getting the temperature value from the µC once (SSI) and switching on the LED via the web interface on the board (CGI), work. Now I would like to get the temperature value cyclically without having to reload the complete page.My idea was to use JSON fetch to query the variable in json.cgi.The function in the JV is also called correctly and the corresponding function in the µC is called (CGIJSON_Handler).My only problem is that CGI returns a web page by default and not a value (int or float). Would anyone have an idea where in the standard httpd.c file I have to adjust this so that a value is returned?FYI: I generated the code with the cube and use LWIP without RTOS.Many thanks in advance.Translated with www.DeepL.com/Translator (free version)
Hi, I need 60370 class-B certification, but without incorporating libraries that we cannot check ourselves. So, I rather develop bare-metal tests than dropping the X-CUBE-CLASSB object into the code. Testing the Cortex-M0 core should be possible with just about 100 lines of assembly, much more efficient than a library full of functions we do not need. Is that code available, can someone help me? thanks, Henk
Hi,I have an external ADC connected to my STM32L55 using the I2S interface. The ADC is sampling 4-channel 16-bit data at 48000Hz sampling rate. However, I have encountered issues while streaming a large amount of data using USB CDC. Therefore, I am considering using the Audio device class to solve this problem. By doing so, I hope to make the PC recognize the 4 channels as 4 microphones and receive all the data without losing a single sample. I've configured my ADC as a master to ensure that there is always data for the STM32 to receive. To begin with, I plan to modify the USB descriptor so that the PC can recognize the STM32 as a microphone. My question is whether I need to make more changes than just altering the descriptor. Do I need to properly fill in these functions?USBD_AUDIO_ItfTypeDef USBD_AUDIO_fops_FS ={AUDIO_Init_FS,AUDIO_DeInit_FS,AUDIO_AudioCmd_FS,AUDIO_VolumeCtl_FS,AUDIO_MuteCtl_FS,AUDIO_PeriodicTC_FS,AUDIO_GetState_FS,};
sir, Hope you doing all are well.......Presently am working on Stm32f746ZG NUCLEO board. am working on usb uvc communication between MCU and computer.so i need to send image/video data on usb using uvc protocol.I got some developed code from lepton but it is developed to f4 controllers. i took library files and attached to f7 project. and there is no compilation errors.and camera port also detecting in my system.I have done CDC_transmit(serial communication) also it is working fine messages are printing on my console.but when i started UVC_transmit function my port is disabling and am getting hard fault handler.st is developed any libraries for video steaming using UVC class???????please find the attachment for UVC libraries.
Posted on June 03, 2012 at 13:59Hi, Does anybody know if there is example on STM32F2xx to support UVC class? I checked USB lib provided by STM but only similar example (Audio with ISO out) provided and I do think there should be quite some works if I port Audio project towards UVC class, as for they indeed have some differences. That would be good if you can share any idea on the implement method or materials could be shared, I appreciate it pretty much. Basically I am doing a small demo to simulate a USB Camera by STM32F2xx, a real camera is plugged to DCMI I/F. What I am facing issue is USB Part with suppporting on UVC. Thank you... #uvc #usb
Is there an example for the x-cube-azrtos-l4 usbx stack showing how to implement the additional string descriptions and GET_OS_FEATURE_DESCRIPTOR features to allow an HID device to appear as WinUSB?
I would like to get started with simple usb device detection and read/write operation , From what i can see , the usb library support is limited to the stm32u5x, my application use freertos but all documentaion i find is regarding USBX and no other usb software packs available , any ideas how to get started ?
Hi there!I'm experiencing a new trouble: trying to program a simple flash Word it results in an hard fault; moreover, also trying to read the same area gives an hard fault.Debugging the application I discovered that the HAL_FLASH_Unlock function fails.Since I already seen sutch code work, it's quite strange to me! b08t InitFLASHwrite(void) { /*.-.-.| Local variables: |.-.-.*/ b08t bIsError = FALSE; // Output error indication HAL_StatusTypeDef enuUnlock = HAL_FLASH_Unlock(); // Unlock state /*.-.-.| Execution: |.-.-.*/ // Unlock FLASH memory... if(enuUnlock == HAL_OK) { // No errors: __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGSERR | FLASH_FLAG_WRPERR); // Clear pending flags (if any) // Needed after an update retry otherwise flash erase is not executed __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_ALL_ERRORS_BANK1); __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_ALL_ERRORS_BANK2); } else { bIsError = TRUE; // Else in
Watching some videos online about FFT and trying to use (in STM32CubeIDE) the arm_rfft_fast_f32 function of the arm_math.h DSP library, it is not clear to me why the buffer output produced by that function is N/2 long and not NIs it something related to Shannon's theorem? To the symmetry of the spectrum? (i.e. is it symmetrical around the origin).You are welcome to share external links if there are detailed explanations that I did not see during my internet search.
Hello,I have a Nucleo-U5A5ZJQ dev board and am attempting to get a minimum USB HS example working using the PCD HAL library. When `MX_USB_OTG_HS_PCD_Init()` is called, a HAL_TIMEOUT occurs when attempting a CoreReset using the `USB_OTG_GRSTCTL_CSRST`, specifically this line in stm32u5xx_ll_usb.c /* Core Soft Reset */ count = 0U; USBx->GRSTCTL |= USB_OTG_GRSTCTL_CSRST; do { count++; if (count > 200000U) { return HAL_TIMEOUT; <---- THIS LINE } } while ((USBx->GRSTCTL & USB_OTG_GRSTCTL_CSRST) == USB_OTG_GRSTCTL_CSRST); return HAL_OK;I have checked and confirmed that the USBPHYCEN and OTGEN bits are set in the AHB2ENR1 register before this function call. I have also confirmed that OTGHSPHYCR is enabled and set to 16Mhz (the USB PHY clock speed). I'm currently out of ideas on what would be causing the USB peripheral to fail on initialization. My intuition is saying that it's clock related, but as far as I can tell, I have setup the clocks
Working with STM32H743IIT single CM7 core MCU I was managed to have a stable product with Ethernet connectivity. Thanks everybody (@Piranha especially) for your advicesNow I was going to implement secure communication over ALTCP instead of regular manual mbedTLS way. It was very promising at the beginning with clean and understandable code... BUT! As soon as I enable ALTCP library in my project by having defined LWIP_ALTCP in lwipopts.h I have a problem:It works like a charm for some time (from some minutes to couple of days) and then my application looses Ethernet link and gets it back again in a second, but with wrong DUPLEX state (half-duplex instead of full duplex). The problem originates in reading wrong values from LAN7820 link status register and is not related to stack overflow.The only difference is in this macro. Link fails if ALTCP is enabled even it is not used (just regular clear-text protocol), but works fine with mbedTLS but not through ALTCP. etherne
Good morning,This is my first postI' m searching for a special micro SD card with:• MCU: 32-bit (produced by ST)• MCU clock: > 100MHz• RAM: > 384 Kbytes• Flash: > 768 Kbytes• Timer function• Random number generator function• Secure memory area required to store encryption keys• Flash of at least 8Gb• Sdk to develop and Upload software on microcontroller (ex: rsa and AES key generation function)• Password or PIN for data protection stored on the flash (not for read but only for mofify/delete/create) Is there anyone who can recommend me some manufacturers please?Thank youVincenzo
Hi, I'm running into problems registering USB interfaces on STM32G0B1KBU6. The same code works fine on STM32F1*, STM32F7*, and STM32G4*.Environment: latest STM32CubeIDE (v.1.13.2) @ Windows. Target: custom board with STM32G0B1KBU6, which uses the following peripherals: USB, CANbus, 9x PWM out lines and a digital GPIO in (the details are below). Flashing is done over SWD using either ST-Link v.2, or J-Link Base, directly from the CubeIDE.For debugging, I've reduced the problem to a new and empty CubeIDE project for this chip, adding only the USB and one timer. No custom code: just what's generated by the IDE. No matter what USB device class is selected in *.ioc->Middleware and Software Packs -> USB_DEVICE -> Class For FS IP, the device fails to be recognized by the host (both Windows and Mac). The message provided by a Windows host is "Device Descriptor Request Failed". If I step over the init functions, the host reports this messa
I have 1024 integer numbers in an array that are between 0 and 4096. Now I'm trying to convert these array values to Q1.15 format. These should then be between -1 and +1. With my attempt, I don't achieve any negative values, all of them are just positive. Thanks for the help. float32_t fir_in_arm [1024],fir_out_arm [1024],fir_state [1089-1];int16_t fir_in_temp [1024]; // with float32_t also tried and no successfloat32_t fir_in_temp_gleit [1024]; for (int i = 0; i<= adcBufferSize; i++){adc_buffer_float[i] = (float32_t)adc_buffer [i];fir_in_temp_gleit[i] = (adc_buffer_float[i])/32767;fir_in_temp [i] = fir_in_temp_gleit[i]*32768;}
Hi, I am running a debug session for a project and am running into a pretty baffling problem where values I load into an array are seemingly getting erased by a tools error. I have a class that has an array as one of its members, that gets filled with pointers to UI objects. This has worked for me on numerous other projects. I had to update to CubeIDE 1.14.1 recently, and suddenly the array values are getting erased as soon as any of the class methods are called. As you can see here, the array shows all the correct values, but then once the class method service_all() is called, the array values get deleted:Before: After (before any part of the service_all() method is even executed!):I have optimization disabled for this part of the source code. Any idea what is causing this? It's completely baffling and has ground development to a complete halt.
I bought an STM32F072 disco board specifically to develop a USB CDC application, but I can't now find an example or demo in STM32CubeMX V6.10. I found this thread https://community.st.com/t5/stm32-mcus-products/stm32f070-usb-cdc-example/m-p/457994#M150836 but has this dropped out of Cube 6.10?
Hi, I am working on custom Bootloader and Application stored with different starting address on same Flash When I jump from my Bootloader to Application area which contains Blinking LED With HAL_Delay() function my application is stuck in HAL_Delay ()function.And also I have observed that if I debug using break points it is executing perfectly, but not working in run mode. Can anyone please helpThanks in advance
HOW to interface LT8491 BUCK boost converter module with STM32F103RCt6tr board with i2c protocol and give detailed explanation and if posiible give an example code
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.