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 CORDIC engine on an STM32G474 to perform an atan2, sin, and cos operations sequentially. Running the code below and testing different inputs yields expected results for atan2, but does not yield expected results for sin and cos. However, the sin/cos operation does yield expected results when commenting out the first CORDIC operation. Essentially, it appears that reconfiguring the CORDIC engine and running a different operation in quick succession yields incorrect results for the second operation. I didn't notice any examples in AN5325 that discussed reconfiguring the CORDIC engine, so I'm not sure how to deal with this issue. LL_CORDIC_Config(hcordic.Instance, LL_CORDIC_FUNCTION_PHASE, LL_CORDIC_PRECISION_6CYCLES, LL_CORDIC_SCALE_0, LL_CORDIC_NBWRITE_2, LL_CORDIC_NBREAD_1, LL_CORDIC_INSIZE_32BITS, LL_CORDIC_OUTSIZE_32BITS); LL_CORDIC_WriteData(hcordic.Instance, cordic_input_x); LL_CORDIC_WriteData(hcordic.Instance, cordic_input_y);
Hi all,I am doing a project and need up to 25 ADC channels to read current from HAL ACS712 sensor,I have never read so many ADC channels.I saw that the STM32L152VET6 supports 25 ADC channels, so I chose it.I have a problem when configuring with ST32 IDE, how to identify IN0 and IN0b in Rank - channel, I see that there is only channel 0 to channel 1, channel 0b is not found.Please help me, thanks all !
Posted on December 08, 2016 at 17:50 I'm trying to jump from an application to the DFU System Memory Bootloader. According toAN2606 this should work with my processor and the System Memory should start at address0x1FFFC800. I'm using an external clock (HSE) with 16MHz. I'm using CDC with CubeMX which is working as expected. For testing I want to jump to the DFU Bootloader when receiving someting via CDC. I found http://stackoverflow.com/a/28288454some code how this should work. In myCDC_Receive_FS function I'm preparing the jump to the bootloader by setting avalue in the RAM and checking this value in SystemInit function: // 16k SRAM in address 0x2000 0000 - 0x2000 3FFF *((unsigned long *)0x20003FF0) = 0xDEADBEEF; // Reset the processor NVIC_SystemReset(); I changed the SystemInit function void (*SysMemBootJump)(void); void SystemInit(void) { if ( *((unsigned long *)0x20003FF0) == 0xDEADBEEF ) { *((unsigned long *)0x20003FF0) = 0xCAFEFEED; // Reset our t
STM32CubeMon-UCPD 1.3.0 does not show any connected board (NUCLEO-G0B1RE + X-NUCLEO-SNK1M1).I followed the intruction in AN5418(ver.5) and the corresponding Youtube video.There are no errors when building the code and flashing it to the board.But the STM32CubeMonitor does not recognize the board, and just shows "Please connect you board"...I already installed the USB driver for ST-LINK and I can only see the COM port in 'select tracer port'.Does anyone know what is causing this error?Thank you and best regards.
Hello,I am thinking of buying an nucleo-g474re for 3-channel DMA sampling from the ADCs. Before I acquire one, I'd like to know if it can fit my use case. There are three analog input sources. Each one ranges from -100mV to +100mV. Is it possible for me to use 3 opamp pins to offset the negative voltages to positive and subsequently amplify to 3.3V? I know it is possible to use the DAC to set the input voltage offset with at least one pin, but I would like to know if this can be done for three. Once I offset, can I route directly to the ADC pins? Can I do this all internally, with no external wires, resistors, and boards?Thank you for your help
Hello,I have made a custom board using the STM32WB55CEU6 chip and I would like to try out some examples that are available from ST. My problem is that these examples are made for STM32WB55CG and I can't find an easy way to change target of these examples. In the read me file it says:This example has been tested with NUCLEO-G431KB RevA board and can beeasily tailored to any other supported device and development board.But i can't seem to find an easy way to do it. My current aproach is:- Getting the example project using CubeMX.- Creating new project with the desired target- Importing .ioc project configurationAfter that I have the same configuration but the project is obviously empty. The example files are linked so i can't copy them. Thank you in advance for any help.
Hello.I have some questions while testing a product using the 107MCU.As the title suggests, when I set up FreeRTOS and create a task, the commonly used callback functions cannot be called:void HAL_SPI_RxCpltCallback(SPI_HandleTypeDef *hspi) void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi) void HAL_SPI_TxRxCpltCallback(SPI_HandleTypeDef *hspi) void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)If I remove the task creation function, it operates normally.Do you know why this is happening?Thank you.
HelloI have two boards master(stm32h743) and slave (stm32g0b1).I am trying to use FDCAN intern bootloader to update stm32g0b1.I have the upgrade file (bin file) for stm32g0b1 saved inside SD-card that the master board has access to.Stm32g0b1 starts from system memory after booting. I send erase command and write commands from stm32h743 to stm32g0b1 to erase the flash memory and write the new bin file to stm32g0b1 and then i send go-command to jump to application and thats all works very well as i want. But, when I receive a new upgrade file on the SD-card and attempt to return stm32g0b1 to system memory, it appears to do so but I'm uncertain if this is occurring correctly, as I do not receive any response from stm32g0b1 when I isend commands, such as the erase command.Anyone has any tips or anything could help me?I use boot0 pin low to start always in system memory after booting.And i use NVIC_SystemReset to resend CPU to systemmemory when Master detect a new bin file inside SD-ca
Can I use STM32F401RCT6 to be I2C master and slave at the same time?1: For the Master, I use I2C1 -> pin PB6 and PB7, I will read data from the current sensor ICs.2: For Slave, I use I2C3 -> pin PA8 and PC9, I will send and receive data from another STM32.Does it work? Please give me advice.Thanks everyone,
Hi,I'm trying to get the infamous Synopsys OTG module to work. I'm not using the STM32Cube libraries, instead I'm rolling my own HAL based on the reference manual, which, as some have noted elsewhere in this forum, is pretty bad.Currently I'm stuck because the core is transmitting zero length packets in response to IN transfers on endpoint 0, no matter what I put in the FIFO or program in DIEPCTL0 and DIEPTSIZ0. Here's my code: static void _ep0_write(struct usb_module *module, size_t ep, const uint8_t *data, size_t length) { assert(module != NULL); assert(data != NULL || length == 0); assert((_OTG_DTXFSTS(module->base, ep) & _OTG_DTXFSTS_INEPTFSAV_MASK) * 4 >= length); _OTG_DIEPTSIZ0(module->base) = _OTG_DIEPTSIZ0_PKTCNT_VALUE(1) | _OTG_DIEPTSIZ0_XFRSIZ_VALUE(length); _OTG_DIEPCTL0(module->base) |= _OTG_DIEPCTL0_EPENA_MASK | _OTG_DIEPCTL0_CNAK_MASK; size_t word_count = (length + 3) / 4; for (size_t w = 0; w < word_count; w++) { // Yes we're prob
Hi,With the latest CubeMx (6.9.1), when calculating the consumption of STM32U535VET6Q, the peripheral consumption is not taken into account in STOP/STANDBY/SHUTDOWN modes. It only seems to work with RUN/SLEEP modes.Thanks
Hello,I'm trying to use FatFS with both USB HOST MSC class and SDIO.FatFS always tries to access the SD card whatever the drive number used in f_mount.May be I'm wrong with the path I use to access the devices : "0" for SD card, "1" for USB.Any help will be welcome.
Hello,I'm developing a USB-Host application (MSC / Fullspeed) with the STM32H743 µC (using STM32H743I-EVAL2 Board)The application works fine when using PLL3Q as clocksource.But when I use PLL1Q or RC48 as clocksource the USB "Core soft reset" timed out: OTG->GRSTCTL |= USB_OTG_GRSTCTL_CSRST; // Core soft reset // Wait Core reset to finish, max 100 ms tout_ms = 100U; while ((OTG->GRSTCTL & USB_OTG_GRSTCTL_CSRST) != 0U) { if (tout_ms == 0U) { return ARM_DRIVER_ERROR_TIMEOUT; } tout_ms--; HAL_Delay(1U); } HAL_Delay(1U);I mapped RC48 to MCO1 to check if there is an 48MHz output and it is.I checked the RCC/USB registers but couldn't find anything suspicious.Does anyone has an idea what's wrong here?Thanks,Peter
I'm wondering if this is caused by the use of a usb type-c connector. Is there recommended wiring for how to connect a type-c to STM32 processors while retaining the ability for dfu functionality? Note that for BOOT0 R30 has been modified to be 0 ohm on my test board. Also I've removed D1.
I've been trying for a while to get DMA working on SPI, it returns an error when i poll the DMA so it stays in the while loop but I can't seem to figure it out and there is not much Info that helps me. Maybe someone can help me to get it working, my code is below and HAL settings are below. /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2023 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes -----------------
Hi.I am trying to configure a timer with PWM in one-pulse mode (TIM5) as slave of another timer that sends N pluses to trigger TIM5.I am unable to do it could you give me a hand to understand what I am doing wrong?TIM1 when started should triggers an specified amount of pulses. I thought I could use Repetition Counter but for now I am not getting any pulses.I am using a STM32G474RE MCU.To start the timers I use:HAL_TIM_PWM_Start(&htim5, TIM_CHANNEL_4); HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_5);Thanks in advance,Raúl Pérez Gómez
I am trying to use the HAL driver - HAL_I2C_MEM_READ(....)The stm32 is the master and there is a slave i2c device that I want to read from. The I2C transaction goes like this: <start> <dev address> <register that I want to read address> <start> <dev address> <value sent from slave><stop>Using an Aardvark I can read the register value and I have captured the I2C transaction. I assume this verifies the hardware. When I attempt to use the HAL driver I can see an I2C transfer start, but it fails. The transaction is this: <start> <dev address> <register that I want to read address> <start> <dev address> At this point the ADDR bit is not set in the status register which indicates "No end of address transmission", but this makes no sense because I see the address being sent and the ACK from the slave. The I2C controller flags AF (acknowledgement failure) next, but I see the pin go low o
Hi,i tried the SAI_AudioPlayback example for the h745 discovery board. I'm using Keil and with the keil 5 armcc compiler everything works fine.Now i switched to armclang 6 and replaced the "libPDMFilter_cm7_keil_wc16.lib" with "libPDMFilter_cm7_gcc_wc16.a" i can compile & run the program but soundoutput is not working.i attached a screenshot. for the input i get pdm values but pcm is always zero. If i compile with armcc the pcm values are not zero.is there something i have to configure? i think maybe it is some signed/unsigned problem? does anybody have a hint what can cause this error?Regards
I have an STM32H745xx dual-core microcontroller, and want to use the Memory Protection Units (MPU) in each core for functional safety. The goal is to prevent the M7 core from accessing GPIO, Flash, and RAM that is dedicated to the M4 core.I can configure the MPU in the M7 core to restrict the memory regions the M7 accesses, but have to deal with the situation if the M7 alters its MPU settings.I don't see any way for the M4 to read the M7's MPU registers.How can I have the M4 core verify the settings in the M7's MPU?
HAL_SPI_Receive_DMA() is non-blocking; it just sets up and starts a transfer. Is it safe to call it from an interrupt context?If it is (at least possibly or sometimes) safe, does it make a difference whether the SPI port is configured as SPI_MODE_MASTER or SPI_MODE_SLAVE? And whether it is bidirectional (SPI_DIRECTION_2LINES) or receive-only (SPI_DIRECTION_2LINES_RXONLY)?If it is unsafe, why?
Hi, I am working on a project using STM32L152. I have ADC DMA set up as I've used in many other projects using this part. For some reason this time around ADC values are not getting ready by the micro, and when I debug I find the DMA1_Channel1_IRQHandler is not getting called, even though the interrupt is set in the .ioc as normal. Here is my .ioc configuration for ADC and interrupt priority, is there anything here that can suggest what the problem might be? I have cross referenced these settings with other working hardware projects and they are exactly the same as far as I can tell. Thanks!Please see attached screenshots for .IOC settings.
I have created a bootloader and application. My bootloader appears to launch my application successfully; however, the interrupts are not functioning in the application. I used memcpy to copy the vector table into RAM. Below shows the results of the memcpy command.Below is the code I use to copy the vector table and hopefully start to use the new RAM based vector table.FLASH_VECTOR_ADDRESS = 0x08003000VECTOR_TABLE_SIZE = 48void copy_to_ram_vector_table(uint32_t *destination){__disable_irq();// Source address in flash (FLASH_VECTOR_ADDRESS)uint32_t *source = (uint32_t *)FLASH_VECTOR_ADDRESS;// Number of uint32_t values to copysize_t num_elements = VECTOR_TABLE_SIZE;// Use memcpy to copy the datamemcpy(destination, source, num_elements * RAM_VECTOR_DATA_SIZE);__HAL_RCC_SYSCFG_CLK_ENABLE();__HAL_SYSCFG_REMAPMEMORY_SRAM();__enable_irq();}I have been able to verify that my main loop is running, but none of the interrupts are firing. I have also verified that I success
I know that they can not be used at the same time. But how can you switch between CAN and USB at runtime in the same application?
The example does not work. It times out:Stack:HAL_OSPI_AutoPolling() at stm32u5xx_hal_ospi.c:1,831 0x80042e8ospi_memory_reset() at lx_stm32_ospi_driver_glue.c:560 0x8001afelx_stm32_ospi_lowlevel_init() at lx_stm32_ospi_driver_glue.c:79 0x800165alx_stm32_ospi_initialize() at lx_stm32_ospi_driver.c:61 0x80166ea_lx_nor_flash_open() at lx_nor_flash_open.c:128 0x8015822fx_stm32_levelx_nor_driver() at fx_stm32_levelx_nor_driver.c:111 0x8014758_fx_media_format() at fx_media_format.c:177 0x8010a26_fxe_media_format() at fxe_media_format.c:114 0x80144b8fx_app_thread_entry() at app_filex.c:156 0x8001464_tx_thread_shell_entry() at tx_thread_shell_entry.c:114 0x8018388Other relevant info:Board: MB1829 Discovery kit with STM32U5A9NJ MCUEnvironment: STM32CubeIDEComponent: MX25UM51245GXDI00 Macronix OctaFlash
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.