Join conversations with your peers and ST experts. Explore the full potential of STM32 microcontrollers for your embedded design.
Most recent activity
Hi everyone, I am having issues interfacing an ADS1298 board with a NUCLEO F767ZI. void ADS1298_ReadConfig1(SPI_HandleTypeDef *hspi) { uint8_t command[2] = {0x20 | 0x00, 0x00}; // RREG command for sending ID uint8_t sdatacCmd = 0x11; // SDATAC mode command for sending data GPIOA->BSRR = GPIO_BSRR_BR4; // CS LOW *(volatile uint8_t *)&SPI1->DR = sdatacCmd; // SDATAC command, stop reading data so the ADS1298 can receive commands -- direct register access method while (!(SPI1->SR & SPI_SR_TXE)); // Wait until TXE (Transmit buffer empty) is set while (SPI1->SR & SPI_SR_BSY); // Wait for transmission to complete while (!(SPI1->SR & SPI_SR_RXNE)); // Wait until RXNE (Receive buffer empty) is set volatile uint8_t sdatac_status = *(volatile uint8_t *)&SPI1->DR; // Discard *(volatile uint8_t *)&SPI1->DR = command[0]; while (!(SPI1->SR & SPI_SR_TXE)); while (SPI1->SR & SPI_SR_BSY); while (!(SPI1-
I am designing a system with an STM32 and an FPGA(Xilinx 7 series).STM32 is in charge of the user interface and the FPGA is in charge of driving the LCD to show images.Information needs to be exchanged between the STM32 and the FPGA. (STM32 send a command to the FPGA to choose which image to display or to stop displaying. STM32 also need to write all logs to the SD card through the FPGA. FPGA needs to report to the STM32 how many images are displayed and how many remain.)After some research, I found SPI seems to be fast and easy to implement.(I am not sure which interface is commonly used for communication between STM32 and FPGA?). I wonder if there is another interface that is faster or easier to implement?
I am trying to work on STM32F439ZIT6 using its respective Nucleo board. I am not able to generate an ioc file even after installing the latest version 1.28.2 in STM32F4 series. Why is this happening and how can i resolve this issue?RegardsavbST
Hi, gents, I have some need to use SPI slave mode instead of working SPI master mode. I'm tranferring 22 16-bit words from Infineon slave board at 6Mhz clock rate, once per 100 ns, and have 4-line interface including CS line. Due to noisy lines I prefer to reset communication before each 22x16 bit transfer. The picture is attached - the 4th line represents CS signal, the 2nd line - data sent from STM32, line 3 is zero as zeros are sent. After some attempts to write the code I came to solution, when I'm attaching a low-priority EXTI interrupt to SPI5 NSS pin (PF6 GPIO pin), and this interrupt has the following code (this code worked OK for master mode):if (GPIO_Pin == GPIO_PIN_6) { if (hspi5.State != HAL_SPI_STATE_READY) { HAL_SPI_DMAStop(&hspi5); } HAL_StatusTypeDef td = HAL_SPI_TransmitReceive_DMA(&hspi5,(uint8_t*)spi2CAT, (uint8_t*)CAT2spi, CAT_PACK_SIZE*(sizeof(int32_t)/2)); tdd = td; SPI_cnt++;
My STlink V2 is not being detected. I bought an original stlink but it's still not being detected. I had a clone previously. It's frustrating why it's only happening with me. It says could not verify ST device. When I update it it says can't detect ST Link. And I don't even know how I am able to update stlink every time I connect it. Please help.
Hi All,I am trying to get up and running the above hardware. I downloaded the software for the board, and we already use IAR compiler here. After compiling and downloading (via the STLink), the system runs the program just fine.However, I just need to run the system with the onboard POT and it is not moving or energizing the motor at all.I changed the 6step_conf.h file to POTENTIOMETER_INTERFACE = 1 and all others to 0. Nothing happens.All the voltages to the board are perfect (running 70VDC to the board via a 7 amp programmable power supply).All help would be greatly appreciated. This is my first intro into using the part. Time is very tight.regards,Charles
Hello,It took few days to find what is wrong with network, and why I can't get it to work, finally I found what libraries have wrong definitions for heth and eth_handle in file nx_stm32_eth_config.h:extern ETH_HandleTypeDef heth; #define eth_handle hethFor N6 MCU correct definition is heth1 defined in main.c, and still, even if you replace heth to heth1 you will not get ethernet to work, I am not sure why, only one way how I get it to work is to replace all heth and eth_handle variables to heth1 in nx_stm32_eth_config.h file !But the worst moment is then you regenerate code from cubeMX all the replacements is gone and network will not work again.And for STM team - dont change structures in examples, include IOC files, because cubeMX generates code totally differently, you are not only causing problems for users, but you are also struggling to solve customer issues yourself.
Hello everyone, I'm currently working on a FOTA (Firmware Over-The-Air) system for my STM32-based project, and I’d love to get your insights or validation from the community regarding the architecture I'm considering. My Goal: To ensure safe firmware updates and enable a rollback mechanism in case something goes wrong during or after the update (e.g., power failure, invalid firmware, etc.). My Current Design: I’ve divided the Flash memory into three main sections: Region Description Bootloader Located at 0x08000000 — always runs first. Handles firmware updates and boot decision logic. Update Space A dedicated Flash section (e.g., at 0x08020000) where the new firmware is written and validated before execution. Application The main app firmware runs from here (e.g., 0x08080000). Update Workflow I'm Considering: The new firmware is received via UART/Wi-Fi and written directly to the update space in Flash. Once fully received, I compute the CRC on the update spa
ST Documentation describes how to determine prior gains of Current PI controllers. My doubts are:1. Will these gains work for all load conditions? How to tune them under varying load conditions? What is the documentation/process related to it, please share?2. How is Motor Control Workbench auto calculating PI Gains for Speed Controller Regulator? Please share documentation/formulas related to it. Official documentation is only about Current PI controllers gains determination. Thank you for your time and support.
hello everyone:I have a problem trying to draw lines.In touchgfx,in most cases,things are done by bitmaps,but draw lines, it is awfull to use. In designer,if I want to draw a line ,I need to first add a line statement,then set line parameter, then add this line to screen.But in many applications,I have to draw dozens of line segments,even more.So,how can I manage to draw dozens of lines into screen or a dynamic bitmap?I have read about the cavas widget,but I can't find any demo on this subject, I really hope to get some help.
Hello,in file RegListSTMV2.json I can define custom registers. Most registers have "UpdateFrequency" configured to "MediumFreq".How often is "MediumFreq" polled by Motor Pilot?Is it possible to configure the polling frequency in Motor Pilot?Thanks,
Hello everyone,I am trying to use the Vector Renderer to draw lines because it utilizes GPU2D, which offers faster rendering compared to the Canvas. Below is the code I am using for this purpose: void TestWidget::draw(const touchgfx::Rect& invalidatedArea) const { if (numPoints < 2) { return; // Nothing to draw } VectorRenderer* vectorRenderer = VectorRenderer::getInstance(); // Configure the vector renderer Rect absoluteRect = getAbsoluteRect(); vectorRenderer->setup(absoluteRect, invalidatedArea); vectorRenderer->setMode(VectorRenderer::STROKE); vectorRenderer->setStrokeWidth(lineWidth); vectorRenderer->setColor(lineColor); touchgfx::Matrix3x3 transformationMatrix; transformationMatrix.scale(scale); transformationMatrix.translate(deltaX, deltaY); // Apply the transformation matrix vectorRenderer->setTransformationMatrix(transformationMatrix); // Prepare command and coordinate arrays uint8_t cmds[MAX_POINTS] = {0}; float coords[M
Hi STM Team, We are planning to use STM32G491 MCU in our application. As per datasheet, it is mentioned that STM32G491 MCU will support USB PD 3.0. We have come across the below STM document where it is mentioned that "STM32 UCPD MCUs are compliant with the latest USB PD r3.1 specifications" and EPR support is there. Could you please confirm, whether STM32G491 MCU supports USB PD 3.1 and Extended Power Range Support(upto 240W). Warm Regards,Mythili B
Tests Performed and Results:1.A DC regulated power supply was used to provide 14V to the board directly. At room temperature, the CPU's TIM pin output is normal. However, at high temperatures, the output waveform becomes intermittent.2.The on-board 3.3V and 5V power supplies remain stable and within specification at all times.3.The external crystal oscillator connected to the microcontroller maintains a stable waveform under all temperature conditions.4.The same issue occurs even after replacing the CPU with one from a previous production batch: the TIM pin output is normal at room temperature but becomes intermittent at high temperatures.5.This TIM pin is used to simulate a frequency signal. When the output becomes intermittent, the total output duration becomes longer. The firmware uses a pulse count to determine when to stop the output, so it appears the missing pulses (due to missed interrupts) cause the output to last longer than expected.Questions:Given the above results, w
Hi,I have a funny issue. I just wanted to add a Share button to my Main Screen in an STM32TouchGFX of a working Weather Station app but when I built and run the app in STMCubeIDE all the widgets which uses background images showed surprising garbage images.Then I changed the Section and Extra Section to IntFlashSection in Default Image Configuration group of Config menu of STM TouchGFX:Then I rebuilt and run the app and everything worked just fine:Who understands this?I Checked the HSPI configuration in STM32CubeMX but I could not find any wrong settings for octo-SPI, so the external flash memory which stores the images (by default) seems to be okay.In addition any ST Demo which based of TGFX works with external flash settings.What could go wrong?Thanks,Louis
Hello everyone,I've designed a development board featuring an on-board STLink (based on STM32F103CBU6) and an on-board MCU (STM32H753VIH6. However, I'm encountering a frustrating issue with the on-board STLink functionality.I've flashed the STLinkV2.J28.M18 firmware onto the on-board STLink, and it seems to be recognized correctly by my system. Both the virtual COM port and the STLink device appear in the Device Manager without any errors. That part seems to be working as expected.The problem arises when I try to use this on-board STLink to connect to the STM32H753VIH6 MCU. It simply won't establish a connection. I've done some troubleshooting to narrow things down:I've confirmed that the power supply to both the STLink and H753 MCU is stable and correct.The H753 MCU itself is functioning properly.Most importantly, I can successfully program and debug the H753 MCU using an external STLink connected to the board's SWD interface. This confirms that the MCU's SWD interface is workin
Hello,I'm using a specific board where the STM32 cohabit with another "master" device on the parralel bus.One time the STM32 is the master and "drive" the external RAM and one time the other device "drive" this RAM.My first thought was to disable the FMC and put all pins in disable (input ?) mode when the STM32 is not the master.And when the STM32 become the master again, put th GPIO back in alternate mode and re enable the FMC.Something like this to disable the FMC:__FMC_DISABLE(); LL_GPIO_SetPinMode(GPIO_FMC_A0_Port,GPIO_FMC_A0_Pin,LL_GPIO_MODE_INPUT); LL_GPIO_SetPinMode(GPIO_FMC_A1_Port,GPIO_FMC_A1_Pin,LL_GPIO_MODE_INPUT); ..... And to reenable it, something like :LL_GPIO_SetPinMode(GPIO_FMC_A0_Port,GPIO_FMC_A0_Pin,LL_GPIO_MODE_ALTERNATE); LL_GPIO_SetPinMode(GPIO_FMC_A1_Port,GPIO_FMC_A1_Pin,LL_GPIO_MODE_ALTERNATE); ..... __FMC_ENABLE(); Obviously, if I'm here this is because it's not working as expected...When the FMC is disabled, the other device canno't access the RAM. L
Hi allI am working with SPI1 on stm32f407vgtx and issue what I am, facing my NSS which internally controlled by SPI is taking more time for goes high even CLOCk has been stopped . my configuration are SPI full duplex 16 bit data clock is 2.6MHZ after prescaled I am transmitting on spi every 10ms task. Please check the screenshot of logic analyzer for further understanding .Note: in the end I have disabled SPE bit before checking TXE and busy flags.
Hello,I am developing a RAM-based bootloader on STM32H5, to update my firmware application.Application and bootloader resides on different flash areas, and the bootloader code is copied into RAM at startup.[0x8000000 - 0x801FFFF] bootloader[0x8020000 - 0x803FFFF] reserved[0x8040000 - 0x80FFFFF] application First, the bootloader erases all the application sectors.Then the bootloader receives code fragments via fieldbus, and program the flash memory 16 bytes (flash-word) at time, at correctly aligned addresses:int16_t HW_FLASH_Program(uint32_t addr, int32_t len, uint8_t *buff_p) { HAL_StatusTypeDef status; uint8_t flash_word[FLASH_WORD_LEN]; uint32_t aligned_addr; uint32_t offset; uint32_t chunk; HAL_FLASH_Unlock(); while (len > 0) { // back-align the address to 16 bytes aligned_addr = addr & ~(FLASH_WORD_LEN - 1); if ((addr == aligned_addr) && (len >= FLASH_WORD_LEN)) { status = HAL_FLASH_Program(FLASH_TYPEPROGRAM_QUADWORD, addr,
Hi everyone,I have successfully deployed the VENC_SDCARD example on the board and can see its feed on my laptop. Now, I want to record it at 480x480 resolution instead of the default 800x480 provided in the example.I have modified the buffer size, DCMIPP, LTDC configurations, and made a few additional changes. I’m attaching my main.c and stm32n6570_discovery_lcd.c files for your reference.The following is my camera feed.and these are the debug statements in the uart terminal.which looks fine to me with no errors.However, after recording in microSD card and decoding using the ffmpeg command provided in the project's README, I get the following error:kartikkhandewal@atl-hpzg14-99:~$ ffmpeg -f h264 -framerate 30 -i dump.bin -vf "fps=30" -c:v libx264 -preset veryfast -crf 23 output_fixed.mp4 ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdev
Hello, i am working on a project involving Wake-Up Radios (WuR) for underground sensor networks. The system is based on a STM32U5 microcontroller and a SX1261 LoRa transceiver module,I have a problem with the BUSY pin the transmitter is stuck waiting for the BUSY pin to go low after sending commands. The STM32 reads the BUSY pin as logic high (1) indefinitely, but an external oscilloscope shows the BUSY line is actually low (0). This discrepancy prevents the program from proceeding, as it continuously waits for the BUSY pin to go low. The pin is configured as an input without pull-up or pull-down resistors. I've verified the pin number and mapping several times.In addition to that, I want to confirm that the SX1261 is actually starting transmission when I send a command. Currently, I don’t receive any TX_DONE interrupt, and the transmission seems to silently fail. Is there any known method to verify that TX is starting on the SX1261? Also, is there a way to bypass
I am trying to run a loopback test with 2 i2c's on the same board. The onboard leds need to light up on successful transmission and reception, the problem is the leds light up when in debug mode, going line by line, but not in stand#define I2C1_ADD (0x15<<1) #define I2C2_ADD (0x42<<1) uint8_t I2C1_tx='1'; uint8_t I2C2_tx='2'; uint8_t I2C1_rx,I2C2_rx; HAL_I2C_Slave_Receive_IT(&hi2c2,&I2C2_rx,sizeof(I2C1_tx)); HAL_Delay(100); HAL_I2C_Master_Transmit(&hi2c1,I2C2_ADD,&I2C1_tx,sizeof(I2C1_tx),1000); HAL_I2C_Slave_Receive_IT(&hi2c1,&I2C1_rx,sizeof(I2C2_tx)); HAL_Delay(100); HAL_I2C_Master_Transmit(&hi2c2,I2C1_ADD,&I2C2_tx,sizeof(I2C2_tx),1000); while(1) { if(I2C2_rx==I2C1_tx) { HAL_GPIO_WritePin(GPIOG,GPIO_PIN_13,SET); HAL_Delay(100); } if(I2C1_rx==I2C2_tx) { HAL_GPIO_WritePin(GPIOG,GPIO_PIN_14,SET); HAL_Delay(500); } }alone. Can someone plz suggest what might be wrong.
i cant seem to really connect to my iphone after direct advertising i get a false print that i have connected Bonded device 0 / 1 - Public BLE address xx:xx:xx:xx:xx:xx -- here it prints my true iphone bluetooth mac addraci_gap_add_devices_to_list() status = 0x00aci_gap_get_bonded_devices = 0x00 (found 1 devices)aci_gap_set_direct_connectable (HIGH DUTY) = 0x00aci_gap_update_adv_data = 0x00Directed ADV to iPhone = Success>>== HCI_LE_ENHANCED_CONNECTION_COMPLETE_SUBEVT_CODE - Connection handle: 0x0- Connection established with Central: @:4f:17:21:ee:cb:2c- Connection Interval: 0.00 ms- Connection latency: 0- Supervision Timeout: 0 ms it isnt truly connecting because i get the same print when my iphone is off or is not in range why does this happen? i am using stm32wb15 nucleo boardi would love to get an example like thishttps://github.com/stm32-hotspot/STM32WB-Filter-Accept-List-Peripheralwhere the only change is that in static void adv_start(void)it uses directed advertisi
I’m using the STM32L443 in one of my products, and currently, there are around 2,500 units deployed in the field. I’ve been experiencing issues that I believe are related to the firmware programming process during production. The product includes a seven-segment LCD. After programming the firmware and running tests, I noticed that some characters do not display correctly in certain menu screens. I’m confident this is not a hardware issue. Interestingly, when I reflash the firmware on the same board, everything starts working properly — the display shows the correct characters. These are just the visible symptoms. I’ve also observed cases where the firmware seems to get stuck in a specific scenario. For example, there’s a routine that runs every 5 minutes. On the third iteration, the system hangs. Even after a power cycle, it always gets stuck at the same point. However, if I reflash the firmware, the issue disappears. This makes me suspect that the firmware might n
Hello,I’m trying to measure temperature using NTC sensors on four different ADC channels of my STM32 Nucleo‑H7 board. I could previously connect potentiometers to the same pins and get flawless ADC readings with the same code and CubeMX settings. I only added a function to convert NTC readings to temperature and didn’t change any other configuration.I connected the NTCs to PA6, PA7, PC4, and PC5. In my loop, I call HAL_ADC_Start(), then four times HAL_ADC_PollForConversion() and HAL_ADC_GetValue() to retrieve the raw ADC values. When I measure the sensor output directly with a multimeter, I see about 1.65 V, but the ADC reads ~0.03 V, resulting in completely unrealistic temperatures.I never had this issue with potentiometers on the same pins and code. Why am I getting such low readings with the NTCs? Is my channel assignment wrong, the pin mode incorrect, or could hardware jumpers/shielding be affecting it?Has anyone experienced something similar or have suggestions? Thanks!
ST Community highlights – April to June 2026
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.