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 using the IHM07M1 inverter board to run a PMSM motor, and I need to measure the phase current using the low-side shunt resistor. Currently, I configured the ADC in injected mode and trigger it from a timer event on the falling edge of the PWM.I have a few doubts:Is triggering the ADC on the PWM falling edge the correct method for accurate low-side current sampling?Since current flows through the low-side shunt only when the low-side MOSFET is ON, should I trigger the ADC only during the low-side ON time, or is it valid to sample at any moment in the PWM cycle?I am using Timer1 with 3 channels for PWM generation, and Channel 4 (CH4) as a compare channel to trigger the injected ADC.What value should I assign to OCxREF4 for correct sampling timing?I’m confused about how to choose the right compare value inside the PWM period. If anyone has experience with this setup, please share your guidance. Thanks!
Good morning.I'm still trying to develop in STM code.I have an open-source code developed for the STM32L476.Questions:If I generate a compiled HEX for the STM32L476, will it run on the 411?Are they compatible?Is it possible to migrate to an STMF303 or an STM32F411?These are the ones I have to continue developing my studies.I still don't have enough knowledge.I've been trying to adapt it to the various available STM controllers.Thank you.Valter Matos
Hi everyone. I am relatively new to working with STM32 devices, and I am currently attempting to design a USB microphone with an analog input using the Nucleo-L476RG development board in combination with the X-NUCLEO-CCA02M2 USB audio expansion board. To configure the system parameters in STM32CubeIDE, I followed the procedure described at the following reference: STM32F4 USB microphone | Details | Hackaday.io. Using this configuration, the computer successfully recognizes the device as a USB microphone; however, no audio data is being transmitted. I have attached the relevant configuration files—usbd_audio.c, usbd_audio.h, and main.c—in case someone might help identify any mistakes or oversights in my implementation. The analog signal is acquired through a single ADC channel using DMA with interrupt callbacks. The USB audio streaming is configured for a sampling rate of 48 kHz, and Timer 8 is used to trigger the ADC conversions. Any assistance or guidance would be greatly appreciated.
Hello,I am working with an STM32L072 and trying to generate a 1Hz interrupt with as little time drift as possible. For this, I am using the RTC wakeup interrupt at 1Hz, with the LSE (32.768 kHz quartz, 10 ppm) as the clock source.On several products, I observe a periodic time drift of about 4ms. The period and sign of the drift vary from one product to another, but the pattern is repeated consistently. The attached graph shows that the drift is periodic for each product, but with different periods.To measure the interrupt timing, I set a flag in the interrupt handler that triggers a USB message to the computer. This explains the noise in the reception time, but not the 4ms discontinuities or their periodicity. The MCU remains in run mode during these tests. And there is no reset of the board.The 4ms drift corresponds to approximately 0.0039978s, which is equal to 131 LSE ticks (131/32768). This seems significant and unexpected.Initially, I suspected an issue with my RTC configuration,
Hello everyone,I'm trying to get the USB CDC protocol working with USBX. The hardware is fine because DFU works, and I can flash the board through it. Following a tutorial, I was also able to implement a bare-metal USB CDC device, and everything enumerated correctly and printed data.I uploaded the USB_CDC example for the STM32WBA65RIVx, and that also enumerated without issues.(I removed the UART part because I don’t have it; I only tested sending “hello world”.)Then I tried to integrate USB CDC into my own project, and I got stuck because I couldn't understand why the example works but my IOC configuration does not.Eventually, I found that enumeration only works if the option UX_DEVICE_CLASS_CDC_ACM_TRANSMISSION_DISABLE is enabled.When I disable that option, the PC cannot detect my board.What could be the reason for this?I increased:usbx_system_stack_size to 32×1024usbx_memory_pool_size to 32×1024Another strange thing: this parameter must be set exactly like this, otherwise enume
Hello, I have a query that can we send or stream the audio instead of Linein or Audio Jack, can we send it through CN12 or CN11 pins (UARTor SPI) from external UAC supported device in I2S format? If yes, could you please help me to configure it. I am using PBP_source example firmware of STM32WBA55G-DK1.Thank you
Dear allI have a complex Flash problem. But even with NUCLEO-C092RC Board and the provided FLASH_EraseProgram example I have Flash erase and/or program problems.I adapted the original provided ST code a litte to get more information of the problem with the on board LED's.This is the code I changed: (all the rest is 100% original code)Problem description (with Keil uVision):/** * @brief The application entry point. * @retval int */ int main(void) { /* USER CODE BEGIN 1 */ /* STM32C0xx HAL library initialization: - Configure the Flash prefetch - Systick timer is configured by default as source of time base, but user can eventually implement his proper time base source (a general purpose timer for example or other time source), keeping in mind that Time base duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and handled in milliseconds basis. - Low Level Initialization */ /* USER CODE END 1 */ /* MCU Configuration------------------------------
Hello,I am working with an STM32H563VITx (2 MB Flash) and I am experiencing a repeatable issue when placing two custom sections (.param_defaults and .app_defaults) at the end of Flash.The application runs as long as these sections are removed.But when they are enabled, ST-LINK GDB server / STM32CubeProgrammer fails to erase/program the Flash during a debug session.Project setupI have a bootloader located at 0x08000000 (32 KB) and the application starts at 0x08008000.At the end of the application Flash, I place two small tables:.param_defaults (160 bytes).app_defaults (96 bytes)Both are aligned to 32 bytes.My linker script computes their addresses like this: FLASH_APP_END = FLASH_APP_START + FLASH_APP_LENGTH; FLASH_APP_TABLE_START = ((FLASH_APP_END - FLASH_APP_TABLE_LENGTH + 31) / 32) * 32; FLASH_PARAM_TABLE_START = ((FLASH_APP_TABLE_START - FLASH_PARAM_TABLE_LENGTH + 31) / 32) * 32;These sections end up at: .param_defaults : 0x081FFF00.app_defaults : 0x081FFFA0 He
Hi everyone,I'm working on a project with an AR0144 image sensor connected to CSI2. (STM32N6)I have a question: if I use PIPE0 without any ISP processing of ROW10 data from the sensor to memory, do I still need to use ISP?Do I need to initialize it? ISP_Init(...)Thanks,Danilo
Hi there,Chip: STM32L053R8TxI've encountered an issue where the code generated in tsl_user.h at the "/* Channel IOs definition */" is incorrect and does not match the chosen settings in the .ioc.In TOUCHSENSING in the .ioc, with TSLPRM_TOTAL_TOUCHKEYS_B set to 8 (one key per sampling capacitor), the first three #define lines in the above section in tsl_user.h is incorrect. It would appear that these lines are hardcoded and unaffected by the code generator. I used the following settings in the .iocIO_TOUCHKEY_B1 is set to G5_IO4IO_TOUCHKEY_B2 is set to G7_IO4IO_TOUCHKEY_B3 is set to G1_IO2IO_TOUCHKEY_B4 is set to G2_IO4IO_TOUCHKEY_B5 is set to G3_IO3IO_TOUCHKEY_B6 is set to G6_IO4IO_TOUCHKEY_B7 is set to G8_IO3IO_TOUCHKEY_B8 is set to G4_IO3...and with these settings, the following code was generated:/* Channel IOs definition */ #define CHANNEL_0_IO_MSK (TSC_GROUP1_IO2) #define CHANNEL_0_GRP_MSK (TSC_GROUP1) #define CHANNEL_0_SRC (TSC_GROUP1_IDX) /* Index in source register (TSC->IOG
Hi, i'm trying to make a firmware that can read an SD card with filex but that can also connect that SD card to USBX MSC device (no simultaney). i'm able to do the two functionality in two separate firmware, but the problem is to merge. for now is sufficient that the card is read at start up and next i can see the SD card with USBX MSC devicewhen i can do that the firmware shall evolve to connect the SD card to USBX MSC and after a modification by PC disconnect the SD card the time necessary to see if something is changed and do stuff unfortunately the first step is totally ok, at startUp i can read the SDcard with FILEX but.. after that USBX wont work i'm using a threadX flag to indicate at the USB that is possible to use the SD card, there is some example about myu goal?i will attach to this message the relevant files.. thank you in advance for any hint. best reguards
We are developing a user interface by using STM32H743 + SDRAM + LTDC + DMA2D and connecting to LCD through an FPC cable, which is only 30 CM long. It works fine.But there is one problem, in some of our products, the LCD can be placed at a position that is 2 meters away from the control board. So I brought a 2-meter-long FPC cable, and the test result was quite bad. Images on LCD became quite unstable and the touch function totally broke down...Is there any solution for this problem?
Hi, I’m working on an STM32G491 MCU and facing an issue with GPIO PB9.In my project, I initialize PB9 as a digital output and try to set it HIGH, but the pin always stays LOW on the board.However, if I configure PB9 as input and toggle the pin externally in the same circuit, I can read HIGH and LOW correctly.Why would PB9 not go HIGH when configured as output? What could be the possible reasons or things to check?
Hi,We have a weired problem with a custom N657 design.When using the Nucleo board, its possible to flash the program on the external flash, as long as BOOT1=1.The programmer resets the board and it flashes the firmware normally every time.On our board we use the internal SMPS and the same external flash with the same diode in the nrst circuit.Wenn i do a power up with BOOT1 pulled up, it flashes without error and the program runs as expected, when i change it to BOOT1=0 and hit reset.But when i want to reflash it, it won't do it.The LED is on and the programmer can connect, but the erase and reflash of the external flash is failing every time until i do a power cycle.The reset signal is reaching the flash, as it should.What could be the problem?
I want to make a project on stm32f103, I write some code. When I want to add sd card support, I need to use spi interrrupt enable.But after I enable the global irq then the code is hang. Besides I debug the code with gdb, then I do ctrl + c , then I found the code hang in some nvic irq handler like WWDG_IRQHandler, UsageFault_Handler, USB_LP_CAN1_RX0_IRQHandler randomly.I try to disable all nvic irq and clear the pendings , But I found it's useless, the code as below int ret; LL_SPI_InitTypeDef spi_init; LL_GPIO_InitTypeDef gpio_instance = {0}; LL_GPIO_AF_Remap_SWJ_NOJTAG(); __HAL_RCC_SPI3_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); /**SPI GPIO Configuration PA15 ------> SPI3_NSS PB3 ------> SPI3_CLK PB4 ------> SPI3_MISO PB5 ------> SPI3_MOSI */ gpio_instance.Pin = LL_GPIO_PIN_15; gpio_instance.Mode = LL_GPIO_MODE_ALTERNATE; gpio_instance.Speed = LL_GPIO_SPEED_FREQ_HIGH; LL_GPIO_Init(GPIOA, &gpio_instance); gpio_insta
Hello ST Team,I am using an STM32H755ZIT6 where CM7 handles a high-speed Quad-SPI flash interface with 100Mhz and UART communication with flow control 115200 baud.The same firmware runs on two hardware revisions:Revision V2: Works perfectlyRevision V3: Same firmware → occasional failure in UART frame processingThe QSPI itself receives data correctly (verified with CRC), but the “end of frame” indication is occasionally not processed.Observed Firmware Behavior1. Using RTOS Event Flags (original implementation)In the UART receive callback, when “end of frame” (EOF) is detected, we set an RTOS event flag: osEventFlagsSet(dataReceiveEvent, DataReceived);Problem on V3:Sometimes the event flag is not triggeredEven though all received bytes are correctCRC validation passesThe callback executes, but the main task does not wakeThis leads to missed packets even though the data is fully received.2. Switching to Polling Loop (temporary workaround)We replaced the RTOS event flag with a s
I'm trying to read the ID of ST7701SN with STM32F469. The read command was sent correctly by the MCU. But the voltage of the response by the ST7701SN is too low. Could it be caused by the settings of the MCU? I tried different screens but it's always the same result.
Hello,I have been working with a NUCLEO-WBA55CG board and the X-NUCLEO-IKS02A1 expansion board. When running my initialization code, the program execution jumps to the error handler. Using a debugger, I've pinpointed the failure to the ISM330DHCX_Set_Mem_Bank function. The function returns an error status, which triggers my error handling routine. My initial approach was to replicate the project setup described in DataLogTerminal project . This led directly to the failure at ISM330DHCX_Set_Mem_Bank. I have compared my initialization code against the reference implementation in Board Extension IKS02A1 ISM330DHCX_0_Probe function and they appear to be identical.My Questions:Is there a known compatibility issue for using ISM330DHCX with the NUCLEO-WBA55CG board?Could this failure point to a I2C communication problem or a timing issue? How can I fix it?Any recommended procedure for initializing I2C or this sensor? Here is the code that I added:/* USER CODE BEGIN Includes */ #incl
[VERSION]: MCWB v6.3.2[TOOL]: STM32CubeMX v6.13.0, STM32CubeIDE v1.11.5[BOARD]: STEVAL-PTOOL1V1[PROJECT]: STEVAL-PTOOL1V1_6S_SL and STEVAL-PTOOL1V1_6S_HLWhen I run the STEVAL-PTOOL1V1_6S_SL project generated by STM32CubeMX, the program loads and runs as expected. When I run the STEVAL-PTOOL1V1_6S_HL (which is just the Hall-effect version instead of the sensorless SL version), the program loads and runs when the debugger is connected, but would not run properly after a power cycle, unless I reset the chip using NRST. Both were tested on the same PCB.I thought the program wasn't booting, but determined that it actually was, but it just wasn't getting past some of the init functions (I think the MX_MotorControl_Init call). If I add a delay (~1s) after the HAL_Init() and SystemClock_Config() calls, before the other peripheral init calls are made, the program runs normally after a reboot for the most part. I still see som
Hey there I have seen a few posts on this and tried a number of things:1 I went through the process in the user manual and get the error shown2. I tried to reboot board with the jumper moved to boot mode. I put it into UART mode but then got similar errors (Error Activating Device : KO. ...."I get the same error on the programmer and the Cube IDE. USB cable is good (it works with other ST eval kits)I'm running Windows 11, programmer is the latest v2.21.0, Cube is v2.0.0. I installed the cube expansion and built the beacon code. As a note, I can see the device using the ST BLE Toolbox and it shows as an Apple iBeacon and a peer to peer server and is unconnectable.When I put the boot mode jumper on then power goes down to 0.26V when I connect over STLink. And device does get hot but not sure if thats normal
I'm using zephyr sysbuild approach to get mcuboot along with the application (application runs in XIP mode)I see that application proceeds to some point; I presume to the point where I enable MCO LL_RCC_EnableMCO(LL_RCC_MCO1)And then it gets stuck, since I'm not able to attach gdb yet, I'm not sure where to digKindly appreciate any help hereSeems that it interferes with other clock subsystems, but don't know whichI haven't found anything in errata yetPlease advise, thank youEDIT: Although I'm able to see MCO pin (PA8) toggling with the desired frequency, which means SEL and PRE DIV were ok
Hello, I may have accidently either shorted or applied voltage to my UART TX and RX pins on my MCU which is on a custom PCB and now my PCB is pulling +60 mA of current under load. I am now experiencing difficulty programming the chip and I am getting errors such as "unable to recognize device" and "check power and cable". I wonder if exposing my UART pins to ground or power caused some sort of ESD or electrical damage inside the MCU and that combined with a longer power supply cable is causing a jump in current that makes it difficult to flash now? Thank you.
This is a big problem for me, as I have thousands of products out there using the older BLE_OTA bootloaders, bootloaders which themselves are not updatable by OTA. I have a custom phone app for iOS and Android that interfaces with these products and provides OTA updates.I was about to release an update to the product firmware via my phone app that incorporates several important fixes, but in regression testing this firmware, I found that older units could not successfully perform OTA updates using my new firmware (though units programmed with the updated bootloader could). I tried many combinations to see what worked and what doesn't work, before narrowing the problem down: FUSBootloaderStackStack locationFirmware Git hashResult + notes01.23 plus b87d60Worked like normal the second time.1.2.0.01.20.01.20.0.20x805A000b87d60No STM_OTA when commanded1.2.0.01.20.01.22.0.20x805C000b87d60No STM_OTA when commanded1.2.0.01.23 plus1.22.0.20x805C000b87d60W
Now I've been sitting here for 2 long day's and still haven't been able to solve the BUS-error problem. I'm logging with Kvaser USB CAN card so what I want to see right now is some healthy frames coming out from it, but no, only bus-errors, so I thought it was time to ask the community about it. I'm not a newbie in CAN and I've made an earlier project with STM32F302R8 which worked fine, but with this processor I seem to be stuck. The main.c attached is only me trying to get the interfaces up and running. What is strange is also the FDCAN Protocol status which doesn't seem to give me correct info, for example the "Activity status" which seems to be 8. Are there a friendly soul somewhere that could help me out? Intention is to get the classic CAN working and then Move over to CANFD. (With a different PC CAN interface of course) Thank you in advance, Johan [FDCAN] Classic 125 kbit/s up (PCLK1=64000000 Hz) [FDCAN] LEC=7, DLE=7, ACT=8, EP=0, Warn=0, BO=0, RxESI=0, RxBRS=0, RxFD=0, PE=0, TDC
Hello,I saw that some people had a similar problem to mine. When generating the project on MC Workbench I have the following error: STM32CubeMX not found - ver. "6.0.0" or higher is requiredBut I have STM32CubeMX installed with version 6.14.0I tried to install STM32CubeMX for all users or to change the Windows language to English as I saw on other posts but without success.Does anyone have another suggestion? Here are some various screenshots that have been asked in similar posts Thanks for your help !
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.