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
I'm using STM32H7S78-DK and STM32CubeIDE v1.17.0. I was try to get Segger RTT working so I switched from ST-Link GDB server to OpenOCD because it has in-built RTT telnet server, but couldn't because OpenOCD didn't find RTT area.I reduced the problem down to this simple example and realized it's related with data cache: volatile uint32_t test = 1; int main(void) { test = 2; SCB_EnableDCache(); test = 3; HAL_Init(); When debugging it with ST-link "test" will be 3 at line 8. When running with OpenOCD, test will remain 2. When not enabling cache, "test" will be 3.I used default CubeIDE OpenOCD configuration and checked all the flags. I haven't had a problem with OpenOCD and STM32H5/H7 series with enabled cache before.I found similar issue report from SO: https://electronics.stackexchange.com/questions/552477/debugging-cortex-m7-with-data-cacheThere's one answer saying to monitor using_hla. I didn't get any response for that command in GDB console.
..
I am using Seeed Studio LoRaWan Project for Wio E5 Mini(STM32WLE5JC6). By default the project is using internal RTC, but I want to use an external RTC DS3231 alarm for my application to send data because it would be run through the power line and when there is a power cut I don't want the alarm to be colliding with other such devices because all other similar devices will be sending data one after the other with no collision. How can I modify the project in lora_app.c such that the DS3231 SQW/INT pin wakes up the MCU from sleep, transmit and then go to sleep, and so on. I have issues using the SQW/INT interrupt pin to check for the alarm and then transmit data.
I've been trying to get MCUboot working on the nucleo-f446re board with the USB DFU sample for a couple of days now, but I'm stuck!Here's my MCUboot configuration:```CONFIG_FLASH=yCONFIG_FLASH_PAGE_LAYOUT=yCONFIG_FLASH_MAP=yCONFIG_LOG=yCONFIG_LOG_MODE_MINIMAL=yCONFIG_MCUBOOT_LOG_LEVEL_DBG=yCONFIG_BOOT_MAX_IMG_SECTORS_AUTO=nCONFIG_BOOT_MAX_IMG_SECTORS=7 ```This is my MCUboot overlay file:```/ {chosen {zephyr,code-partition = &boot_partition;};};And here's the board overlay for the USB DFU sample:/ {chosen {zephyr,code-partition = &slot0_partition;};};zephyr_udc0: &usbotg_fs {pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12>;pinctrl-names = "default";status = "okay";cdc_acm_uart0: cdc_acm_uart0 {compatible = "zephyr,cdc-acm-uart";};};```However, when I try to run it, I get the following log output:```*** Booting MCUboot v2.1.0-rc1-146-gf74b77cf7808 ****** Using Zephyr OS build v4.0.0 ***I: Starting bootloaderD: Non-optimal sector distribution, slot0 has -1 u
I'm trying to write a struct of size around 680 bytes to Sector 1, Bank 2 of the flash in an STM32H757XIH6. I'm pretty new to this kind of thing so I'm slowly building on the code. I'm using the STM32 HAL driver. The address of this sector is 0x08100000.Here's the code: typedef struct { uint32_t data_header; Parameter parameter[NUMBER_PARAMETERS]; int screen_paras[MAX_SCREENS][MAX_WIDGETS]; } Persistent_data; void save_data() { Persistent_data save_data; uint32_t data_header = DATA_HEADER; save_data.data_header = data_header; memcpy(save_data.parameter, parameter, sizeof(save_data.parameter)); memcpy(save_data.screen_paras, screen_paras, sizeof(save_data.screen_paras)); size_t size = sizeof(Persistent_data); uint32_t word_count = (size + 3) / 4; //32bit alignment Flash_Write(FLASH_START_ADDRESS, (uint32_t*)&save_data, word_count); } HAL_StatusTypeDef Flash_Write(uint32_t address, uint32_t* data, uint32_t length) { HAL_StatusTypeDef status = HAL_OK; // Ens
I have a custom board with an STM32F303CBT6 MCU with an external 16 MHz oscillator, but I am unfortunately not able to get Zephyr RTOS to successfully boot.From the KConfig options, it does not look like the specific variant of F303 is supported. It does have the following configs:CONFIG_SOC_STM32F303X8CONFIG_SOC_STM32F303XCCONFIG_SOC_STM32F303XEIn addition, the device trees to include is also:zephyr\dts\arm\st\f3\stm32f303X8.dtsizephyr\dts\arm\st\f3\stm32f303Xc.dtsizephyr\dts\arm\st\f3\stm32f303Xe.dtsiBoth the config and dtsi are missing the stm32f303Xb variants.I tried to put my own dtsi file together, but so far without any luck. Its attached to this post.When using the attached dtsi, the debugger gets stuck in "LL_RCC_HSE_IsReady" defined in modules/hal/stm32/stm32cube/stm32f3xx/drivers/include/stm32f3xx_ll_rcc.hDebugger is an STM32 programmer connected by SWD to the board.Any recommendations to get the specific MCU working with Zephyr RTOS?
Hello,Question related to post "How to create a project for STM32H7 with Ethernet and LwIP stack working":I downloaded, build and load the STM32H723_Nucleo_ETH to my Nucleo after I changed the board IP to 192.168.0.160 to fit my network and I run an iperf 2.0.8 (I was not able to find 2.0.6 as mention in the code) on my windows PC with IP 192.168.0.32.But, I don't see any data on the PC running iperf in server mode on port 5001.I check with Wireshark also and I don't see data other then a single line:1225 27.865374 192.168.0.160 192.168.0.34 TCP 60 52432 → 5001 [SYN] Seq=0 Win=5840 Len=0 MSS=1460Ping from 192.168.0.32 to 192.168.0.160 works fine.Any help will be appreciate.ThanksEyal
Hello, I bought STM32F429ZIT6 MCU the other day but strangely I am getting program outside error in the system and I have no hardware problem. So why is this happening? Is it a knock-off or a software problem
Hello all, I am currently working with the STM32CubeIDE. I wrote a program that didn't end up working but concluded the code was fine after reviewing it. I tried copy and pasting the code into a different project within the IDE, and it works just fine. Does anyone know why this might be?The code does not work when pasted into existing projects, or new projects, except for the one particular existing project. There are no error codes thrown when it doesn't work; it builds and downloads to the board just fine but then doesn't run.The program is attached.
Hi,I am struggling to make PDM2PCM library work. My projects build without issues, but when I upload them to the board , program executes until it reaches PDM_Filter_setConfig function (tested with breakpoints). After that, it goes to infinite loop caused by watchdog.I tried to integrate this library in a project with my own drivers and it was the first time I ran into this problem. To make things simple, I created an empty project to run the configuration only. The result was unfortunately the same.I am using 32F411EDISCOVERY kit. I tested the lib using STM32Cube F4 1.28.0 and 1.26.2 packages. I am not using HAL.Below you can find the code I used in the simpler project (it is basically code copied and pasted from the official docs). #include <stdint.h> #define STM32F411xE #include "stm32f4xx.h" #include "pdm2pcm_glo.h" int main(void) { RCC->AHB1ENR |= RCC_AHB1ENR_CRCEN; CRC->CR = CRC_CR_RESET; PDM_Filter_Handler_t PDM1_filter_handler; PDM_Filter_C
Moved from the Motor Control forum as this has nothing to do with motor control. i am using stm32f469 discovery with architecture um1932, in MX i configured for Host only host CDC class for full speed (FS) my clock configuration is also correct (48mhz for USB) also i codded to transmit data to USB device which is motor controller , i am getting application ready state and USB_OK state after transmitting some data over USB but the device is not responding, what will be the reason. but when i do the same by using stm32f469i example code provided by stm it is working . i need to check the HOST is transmitting or not how can i ensure this. please someone suggest me what are the procedure i need to follow for configuring and debugging the USB HOST CDC
I am working on a project with STM32L432 and trying to get a clean (without necessity to de-init peripherals and disable peripheral interrupts) jump to application from a bootloader and back.The widely described method to do so is as follows (for a booloader): Write a predefined key value to the non-initialized RAM predefined key variable.Call NVIC_SystemReset().After reset check the key variable. If it contains the key value, erase it and execute standard jump to the application:typedef void (*pFunction)(void); pFunction Jump_To_Application; void Application_jump(void) { uint32_t JumpAddress; /* Get the application stack pointer (First entry in the application vector table) */ JumpAddress = (uint32_t) *((__IO uint32_t*)APP_START_ADDRESS); /* Get the application entry point (Second entry in the application vector table) */ Jump_To_Application = (pFunction) *(__IO uint32_t*) (APP_START_ADDRESS + 4); /* Reconfigure vector table offset register to match
Code formatting applied - please see here for future reference.Hello everyone,I'm currently working on an STM32 project using the NUCLEO-G431KB board. I've come across the BSP_COM API in the STM32Cube firmware, which seems to be an abstraction layer for handling USART/UART communication. I have successfully set up the following code to send data over a virtual COM port using "printf": COM_InitTypeDef BspCOMInit; BspCOMInit.BaudRate = 115200; BspCOMInit.WordLength = COM_WORDLENGTH_8B; BspCOMInit.StopBits = COM_STOPBITS_1; BspCOMInit.Parity = COM_PARITY_NONE; BspCOMInit.HwFlowCtl = COM_HWCONTROL_NONE; if (BSP_COM_Init(COM1, &BspCOMInit) != BSP_ERROR_NONE) { Error_Handler(); } printf( "Hello, Virtual COM Port!\n" ); This works perfectly for transmitting data, but I'm struggling to figure out how to receive data using the BSP_COM interface. Is there a built-in function in BSP_COM for receiving data, or do I need to revert to using HAL_UART_RECEIVE&nbs
Hello,I would like to understand the code to carry out my software integration : /* Configure SD pin detect */ __SD_DETECT_GPIO_CLK_ENABLE(); __HAL_RCC_PWR_CLK_ENABLE(); And This refers to lines of code that I am lost, for the first line for example #define __SD_DETECT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOG_CLK_ENABLE() And after : #define __HAL_RCC_GPIOG_CLK_ENABLE() do { \ __IO uint32_t tmpreg; \ SET_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOGEN); \ /* Delay after an RCC peripheral clock enabling */ \ tmpreg = READ_BIT(RCC->AHB2ENR, RCC_AHB2ENR_GPIOGEN); \ UNUSED(tmpreg); \ } while(0) I would just like to configure the SD card to be able to write the code from an example on the evaluation card. My real card is not the evaluation card and I would like the code just necessary. Do you have an example for STM32L5xx with the file .ioc for example.Thank you
Hello , I am trying to write a USB OTG FS code from scratch (in Device mode) .At this point i can receive and send control transfers .For the Device Descriptor and Set address commands there seem to be no issue but with the Configuration Descriptor there seems to be something wrong.In task manager my device appears as Unknown USB Device ( Configuration Descriptor Request Failed ) When i use a USB sniffer i am able to see that my device responds to the request and the packet doesn't seem to have any errors Packets sniffed :Configuration Descriptor Response: I am also attaching the full Log from WiresharkUseful filter: (!(_ws.col.protocol == "USBLL")) && !(_ws.col.protocol == "Syslog") What could be causing this behavour ? My goal for now is for the device to enumerate and not appear as an Unknown USB Device.Note: The task manager error appears a few seconds before the Configuration Request and Response in the sniffer, I am not sure if thi
Good morning, I'm having trouble understanding how to solve a problem.there is already a software developed in keil 4, but we need to change some things but now we will use keil 5 with the hal library, so far ok without problems. my first problem was with the i2c which is ready but uses 4 eeprom 24aa1025 on my board. attached is the diagram of the board (already working but with keil 4 software without hal library). the problem is that the programmer retired and I had to take on the job of converting the software because of a touchpanel on the “stone” which is using the HAL library, the old code uses the command “I2C_SendData(I2C1,AddressMEM>>8);” and the new i2c library doesn't have it and I'm a bit confused about the system that has been set up. The AddressMEM variable is working perfectly as far as the address of the bytes to be read is concerned, the problem is passing this command to the HAL_I2C_Mem_Write(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uin
Hi, what is the correct way to switch between CAD state machines? For example, between DRP to SNK and vice versa.Motivation: When the battery is bellow the defined SOC, switch from the DRP state machine to the SNK only and stop toggling between SRC and SNK.Switch can be done by executing for example: // To SNK CAD_HW_Handles[PortNum].CAD_PtrStateMachine = &CAD_StateMachine_SNK; // To DRP CAD_HW_Handles[PortNum].CAD_PtrStateMachine = &CAD_StateMachine_DRP; But what is the best place for the code to change the state machine and in what CAD state?Hard reset? Error recovery? or simply in disconnected state?Thanks for any advice
FDCAN1_IT0_IRQHandler and FDCAN1_IT1_IRQHandler are not defined in the interrupt table of the file startup_stm32g483xx.s. When an FDCAN1 interrupt occurs, it generates an hardware fault. Adding the FDCAN1 irq handlers to the interrupt table solves the problem. Is it a bug in CMSIS package or is there a reason for omitting FDCAN1 handlers in this file?
Hi,I am curious that how can ı choose electrolytic capacitor of auxiliary circuit? Firstly, I used 10uF electrolytic capacitor at Vcc pin.When I short circuit the output, the HB mosfets has failed.Then I notice that STCMB1 datasheet mention this topic. According to STCMB1 datasheet, an electrolytic capacitor of at least 22 μF (typ. value) must be connected between the pin and GND. But when ı place 22uF electrolytic capacitor, I'm having trouble with the short circuit test. After a short circuit (about 20s), it causes the LEDs flickering.Therefore, I used 100uF electrolytic capacitor at Vcc pin.I thought I solved the problem using 100uF but i encountered a new problem. I produced 10 driver and tested them. Almost half of them are undecided about working. The driver which worked yesterday, it does not work today.
This is another issue found in my endeavors to learn Zephyr. When building I get the following error:warning: orphan section `.stm32_sdram2' from `zephyr/drivers/display/libdrivers__display.a(display_stm32_ltdc.c.obj)' being placed in section `.stm32_sdram2'section `.stm32_sdram2' will not fit in region `IDT_LIST'section .stm32_sdram2 VMA wraps around address spaceregion `IDT_LIST' overflowed by 228513 bytescollect2.exe: error: ld returned 1 exit statusHere's my DTS setup: &fmc { pinctrl-0 = <&fmc_nbl0_pe0 &fmc_nbl1_pe1 &fmc_sdclk_pg8 &fmc_sdnwe_ph5 &fmc_sdcke1_ph7 &fmc_sdne1_ph6 &fmc_sdnras_pf11 &fmc_sdncas_pg15 &fmc_a0_pf0 &fmc_a1_pf1 &fmc_a2_pf2 &fmc_a3_pf3 &fmc_a4_pf4 &fmc_a5_pf5 &fmc_a6_pf12 &fmc_a7_pf13 &fmc_a8_pf14 &fmc_a9_pf15 &fmc_a10_pg0 &fmc_a11_pg1 &fmc_a12_pg2 &fmc_d0_pd14 &fmc_d1_pd15 &fmc_d2_pd0 &fmc_d3_pd1 &fmc_d4_pe7 &fmc_d5_pe8 &fmc_d6_
Hi, any idea about why stm32xx_hal_uart functions write to USART control registers by ATOMIC_CLEAR_BIT()/ATOMIC_SET_BIT(), while homologous stm32xx_hal_usart functions write to the same registers by CLEAR_BIT()/SET_BIT()?In example:UART_DMATransmitCplt() -> ATOMIC_CLEAR_BIT(huart ->Instance->CR3, USART_CR3_DMAT);USART_DMATransmitCplt() -> CLEAR_BIT(husart->Instance->CR3, USART_CR3_DMAT);Since both UART/USART are referred to by the same USART_TypeDef structure, I'd be expected to use them in the same way. So, is that due to some undocumented difference in the silicon between UART/USART?
**Problem:**- When the I2C is enabled, the part can hit the WWDG.- It looks like the pointer to the function `XferISR` is getting set to NULL somehow. - When this happens, the interrupts are not cleared, and it continually fires the interrupt because it is never cleared. - This is hard to troubleshoot because, in my system, there are many higher priority interrupts, making it hard to know that this is the problem.- On another note, it looks like the interrupts are not always cleared in accordance with **RM0440 Table 394**: - In the error section, I2C_FLAG_PECERR, I2C_FLAG_TIMEOUT, and I2C_FLAG_ALERT are never cleared. - Also in I2C_Master_ISR_IT.**Background:**- Using an STM32G4 with HAL v1.2.3.- Using DMA or IT (different builds).- Connected to many I2C sensors.- It is in a pretty noisy environment.- All calls are from the main loop (except what was generated by HAL); all reading of buffers is in the main loop.- If I have an I2C error, I re-init the I2C to clea
Hi y'all, is there a IOC file or way to setup the LWIP + RTOS + NETCONN example via IOC for STM32F767ZI? I have it completely working based on the example with no IOC, but that makes this code hard to scale and move across multiple machines. I noticed that it has some deprecated folder called SW4STM32 or something. It's also completely missing the ".ld" linkers from the downloaded example in the STM32CubeIDE examples. Any help would be appreciated, thanks!
Hi Team,I am Using STM32F7 nucleo board, I created project using ST CUBEIDE version 1.16.0.Note: NOT USING CUBEMX and RTOSI have taken a ref code for low level eth functions ethernetif.c and lwip.c.I Enabled Enable DHCP, Http and SSI it is working fine I am able to interact my webpage.Now I want to work on TCP and ping, I enabled LWIP_ICMP and LWIP_TCP, Disabled DHCP.But Ping NOT working (timeout err ).I have taken care of1.Proper pin assignment.2.Configuring PHY properly. (as I m able to get Eth cable linkup/down notify).3.Disable DHCP and activate ICMP.I have gone thr icmp.c the code flow whenever i ping-> ethernetif_input-> ethernet_input->icmp_input -- checks type and switch to ICMP_ECHO--> Ip4_outputif()-->ip4_outputif_src-->netif_output-->low_level_output--> HAL_ETH_Transmit i debuged icmp.c it was not going to 1.icmp_dest_unreach 2.icmp_time_exceeded @STea I have attached my files,Please correct me where it goes wrong and reason behind
Hi,I am having trouble extracting the STSW-SAFEA1-MW. This is the same issue mentioned here and here. I can't use your product if I can't use your drivers. A fix would be appreciated.Thanks
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.