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 Everyone,I have a Problem with to acquisition DATA from One TASK to another and release data.And there is another problem that I can not access Data from One task to another task.how to use and when can we use , in this code i have to use acquisition and release process in this given code.i have to send latitude , longitude ,objectTemp and ambientTemp by EC200u(message) and take data from temp sensor and L89. void StartTask1(void *argument) { /* USER CODE BEGIN 5 */ /* Infinite loop */ for(;;) { while(!sendHTTP(Latitude, Longitude, objectTemp, ambientTemp)){ osSemaphoreAcquire(myCountingSem, osWaitForever); if(count < 1){ count++; } else{ break; } osSemaphoreRelease(myCountingSem); } osDelay(100); } /* USER CODE END 5 */ } /* USER CODE BEGIN Header_StartL89 */ /** * @brief Function implementing the L89 thread. * argument: Not used * @retval None */ /* USER CODE END Header_StartL89 */ void StartL89(v
HelloI have STM32H563 with KSZ8081 ethernet phy. On FreeRTOS + LWIP i was able to define the PHY in CubeMX and it was basically working out of the box. However on the NetXDuo when i select Custom Phy Interface I am a bit lost. Are there any guidelines on how should i write a custom PHY driver for NetXDuo? I tried searching for a guide or documentation but couldn't find any.
Hi,i am new to HAL Libraries. i am learning to work with CAN BUS using HAL Libraries. Can any one please post an example of STM32F CAN BUS using HAL Libraries. I searched about the existing examples but their isn't any example with new firmware. im new to this plz help me on this. or direct me in the right direction
after writing below flash related code in stm32f7508-dk board , controller is not working display getting blank and , it is also not detecting . can any one help me hot to erase the code and reload the my code void SetupFlashMemory(){//setup memory// Modify Flash Address according to target MCUHAL_FLASH_Unlock();FLASH_Erase_Sector(11, FLASH_VOLTAGE_RANGE_4);HAL_FLASH_Lock();} //write to memory void FlashWrite(){ HAL_FLASH_Unlock();for(uint32_t x = 0; x < 30; x++){HAL_FLASH_Program( FLASH_TYPEPROGRAM_WORD, flashAddress, ((uint8_t *)wrBuf)[x]);flashAddress++;}HAL_FLASH_Lock();} //readvoid FlashRead(){flashAddress = 0x080E0000 ; // 0x0800F400; // 0x90000000for(uint32_t k=0; k<5; k++){*((uint8_t *)rdBuf + k) = *(uint8_t *)flashAddress;flashAddress++;}}
I want to use STM32U5A5 SAI1 to generate via SAI1 a master I2S, with 24bit sample words.I need 24bit because sending out afterwards as S/PDIF (via SAI2) needs 24bit sample words (as I understand: SAI2 as S/PDIF Tx is "forced" to send as 24bit samples - only).I get just 16bit PCM or 32bit PCM, but not 24bit! WHY?My config: hsai_BlockA1.Instance = SAI1_Block_A; hsai_BlockA1.Init.AudioMode = SAI_MODEMASTER_RX; hsai_BlockA1.Init.Synchro = SAI_ASYNCHRONOUS; hsai_BlockA1.Init.OutputDrive = SAI_OUTPUTDRIVE_ENABLE; hsai_BlockA1.Init.NoDivider = SAI_MASTERDIVIDER_ENABLE; hsai_BlockA1.Init.FIFOThreshold = SAI_FIFOTHRESHOLD_EMPTY; hsai_BlockA1.Init.AudioFrequency = SAI_AUDIO_FREQUENCY_48K; hsai_BlockA1.Init.SynchroExt = SAI_SYNCEXT_DISABLE; //SAI_SYNCEXT_OUTBLOCKA_ENABLE; //SAI_SYNCEXT_DISABLE; hsai_BlockA1.Init.MckOutput = SAI_MCK_OUTPUT_DISABLE; hsai_BlockA1.Init.MonoStereoMode = SAI_STEREOMODE; hsai_BlockA1.Init.CompandingMode = SAI_NOCOMPANDING; hsai_BlockA1.Init.TriState = SAI_OUT
Hi,I have defined a function, that when called, from the main.c while loop works fine. When the same function is called from an interrupt it fails to work.In debug mode I can see that the interrupt function (void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) is called. My function is then called, but it no longer works as it did when called from the main while loop. The context is the function, defined above, asks a LCD TFT display to do something. The LCD is controlled via SPI. DMA is enabled.Is it the case that the interrupt would only "fire" once the SPI has finished its work? If it interrupts the current SPI communication would this be the problem?I note also that I can alter global variables fine in the said function. Any suggestions welcome.Thanks in advance
Dear Sir/Madam,Currently I am doing a project called "Displaying two animations simultaneously on ssd1306 oled display".Problem :- For this I am using cmsis rtos v1 to create two separate tasks. One task handles one animation frames & the other task handles the other animation frames. But this is not achievable as expected.So am I doing any mistakes? /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2024 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 Heade
Hi,I've encountered a problem with digital input probing. I have two signals connected to my GPIO on the STM32 F411; the first one is the CMD line, and the second is CLK. Based on the CLK, I would like to read incoming bits on CMD, but only for a specific number of times (for example, 50 times). So far, I've implemented external interrupts on both pins, and up to 400kHz, it works fine. I would like to increase the speed to a few MHz or at least 1 MHz. Moreover, I would like to send the collected data over USB FS. Please let me know if it is possible to achieve this and guide me on how to do it.Thanks for your responses.
Hello everyone, I'm getting my feet wet with ThreadX and NetxDuo.I'm using a NUCLEO-H563ZI board.I started by building and flashing the Nx_UDP_Echo_Server example project to the board using the STM32CubeIDE.This worked right away. The board got address 192.168.1.164 assigned, green led was flashing, responded to a ping, and echoed whatever I sent over UDP port 6000. My goal however, is to get this working with a static IP address. To accomplish this, I made the following changes in CubeMX:- Middleware and Software packs -> NETXDUO -> Addons (Top pane)Changed DHCP from "Client" to "Disable"- Middleware and Software packs -> NETXDUO -> Configuration (Bottom pane) -> NetxDuo ProtocolsNetxDuo Ethernet IP Address: From "192.168.1.1" to "192.168.1.164" After that I needed to make the following code changes to get the software to compile again:app_netxduo.h:- removed the include for nxd_dhcp_client.happ_netxduo.c:- removed:
Hello everyone,return to the issue of problems that can arise using the HAL_Delay (), within the Interrupt service functions in projects for embedded systems without RTOS.Briefly: the HAL_Delay (), uses the interrupts thrown every mSec by the system timer SysTick; these interrupts increment a counter and the HAL_Delay () waits within a while for the counter value to reach the desired value.But in the projects I made in the Cube environment, the SysTick is assigned by the development environment, in the HAL_Init () function, a priority of 15 (the lowest).You can see this both from the MX environment and from the code.Obviously an IRQ service function with higher priority (<15) can never be interrupted, and when using the HAL_Delay (), the Systick counter cannot be counted and the HAL_Delay() function is blocked; the system stops advancing.I use a micro STM32F401 and as some external peripherals I use, they often need small delays , also in some interrupt situation (I think it happene
Hello,I am developing synchronization libraries on top of ThreadX for an STM32 project. My libraries work perfectly when used on ONLY either the M4 or M7 core while the other core is idling. However, when I attempt to run ThreadX on both cores in AMP fashion with separate kernels, the M4 core encounters a hard fault.After investigating, I found that the issue originates in the M4 core's signal handler due to a stack overflow in the System Timer Thread. The strange part is that the M4 core is not creating any threads and is running only the skeleton code generated by CubeMX (obviously, the error remains even when application threads are created). Notably, if I run only the initialization (skeleton) on the M7 core without creating any application threads, the stack overflow issue does not occur on the M4 core.By default, all stacks are allocated in AXISRAM. So, to ensure that application threads created on the M7 core are not interfering with the M4's System Timer Thread stack, I changed
How should a new STM32H747I-DISCO be used, why does the display not start after I connect the computer with st-link and display 32kb of memory
Hello!I am working to use the STM32F769I + LCD_DSI_VideoMode_SingleBuffer code example with a different timing output. I was able to get both the 720x480 and 720x576 resolution examples working with no issue. I added a 720p resolution and also got that to work. For my application, frame rate isn't important, I'm just trying to get the DSI timing signals to behave correctly. I've modified the HDMI_Format, HDMI_DSIPacket, and HDMI_PLLConfig structs to include these resolutions. I am using standard timing resolutions#if defined(USE_LCD_HDMI)/** * @brief DSI timming used for different HDMI resolution (720x480 and 720x576) */HDMI_FormatTypeDef HDMI_Format[5] ={/* HA HS HB HF VA VS VB VF ASPECT BPP */{720, 62, 60, 30, 480, 6, 19, 9, HDMI_ASPECT_RATIO_4_3, LCD_DSI_PIXEL_DATA_FMT_RBG888},{720, 64, 68, 12, 576, 5, 39, 5, HDMI_ASPECT_RATIO_16_9, LCD_DSI_PIXEL_DATA_FMT_RBG888},{1280, 40, 220, 110, 720, 5, 20, 5, HDMI_ASPECT_RATIO_16_9, LCD_DSI_PIXEL_DATA_FMT_RBG888},
Hello all,I bought two NUCLEO-H753ZI to experiment the ADC.Used the CUBEMX inside the STM32CubeIDE to configure the ADC to do 4x oversample (ADC1 Oversampling Ratio = "Oversampling ratio 4x").Then generated the code, but it does not compile: ... hadc1.Init.LeftBitShift = ADC_LEFTBITSHIFT_NONE; hadc1.Init.OversamplingMode = ENABLE; hadc1.Init.Oversampling.Ratio = ADC3_OVERSAMPLING_RATIO_4; hadc1.Init.Oversampling.RightBitShift = ADC_RIGHTBITSHIFT_NONE; ... The error is "... main.c:204:35: error: 'ADC3_OVERSAMPLING_RATIO_4' undeclared ..."Investigating a little, I found that ADC3_OVERSAMPLING_RATIO_4 is declared in stm32h7xx_hal_adc.h, but only if ADC_VER_V5_V90 is defined (#if defined...) - which is not. With oversampling disabled in CubeMX, the compilation goes OK. I am new to stm32 and CubeMX. How can I solve my problem? Regards,linuxfan
The following are some configuration parameters:
Do I need to disable global interrupts for internal flash erase and write operations? __disable_irq(); erase(); __enable_irq(); __disable_irq(); write(); __enable_irq();
I'm looking to use an STM32F407I for EtherNet/IP communication with some industrial motors and sensors.I cannot seem to find a library that would help me do that for the STM32F4.I found this, but I didn't really understand how to use the solution that's suggested Any help on finding a library would be greatly appreciated.
Hello everyone, I am working with the STM32F411E and i am trying to make the LSM303DLHC working on my board. At this moment i am using this lib: https://github.com/STMicroelectronics/STM32CubeL4/blob/master/Drivers/BSP/Components/lsm303dlhc/lsm303dlhc.c The problem i am having is that it cant find accelero.c to understand the GetXYZ function code in the code AccelerometerDrv->GetXYZ(pDataXYZ);
Hi all,I want to access a NandFlash(H27U1G8F2B) chip which is extended by STM32F429BI's FMC;According the datasheet, seems the default value after erase is '1' for each bit.But I read the value by program is '0':My test code as below:#define TEST_NUM 97 NAND_FLASH_STA_t NAND_FLASH_test(void) { HAL_StatusTypeDef hal_sta = HAL_OK; NAND_IDTypeDef nand_id = {0}; uint8_t buf[PAGE_SIZE] = {0}; hal_sta = HAL_NAND_Reset(&hnand1); if(hal_sta == HAL_OK) { NAND_FLASH_DBG("nand flash reset OK\n"); } else { NAND_FLASH_ERR("nand flash reset err[%d]\n", hal_sta); return NAND_FLASH_RESET_ERR; } // read ID (0xADF1001D for H27U1G8F2BTR) // 0xADDC9095 for H27U4G8F2ETR hal_sta = HAL_NAND_Read_ID(&hnand1, &nand_id); if(hal_sta == HAL_OK) { NAND_FLASH_DBG("nand flash id[0x%02x%02x%02x%02x]\n", nand_id.Maker_Id, nand_id.Device_Id, nand_id.Third_Id, nand_id.Fourth_Id); } else { NAND_FLASH_ERR("read nand flash id err[%d]\n", hal_sta); return NAND_FLASH_READ_ID_ERR; } NAND_A
Hi,I going to choose "B-L4S5I-IOT01A" this board for my project (it is combination of ADC and IOT), can please in which IDE version having all these libraries for ADC and Wi-Fi on this board.Thanks,
We're running into what seems to be a low-level race-condition when initializing LWIP on boot. The LWIP always initializes successfully after using the STLink to flash the .elf either in debug and release modes. After flashing, I verify by sending a ping command to the Ethernet interface and get a good response with TTL. I then subsequently cycle the power and ping returns the infamous "Request timed out" message.It's difficult to debug because the initialization issue goes away once I start a debug session. So, I'm completely in the dark on this one. Any and all help/suggestion/insight is much appreciated.
Hi,I'm a little lost, I would like to use the alternative6 (AF6) function on my stm32f405. I tried to do it via cube mx by configuring the pins but the generated code seems strange to me :So for me I'd like to use SPI3 with PB3/4/5 so AF6 in datasheet. But if I configured that on cubemx I got this: static void MX_SPI3_Init(void) { /* USER CODE BEGIN SPI3_Init 0 */ /* USER CODE END SPI3_Init 0 */ /* USER CODE BEGIN SPI3_Init 1 */ /* USER CODE END SPI3_Init 1 */ /* SPI3 parameter configuration*/ hspi3.Instance = SPI3; hspi3.Init.Mode = SPI_MODE_MASTER; hspi3.Init.Direction = SPI_DIRECTION_2LINES; hspi3.Init.DataSize = SPI_DATASIZE_8BIT; hspi3.Init.CLKPolarity = SPI_POLARITY_LOW; hspi3.Init.CLKPhase = SPI_PHASE_1EDGE; hspi3.Init.NSS = SPI_NSS_SOFT; hspi3.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2; hspi3.Init.FirstBit = SPI_FIRSTBIT_MSB; hspi3.Init.TIMode = SPI_TIMODE_DISABLE; hspi3.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; hspi3.Init.CR
Hi, I integrated the OpenBootlader for the STM32L552 to my project and it works normally as expected. I'm only using the UART interface and reduced the boot loader project to the minimum.The problem I'm facing is that sometimes the flashing stops, because the MCU is not acknowledging the messages from the programmer.This is because the MCU is hanging in the USART receive loop: /** * @brief This function is used to read one byte from USART pipe. * @retval Returns the read byte. */ uint8_t OPENBL_USART_ReadByte(void) { while (!LL_USART_IsActiveFlag_RXNE(USARTx)) { // OPENBL_IWDG_Refresh(); } return LL_USART_ReceiveData8(USARTx); } I tried different UART speeds and the problem is not speed related.Maybe there is a problem because every single byte is handled for reading? Why there is no DMA or interrupt mechanism implemented?How can I fix this issues?
I am working on a ThreadX project on my STM32H747I-Disco with M7 and M4 cores. I want to allocate memory dynamically in the initialization phase that can be accessed from both cores. For this, I am planning to use the "tx_byte_pool_create" and "tx_byte_allocate" APIs. The former requires the starting address of the memory pool. The example in the ThreadX user guide shows that it can be any memory location, such as 0x30000000. As I want to access the pool from both cores, I assume the memory location has to be in one of these locations (AXISRAM, SRAM1, SRAM2, SRAM3, SRAM4, BKSRAM). Now, I can get the address of these sections in the reference manual, but how do I know which one to select? Some sections will be used for the stack, which can grow. How can I ensure that the section I am selecting for the pool will always be available and not overwritten by the system?In summary, I want to understand how to select the start address for the memory pool in RAM, which will remain valid indefin
We notice, after a certain time, a totaly break of UDP/IP communication (LwIP layer) of our STM32H7 project (FreeRTOS layer is also used).This stop occurs without any particular external condition and generally after a fairly long time (after a few hours).No more frames are then transmitted (by UDP client in particular) nor received in the Callback function (UDP server).This break of communication is never followed by a resumption of communication, but a program reset systematically allows good communication to be restored.What could this possibly be due to?Could we have configured an element incorrectly?is there a bug in the Ethernet or LwIP layers?
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.