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 friends,I'm new to the H series and CanOpen. I found the CanOpen Node stack sample structure on Github. I did some experiments on this. But I cannot see the data.Data always comes as zero and dID =723, but my ID is 123. Can anyone help me on how to send the data and manage TPDO? I cannot find the data in the objects in the OD.c file. Thank you in advance.https://github.com/CANopenNode/CanOpenSTM32/tree/master/CANopenNode_STM32
Hi, I would like to know the procedure to execute specific functions from RAM.I have tried __ramfunc at beginning of the function but it requires all the subsequent functions also to be run from RAM. This would require lot of manual code updates. Is there a way to do it from linker script? I tried placing the functions like below but it would not move the function from ROM to RAM.place in RAM_region { readwrite, block CSTACK, block HEAP, readonly object function1 // this is my expected function to run from RAM};
Tôi hy vọng mọi người có thể giúp đỡ. Nếu tôi chưa cung cấp đủ thông tin, vui lòng yêu cầu thêm.
I am writing the code stm32H7ZIT6 based master to control slaves based on LTC6810 ic. Although, I am getting errors while importing the specific LTC libraries needed for making this setup work. I am trying to import specifically these libraries 1. LT6810.h2. LT681x.h3. LT_SPI.h 4. Linduino.hbut all these are dependent on arduino-based libraries. I have limited experience with stm32, can you help me with what I am doing wrong.
Hello,I am implementing the use of the DMA for receiving data from the UART on a board with an STM32G491 that is constantly receiving data at 19200 baud.The DMA is configured in normal mode, and the receive buffer is currently of 50 bytes.Each time the buffer fills up, in the HAL_UART_RxCpltCallback interrupt I enable a flag to handle data in the main loop and in the same interrupt I call HAL_UART_Receive_DMA to re-enable reception.The problem comes when in this call returns HAL_BUSY because the DMA reception is blocked waiting for HAL_UART_Receive_DMA to be called again to restart the reception.I don't understand why I get this response (HAL_BUSY), nor how to deal with it.If I configure the DMA in circular mode I always receive the HAL_BUSY response and therefore the reception does not work.Any idea what I can be doing wrong?Thanks in advance,
I hope this email finds you well. I am currently working with the STM32 NUCLEO F429ZI and encountering challenges with Ethernet connectivity. Specifically, I am looking for example projects demonstrating how to connect STM32 to Ethernet, both using a fixed IP and DHCP.
Hi,I am using STM32CubeIDE and an ST-LINK V2 to program a custom board that runs off an STM32WB10cc chip. After flashing the program onto the board, the board resets and the program runs as expected, including a BLE. However, if I then unplug the board and power it on again, the program behaves unusually. The general program logic is as expected, including the Bluetooth stack, but it seems as though some of the program's data has become corrupted. To be specific: the project includes a ~14kb chunk of data (defined as array of const uint8_t) which is used to program an ICM-20948 via I2C at runtime. Once the transfer is done, the STM32WB10cc is able to read data generated by the program on the other chip, which is processed and then set as the value of a BLE characteristic. This works properly when freshly flashed, but when the board is powered off and powered on the data read from the other chip becomes jumbled, which I know to be the case because what should be four doubles that form a
Posted on October 13, 2017 at 14:10Hello,I am trying to make a rest api for my stm32f controller. I am using the lwIP library for the Ethernet connection.I looked at the STMCube applications with the lwIP library, but it works with .(s)html web pages.i want to make a web interface that can be used for remote IO, settings and reading pins/data.I want to send the data in JSON strings.The data of LED 1 has to be set my styping into a web browser: http://10.1.0.113/LEDS/1/1.Does anyone know how to make REST API's for the stm32?Greetings,Angus Schmaloer#REST # API #STM32 #lwIP
The HAL_FLASH documentation is especially poor. There in no overview of what you have to do. You would think (because of lack of anything saying different) you have to HAL_FLASH_OB_Unlock()HAL_FLASH_Program(...)HAL_FLASH_OB_Lock()The first command HAL_FLASH_OB_Unlock() crashes. HAL_FLASH_Program(...) says the format is HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data)Nowhere in the HAL Documentation's (UM1940) 1441 pages does it say what "TypeProgram" is, what it is used for, or what it should be. It says TypeProgram indicates the way to program at a specific address. The value can be a value of FLASH Type Program. What is FLASH Type Program? On page 234 it has FLASH Type ProgramFLASH_TYPEPROGRAM_BYTEFLASH_TYPEPROGRAM_HALFWORDFLASH_TYPEPROGRAM_WORDFLASH_TYPEPROGRAM_DOUBLEWORDI cannot program that with a byte or a halfword, or a word. it can only be a word.Looking into the code for HAL_FLASH_Program() in stm32g0xx_hal_flash.c it says /** *
I ran Ux_Host_CDC_ACM project from https://github.com/STMicroelectronics/STM32CubeH5.git on STM32H573I-DK board, inserted an EC800G (Quectel LTE USB dongle) to STM32H573I-DK via USB port, expecting the STM32H573(USB CDC host) to control the EC800G(USB CDC device). However, I noticed that after the device was connected, a UX_DEVICE_REMOVAL event was triggered, which caused the CDC ACM object to be released. I'm not sure why this is happening. Below is the log from the STM32H573:============================Simple Interface initializedPID: 0x3004VID: 0x2eccCDC Data Interface initializedUX_DEVICE_REMOVALMX_USBX_Host_Init OK !!!!!!!!**** USB DRD CDC Host ****USB Host library started.Starting CDC ApplicationConnect your CDC Device*** Device descriptor ***bDescriptorType 1bcdUSB 512bDeviceClass 0x2bDeviceSubClass 0x2bDeviceProtocol 0bMaxPacketSize0 64idVendor 0x2ECCidProduct 0x3004bcdDevice 0iManufacturer 1iProduct 2iSerialNumber 3bNumConfigurations 1 *** Interface descriptor ***
Hello,I made a Motor Driver Circuit and I want to read the ADC via DMA, but it has different settings compared to other microcontrollers such as F4, G4, F0. How can I do it or is there a code or video that can be an example? STM32F042C6U6 SettingsOther MCU`s Settings
Are there any issue using both controllers in host mode? USBH_StatusTypeDef USBH_LL_Init(USBH_HandleTypeDef *phost) { /* Init USB_IP */ if (phost->id == HOST_FS) { /* Link the driver to the stack. */ hhcd_USB_OTG_FS.pData = phost; phost->pData = &hhcd_USB_OTG_FS; hhcd_USB_OTG_FS.Instance = USB_OTG_FS; hhcd_USB_OTG_FS.Init.Host_channels = 16; hhcd_USB_OTG_FS.Init.speed = HCD_SPEED_FULL; hhcd_USB_OTG_FS.Init.dma_enable = DISABLE; hhcd_USB_OTG_FS.Init.phy_itface = HCD_PHY_EMBEDDED; hhcd_USB_OTG_FS.Init.Sof_enable = DISABLE; // GW8RDI NOTE todo try with SOF if (HAL_HCD_Init(&hhcd_USB_OTG_FS) != HAL_OK) { Error_Handler( ); } USBH_LL_SetTimer(phost, HAL_HCD_GetCurrentFrame(&hhcd_USB_OTG_FS)); } return USBH_OK; }
Working on an audio device using STM32H750 with USB3300, using TinyUSB stack.Either it works perfectly, or there is no ULPI communication.In the latter state, STP, DIR and NXT are all solid high and nothing moves. I can unlock it by pausing the program and manually toggling PC2SO in the SYSCFG register. This is equivalent to electrically disconnecting and reconnecting the DIR line, thus fooling the OTG peripheral into thinking that DIR has gone low. STP and NXT follow suit. I can then resume the program and all works nicely.So it seems there's a state where the MCU is waiting for DIR to go low, and the PHY is waiting for STP to go low.I'd find it a bit of a kluge to add the DIR disconnect/reconnect trick to the code, so I was wondering if anyone knows of a common error in the setup procedure that could cause this kind of deadlock.
Hi all, I put together a custom bootloader for my application (to allow the program to update itself). The bootloader itself is incredibly simple. It just reads from a known location in flash to determine which address to load from and then attempts to boot to that address. The main() function for that bootloader is included below (the rest of the code is auto generated minus some defines):int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MPU Configuration--------------------------------------------------------*/ MPU_Config(); /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ /* USER CODE BEGIN 2
Hello,I am working on device USBX cdc acm with stm32h573i-dk. I am progressing my work from the example in the attachment below.After creating the project as in this example, I ran the software and no Com Port appeared on my computer. Also no error_handler is generated and scheduler is working correctly.I am waiting for your help on where the error is.Best Regards. https://community.st.com/t5/stm32-mcus/how-to-implement-the-usb-device-cdc-vcom-in-stm32-using-the/ta-p/599170
How can I achieve optimal range for LoRa node-to-node communication? I'm using the RFM95 module at a frequency of 932 MHz but experiencing very poor range—data transmission cuts out at only 4 feet. I have a compatible antenna, which is properly soldered as well.
Hello, I am trying to implement a STM32 based pad assessment functionality, in which the applied force should be converted to the velocity based on user set polynomial degrees as in below image. I have implemented the code to calculate velocity based on ADC values and apply it to pad curve functionality. But I don't have any mechanical setup to measure the force applied so I can plot the Force vs Velocity curves. I would like to get some feedback on the implementation and need some idea on how to test the same. FinalVelocity = ApplyPadCurve(user_velocity, usr_degree); uint8_t ApplyPadCurve(uint8_t velocity, uint8_t degree) { uint8_t FinalscaledValue = scaledValue; switch (degree) { case 1: // Curve deg 1 (Linear) FinalscaledValue = scaledValue; break; case 2: // Curve deg 2 (Quadratic) FinalscaledValue = pow(scaledValue, 2.0) / 100; break; case 3: // Curve deg 3 (Cubic) FinalscaledValue = pow(scaledValue, 3.0) / pow(100, 2.0); break; case 4: //
Hi,So far I have been writing my own debug library but there might be much better one out there.Does anybody know of any well known, perhaps feature-rich, debug libraries which I could use to either improve mine or use directly?Thank you :)
Hello everyone,I am currently implementing an audio synthesizer. My DAC requires the I2S protocol, which is supported by my device (F446). I want to setup a circular buffer to feed the I2S peripheral using DMA. Idealy, i want to set it up and let the DMA increases the read pointer and handle the wraparound). I require the read pointer to avoid buffer overflows, so it is crucial that i have it. I am not sure if this is possible. The circular dma mode seems like exactly what i need, but i have not found a way to make it work with a ring buffer... Is there another way to do it properly? If i simply could access the internal read pointer from the DMA..I thought about using a double buffer and having an interrupt fire every time a buffer is completely send. I am thankful for every inputChees
I am currently using the STM32H7B3I-DK for touchGFX development before moving to something in the STM32H743 family. I am curios about adding a simple webserver capability while running a touchGFX UI. I have implemented an httpd server on an Nucleo-H743ZI starting from this forum. Currently it seems to be using over 300KB of RAM (collectively from RAM_D1 and RAM_D2).I am not sure if this much RAM is being used because I have not made any optimizations (as I am new to LWIP), or if this seems like a reasonable amount for a simple web server. If this is normal amount, I am thinking it does not seem feasible to try and run touchGFX and a server from the same MCU.Does anyone have any advice on the feasibility of hosting a server and touchGFX UI from a STM32H743 MCU? Thank you,Ethan
I am new to STM32F103and My goal is to Update Firmware using Bootloader.but I do not want to use Hardware way as Pin BOOT0.I want to enter bootloader mode using Backup Register.here is my code============================if (BKP->DR1 != 0) //DR != 0 means, that boot request has been sent { uint32_t *stack_ptr = (uint32_t *)FW_ADDR; __disable_irq(); // Good idea when messing with MSP/VTOR #if 1 LL_RCC_DeInit(); #elif 0 HAL_DeInit(); #else //__HAL_RCC_AHB1_FORCE_RESET(); //__HAL_RCC_AHB1_RELEASE_RESET(); #endif SysTick->CTRL=0; SysTick->LOAD=0; SysTick->VAL=0; __set_PRIMASK(1); SCB->VTOR = FW_ADDR; #if 0 __set_MSP(*(volatile uint32_t *)FW_ADDR); #else __set_MSP(0x20001000); // Use value found at 0x1FFF0000 #endif __set_CONTROL(0); // Call the reset handler (the construct below is 'pointer to a pointer to
Posted on December 19, 2017 at 12:24 Hi, I'm using one STM32F2 board and two STM32F3 boards. The F2 is the CAN master and the F3 are slaves. Everything works fine if I use only one F3 board. If I add the other one, then after 30sec - 5min one of the F3 boards is going to always return HAL_TIMEOUT from HAL_CAN_Transmit. This is the code from HAL_CAN_Transmit that always returns HAL_TIMEOUT. /* Check End of transmission flag */ while(!(__HAL_CAN_TRANSMIT_STATUS(hcan, transmitmailbox))) { /* Check for the Timeout */ if(Timeout != HAL_MAX_DELAY) { if((Timeout == 0U) || ((HAL_GetTick()-tickstart) > Timeout)) { hcan->State = HAL_CAN_STATE_TIMEOUT; /* Cancel transmission */ __HAL_CAN_CANCEL_TRANSMIT(hcan, transmitmailbox); /* Process unlocked */ __HAL_UNLOCK(hcan); return HAL_TIMEOUT; } } }�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�? I'm using STM32CubeF3 V1.9.0 Here is a snapshot of my CAN registers right before the return HAL_TIMEOUT; #can-bus #stm32-f3 #hal #
Within USBH_MSC_Write() the USBH_MSC_RdWrProcess(phost, lun) loops. Loop runs into the 10s timeout (see screenshot). USBH_MSC_RdWrProcess(phost, lun) still returns BUSY for this 10s period. Status:MSC_Handle->unit[lun].state is MSC_WRITE MSC_Handle->hbot.cmd_state is BOT_CMD_WAIT MSC_Handle->hbot.state is BOT_RECEIVE_CSW_WAIT unclear: URB_Status = USBH_LL_GetURBState(phost, MSC_Handle->OutPipe) is USBH_URB_IDLEOnly reconnecting Thumbdrive releases systemEnvironment: STM32G0B0 MSC middleware
Hi,I am using Azure RTOS for my STM32H723ZGT6 to write log file to my USB pendrive. so, i am using usbx msc host and filex example code from github. File created successfully, but not opened for write, because my code returns FX_PTR_ERROR due to the (file_control_block_size != sizeof(FX_FILE). I got my file_control_block_size as 457 but sizeof(FX_FILE) is 480. How get my file_control_block_size as 480, am i missing something. Please find the code and screen shot below, UINT _fxe_file_open(FX_MEDIA *media_ptr, FX_FILE *file_ptr, CHAR *file_name, UINT open_type, UINT file_control_block_size){ UINT status;FX_FILE *current_file;ULONG open_count; /* Check for a null media or file pointer. */if ((media_ptr == FX_NULL) || (media_ptr -> fx_media_id != FX_MEDIA_ID) || (file_ptr == FX_NULL) || (file_control_block_size != sizeof(FX_FILE))){return(FX_PTR_ERROR);} /* Check for an invalid open type. */if ((open_type
Hi,We have been trying to setup DMA USART3 with the STM32H753ZI Nucleo.We would like to keep our stack in DTCMRAM and we thought we could move the USART buffer into SRAM1 or SRAM2 since DMA1 and DMA2 have access to it, following this post.We edited our GCC linker file to have a section in RAM_D2 for the buffer. We also configured the MPU to write-through the buffer region on RAM_D2 to prevent DCache from interfering with the DMA. This did not work, we tried multiple buffer positions and MPU configurations and none of them worked. /* Highest address of the user mode stack */ _estack = ORIGIN(DTCMRAM) + LENGTH(DTCMRAM); /* end of RAM */ /* Generate a link error if heap and stack don't fit into RAM */ _Min_Heap_Size = 0x200; /* required amount of heap */ _Min_Stack_Size = 0x400; /* required amount of stack */ /* Specify the memory areas */ MEMORY { DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 512K RAM_D2 (xrw) : ORIGIN = 0x30000000, LE
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.