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
Hi everyone I am using stm32l496 and I am trying to disable all the interrupts while running sensative routines. to disable all the interrupt I am using __disable_irq and to enable them __enable_irq.But nothing seems to happen, even after I use disable in one of the task the interrupts still functions. Now I checked what __disable_irq is actually doiung and in the comments it is written that it can only be excecuted in Privileged mode, now I have no idea what this mode is even or how can I switch to it.
Hi,Our project is using STM32H750 together with µC/OS-III as the OS and µC/TCP-IP as the network stack.The device is able to be assigned with an IP address by DHCP server.And the device can respond to ping initially.But if we ping the device continuously, it will be kind of like disappearing from the network and no longer able to respond to the ping.From IAR debugger, the Ethernet interrupt is still working. And we can still see the UDP packets are passed to µC/TCP-IP network stack.But the network stack will no longer receive any ICMP (thus not responding to ping) or TCP packets.What are things that could possibly go wrong here. Appreciate any suggestion on the areas that we should check.rgds,kc Wong
Hi. I'm using an STM32H7, and I have the d-cache DISABLED in cubemx, but __DCACHE_PRESENT seems to always be set to 1 by stm32h755xx.h, anyway, and as a result, I'm getting a hardfault when X-CUBE-AZRTOS-H7 ethernet init calls SCB_CleanDCache_by_Addr().If I just modify the code to set __DCACHE_PRESENT to 0, everything works fine. Why is this definition being set even though I have the d cache disabled? Do I still have to worry about the cachability settings in the MPU even when the dcache is disabled, and could that be the problem that I just have something configured there wrong?Either way, I shouldn't need to clean the dcache when it's disabled, right? So why is the auto-generated code even wasting its time doing that?In the azure rtos port, we have:#if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) SCB_CleanDCache_by_Addr((uint32_t*)(pktIdx -> nx_packet_data_start), pktIdx -> nx_packet_data_end - pktIdx -> nx_packet_data_start); #endifShould it instead be c
I am attempting to debug an Azure RTOS example (NX_TCP_Server_Echo) but I am not receiving any messages on the VCOM port. In device manager I can see that the STLink Virtual Com Port is assigned to COM8 at 115200 bps. So I attach my Hercules Setup utility to Serial COM8 at 115200 bps. But when starting the debug session I receive no messages. So I cannot attach remotely to the target server application.Is there some magic configuration parameter that needs to be set in order to use the VCOM port?
I have adapted the Nx_Azure_IoT example for my board with an STM32U585QII6Q. My problem is that every time STM32CubeMX regenerates the code, it deletes three files that I added: nx_tcp_socket_driver_establish.c, nx_tcp_socket_driver_packet_receive.c and nx_udp_socket_driver_packet_receive.c. I have checked the NETXDUO settings in the example of the nx_udp_socket_driver_packet_receive.c board and those of my board and they are identical. Why does the original project include these files and mine doesn't?Thanks
Hello,I am trying to implement an ADC init and read in interrupt mode.I have a very basic setup where I read an analog entry from a potentiometer and print its raw converted value.When I first implemented it with HAL, I had no issue and could read values that smoothly evolved from 0 et 65535 (16 Bits) as I tweaked the potentiometer.Then I tried reimplementing my code using the Low Layer (LL) Library and as I read from the ADC, I can only read 3 values: 32767, 49151, 65535.Here is a snippet of my code :void ADC_Init(void) { LL_ADC_InitTypeDef ADC_InitStruct = {0}; LL_ADC_REG_InitTypeDef ADC_REG_InitStruct = {0}; LL_ADC_CommonInitTypeDef ADC_CommonInitStruct = {0}; LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; LL_RCC_SetADCClockSource(LL_RCC_ADC_CLKSOURCE_PLL2P); // Peripheral clock enable LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_ADC12); //ADC1 GPIO Configuration LL_AHB4_GRP1_EnableClock(LL_AHB4_GRP1_PERIPH_GPIOA); GPIO_InitStruct.Pin = LL_GPIO_PIN_
Hello,I have read the RM0091 and some posts on the forums, i.e.: https://community.st.com/s/question/0D50X00009XkgYiSAJ/stm32f042-usb-what-is-activate-oe?t=1672784003313With all that, I am still unable to understand what is the USB_NOE functionality for, like exactly...?I would appreciate all help...
Hi,We are using STM32H750XB MCU with the STULPI01A, external High-speed USB ULPI transceiver.Is there a way to access STULPI01A registers from firmware running on the MCU ?rgds,kc Wong
I am attempting to use an Azure RTOS Nx_TCP_Echo_Client example in CubeIDE V1.11. I create a FILE->NEW->STM32 Project, then select the Nx_TCP_Echo_Client example from the Examples List in the Target Selector for my NUCLEO-F767ZI board. I then create the example project in my workspace (using STM32Cube FW_F7 V1.17.0). But the Azure RTOS files do not download into my project. What I am doing wrong?
Hello ,I want to connect (M02 weight indicator) with my controller(STM32F779BI) through MODBUS TCP/IP protocol.I am using microcontroller as client and weight indicator as server. I can't able to read data from server. server is not responding with any of data. I want to clear that server is connected successfully. One more thing I want to clear that with this microcontroller as master I able to read and write data to mbslave(application which is work as Modbus server) Modbus Frame : 0x01 0x02 0x00 0x00 0x00 0x06 0x01 0x03 0x00 0x0b 0x00 0x01Thank you.
1- Using cubre-mx I enabled two IRQ lines, each generate its own ISRvoid EXTI0_IRQHandler(void){ HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_0);}andvoid EXTI15_10_IRQHandler(void){ HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_0);}Why HAL joint together both IRQ handlers in one function, isn't better to use two separate functions ?2 - Later why use the name callback, this name should be reserved for functions used as parameter on functions?
Hello, I'm exploring a new STM32L4S Discovery kit IoT node. After attemped to connect AWS but failed, the original Web server demo FW was erased. I appreciate your guidance regarding:How to restore the demo FW?Where can I get some basic CubeIDE examples for B-L4S5I-IOT01A?Thanks in advance,pic1: web demo fw goodpic: web demo fw broken
processing full erase cycle helps, but still have no idea, why device enters such condition!Please help!
..
I am trying this example on my STM32F769I-DISCO. I followed the given tutorial for adding the dependecy. wm8994 is in ../Components/wm8994/wm8994.h. But when building the code I am getting ../stm32disco/test2_audioread/Debug/../Core/Src/main.c:1263: undefined reference to `wm8994_drv'Tutorial link : https://wiki.st.com/stm32mcu/wiki/STM32StepByStep:Getting_started_with_analogEdit: When I looked the header file it is defined as extern. So it may be a problem how it can be resolved. /* Audio driver structure */extern AUDIO_DrvTypeDef wm8994_drv;#endif /* __WM8994_H */
Hello, I'm attempting to flash firmware to aforementioned microcontroller using STM32CubeProgrammer. I have connected ST-Link VCP port to PA2 and PA3 ports, and i can communicate with my application fine. I even erased flash memory so I could be sure that device is in Boot mode. Unfortunately, I cannot connect to bootloader, log from Programmer below: 13:48:06 : Serial Port ttyACM0 is successfully opened. 13:48:06 : Port configuration: parity = even, baudrate = 115200, data-bit = 8, stop-bit = 1.0, flow-control = off 13:48:08 : Timeout error occured while waiting for acknowledgement. 13:48:08 : Timeout error occured while waiting for acknowledgement. 13:48:08 : Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again... I'm wondering if listing both PA9/PA10 and PA2/PA3 as UART ports in documentation has anything to do with it. How does bootloader determine which of both pairs to use? Can pull
This is the data I recorded with WireShark. As shown in the picture, when I send HID packet once (len=91), the USB will send empty data packets indefinitely (len=27), then trying to send packets from host to device (out direction) will cause the transmission to fail. The USB middleWere was done by the CubeMX plus modifications that needed to support 64 bytes packets for custom HID.I can’t find a way to stop or solve it.Need to mention that this kind of problem has never appeared when doing the same on STM32F103.
I was getting strange results with the deadtime prescaler of the H7 hrtim and it appears that the H7 reference manual (RM0433 rev 7) is incorrect: The DTPRSC field of register HRTIM_DTxR, is supposed to get binary values from 011 to 111 (000 to 010 are reserved) which correspond to multiplication of the tHRTIM by 1, 2, 4, 8, and 16. The provided formula is tDTG = 2^(DTPRSC - 3) * tHRTIM.But, when I set the prescaler to the HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL8 define from HAL, it places a 0 in DTPRSC, while according to RM0433, it should have been 0b110 (= 6). Then when I used HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL4, it wrote 1 in DTPRSC, and so on. There is not a XX_MUL16 defined. The actual deadtime is scaling in the oposite direction! The delay with MUL8 is half of the delay with MUL4, which is half of that with MUL2, ....Therefore the actual formula is tDTG = 2^(DTPRSC) * tHRTIM, so the -3 should not be in the exponent and the values of 0b000 to 0b010 are valid. (Probably the h
Hi,I am using RTC with LSE (32.768Khz) in my product, and I programed RTC wakeup timer to 5min by calling HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 300, RTC_WAKEUPCLOCK_CK_SPRE_16BITS);It works perfectly on my test machine, but it will not trigger on my customer side with identical firmware.I have checked the return value from HAL_RTCEx_GetWakeUpTimer() is 300 for sure.Is there any reason make RTC stop counting this timer or stop this feature?Thanks,-Engin
I am trying to implement a cdc device and would also like to use the FreeRTOS. For code generation I use CubeMX. To keep the interrupt of the receives as short as possible I want to send the answer to the host using a task. But after a few seconds my host receive an invalid answer. Is there a simple example that shows how to combine the UBS Device library with FreeRTOS ?Regards,Lena
Hi,I am new to HAL libraries and currently working on a small CAN bus consisting of two STM32F4-discovery boards connected to a CAN transceiver connected to the bus. Both transceivers are externally powered with 5V.So far, I tried the existing CAN examples from the STM32CubeF4 github. The loopback example works fine, the normal mode example does not. After a few transmissions the mailboxes are filled and the transmit function returns an error. And I can't figure out why it does not transmit the requests. Below you can find the code I on both discovery boards. It is basically the Networking example but with some light adjustments for LED output pins.Any ideas on why this might not be working as expected?#include "main.h" #define KEY_PRESSED 0x00 #define KEY_NOT_PRESSED 0x01 uint8_t ubKeyNumber = 0x0; CAN_HandleTypeDef CanHandle; CAN_TxHeaderTypeDef TxHeader; CAN_RxHeaderTypeDef RxHeader; uint8_t TxData[8]; uint8_t RxData[8]; uint32_t TxMailbox; void SystemClo
I got my SPI5 running the way I want it but now I want to move to DMA. When I do this the SPI lines remain low after sending its data. So I assume my config is off. Using the IOC to make changes I only see the fowling added. /* SPI5 DMA Init */ /* SPI5_TX Init */ hdma_spi5_tx.Instance = DMA2_Stream3; hdma_spi5_tx.Init.Request = DMA_REQUEST_SPI5_TX; hdma_spi5_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; hdma_spi5_tx.Init.PeriphInc = DMA_PINC_DISABLE; hdma_spi5_tx.Init.MemInc = DMA_MINC_ENABLE; hdma_spi5_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; hdma_spi5_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; hdma_spi5_tx.Init.Mode = DMA_NORMAL; hdma_spi5_tx.Init.Priority = DMA_PRIORITY_VERY_HIGH; hdma_spi5_tx.Init.FIFOMode = DMA_FIFOMODE_DISABLE; if (HAL_DMA_Init(&hdma_spi5_tx) != HAL_OK) { Error_Handler(); } __HAL_LINKDMA(hspi,hdmatx,hdma_spi5_tx); /* SPI5_RX Init */ hdma_spi5_rx.Instance = DMA2_Stream
How configure port ,how get _port_status work,
char *data = "Hello World"; while (1) { HAL_GPIO_TogglePin(LD2_GPIO_Port,LD2_Pin); HAL_Delay(1000); CDC_Transmit_FS((uint8_t*)data,strlen(data)); }uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len) { uint8_t result = USBD_OK; /* USER CODE BEGIN 7 */ USBD_CDC_HandleTypeDef *hcdc = (USBD_CDC_HandleTypeDef*)hUsbDeviceFS.pClassData; if (hcdc->TxState != 0){ return USBD_BUSY; } USBD_CDC_SetTxBuffer(&hUsbDeviceFS, Buf, Len); result = USBD_CDC_TransmitPacket(&hUsbDeviceFS); /* USER CODE END 7 */ return result; }I'm trying to transmit MPU6050 sensor readings to my computer via virtual comport.I'm using STM32 Nucleo F446RE. As far as i can see in debug mode there is no issue in sensor and sensor readings. Problem is I can't transmit them using USB. Are there anyone who have experienced this issue before?
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.