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
This should be possible, in the code which moves data from the ETH controller's buffers to LWIP's buffers.I am aware of the BFD bit of ETH_MACFFR solution, which works, but it makes the box useless unless it is addressed by MAC# directly. The broadcasts do need to be processed by the CPU at least for switches etc to work. I just want to not pass them to LWIP.The source for my current code is below and I will offer $100 to anyone who delivers a working solution : - )I don't really understand this code in detail; it is standard stuff from ST Cube MX and ST ETH-LWIP interfacing documents, with various patches from this forum and elsewhere applied. It uses polling instead of interrupts, partly because I never found properly a working interrupt version and partly because this approach auto protects from a too-rapid rx traffic.Thank you in advance./** * @brief Should allocate a pbuf and transfer the bytes of the incoming * packet from the interface into the pbuf. * * @param netif the lwi
I am trying to configure my STM32H743ZI2 to work with a microSD card. For data logging purposes. schematic of the SD card adaptor:I configured the following in CUBEMX:SDMMC1 as SD 4 bits Wide bus with SDMMC1 global interrupt enabled (all other settings are default)FATFS mode SD Card with everything default.Changed stack and heap size : 0x400 heap size, 0x800 stack size.My clock config:When i run the following code :void SystemClock_Config(void); /* USER CODE BEGIN PFP */ /* USER CODE END PFP */ /* Private user code ---------------------------------------------------------*/ /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ /** * @brief The application entry point. * @retval int */ int main(void) { /* USER CODE BEGIN 1 */ FRESULT res; /* FatFs function common result code */ uint32_t byteswritten, bytesread; /* File write/read counts */ uint8_t wtext[] = "STM32 FATFS works great!"; /* File write buffer */ uint8_t rtext[_MAX_SS];/* File read buffer */ /* U
Hi all!I'm working with an STMF401CC chip, and all tools up to date as of today.Code generation calls above mentioned function in SystemClock_Config() in main.c.In stm32f4xxhal_pwr_ex.c this function clearly is not available for STM32F401 devices, but for others.This does not happen when not using X-CUBE-AZRTOS in the project. So i assume it is caused by X-CUBE-AZRTOS code generation.Best regards
i had I2S 16bit out in slave mode running, but with 32bit data no success. always wrong byte order. so i try SAI , slave mode, 32bit data. but nothing coming from SAI....check with DSO.also DMA -> callbacks for half + full buffer never triggered.i dont know, what i am doing wrong, anyone can help ?i did (CubeIDE -> HAL ...) :init from HAL: MX_SAI1_Init();callbacks: HAL_SAI_RegisterCallback(&hsai_BlockA1, HAL_SAI_TX_HALFCOMPLETE_CB_ID, HAL_SAI_TxHalfCpltCallback); HAL_SAI_RegisterCallback(&hsai_BlockA1, HAL_SAI_TX_COMPLETE_CB_ID, HAL_SAI_TxCpltCallback);DMA init: fresult = HAL_DMA_Init(&hdma_sai1_a);start DMA: fresult = HAL_SAI_Transmit_DMA(&hsai_BlockA1, (uint8_t *)playbuf , (sizeof(playbuf))/2);i think, SAI should run now and via callbacks data send...but nothing happens.whats wrong , missing... ??
I am using STM32L151C6U6A device, both UART ports are used as RS485 ports. I am trying to boot from system memory and talk to bootloader using a USB-RS485 converter from my PC. Access to Boot0 pin is not possible in my hardware. So I am jumping from my application to bootloader by just forcing it to boot from system memory address by calling the below function as my first line of code in main().void vSystemInit(void){ /* Check if we should go into bootloader mode. * * Set the main stack pointer __set_MSP() to its default value. * * Note that 0x1FFFC400 is "System Memory" start address for STM32F042 */ if (u32UbootKey == 0xDEADBEEF) { u32UbootKey = 0xCAFEFEED; __set_MSP(0x20004000); // set main stack pointer to start of stack // // 0x1FF00000 is "System Memory" start address for STM32L151 void (*SysMemBootJump)(void) = (void (*)(void)) (*((uint32_t *)
I want to configure one STM32F091RCT6 as master and 2nd as slave.I have used Cubemx to generate code.In Master I use HAL_StatusTypeDef HAL_SMBUS_Master_Transmit_IT(SMBUS_HandleTypeDef *hsmbus, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions) I call the above function with required parameters in while(1).So should I use HAL_SMBUS_IsDeviceReady(SMBUS_HandleTypeDef *hsmbus, uint16_t DevAddress, uint32_t Trials, uint32_t Timeout)To check if slave is ready or not and then call the master transmit but IsDeviceready is a blocking function?Also I am not able to understand what is Xferoptions? SMBUS_NEXT_FRAME ((uint32_t)(SMBUS_RELOAD_MODE | SMBUS_SOFTEND_MODE))#define SMBUS_FIRST_AND_LAST_FRAME_NO_PEC SMBUS_AUTOEND_MODE#define SMBUS_LAST_FRAME_NO_PEC SMBUS_AUTOEND_MODESMBUS_FIRST_FRAME_WITH_PE ((uint32_t(SMBUS_SOFTEND_MODE|SMBUS_SENDPE_MODE
Hi,I am developing an application with one configuration descriptor & 2 interfaces with 2 endpoints each. The endpoint (CUSTOM_HID) that comes as default while setting up the project via cubeIDE seems to be working alright. I can send and receive data correctly in this interface.But when I add another interface with two of its new endpoints, the transmission (from device to host) using the in endpoint does not work & generates a pipe error on linux (libusb). Any idea why this could be occuring? Do I need to enable the macro indicating that I want to make the USB device a composite one?Thanks
We have custom board based on STM32h745XIH6. We have configured our board to be in USB device mode operating in USB_OTG_HS (480 mbps) and registered it as Mass Storage device. The device is getting discovered as "USB mass storage device" on PC. We have a custom USB drivers for the PC side so we have changed the class to "0x00"(UsbInterface). With this the board is getting discovered as our own device specified in the USB drivers on PC. The issue that we are facing is we are unable to transmit the data from the board(USB device) to the PC(USB Host). We have used a USB analyzer to monitor the packets to and from. Our custom GUI is able to transmit the packet from PC to board but after the first packet has been transmitted the endpoint are getting stalled and after that even if we send the data, the status register (OTG_GRXSTSP) is recognizing the packet as setup packet not data packet.It would be really helpful if someone shared any method to transmit and receive the data via USB
Title edited - please don't put the whole question in the title!I have created custom game controller using usb hid device. Now I want send data to device to host. Can any one help me ??
Hello,I found a strange behaviour now in my code. When I initialize my UART3, I can communicate with my terminal as expected. During runtime, I call the function HAL_TIM_PWM_Start_IT() to start timer 1. After this call, the received characters are not same as before. When I step through the code, I found within the HAL_TIM_PWM_Start_IT() function the call to enable the timer (line 1623), which causes this change of my parity settings.This is my function call.printf("\033[2;1H ==>> Correct output"); if(HAL_OK != HAL_TIM_PWM_Start_IT(&htim1, TIM_CHANNEL_1)) Error_Handler(); printf("\033[3;1H ==>> What happend now?");When I start debugging, it ends here in stm32h7xx_hal_tim.c (lines are added by me, just for this box).1620 tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; 1621 if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) 1622 { 1623 __HAL_TIM_ENABLE(htim); 1624 }Register from UART3 beforeand after the function call. Here are my settings for the UARThuart3
Hi. I hope this is the right place for such a question about USB communication, I am still new to STM32.I have been trying to send a message from my STM32 board (STM32756-EVAL) without using UART, but the OTG USB. I have been trying to set up my PuTTY to read the data sent from the board, but I am not sure which COM port should be used, or what the connection type should be.My code is based on my understanding of UART but translated into (what I think is) the USB OTG context. Please let me know if more information is required.int main(void) { /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* Configure the system clock */ SystemClock_Config(); /* Configure the peripherals common clocks */ PeriphCommonClock_Config(); /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_FMC_Init(); MX_I2C1_I
STM32Cube FW_F4 V1.27.1HAL ETH LWIPfileethernetif.c HAL_ETH_Start(&heth); line 880 if(linkchanged) { /* Get MAC Config MAC */ HAL_ETH_GetMACConfig(&heth, &MACConf); MACConf.DuplexMode = duplex; MACConf.Speed = speed; HAL_ETH_SetMACConfig(&heth, &MACConf); HAL_ETH_Start(&heth); netif_set_up(netif); netif_set_link_up(netif); }Fix: HAL_ETH_Start_IT(&heth);
Hi ST guys,There seems to be an issue with the "ethernet_link_thread" generated for my particular use-case from CubeMX. As generated,the Ethernet link will not restore the link UP state after being disconnected during run time. My .ioc and workaround are attached below.Cheers,Trifonif(linkchanged) { osSemaphoreRelease(RxPktSemaphore); // in some cases the semaphores were stuck taken... osSemaphoreRelease(TxPktSemaphore); // ...so force-release them here linkchanged = 0; // linkchanged was never given zero value after intialization /* Get MAC Config MAC */ HAL_ETH_GetMACConfig(&heth, &MACConf); MACConf.DuplexMode = duplex; MACConf.Speed = speed; HAL_ETH_SetMACConfig(&heth, &MACConf); HAL_ETH_Start_IT(&heth); // My project uses FreeRTOS, but code was generat
I use ADC with DMA in cirular scan mode to convert two audio-channels triggered by a timer. This all works well with expected results and quality most of the time.For power-saving reasons I have to change the clock tree in runtime. This may screw up channels as dma clock will not be continuous in this case. Therefore I tried to Stop and Start the ADC-DMA-Conversion with HAL functions whenever clock tree has changed. But I realize that also when no clock tree changes are made. (disabled that code) The stopping and immediate starting of ADC-DMA conversion may lead to mixed up channels (so rank 0 being on pos 1 in mem and rank 1 being on pos 0). In my case this may lead to total malfunction of the device as audio channels are swapped. However I even don't find a way to detect if that issue happened. There are no Error-IRQ's or something fired neither on DMA nor on ADC. All registers are looking the same as if there was no error. The only dirty work-around I can imagine for now is to confi
I'm currently starting to use ThreadX / AzureRTOS on a STM32 Nucleo-H723ZG (STM32H723ZG MCU).I noticed that when loading the Nx_TCP_Echo_Server / Nx_TCP_Echo_Client projects from CubeMX, the RAM gets filled up pretty much to the top, which makes me wonder, how I'm supposed to add my own code and data here.Since I'm pretty new to RAM partitioning, RTOS and similar, I don't have a perfect feeling for what is wrong or right and how to proceed (and if it is a problem at all). Nevertheless I wonder, if maybe using a different way of partitioning the RAM or by dropping some non-necessary code-parts, the RAM could be freed-up.Or a different way of thinking:Since RAM_D1 got filled, but _D2, _D3 and DTCMRAM are pretty much empty, is there a way to use the free RAM for my own purposes (I would like to let SPI and ADC processing run via DMA, so this needs a place to go ....)Hope my questions are not too confusing ;)The system has the following amount of RAM, according to STM:"SRAM: total 564 Kbyt
There are several examples available in the repo. None of them work even though they are designed to work with the STM32F746 DISCO board. I use IAR to flash the board. Any suggestion?
Hi,is it possibility to show a list of files and folders with the fatfs library?Like "ls" in the console.
Roughly 10 years ago, my experience using VirtualBox, with the development stuff running in it, and trying to debug, ... well the bottom line was basically "doesn't work".While common, widely used & supported USB devices such as mouse and keyboard HIDs connected to the host machine have been working well within the VBox guest (otherwise it would be plenty useless ;) ), more "niche" USB devices such as FTDI, ST-Link or Keil debuggers for STM32, were extremely unreliable or didn't work at all, and our whole team back then couldn't resolve the issues and we gave up on that.Now, I don't know whether there's anything inherent in the whole setup that makes this problem eternal, or it was just the state of development of VBox and/or the involved operating systems and drivers of back then.A side note should perhaps be that the host OS back then was Windows (7).I actually am thinking about using Linux as a host in my new laptop (that is to be carried around only in special situations, not r
I am using Nucleo board and Tera term for serial monitorI want to do simple addition programI want to take two values from serial monitor by typing (number + Enter ) and print back its additionExpect output on Serial monitor:enter value A : 5enter value B : 6Sum is : 11Give me a code example
Hey allI am building an application using a STM32G071RB with a DRP1M1 as ucpd 0 and a USBDP1 (old SNK1M1) as ucpd 1 and new to the STM UCPD worldIn an attempt to start from a working base, I used the DRP1M1_DRP example project as a starting point. This works until I change the "USBPD_PORT_COUNT" in the .cproject file to "=2" at witch point the the running board stops being picked up by cubeMonitor After that I created a blank project to see if I could get both ucpd's working. The system only seems to work when cmsis v2 is used.The DemoUCPD example seems to run on cmsis v1, so my my question is there something I missed setting to get two ports on cmsis v1?These are the changes to the DRP1M1_DRP example so far-the additional PDO lists for port 1, in pdo_defs-adition of an ADC channel for sink vbus-setting "USBPD_PORT_COUNT=2" in the .cproject fileThanks
Hi everyone, Hope all is well. I am trying to setup a basic SPI demo for the STM32H753ZI using the nucleo H753ZI just seeing if I can output my test word onto the MOSI line.The conditions in my SPI demo is as follows:MCU clocked at 400MHzSPI is set as Full Duplex MasterSPI Clocked at 400MHz/256 = 1.5625MHz approxPA4 = SS, PA5 = CLK, PA6 = MISO, PA7 = MOSITheres no slave on the otherend just hooked up to the Salae logic Analyzer The issues I am seeing is that My SPI demo and STs theres no data on the MOSI line additional to that the CLK is behaving super weird in my SPI demo. You can see boths STs and My SPI demo down below from the logic anayalzer void initSPI() { LL_AHB4_GRP1_EnableClock(LL_AHB4_GRP1_PERIPH_GPIOA); LL_AHB4_GRP1_EnableClock(LL_AHB4_GRP1_PERIPH_GPIOB); LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_SPI1); LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_SPI2); LL_GPIO_InitTypeDef LL_GPIO; LL_SPI_InitTypeDef LL_SPI1; LL_SPI_InitTypeDef LL_SPI2; &nbs
..
Hi On STM32H750XB datasheet it says 2 x USBUSB OTG interfaces (1FS, 1HS/FS) .I configured the 1st port as FS, and the 2nd port as HS which connectd to external PHY (internal FS phy disabled) .I want to confirm that if the 2 ports can be used at different speed (1 as FS and 1 as HS) at the same time just for sure.Thanks
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.