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, I would like to have some help understanding what the measurements that i can get from the SoundMesauRments library provided in cube actually are. What does the calculated dB's actually relate to? What is 0dB in the scale?My setup is a mems mic connected through i2s which are sampled an feed into the SMR library.Kind RegardsDaniel Moberg
Hi, This is the first time im working with SMBUS peripheral and want to implement this for a project.I have gone through AN4502 document for SMBUS but im having hard time understanding stack of SMBUS module.why do we need stack for communication for just one SMBUS peripheral from STM32H7 board. whats the difference between SMBUS_StackHandleTypeDef & SMBUS_HandleTypeDef and whats use of this.i have read the 6.1 Host side point from the same document and initialised things as mentioned in it. MX_GPIO_Init();MX_SMBus_PMBus_Stack_Init();MX_I2C1_SMBUS_Init();STACK_SMBUS_Init(&hsmbus1);STACK_SMBUS_GetBuffer()MX_SMBus_PMBus_Stack_Init();STACK_SMBUS_HostCommand(&hsmbus1, 0x17, 10, 0x17);but HAL_SMBUS_IsDeviceReady fnction returning HAL_ERROR in response.can someone guide me in a right direction for this
Hello, I'm using the STM32F413ZH board to read data from the MPU6050. While the data retrieval works when I implement it in a blank project, it fails to function correctly in my current project. This project also includes two additional UART interrupts, though they are not currently connected to the system. What might be causing the issue?In this project, HAL_StatusTypeDef always returns HAL_BUSYThank You. #include "main.h" #include "string.h" #define MAX_NMEA_PROTOCOL_CHARACTER_LENGTH_ 82 I2C_HandleTypeDef hi2c1; UART_HandleTypeDef huart4; UART_HandleTypeDef huart5; UART_HandleTypeDef huart3; PCD_HandleTypeDef hpcd_USB_OTG_FS; void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_USART3_UART_Init(void); static void MX_USB_OTG_FS_PCD_Init(void); static void MX_UART4_Init(void); static void MX_UART5_Init(void); static void MX_I2C1_Init(void); HAL_StatusTypeDef hal_status_one; //THIS CODE FOR I2C uint8_t data_mpu[1] = {0x00}; //THIS CODE FOR I2C
I am running a modified TCP Echo Server on the IO Board with STM32H723ZET6 MCU, and LWIP enabled on the Board. No RTOS used. I am sending a continuous sequence of Modbus requests from the ModPoll tool to the Modbus server running on the Board. But the response contains both Echo Response and Modbus Response. I need to turn off the Echo Response and allow only the Modbus Response. Please mention how to modify the attached Echo Server for this purpose. The TCP Server is based on the source in the webpage: https://community.st.com/t5/stm32-mcus-embedded-software/how-to-send-data-lwip-tcp-server-to-client/td-p/119556 Is there any standard server source code is available using the LWIP TCP Raw Sockets, instead of an Echo Server? I have attached the TCP Server Source code file. Just for your reference, ModbusIxFace(..) function called in the TCP Server file, is given below:struct pbuf * ModbusIxFace(struct pbuf *p){MBDEFS_BOOL mbHandle;struct pbuf *pTx =
While looking at the stm32h745xihx-pinctrl.dtsi file I see the slew rate is defined for the QUADSPI pins, but the LTDC pins. Is it set to Very High speed implicitly? I would be concerned if they are set to Low Speed by default. Thanks in advance for any input.
My workI have been experimenting with ethernet with tcp server, and i got some good referance to start the basic level of communication from the follwoing pages.https://controllerstech.com/stm32-ethernet-4-tcp-server/https://community.st.com/t5/stm32-mcus/how-to-create-a-project-for-stm32h7-with-ethernet-and-lwip-stack/ta-p/49308What i have doneBased on this iam experimenting on server, on the controller iam able to do the communication with 9 server @100ms with 100bytes of data. For the server side when client sends some data server return 100 bytes of dataFor client side iam using winscok on visual studio, here iam initilizing same number of clients as in the server and transmitting data at 100ms (100 bytes)Observed packets through waveshark and there is no packet corruptionFrom the above referances some of the modification i have done is initilizing multiple instacnes at a time and pbuf and payload memory allocation at the time of connection accept, berfore it was done&nbs
Hello everyone, I'm a newbie working with STM32C031, setting up interrupt for user button (blue button) integrated on the board.I am using VS Code, GNU_ARM_GCC, and CMSIS. No hal.while setting up interrupts, interrupt priority, etc. , I am making use of CMSIS functions which use parameter IRQn_Type which defines interrupt numbers and defined interrupt number 4-15 as 7, which I do not understand.Why 7?How does shifting a "one" 7 to the left turn on interrupt 13, for example? /** \brief Enable Interrupt \details Enables a device specific interrupt in the NVIC interrupt controller. \param [in] IRQn Device specific interrupt number. \note IRQn must not be negative. */ __STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) { if ((int32_t)(IRQn) >= 0) { __COMPILER_BARRIER(); NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); __COMPILER_BARRIER(); } } typedef enum { /****** Cortex-M0+ Processor Exceptions Numbers *****************************
HAL RTC functions for the STM32L4 should, like HAL functions for other peripherals, have an IS_RTC_INSTANCE() macro and make use of it before using hrtc->Instance. assert_param(IS_RTC_INSTANCE(hrtc->Instance)); All of the HAL_RTC_* functions accept an RTC_HandleTypeDef argument. However, the implementation of these function mix the use of hrtc->Instance->REG and RTC->REG. This inconsistency has led to some bugs creeping into my code. For example, one can successfully set date and time (HAL_RTC_SetDate(), HAL_RTC_SetTime()) without first calling HAL_RTC_Init() to initialize hrtc. But with a change to the STM32L4 HAL between 1.17.1 and 1.18.0, these functions still successfully set the date and time, but now return HAL_TIMEOUT. I really do need to call HAL_RTC_Init(), but the HAL should help the developer here.It would be best if these functions either used only RTC or only hrtc->Instance for access to the device registers rather than mixing th
Hi there, I'm fixing the jump function from my custom bootloader to the application, below the code: static void __inline__ CheckAPPjumpRESET(void) { /*.-.-.| Local variables: |.-.-.*/ u32t uiI = 0; /*.-.-.| Execution: |.-.-.*/ if(GetRESETkey() != RESET_DRV_APP_KEY) { ; } else { // RESET_DRV_APP_KEY found: jump to app! SetRESETkey(RESET_DRV_BTL_KEY); __disable_irq(); // Disable all interrupts SysTick->CTRL = 0; // Disable Systick timer HAL_RCC_DeInit(); // Set the clock to the default state // Clear Interrupt Enable Register & Interrupt Pending Registers: for (uiI = 0; uiI < 8; uiI++) { NVIC->ICER[uiI]=0xFFFFFFFF; NVIC->ICPR[uiI]=0xFFFFFFFF; } SCB_CleanDCache(); // Clean Data Cache SCB_DisableDCache(); // Disable Data Cache SCB_DisableICache(); // Disable Instruction Cache HAL_MPU_Disable(); // Disable MPU HAL_DeInit(); __enable_irq(); // Re-enable all interrupts
Hi all,I am working with the Nucleo-L476RG board.I generated a project with CubeMx and enabling FreeRTOS.At this point the project is running fine.I debug the project and all is working.I put a breack point inside the "SysTick_Handler" and this hadler is always launching.Now, in main function, I add "HAL_Delay(1000)" after creation of the default task with "osThreadCreate" function:When I debug this code, the "SysTick_Handler" is never launching.And the code hangs in the "HAL_Delay" function where "HAL_GetTick()" function returns always 0.I read at https://community.st.com/s/question/0D50X00009XkYFaSAN/freertos-stm32-tickthat If Iwant to use HAL_Delay() before vTaskStartScheduler (osKernelStart), I need to check scheduler state before call xPortSysTickHandler:I add this check in "SysTick_Handler":BUT the problem persists because the "SysTick_Handler" was never launched.Can anyone please found the cause of this problem.I now that I can overwrite the "HAL_Delay" function s
HelloI am trying to merge USB CDC code into an existing code which is a Keil multi project code. I am using the USB CDC code generated by stm32cubemx for data transmission and reception testing. The multi project is position independent build and when i add the files from USB CDC test application into it, it throws following errors and warnings. I am new to PI concept and would really appreciate if someone could guide me over this and help me resolve these.Thanks.************************************************ Using Compiler 'V5.06 update 4 (build 422)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'WARNING: usbd_cdc_if.c(150): warning: #1357-D: static initialisation of variable "USBD_Interface_fops_FS" using address of CDC_Init_FS may cause link failure -ropiUSBD_CDC_ItfTypeDef USBD_Interface_fops_FS =linking....\objects\zero.axf: Error: L6248E: usbd_cdc.o(.data) in PI region 'ER_RW' cannot have address type relocation to USBD_CDC_Init in PI region 'ER_RO'.**********************************
Hi everybody,i am currently working with the STM32H755ZI (Revision V) on a NUCLEO-144 Board and I need to use all three ADCs. To use these ADCs I need to calibrate them according to the reference manuals and the application notes. Calibrating the offset error with or also without the HAL-Library is pretty straight forward. To calibrate the linearity error the application note AN5354 (https://www.st.com/resource/en/application_note/an5354-getting-started-with-the-stm32h7-series-mcu-16bit-adc-stmicroelectronics.pdf) states that the ADCs are calibrated when fabricated and the calibration values are stored into flash. I could not find any information about the location in flash (like an address) where these calibration values are stored. Could you help me here how to locate these values and also how to load them into the ADC-Registers to use the calibration values?If you got any further tips about calibrating the ADCs please write them below this post. Here is my init function of the
halo!i have a adc_value as array and i hava this for potentiometer, i want to call the adc_value as int, but i can't thingking for this now, can anyone help me?
Can I know what is difference between internal adc of STM32f429 disc1 board and an external 12bit 1MSPS adc.Which adc to use for any application that needs more accuracy whether I should go for external or internal adc.Will internal adc produces any noise compared to external.
Hello,I work in a company that uses stm32F031C4T6 and we manufacture 40,000 cards a year with this reference. I was wondering if it would be possible to ask the manufacturer to program the microcontrollers directly in their factories, because for our company this represents a lot of human time.
Hi All,I am working at project with STM32H7 and NetX Duo. At current version of Ethernet driver from ST (X-CUBE-AZRTOS-H7 v3.0.0) is not handled by any way state when link is disconnected. Link status variable nx_interface_link_up is set at "Enable Link" (nx_ip_driver_command=NX_LINK_ENABLE) and "Disable Link" (nx_ip_driver_command=NX_LINK_DISABLE). But there is no modification of this variable when phy-link goes down.Should be control of this variable implemented into driver, when I detect link down via MDIO interface? Or it is OK do not set nx_interface_link_up when link is physical down (e.g. disconnected Ethernet cable)? In case of control of nx_interface_link_up should be implemented, what is best place inside driver (NX_LINK_GET_STATUS, NX_LINK_USER_COMMAND, etc.)?Thank for answerRegards,Jan
I'm trying to set up a DMA transfer from UART1 periheral to memory. Using LL drivers. Using STM32Cube for "convenient" setup. It puts the all the USART peripheral init in usart.c. Where for GPDMA it does something like: /* GPDMA1_REQUEST_USART1_RX Init */ NodeConfig.DestAllocatedPort = LL_DMA_DEST_ALLOCATED_PORT0; NodeConfig.DestHWordExchange = LL_DMA_DEST_HALFWORD_PRESERVE; NodeConfig.DestByteExchange = LL_DMA_DEST_BYTE_PRESERVE; NodeConfig.DestBurstLength = 1; NodeConfig.DestIncMode = LL_DMA_DEST_INCREMENT; NodeConfig.DestDataWidth = LL_DMA_DEST_DATAWIDTH_BYTE; NodeConfig.SrcAllocatedPort = LL_DMA_SRC_ALLOCATED_PORT0; NodeConfig.SrcByteExchange = LL_DMA_SRC_BYTE_PRESERVE; NodeConfig.DataAlignment = LL_DMA_DATA_ALIGN_ZEROPADD; NodeConfig.SrcBurstLength = 1; NodeConfig.SrcIncMode = LL_DMA_SRC_FIXED; NodeConfig.SrcDataWidth = LL_DMA_SRC_DATAWIDTH_BYTE; NodeConfig.TransferEventMode = LL_DMA_TCEM_BLK_TRANSFER; NodeConfig.Mode = LL_DMA_NORMAL; NodeCon
We are using STM32H723ZG on custom board. Sometimes, we want to jump to System Bootloader (address 0x1FF09800) from our application. Then we connect to device via USB DFU. I thought that it works reliably, however we discovered that sometimes, there is a problem that the device is not enumerated correctly (STM32CubeProgrammer doesn't see it).Additional info:Bootloader version both v9.2 and v9.3Preparation for jump is done almost the same as in https://community.st.com/s/article/STM32H7-bootloader-jump-from-application (note that there is wrong clearing of ICER/ICPR registers) with few additions such as disabling cache. Let me know if I should post the complete code.We have BOOT pin on button to go directly to the bootloader after reset. This seems to always be working correctly. So the issue seems to affect only jumping from our application.Furthermore, when I tried looking to bootloader operation through debugger, from the disassembly, it seems that it is not stuck and correctly check
Hi,I want to make PWM stream with various duty, so I'm testing PWM with DMA using NUCLEO-G0B1RE and HAL library.The first image shows weird pulse train. I set DMA buffer with [duty 1] * 8 + [duty 17] * 8 + [duty 5] * 8, but oscilloscope captures eight 1s, "nine" 17s and "seven" 5s. Left pane is screen of STM32CubeIDE Debugger.I tested while debugging - if I change DMA buffer I can see results on-the-fly.It looks like if I set more than 11 on DMA buffer, next PWM affected. I attached a short screen recording clip, please check it.How can I get the exact PWM trains? I also attached entire project files.Note : I found code generation problem regarding TIM4 and DMA(https://community.st.com/t5/stm32cubeide-mcus/stm32cubeide-1-15-1-code-generation-problem/td-p/673440) so I modified HAL_TIM_PWM_MspInit()
Hello,I am trying to do an OTA upgrade on my STM32H750. I am using QSPI flash in dual mode as the IC does not have so much internal flash for my application. My application is running FreeRTOS and does have a LCD screen. So I build a bootloader to configure the QSPI and then jump to my application located on the external QSPI flash. That is working fine.Now I need to be able to upgrade the FW. The idea is to download a part of the FW, store it in RAM, jump back to bootloader, unmapped the flash, write the data, remapped the flash and go back to my main application as fast as possible so that the user may not really see it.The problem I am facing, is that I am stuck when I am back from the function that write the data. The execution continue properly in XIP mode, but not as it was.for the testing purpose the external function that is suppose to write the data does not do anything for now except returning a value.#define jumpToInternalFlashFunction_ADDR 0x08018000 typedef int (*pFunction
Hi everyone. I'm using stm32f767zi board with lwip stack and I need to transmit at different rate through Ethernet: 50mbit/s, 80mbit/s and 100mbit/s. When I tried to send a buffer of 6554 byte every 1ms (in order to send 6553600 byte aka 50mbit every second) lwip give me memory error: I tried to change some of its parameters but the maximum rate I got was 27mbit/s. So anyone can help me and give me some tips to solve this problem
I am working on EEPROM Emulation in STM32L432 using its internal flash memory so is there any specific address for making EEPROM emulation in stm32l432kc or can we take any random address of flash memory? give the solution.
Hello,I'm working with the stm32f439ZG and I have one question regarding the CAN bootloader.I'm trying to update one node via CAN interface. I have one network with 3 nodes (the node 1 is responsible for send the new firmware, the node 2 will receive this new firmware and the node 3 is idle). My "normal" CAN bitrate is 500kbits.My strategy is:1. node 1 sends one message that forces nodes to stop sending messages;2. node 1 sends one message that forces node 2 to enter in bootloader and node 3 execute the function HAL_CAN_DeInit(&hcan2) and after MX_CAN2_Init_125(), init CAN with CAN bitrate=125kbits;3. node 3 has one CAN filter that blocks all the Standard IDs.However, when I send the sync message (0x79) the node 2 jumps off the bootloader.What is the right approach for execute the firmware update via CAN when have in the network multiple nodes?Thanks for your help.
When the HAL_ETH_Transmit is called by the driver it seems the code below (part of HAL_ETH_Transmit ) times out as the DMA TX complete callback are not called. I've followed the STM32H743 example but I guess STM32H742 memory map is a bit different than H743. Does anyone tries Ethernet on STM32H742 ? Thanks The timeout error while((dmatxdesc->DESC3 & ETH_DMATXNDESCWBF_OWN) != (uint32_t)RESET) { if((heth->Instance->DMACSR & ETH_DMACSR_FBE) != (uint32_t)RESET) { heth->ErrorCode |= HAL_ETH_ERROR_DMA; heth->DMAErrorCode = heth->Instance->DMACSR; /* Set ETH HAL State to Ready */ heth->gState = HAL_ETH_STATE_ERROR; /* Return function status */ return HAL_ERROR; } /* Check for the Timeout */ if(Timeout != HAL_MAX_DELAY)&
Hello,I'm have a Nucleo board with a STM32F334R8T6I configured a timer with 10kHz and I'm using the HAL_TIM_PeriodElapsedCallback to call a funtion that will control my motor and read some data with the ADC. I want to check the frequency that the controller function hapens, my first idea was to toggle a GPIO pin every time the function is called, but the frequency is lower than the 10kHz, aprox 7kHz, anyone knows why this is hapenning?
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.