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 am using the Nucleo-H743ZI with a c++ project, and have used this code many times before with this board and c++; however, now the printf() function no longer prints to uart:int __io_putchar(int ch) { HAL_UART_Transmit(&huart3, (uint8_t*) &ch, 1, 0xFFFF); return ch; } [...] printf("hello\n"); I can send chars using HAL_UART_Transmit(&huart3, (uint8_t*) &ch, 1, 0xFFFF);I stepped through the disassembly and found that __io_putchar is called with the following:112 __io_putchar(*ptr++); 08003718: ldr r3, [r7, #8] 0800371a: adds r2, r3, #1 0800371c: str r2, [r7, #8] 0800371e: ldrb r3, [r3, #0] 08003720: mov r0, r3 08003722: nop.w To the best I can tell, it seems like the default weak __io_putchar is being called.In the memory map file it is listed as: .text._Z12__io_putchari 0x00000000 0x24 ./Core/Src/main.o Ant ideas what is going wrong and how to fix it? Thanks,Ethan
First of all , I read this post (https://community.st.com/t5/stm32-mcus-products/adc-calibration-doesn-t-complete-on-stm32g0c1re/td-p/590459) that was previously opened on this subject. I think the issue is noy completly resolved because there is a misunderstanding. I'm using STM32Cube MCU Package for STM32G0 Series, software package.As @Imen.D replied on 2024-03-26 , 04:44 pm in this post (https://community.st.com/t5/stm32-mcus-products/adc-calibration-doesn-t-complete-on-stm32g0c1re/td-p/590459:(In fact, the delay is required for ADC disable to be effective (therefore, applicable between ADC disable and calibration start, or between ADC disable and calibration factor set). I couldnt see delay placed in the relevant code sections. Even if I put uS delays to those sections. It didnt work. Here is the problem : HAL_StatusTypeDef HAL_ADCEx_Calibration_Start(ADC_HandleTypeDef *hadc){HAL_StatusTypeDef tmp_hal_status;__IO uint32_t wait_lo
Hi all,I am trying to launch the app from a bootloader code that I copied from a project on an STM32L0 and STM32F446, it worked fine there but somehow my app doesn't start on the STM32G491.Here's the code for the jump: static void bootloader_jump_to_app(void) { uint32_t JumpAddress = *(__IO uint32_t*)(APP_ADDRESS + 4u); pFunction Jump = (pFunction)JumpAddress; if (!bootloader_check_integrity()) { bootloader_send_message("Abort\r", 8u); bootloader_init(); } else { bootloader_send_message("Starting\r", 9u); HAL_FLASH_Lock(); // lock flash after memory erase + write HAL_RCC_DeInit(); HAL_DeInit(); SysTick->CTRL = 0u; SysTick->LOAD = 0u; SysTick->VAL = 0u; SCB->VTOR = (__IO uint32_t)APP_ADDRESS; __set_MSP(*(__IO uint32_t*)APP_ADDRESS); Jump(); while(1); } } I have modified my .ld file accordingly with app start address 0x08003000, I compared the memory part with the app to the bin file and it's similar, I don't unde
I tried to program a STM32L031C6T MCU using bootloader through USART2. I use STMFlashLoader application and Cisco USB to RJ45 (p8) cable. This cable uses a FT231X chip and I have it´s driver installed.My problem is that the connection it´s working, it says: "unrecognized device... please reset your device and try again".To enter in bootloader mode I need to put "1" on BOOT0 pin and nBOOT1 bit must be also "1". By default nBOOT1 is "1" so I only need to put "1" on BOOT0 pin during reset. I know my MCU is not running my code (and also message from STMFlashLoader is different) so it only can be in bootloader mode or running from embedded RAM. But as I said before nBOOT1 bit is "1" by default and I didn´t touch this, so it must be in bootloader mode.I've searched for info and find this page: http://www.emcu.eu/2017/11/10/flash-loader/ that says: "ATTENTION. Up to now, 10-November-2017, there is a problem to program the STM32L0x1/2/3(32KFlash) using the standard Flash Loader&
I lifted regression test code from the netxduo stack to attempt a websocket client, but the best I can achieve is a 400 response from the server. Has anyone successfully using websockets with STM32 + netxduo?The following code resides inside app_netxduo.c. The thread is created TX_DONT_START and is resumed in the nx_app_thread_entry thread. It dies on line 59 with a NX_WEBSOCKET_INVALID_STATUS_CODE return. I am trying to connect with a flask-socketio project running on a Ubuntu system. #include "nx_websocket_client.h" #define DEMO_STACK_SIZE 4096 #define TEST_SERVER_ADDRESS IP_ADDRESS(192,168,100,2) #define TEST_SERVER_PORT 8000 #define TEST_HOST_NAME "192.168.100.2" #define TEST_URI_PATH "/ws" #define TEST_PROTOCOL " " static UCHAR client_test_data[4] = { 0x11, 0x22, 0x33, 0x44 }; void thread_client_entry(ULONG thread_input) { UINT status; NX_PACKET *packet_ptr; NXD_ADDRESS server_ip_address; UINT code; /* Create client socket. */ sta
FreeRTOS is not started, failed on configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == configPRIO_BITS ); port.c 346It's working if change #define configPRIO_BITS from 4 to 3 in FreeRTOSConfig.hIn datasheet: NVIC; 16 programmable priority levels (4 bits of interrupt priority are used)Code generator STM32CubeIDE and STM32CubeMX - the same result.
Hello,I'm currently using STM32CubeIDE, version 1.15.1 (Build: 21094_20240412_1041 UTC), with the embedded package version 1.5.0. I have set up a project with a secure zone configuration.After generating code from the IOC file, I encounter an issue in the flash.c file at line 54. The generated code looks like this: //!!! HAL_FLASHEx_OBProgram is commented because some parameters are missing//pOBInit.OptionType = OPTIONBYTE_USER|OPTIONBYTE_BOOTADDR|OPTIONBYTE_WMSEC;//pOBInit.WMSecStartPage = 0;//pOBInit.WMSecEndPage = 126;//HAL_FLASHEx_OBProgram(&pOBInit); //!!! HAL_FLASHEx_OBProgram is commented because some parameters are missing//pOBInit.OptionType = OPTIONBYTE_USER|OPTIONBYTE_BOOTADDR|OPTIONBYTE_WMSEC; The OPTIONBYTE_WMSEC parameter is on the next line of the comment, which causes it to be ignored by the //. This obviously breaks the build.While this is easy to fix manually, I have to go back and correct this every time I regenerate the code from
I've run into some problems with the Demo example pulled in by the project configurations tools for the STM32U083C-DK eval board. The error I am getting is a missing header file. Error message: In file included from C:/Users/rufus/STM32CubeIDE/workspace_1.16.0/Demo/Middlewares/ST/STM32_TouchSensing_Library/src/tsl_acq.c:20: ../../Middlewares/ST/STM32_TouchSensing_Library/inc/tsl_acq.h:24:10: fatal error: tsl_conf.h: No such file or directory 24 | #include "tsl_conf.h" I see one tsl_conf.h in an unreferenced directory (main_app) and two other files that appear to be renamable templates. tsl_conf_stm32l1xx_template.h and tsl_conf_tsc_template.h in the library inc directory. They have slight different contents, so I don't know which I should attempt to use, or if they are all incorrect.If someone could explain the file naming conventions for the library too, that would help.P.S. Incidentally The BSP project for STM32U083C-DK
Hello STM Community, I am currently working on a project using the STM32F407 microcontroller, and I need to implement MQTT communication with Azure IoT Hub for cloud connectivity. The STM32F407 is already connected to the internet through LTE modem via PPPoS, and now I need to integrate MQTT to send data to Azure IoT Hub How to set up an MQTT client on STM32 for Azure IoT Hub? How to handle TLS/SSL for secure communication with Azure? Any resources or example code for device authentication and reconnection logic? Any guidance or resources for setting this up would be greatly appreciated! Thanks!
Hi Is there a plan to update the x-cube-freertos Kernel to 11.1.0? Github repo: STMicroelectronics/x-cube-freertos: X-CUBE-FREERTOS (FreeRTOS™ software expansion for STM32Cube) provides a full integration of the FreeRTOS™ kernel in the STM32Cube environment for a set of STM32 series of microcontrollers. Thanks in advancenobody
Hello, i am struggling with creating an working image of my openblt bootloader and my user application.When i just flash the bootloader, and upload the user application via bootloader pipeline everything works fine.But when i try to use srec_cat or other merge tools the application will not start.because the bootloader does not accecpt the application. I think i need to calculate the crc of the application and merge that into the factory image.But i have so success.Anyone hwo did this before?Thanks so muchmax
Hi, I'm trying to receive data from UART peripheral to DMA using HAL Library. I'm using STM32F410RB. I tried all the possible configuration as in reference manual - Code part - //#define OFFSET 0x800 //#define DEST_ADDR (SRAM1_BASE + OFFSET) //Tried writing to SRAM static void MX_USART2_UART_Init(void) { huart2.Instance = USART2; huart2.Init.BaudRate = 115200; //Tried with other Baud rates huart2.Init.WordLength = UART_WORDLENGTH_8B; huart2.Init.StopBits = UART_STOPBITS_1; huart2.Init.Parity = UART_PARITY_NONE; huart2.Init.Mode = UART_MODE_TX_RX; huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE; huart2.Init.OverSampling = UART_OVERSAMPLING_16; if (HAL_UART_Init(&huart2) != HAL_OK) { Error_Handler(); } } static void MX_DMA_Init(void) { /* DMA controller clock enable */ __HAL_RCC_DMA1_CLK_ENABLE(); /* DMA interrupt init */ /* DMA1_Stream7_IRQn interrupt configuration */ HAL_NVIC_SetPriority(DMA1_Stream7_IRQn, 0, 0); //Tried Stream5 as in RM HAL_NVIC_Enab
Originally a reply to https://community.st.com/t5/stm32cubemx-mcus/lwip-lan8720/m-p/690602 but needs a new threadHow do i manually add file C and file H ??
Good day.I've got an issue when trying to connect two STM32 MCUs via SPI.STM32F429ZI is master and STM32F103RB is slave.Master is running at 168MHz and slave runs at 72MHz. SPI clock is the lowest possible - 164.062kHz.Slave select is hardware controlled.Clock polarity is 0 and clock phase is 1. Data frame size is 8 bits. Both devices have the same configuration.Slave device uses DMA in circular mode to receive and transmit. Receive/Transmit is initiated only once on the slave. The firmware is coded with use of HAL.Master's firmware uses interrupts to read data received via SPI and the source code uses mbed.Now, master sends 26 bytes to the slave and receives 26 bytes of response. The operation is regular.Now, the issue I encounter is that the data is sent by slave starting from the second byte, e.g. the buffer provided to HAL_SPI_TransmitReceive_DMA for transmission contains 0x01, 0x02, 0x03... 0x1A and the master receives 0x02, 0x03, 0x04..0x1A, 0x01. Now, the last 0x01 received actu
hello! i have a question about the power voltage detector in (external input analog voltage) i have a adjustable power supply connected on the pin (using a nucleo-G0B1RE) i was thinking that if i drop the voltage on the pin under the vref int voltage a interrupt should be triggered.. but unfurtunately i'm not able to do that.. there is an exmple? i 'm able to use the internal analog voltage without problem thank you
Hello,I am using a custom board with the STM32L452RET. On this board:SPI1 is connected to an IIS3DWB accelerometer,SPI2 is connected to a 240x280 TFT display with an ST7789 controller and TouchGFX,SPI3 is used with FatFs to access an SD card, following this tutorial: https://controllerstech.com/sd-card-using-spi-in-stm32/,USB CDC is used for communication.My issue is that if I compile a file containing the FatFs functions (regardless of whether I use the SD card access functions or not), the numerical values that should be displayed on the screen appear incorrectly (see attached images). However, if I exclude the FatFs functions from compilation, the display shows the values correctly.I’ve tried several solutions:Compiling everything but not mounting the SD card,Modifying the initialization sequence of peripherals,Reducing the clock speed for SPI2 and SPI3.Unfortunately, none of these attempts worked.I am using CubeIDE version 1.16.1.I appreciate any help you c
Hi everybody.I'm facing a strange behaviour on my application. I'm using a STM 23H562, and I'm usign LL library to drive a SPI display (classic iLi).I take the example from c:\Users\[..]\NUCLEO-H533RE\Examples_LL\SPI\*and the display do what I want... only sometime!Due to the 65535 max transfer length, I need to split it into 3 session. I wait the end of the previous as indicate in the example, using:while (!LL_DMA_IsActiveFlag_TC(GPDMA2, LL_DMA_CHANNEL_0)){}LL_DMA_ClearFlag_TC(GPDMA2, LL_DMA_CHANNEL_0);But the color of the filling change (= the data transmitted to the display) from one session to the others. The 1st is correct, the second "sometime", the 3rd rarely.But if I put a small delay from one session to the following everything work fine. How I can fix it?It seems I must wait for some other flag, but donnow wich!Moreover, the command to the display is based on a 8 bit spi data, so I change to 16 and back to 8 when I use the DMA. But the session of manual sending comm
When using this microcontroller for emulate eeprom process, i got some problems like freezing at start-up, when writing OLED, sprintf function can not write characters- writes silly words. I am not sure if the problem is about my emualte_eeprom process or something like that? In addition to this, can anybody lead me to how correctly use emulate_eeprom with above STM32 microcontroller? A sample code will be the best. Thank all for your helps.
Hi everyone, I am trying to implement HID communication using the classic USB library on the NUCLEO-U5A5ZJ-Q. Until now I tried to follow this tutorial https://community.st.com/t5/stm32-mcus/how-to-use-stmicroelectronics-classic-usb-device-middleware-with/ta-p/599274Sadly, between the H7 and U5 there are a couple of difference and I can't seem to find a way to make use of this tutorial for it.I tried to implement the HID Device from this git https://github.com/STMicroelectronics/stm32u5-classic-coremw-apps/tree/main/Projects/NUCLEO-U575ZI-Q/Applications/USB_Device/HID_Standalonebut I am not able to merge these file within an STM32CubeIDE project and make it work (I didn't even manage to build it).Before getting into the USBX version of the HID communication I still want to try to implement one without the use of a FreeRTOS, can somebody help me? Maybe if you already followed one of the links you can tell me what extra steps you did to make it work. Thank you in advance!
Hello everyone,Today I'm writing to you because I'm trying to implement a PPPoS connection over the USB CDC Host of a STM32H745. The modem I'm trying to connect to is a SIM7500 of SimCom.I managed to establish the connection between the modem and the mcu because I can see in the status callback the case PPPERR_NONE.The problem is that even after establishing the connection, when I try to ping the ip that the SIM has assigned I cannot get a response. I tried to debug and I am able to see the ping received on the MCU side. It tries to respond and it but it never reaches te computer from which I sent the ping. If I'm not in PPP mode and I set up the PDP context I can ping the modem without any problem, so the ip is reachable.Any ideas how should I proceed to debug that?Thank you very much in advance <!!!UPDATE!!!>Seems like I haven't enabled the checksum generation and checksum control for lwip and I was sending packages with a 0x0 checksum.For me worked enabling it with
HiI'm using this example:en.stm32cubef7_v1-16-0\STM32Cube_FW_F7_V1.16.0\Projects\STM32F767ZI-Nucleo\Applications\LwIP\LwIP_HTTP_Server_Netconn_RTOS\EWARM(I have applied patch 1.16.1)I'm using a Nucleo-144 STM32F767ZI.The board has a static IP address of 192.168.0.10 with a MAC address of 02:00:00:00:00:00.I'm getting a strange behaviour...When the board starts by the IAR debugger or by pressing the Reset button on the board all works fine.By when I power cycle the board the firmware doesn't work, that is, when I try to show the web page at address 192.168.0.10 I get a connection error after some time.However if I put a delay before ( see code below for main() ) the initialisation of the LwIP all works. With debugger, with reset and with power cycle.It also works with 2.5s delay, but not with 1s delay.The difference I can see in wireshark is when I power cycle without the delay the ARP annoucement shown below is not transmitted by the Nucleo-144.40175 1124.456115 02:00:00:00:00:00 Broad
I cannot get OTG_HS to communicate with a USB host, and I'm out of ideas. Any help would be greatly appreciated.The problem:I've instrumented HAL_PCD_IRQHandler to print whenever an interrupt occurs. Right after USBD_Start, I get:0x800 (USBSUSP)0x1000 (USBRST)0x2000 (ENUMDNE)It then repeats 2 then 3 a few times until the OS gives up. I do not get any other interrupts (I'm expecting at least RXFLVL after USBRST to transfer the Setup packet). Windows reports Device Descriptor Request failed. Linux reports "device descriptor read/64, error -71".Things I've tried:DMA Mode and NotData Caching universally disabledPutting hpcd_USB_OTG_HS into noncacheable memory. (Strangely, this prevents any USB interrupts from arriving for some reason)I've tried enabling Activate-VBUS. This changes the behavior (I get SRQSINT, USBRST, and that's it)I've tried initializing as PCD_SPEED_FULL instead of PCD_SPEED_HIGH with no changes.Possibly relevant details:VDD50USB is driven by VUSB at 5V, and VDD33USB is p
Hello STM32 community,I am currently working on an embedded application using the LPTIM1 (Low Power Timer Mode) on an STM32WL55JC16 microcontroller. My goal is to count pulses from an external signal connected to the BP5 pin (assuming this is the correct pin for pulse input), and after counting 500 pulses, I want to trigger an interrupt.However, I am facing some issues in achieving this functionality. Here is the general setup:Pulse Source: (Flow Sensor) External pulse signal connected to BP5 pin.Timer Mode: LPTIM1 in low-power mode.Desired Behavior: Count up to 500 pulses, then trigger an interrupt.Issue:After setting up the LPTIM1 and starting the timer, the program counter reaches HAL_Init and continues initialization, then enters the LPTIM1_StartWithCompare(compare_value) function.The timer starts but gets stuck in Error_Handler() after this function is called.I have shared the code below, and I am uncertain about whether this issue is related to clock configuration or the timer mo
Hi - I am new to the STM32CubeIDE - moving from Attolic.I have created a new STM32 project using STM32CubeIDE 1.9.0 for a STM32L151VET6 using New Project.Our board is built to use an internal oscillator. I can try to debug the basically empty new created project or add just a for loop in the while(1) in main() and either way it immediately stops on Hardfault_Handler. In the Fault Analyzer :X Bus, memory management or usage fault (FORCED)X Imprecise data access violation (IMPRECISER)X Stacking error (STKERR)I have set a breakpoint on the while(1) and on the for loop inside it and neither are ever hit.I believe I have set the pins in the IOC to match my board ( UART, SPI, GPIO )Any suggestions on how to proceed ?Thanks!
Hi everyone, I am using the STM32U5G9J-DK2 board and have generated the USB Video Class (UVC) code using CubeMX. However, I am new to both this board and UVC, and I am facing difficulties in understanding how to proceed further. I couldn't find any specific examples or resources related to UVC implementation for this board. If anyone has already worked on UVC with this board or has any example code, it would be a great help. Looking forward to your responses! Thank you in advance.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.