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 I'm developing RTOS environment of dual-core in STM32H757.I could refer to the examples provided by STM32, and I read the application note AN5617. I checked that the error is a exception "err1" under the function "rproc_virtio_create_vdev" in the remoteproc_vrtio.c file. it was caused by the saturation of the memory "._user_heap_stack". Please refers to debugging results and the memory map.How can I resolve this error?Is it because I didn't add memory flush logic? Task ICP(Inter Core Processing) in RTOS handles communication between CM7 and CM4.the task that is applied HSEM synchronization repeatedly runs from the functions "MAILBOX_Init" and "MX_OPENAMP_Init" to the function "OPENAMP_DeInit". # PICTURE1. The err1 under the function "rproc_virtio_create_vdev" in the remoteproc_virtio.c file +) The function "virtqueue_allocate" codes+) The function "metal_free_memory" codes# PICTURE2. The debugging results1) Hexadecimal conversion2) T
I am currently trying to figure out at what byte the slave sends a NACK during an I2C master write transfer.When the slave sends the NACK after X bytes the error callback is called. Inside the error callback I am having trouble finding out at what byte the NACK occured (I want to know how many bytes were transferred fine and at what position the NACK was send).if (HAL_I2C_Master_Seq_Transmit_DMA(i2c_handle, slave_addr, data, write_size, I2C_FIRST_AND_LAST_FRAME) != HAL_OK) { // error handling } void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef* /*hi2c*/) { // Never called } void HAL_I2C_ErrorCallback(I2C_HandleTypeDef* hi2c) { uint32_t tx_cnt = __HAL_DMA_GET_COUNTER(hi2c->hdmatx); }I tried to register DMA callbacks, but they are cleared inside the HAL_I2C_Master_Seq_Transmit_DMA function and therefore never called... if (HAL_DMA_RegisterCallback(&handle_GPDMA1_Channel3, HAL_DMA_XFER_ABORT_CB_ID, DMAabortCallback) != HAL_OK) { Error_Handler(); } if (HAL_DMA_Regi
HiI am am trying to use the X-CUBE-EEPROM package in my application.I found this very helpful post which I am using as a guide to setup the code.https://community.st.com/t5/stm32-mcus/porting-and-using-x-cube-eeprom-with-any-stm32/ta-p/570539I think I need to define the flash address where the emulated eeprom starts.In order to do that, I need to know the size of the emulated eeprom.FormulaApplication note an4894 gives a formula to calculate the required size of flash memory, but I want to make sure I am using it properly. Also note, I am using a STM32G070CB, which has a flash memory endurance of 1K cycles. This is less than the standard 10K of most other STM32 MCUs.Here is the formula:Here is my calculation, I would appreciate if anyone can confirm I am doing it correctly!I want to store a max of 50, 32 bit variables.The page size of the STM32G0 series is 2KB.The flash memory endurance is 1K cycles.Variable elements per page = 500 = 2000 byte page size / 4 bytes for each variableNumbe
Hi,I am creating a project using the STM32H523 microcontroller. One of the planned functionalities is USB CDC communication with a computer (as a virtual COM port device). Since I do not plan to use RTOS, I would like to use the classic USB library.Initially development was done on the Nucleo board with STM32H503. Using this guide I managed to implement everything.https://community.st.com/t5/stm32-mcus/how-to-use-stmicroelectronics-classic-usb-device-middleware-with/ta-p/599274Problems appeared when switching to the target platform (STM32H523). The hardware was connected as on Nucleo (D+ to pin PA12, D- to PA11). CubeMX was configured analogously, the rest of the code was transferred. Unfortunately, after connecting to the computer there is no reaction, the USB device is not detected.Does anyone have an idea what could be wrong? Is it also necessary to connect the VDET pin, and if so, where is the pin configuration in the code?I tried to debug the problem on the HW side. There is no co
Posted on January 20, 2015 at 02:55 Hi I have the camera demo for STM32F4Discovery working which can display the image from camera (OV9655) to the LCD (DM-LCD35RT). I also have fatfs for SDIO working. I am writing the image data to a .bmp file on the SD card. This works except the image is distorted (see the different between the LCD image and the created PICBMP image. It looks like the width is incorrect some how. https://drive.google.com/folderview?id=0B2tRJoqjaZmxSnJzYWdXYVVGQUE&usp=sharing Flow is DCMI (SnapShot)->DMA->FSMC (on LCD) <- This works correctly then I simply read the data from the LCD and write it to a write, adding a bmp header at the start. Any suggestions as to why the bmp image does not align with the LCD image? Offending code below, in the for loop I suspect: int32_t Capture_Image_TO_Bmp( void ) { int32_t ret = -1; int32_t i = 0; int32_t j = 0; int16_t data_temp = 0; uint32_t bw = 0; char file_str[30] = ''picbmp'' ; FIL file;
Hi community,like the title says, I need your suggestions regarding firmware update via UART on an STM32F446RET6.So I developed a product with the STM32F446RET6 chip. The only accessible protocol to my users is UART1, on which I implemented Modbus RTU with RS485.Now the TX and RX pins of UART1 are converted to RS485 signal using this particular IC: MAX3485ESA, and the RS485+ and RS485- pins are exposed to the users.Other than those, nothing else is accessible, no SWD nor Boot pins. I need to implement a firmware upgrading scheme based on this hardware, so from a computer through an RS485 transceiver, to the IC on the board, and then to UART1. I want to know whether this is possible, and if yes, please kindly give some suggestions on where to start.Also, I wrote a GUI application for the product and in the future want to integrate the firmware upgrading functionality into the software, so no third-party app is needed. Is it that I would have to write my own bootloader to achieve th
Hello,I am currently working with the STM32H7S78-DK board, using STM32CubeIDE for programming. My goal is to configure the Ethernet peripheral and send/receive data via UDP. As a reference, I am following the example project provided at the following link:stm32-upd-client Here is my implementation,void udp_receive_callback_client(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16_t port); static void udpClient_send(void); struct udp_pcb *upcb; char buffer[100]; int counter = 0; extern TIM_HandleTypeDef htim1; void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) { printf("HAL_TIM_PeriodElapsedCallback\n\r"); udpClient_send(); } /* IMPLEMENTATION FOR UDP CLIENT : source:https://www.geeksforgeeks.org/udp-server-client-implementation-c/ 1. Create UDP socket. 2. Send message to server. 3. Wait until response from server is received. 4. Process reply and go back to step 2, if necessary. 5. Close socket descriptor and exit. */ void udpClient_con
Hii, I have been trying to interface Nucleo-H503 with SD card adapter which has SPI pins to interface, in stm32cubeide i selected SPI1 and FileX in the middleware. But unable to get how to write code for it for creating file and saving Helloworld in the file created in SD card.
Hi All,I've been having issues with unreliable SPI transmission on an NUCLEO-H753ZI using ST H7 HAL HAL_SPI_TransmitReceive() talking to an ICM-42688-P IMU over SPI1 at 1 to 12 MHz clocks, with H753ZI RCC set up at 400MHz CPU clock and a 25 MHz SPI1,2,3 peripheral clock. SPI is set up for software controlled CS line to handle some specified ICM SPI timing hold time needs.I came across a few forum posts discussing issues with SPI EOT flag timing causing frame truncations, such as "STM32H743 does not set EOT-Bit when SCK is to high" [link here] that led me to the device errata sheet [here]. In the errata sheet (ES0392 - Rev 13) I find "2.22.6 Truncation of SPI output signals after EOT event" I find:With fast software execution (high PCLK frequency) and slow SPI (low SCK frequency), the SPI disable occurring too fast may result in truncating the SPI output...WorkaroundApply one of the following measures or their combination:• Add a delay between the EOT
Hi, I am building a custom board with stm32h7r3z8t6. Have a problem with EXTI function: I use 2 EXTIs - EXTI8 in PD8 and EXTI9 on PC8. Both are defined as rising edge interrupt sources. Both pulled down and without any signal. Both are toggling LEDs. EXTI8 generates a square signal of 2.1MHz on the LED pin. EXTI9 nothing, never entering to the interrupt. The picture is the same if the signal source with 400KHz is connected to EXTI9 and EXTI8. system clock running at 600MHz HCLK at 300MHz. External crystal 48MHz. I tried just reading pins and applying the value to LEDs - it works fine, so I guess, the pins are soldered well and not burned. Using ST-LINK3 Debugger. The Signal on LED2_Pin: void SystemClock_Config(void) { if (HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY) != HAL_OK) { /* Initialization error */ Error_Handler(); } RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTy
Hi everyone,I get stuck with an issue and can't figure what to do.I implemented on a STM32l071 a I2C slave and using DMA with circular buffer, I am using HAL with CubeMX generated code.The microcontroller is by default in stop mode, so when something communicates with the microcontroller with I2C, the microcontroller wakes up by I2c address match, then do what it has to do, then return in stop mode.All that I have implemented seems to work well.The custom board we are using consume around 22µA when the microcontroller is in stop mode.The problem is:When I disconnect only the SDA line before SCL line, the board consume arround 321µA .(I can then disconnect and reconnect all lines it doesn't change the result).Then If a send a read or write I2C frame with the master with SCL connected, (SDA connected or not), the board consumption go back to normal at 22µA.Before entering stop mode, I clear all power flag and I2c flag just in case.I also activate an output pin in order to see if som
Hello, I am trying to generate initialisation code for CubeIDE using MX. Functions starting with ‘xevent’ compile successfully in CubeIDE, but in MDK it reports an error indicating that ‘)’ is missing before the function. Do you have any idea what is causing this? *This post has been translated from Chinese to comply with the ST Community guidelines.
After connecting to a X-NUCLEO-LPM01A board for power consumption test , RTC init will not end.Stuck in this while loop: tickstart = HAL_GetTick(); /* Wait till RTC is in INIT state and if Time out is reached exit */ while ((hrtc->Instance->ISR & RTC_ISR_INITF) == 0U) { if ((HAL_GetTick() - tickstart) > RTC_TIMEOUT_VALUE) { return HAL_TIMEOUT; } } Current solution: I have to program some example using stm32wbIDE, only that fixes it and I can now use my FW.
Moved from this thread: https://community.st.com/t5/stm32-mcus-embedded-software/stm32h523-usb-host-without-external-crystal/td-p/755600 I am currently working on a data logger application where data from my custom board is saved onto a USB pen drive. For this project, I am using an STM32H523 microcontroller and referencing the USBX Host MSC example provided in the STM32Cube Firmware Package:\Users\pc\STM32Cube\Repository\STM32Cube_FW_H5_V1.3.0\Projects\STM32H573I-DK\Applications\USBX\Ux_Host_MSCI have adapted the example for the STM32H523, ensuring that all configurations are aligned with the settings from the original STM32H573 example. However, when running the application, it gets stuck at the following point in the code/* Enter the scheduling loop to start executing threads! */_tx_thread_schedule();
BackgroundFirmware STM32Cube FW_H7 V1.9.0MCU Reference STM32H745ZITxToolchain STM32CubeIDEI created a new STM32 project targeting the Nucleo-H745ZI-Q enabling the OpenAMP Middleware along with FreeRTOS. Referencing the project for the Disco board, I copied the software over and making sure to enable the what I needed to in hal conf as well and made sure the correct compiler symbols were defined.The M7 seems to be configured properly and running. The M7 is able to hold wake the M4 on reset via HSEM event and go through it's openamp initialization to wait at OPENAMP_Wait_EndPointreadyOn the M4 side it's stuck at ```while(resource_table.vring1.da != VRING_RX_ADDRESS)```even though I stepped through the M7 code to see that it did do that assignment.I'm wondering if there is some linker script problem I've got.For some background on that, I did see the note in the openamp_conf.h to add the relevant lines in Memory to define the OPEN_AMP_SHMEM location and lengths along with the start and en
Hello everyone.What is the proper procedure when restarting the entire ethernet?Im using LWIP and FreeRTOS and im not sure if im restarting everything correctly...These are the steps im using.Terminate TCP Server thread. netif_set_down(&gnetif); netif_remove(&gnetif); netconn_delete(Connection); osThreadTerminate(ThreadID); HAL HAL_ETH_Stop(&heth); HAL_ETH_DeInit(&heth); HAL_ETH_Init(&heth); HAL_ETH_Start(&heth); Start TCP server netif_set_ipaddr(&gnetif, ip); netif_set_up(&gnetif); ThreadID = osThreadNew(TCP_Thread, NULL, &TCP_Thread_attributes); What steps am i missing?Thanks for any replies :)
Hi,I have a STM32F407G-DISC1 board. The final goal is to write a program that get data from the hardware and publish via mqtt, and via the usb (HID client). Also an integrated http server would be great.Is it there online an implementation example for this? Or some documentation that can help? I worked for many years as a c# developer, I can understand some concepts, but I am not speaking firmware fluently for now. Any hints would be appreciatedMCU: STM32F407VGT6
I am using FreeRTOS and lwIP (callback api) on the STM32F407. I have 1 UDP and 2 TCP ports. After a few hours, the struct pbuf_custom *p = LWIP_MEMPOOL_ALLOC(RX_POOL); operation returns NULL. When I checked the ethernetif.c file, I noticed that the ETH_RX_BUFFER_CNT value is statically defined as 12. Do you think I should increase this value? If I increase it, do I also need to modify the ETH_RX_DESC_CNT , ETH_RXBUFNB and etc. values? Below, I’m sharing the current values and the lwipopts file. Thank you in advance for your helpvoid HAL_ETH_RxAllocateCallback(uint8_t **buff) { /* USER CODE BEGIN HAL ETH RxAllocateCallback */ struct pbuf_custom *p = LWIP_MEMPOOL_ALLOC(RX_POOL); // THE PROBLEM OCCURS HERE if (p) { /* Get the buff from the struct pbuf address. */ *buff = (uint8_t *)p + offsetof(RxBuff_t, buff); p->custom_free_function = pbuf_free_custom; /* Initialize the struct pbuf. * This must be performed whenever a buffer's allocated because it may be * cha
Hello.I am using an STM32H743BI processor in the project.I am using freertos.I have completed the connection setup from ethernet. I can ping the device and connect as tcpclient.In the working scenario I need to send data at 100ms intervals as long as the client is connected to the client.I am having trouble with this, after a few messages the device goes to hardfault as you can see in the picture below. #define MEM_SIZE 10*1024/*----- Default Value for H7 devices: 0x30044000 -----*/#define LWIP_RAM_HEAP_POINTER 0x30004000you can also find the whole lwipopts.h file attached.I will also leave here the settings I made about memory.MPU_InitStruct.Number = MPU_REGION_NUMBER2;MPU_InitStruct.BaseAddress = 0x30004000;MPU_InitStruct.Size = MPU_REGION_SIZE_32KB;MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL1;MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE;MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;HAL_MPU_ConfigRegion(&MPU_InitStruct);I am using heap1 as freertos heap and I
I'm using the LWIP library and STM32F407. I’m trying to send a 1860 bytes through Ethernet using UDP protocol, exceeding the Ethernet MTU (1500 bytes) so my data is fragmented. I´ve used some programs to test If I could read UDP stream, but nothing works. No problem to read packets under 1500byte (with no fragmentation) with my host application or other.. However, I can see the traffic generated by this packet using Wireshark: There is any way to read this fragmented Data properly, configuring some parameter of the LWIP library? thanks
Hi, I am using STM32F767ZI for ethernet communication. I update my CUBEIDE version from 1.16.1 to 1.17 latest version. After I update my ethernet program was show HardFault_Handler() during Execution. This was working fine in the previous version(1.16.1). In the new version(1.17) It hit the fault in mem_init() at mem.c (line no. 18). void mem_init(void) { struct mem *mem; LWIP_ASSERT("Sanity check alignment", (SIZEOF_STRUCT_MEM & (MEM_ALIGNMENT - 1)) == 0); /* align the heap */ ram = (u8_t *)LWIP_MEM_ALIGN(LWIP_RAM_HEAP_POINTER); /* initialize the start of the heap */ mem = (struct mem *)(void *)ram; mem->next = MEM_SIZE_ALIGNED; mem->prev = 0; mem->used = 0; /* initialize the end of the heap */ ram_end = ptr_to_mem(MEM_SIZE_ALIGNED); ram_end->used = 1; ram_end->next = MEM_SIZE_ALIGNED; ram_end->prev = MEM_SIZE_ALIGNED; (In this line the hardware fault was occur) MEM_SANITY(); /* initialize the lowest-free pointer to the start of the heap */ lfree =
Hi,I want to use a single low-level module to handle up to three I2C buses at the same time using the HAL library and using the interrupt for all communications with the relative callback. Is it possible to use a single write/read/callback function for all transactions on all three buses at the same time. Are there any problems if the callback is interrupted to handle another interrupt of another I2C bus with higher priority?Best regards,Domenico
Hello,Now I'm testing 50msec regular Stop and wakeup usingHAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 102, RTC_WAKEUPCLOCK_RTCCLK_DIV16);Firstly I expected HAL_RTCEx_WakeUpTimerEventCallback() is done every 50msec but in real it was far faster than expexted.How do I calculate time interval of HAL_RTCEx_WakeUpTimerEventCallback()?And I had onother question.I checked if systick works normally under the regular Stop and wakeup condition.So I used serial debug by CDC like following but didn't work.If WakeUpTimer is applied systick doesn't work normally?Thanks,static uint32_t count = 0;count += 1;uint8_t send_message[30];sprintf((char *)send_message, "sec:%d\n", (unsigned int)count);DebugPrint((char *)send_message);
Hi, I'm trying to use https://www.st.com/en/embedded-software/x-cube-eeprom.html on my custom stm32g030 board.Following the examples I write this code: HAL_FLASH_Unlock(); ee_status = EE_Init(EE_FORCED_ERASE); if(ee_status != EE_OK) { Error_Handler(); } VarValue = 3; for (Index = 1; Index < NB_OF_VARIABLES+1; Index++) { ee_status = EE_WriteVariable32bits(Index, Index*VarValue); /* Start cleanup polling mode, if cleanup is needed */ if ((ee_status & EE_STATUSMASK_CLEANUP) == EE_STATUSMASK_CLEANUP) {ErasingOnGoing = 0;ee_status|= EE_CleanUp();} if ((ee_status & EE_STATUSMASK_ERROR) == EE_STATUSMASK_ERROR) {Error_Handler();} } for (uint8_t idx = 0; idx < NB_OF_VARIABLES; idx++) { // Virtual address arranca en 1 ee_status = EE_ReadVariable32bits(idx+1, &VarValue); if (ee_status != EE_OK) {Error_Handler();} } /* Lock the Flash Program Erase controller */ HAL_FLASH_Lock(); I unlock the flash, the Init the EE emulation,
Hello, while testing the STM32Cube Ux_Device_* examples for STM32C071, I have encountered an issue of them not properly finishing USB enumeration. For example, both Ux_Device_HID and Ux_Device_HID_Standalone stall after the configuration descriptor phase (data from Wireshark):167 14.656560 host 1.255.0 USB 36 GET DESCRIPTOR Request DEVICE168 14.656844 1.255.0 host USB 46 GET DESCRIPTOR Response DEVICE169 14.656879 host 1.255.0 USB 36 GET DESCRIPTOR Request CONFIGURATION170 14.657134 1.255.0 host USB 37 GET DESCRIPTOR Response CONFIGURATION171 14.657158 host 1.255.0 USB 36 GET DESCRIPTOR Request CONFIGURATION172 14.657420 1.255.0 host USB 62 GET DESCRIPTOR Response CONFIGURATION173 14.657449 host 1.255.0 USB 36 SET CONFIGURATION Request174 14.658090 1.255.0 host USB 28 SET CONFIGURATION Responsewhile the Ux_Device_CDC_ACM passes the enumeration properly:9 38.457333 host 1.51.0 USB 36 GET DESCRIPTOR Request DEVICE100 38.457651 1.51.0 host USB 46 GET DESCRIPTOR Response DEVICE101 38.45770
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.