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
Hi,Recently I had to replace the MCU in a device and I tried to upload the code using USB Bootloader, as it is available and requires very little stuff when you're on site.So, the MCU has been detected in the system (see PIC1.png), but the CubeProgrammer (v 2.5.0) could not properly connect to it via USB. Properly means that I'd get an accesss to anything - after a connection try, it changed state to connected, but the MCU ID, flash size etc are not shown, while they should be (see PIC2.png). Luckily I managed to connect using ST-Link (see PIC3.png) and the situation is partially resolved. The application does not use USB so I cannot do a fast check if the USB peripheral even works properly.What I noted is that the MCU revision is 2.0, while in the other device (which normally connects via USB) it is Z. Can this be a problem?Thanks in advance for any help, as I'd like to make the DFU via USB running back again.BR,Piotr Rutkowski
How to write code for TCP client on the STM32F767ZI based NUCLEO board without using any RTOS on STM32Cube IDE? Do you have any example code? Also looking for TCP server code that is working... Please respond with details and the sample program if you have one. It is little urgent. Thanks!
Hello,I have a digital buck converter with hrtim. I followed examples Buck_VoltageMode_HW etc. So far so good, output is stable, well regulated to fixed value.But what if want adjustable output by the user? What is the strategy to do that? I can do a prescaler from feedback ADC to adjust the output, but i feel that it is not the right way to do that properly. I'm not well oriented in control theory, but when i set different output voltages in Biricha WDS, control B parameters are slightly different. Unfortunately, I don't have access to bode plot.What is the proper way to solve this?Leave B parameters fixed and hope that smps will be stable with different output voltagesMake a lookup table with B parameters for lets say 0,5V steps in outputCalculate b parameters on MCU.???Thank you for the suggestions. Hynek
Hi,my application is loaded via the bootloader and i sstarted. Two threads are generated and it seems properly generated because one thread is in ready state while the other is in suspended state.Systick is used for the ThreadX and TIM6 is used for the HAL-Tick.But the scheduler doesn't start the ready thread.Had somebody a similar problem? Can it be a priority problem of the timers?
Dear Sir/Madam,Is it possible to have a STM32 with build in UCPD-controller to deliver 240W at the port? or does anyone have experience with this type of application?According to (link: https://www.st.com/content/st_com/en/ecosystems/stm32-usb-c.html?ecmp=tt21056_gl_link_may2021) I should be able to negotiate of up to 240W with EPR (extended power range) if I make use of the STM32G0 series. After consulting your presentation (link: https://www.st.com/resource/en/product_presentation/stm32-usb-c-pd-solutions-presentation.pdf) I have come to the knowledge (see page 10) that I also need a TCCP0X port protection IC, I want to have a STM that is able to sink or source power (DRP) according to the presentation I need a TCPP03-M20. Consulting the datasheet of the TCCP03-20 I came to the conclusion that it complies with powers up to 100W only. Also looking into AN5225 (https://www.st.com/resource/en/application_note/dm00536349-usb-type-c-power-delivery-using-stm32
I am working on STM32H7 with Azure RTOS ThreadX core; same project with CubeIDE toolchain builds and works fine but when the code is generated with MAKEFILE toolchain and I try to build the following error is encoutered: arm-none-eabi-gcc -x assembler-with-cpp -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DTX_INCLUDE_USER_DEFINE_FILE -DUSE_HAL_DRIVER -DSTM32H723xx -ICore/Inc -IAZURE_RTOS/App -IDrivers/STM32H7xx_HAL_Driver/Inc -IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy -IDrivers/CMSIS/Device/ST/STM32H7xx/Include -IDrivers/CMSIS/Include -IMiddlewares/ST/threadx/common/inc/ -IMiddlewares/ST/threadx/ports/cortex_m7/gnu/inc/ -Og -Wall -fdata-sections -ffunction-sections -g -gdwarf-2 -MMD -MP -MF"build/tx_thread_stack_build.d" Middlewares/ST/threadx/ports/cortex_m7/gnu/src/tx_thread_stack_build.s -o build/tx_thread_stack_build.o arm-none-eabi-gcc -x assembler-with-cpp -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -DTX_INCLUDE_USER_DEFINE
In stm32f0xx_hal_flash.c line 319: /* Check if there are still pages to erase */ if(pFlash.DataRemaining != 0U) { addresstmp = pFlash.Address; /*Indicate user which sector has been erased */ HAL_FLASH_EndOfOperationCallback(addresstmp); /*Increment sector number*/ addresstmp = pFlash.Address + FLASH_PAGE_SIZE; pFlash.Address = addresstmp; /* If the erase operation is completed, disable the PER Bit */ CLEAR_BIT(FLASH->CR, FLASH_CR_PER); FLASH_PageErase(addresstmp); } else { /* No more pages to Erase, user callback can be called. */ /* Reset Sector and stop Erase pages procedure */ pFlash.Address = addresstmp = 0xFFFFFFFFU; pFlash.ProcedureOnGoing = FLASH_PROC_NONE; /* FLASH EOP interrupt user callback */ HAL_FLASH_EndOfOperationCallback(addresstmp); CLEAR_BIT(FLASH->CR, FLASH_CR_PER); // ?????????For example here??????????? } After interrupt I expect PER bit to be cleared but it is not, because of this I can't
Hi,I am using a STM32L452RET6 and need to change the PWM frequency (and later the duty cycle) of Timer1 Channel 1 multiple times and on the fly. I tried using the following code but does not change the frequency:htim1.Init.Period = 20000;HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1); // Could someone please help with the following:1) which registers do I need to change for frequency and which for duty cycle?2) is that htim1.Init.Period = 20000; the correct way to change the frequency or do I need to call a dedicated function?3) if that is the correct way, is there an additional HAL function I need to call to "load" that new value? Thank you :)
I'm running a USB keyboard on an H743. This works completely reliably at all CPU speeds up to and including 400MHz. However, above 400 MHz the connection is no longer reliable. Sometimes the keyboard connects perfectly and then it will work properly as expected with no issues. including re-connecting if unplugged and re-plugged. Sometimes repeated resets are needed before a connection works. In this case unplugging and re-plugging will have no affect.I suspect some sort of race condition in the USB initialisation that only manifests itself when the CPU speed is very high but whatever is happening is deep inside the USB code.Has anyone got HID working reliably at 480MHz?I'm running on a Nucleo-H743ZI2. Note: the USB power drive pin is PD10 on this board rather than PG6 on the original Nucleo-H743 and also the sense of the power drive is reversed compared to the original board.
I have been examining the X-CUBE-EEPRMA1 codebase and noticed a couple of issues with the code that is causing delays in the firmware:m95xx.c. Line 344 "pObj->IO.Delay(6);". Is the 6 ms delay necessary? In line 353, the system checks if the chip is ready before proceeding to writing to the next page. Ref: Code Reference m95xx.c. Line 353 "while( pObj->IO.IsReady( pObj->IO.Address ) != M95_OK ) {};". Shouldn't the check for if the chip is ready be done before writing to it? Additionally, if a single page write is required, this would have cause an unnecessary delay. Ref: Code Ref
I have an STM32L433 that implements a SPI slave, it is connected to another MCU master. It is unclear from the datasheet and searches for answers whether MISO and MOSI on the slave should connect directly to MISO and MOSI on the master, or, if they should be crossed. Is master MOSI -> slave MOSI and master MISO to slave MISO correct?Sid
Hi, We've been using a board (the Daisy Seed) that has an STM32H750IB and external QSPI flash chip.We're having an issue with some of the boards somehow getting into a persistent (across reset. power cycle, and chip erase) state whereby the SCB_EnableDCache function is taking several seconds to execute. Even stranger, when DCaching is disabled, then the QSPI init call takes several seconds. Most of the boards are working fine, but somehow something happens and the board/chip will start doing this. In one case, it just as randomly stopped doing it. Could some kind of un-initialized variable be causing this? Also, we're using an older version of CMSIS code (Ver 5.0.1), has anything been fixed or changed in the newer versions?
I can find the UM1021 document for STM32F105xx, STM32F107xx, STM32F2xx and STM32F4xx, but nothing for STM32F7xx.Any help would be appreciated.Thanks
hello everyone i'm working on stm32h742 from two week but i'm not make it configure it anyone can help me i'm not able to communicate with lan please provide me some guidence i tried many tutorial on ethernet but its not working att all kindly suggest me some lwip configuration and memory configuration on this controller
I have planned to connect my custom flight controller to the ground station(mission planner) for that i have connect all the necessary connection usb connection also and flashed the pre compile firmware of matekf405 from here: https://firmware.ardupilot.org/Copter/stable-4.0.5/MatekF405/ and follow all the step. Uploaded it using cube programmer via ST LINK debugger . After the successful flashing of the code it says it should connect with the computer but upon connecting with computer using usb nothing appears nor connect with the mission planner either . Any suggestion or have i made any mistake ?
As title says.If so, where could I find an example.If not, will it be supported?
Hi,I'm looking for a working LWIP UDP example without FREERTOS pls.I have such a project which is working, but it was generated on old cubeMX (6.5.0) and now no matter what I did (I did some research online and tried most of your guides) I didn't manage to implement a simple LWIP without FREERTOS project that works with the latest cubes. pls help me !!!an IOC file would be perfect thanks.
In this code, the value of the range variable in the purse does not change correctly. What is the reason?Board = NUCLEO-F413ZH/* External variables --------------------------------------------------------*/ extern UART_HandleTypeDef huart4; extern volatile uint8_t range; extern uint8_t first_buffer[5]; extern uint8_t main_buffer[8]; /* USER CODE BEGIN EV */ void UART4_IRQHandler(void) { /* USER CODE BEGIN UART4_IRQn 0 */ /* USER CODE END UART4_IRQn 0 */ HAL_UART_IRQHandler(&huart4); /* USER CODE BEGIN UART4_IRQn 1 */ //__HAL_UART_ENABLE_IT(&huart4, UART_IT_RXNE); if(range == 0) { HAL_UART_Receive_IT(&huart4, first_buffer, 5); range = 1; } else if(range == 1){ HAL_UART_Receive_IT(&huart4, main_buffer, 8); range = 0; } /* USER CODE END UART4_IRQn 1 */ }
I am migrating from Cube_FW_F7_1.16.0 to STM32Cube _FW_F7 V1.17.2 But now Ethernet doesn't work. I made changes to the file: STM32F765VITX_FLASH.ld /* Highest address of the user mode stack */ _estack = 0x20080000; /* end of RAM */ MEMORY { FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2047K FLASHSW (rx) : ORIGIN = 0x081FFC00, LENGTH = 1024 RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 497K Memory_B1(rw) : ORIGIN = 0x2007C000, LENGTH = 0xA0 Memory_B2(rw) : ORIGIN = 0x2007C0A0, LENGTH = 0xA0 } .ARM.attributes 0 : { *(.ARM.attributes) } .RxDecripSection (NOLOAD) : { *(.RxDecripSection) } >Memory_B1 .TxDecripSection (NOLOAD) : { *(.TxDescripSection) } >Memory_B2 main.c static void MPU_Config(void) { MPU_Region_InitTypeDef MPU_InitStruct; /* Disable the MPU */ HAL_MPU_Disable(); /* Configure the MPU as Strongly ordered for not defined regions */ MPU_InitStruct.Enable = MPU_REGION_ENABLE; MPU_InitStruct.BaseAddress = 0x00; MPU_InitStruct.Size = MPU_REGION_
We are using the STM32L071RB, currently have the firmware set to go to sleep (stop mode) and wake up after ~5 minutes with the RTC WUT (see section 22.4.6 and A13.3 in RM0377). This works great, however this timer isn't the only wakeup source. If the device wakes up due to a external interrupt, the timer restarts back to another 5 minutes. So, for these external interrupt events we need to know how long it's already been asleep to compensate and have the periodic wakeup keep the same interval. My first thought was that we could just read the "wakeup timer" register to see how long it's been asleep, but can't find any information on where that is located... (RTC_WUTR is simply the reload register, so it doesn't change)Does anyone know where the mcu is storing that counter/timer? Alternatively we could set up with an alarm or store the RTC value before going to sleep and compare, but we are low on space and don't want to rewrite deployed code unless necessary
I'm using STM32U073MCT6 MCU. I have a custom board (which contains this MCU and other required components) and I have 4 stages in my data logger that I want to develop using this board:1) Just the battery is soldered and trip isn't started2) Trip started but in low power mode i.e not performing any task3) Collecting data through temp sensor (I2C) and storing data in SRAM (During the trip)4) Moving all the data stored in SRAM to an external flash memory (During the trip) so that the SRAM can be used againI want to put my device entirely in a low power mode and wakeup every certain interval and do 3) or 4). So now, I have few things to ask:Q1) Basically, before the trip starts, button interrupt should have the wakeup capability and during the trip, both button interrupt and RTC should have the wakeup capability. And I want to use a low power mode such that the power consumption is very less. According to the datasheet, in Stop2, Standby and Shutdown: all these 3 low power modes both
Hello, I am trying to perform a flash bank swap from bank1 to bank2. Executing the following code: FLASH_OBProgramInitTypeDef OBInit; /* Unlock tha User Flash area */ HAL_FLASH_Unlock(); HAL_FLASH_OB_Unlock(); /* Get the Dual boot configuration status */ HAL_FLASHEx_OBGetConfig(&OBInit); /* Get FLASH_WRP_SECTORS write protection status */ OBInit.Banks = FLASH_BANK_1; HAL_FLASHEx_OBGetConfig(&OBInit); /* Check Swap Flash banks status */ if ((OBInit.USERConfig & OB_SWAP_BANK_ENABLE) == OB_SWAP_BANK_DISABLE) { /*Swap to bank2 */ /*Set OB SWAP_BANK_OPT to swap Bank2*/ OBInit.OptionType = OPTIONBYTE_USER; OBInit.USERType = OB_USER_SWAP_BANK; OBInit.USERConfig = OB_SWAP_BANK_ENABLE; HAL_FLASHEx_OBProgram(&OBInit); /* Launch Option bytes loading */ HAL_FLASH_OB_Launch(); SCB_InvalidateICache(); NVIC_SystemReset(); } else { /* Swap to bank1 */ /*Set OB SWAP_BANK_OPT to swap Bank1*/ OBInit.OptionType =
Hi,I'm emulating M24C02 protocol with STM32F030 & STM32G030. To read M24C02, address is written following by repeated start then data read. Here is my code: ----main.c ----uint8_t i2c_bytes[256] ={0x55, 0xaa, 0xff, 0x00}; //Virtual M24C02 ContentLL_I2C_EnableOwnAddress1(I2C1);LL_I2C_EnableIT_TX(I2C1);LL_I2C_EnableIT_RX(I2C1);LL_I2C_EnableIT_ADDR(I2C1);NVIC_EnableIRQ(I2C1_IRQn);//enable i2cLL_I2C_Enable(I2C1);---stm32g0xx_it.c---extern uint8_t i2c_bytes[256];void I2C1_IRQHandler(void){static volatile uint8_t i2c_bytes_addr = 0;__disable_irq();if(I2C1->ISR & I2C_ISR_TXIS){I2C1->TXDR = i2c_bytes[i2c_bytes_addr];//Send Data} elseif(I2C1->ISR & I2C_ISR_RXNE){i2c_bytes_addr = I2C1->RXDR;//Store Address} elseif(I2C1->ISR & I2C_ISR_ADDR){I2C1->ICR |= I2C_ICR_ADDRCF_Msk;}}__enable_irq();} The result is not as expected. Dump the virtual device with raspberry pi, Instead of '55 aa ff 00', bit 00 is ‘00’: $ i2cdump -y 1 0x1bNo size specified (using
Hello together, I'm using a STM32F769-DISCO Board with STM Cube IDE.LWIP is activated.No DHCP, static IP.Most of the LWIP is default only disabled the DHCP and TCP parts.First, sending UDP packages is working fine. My Issue is:that the receiving udp callback function delivers a udp data length of 22 (p->len = 22). But I only receive 2 Bytes of data in the Rx-buffer (p->payload). The 2 Bytes are filled correctly with data. The rest of the data array is 0. Does someone have any advise regarding LWIP UDP receiving?I tried allocating (pbuf_alloc) the buffer and using pbuf_take() , but I did not see any difference. I think there could be some issues with the buffer address, but I'm honestly at a loss here... Here the udp init and the receive callback function in "lwip.c": uint8_t testbuffer[100] = { 0 }; err_t udpServer_init(void) { err_t err = ERR_OK; ip4_addr_t destIPAddr; ip4_addr_t myIPAddr; upcb = udp_new(); IP4_AD
Using NUCLEO-H563ZI, FW_H5 V1.3.0, CubeIDE 1.16.0, MacOS 14.5.I've been beating my head against the wall, getting some test code going.4 ADC channels, 2 on ADC1, 2 on ADC2.Conversions triggered by timer 3. (200 groups of 4 conversions per second)Results delivered using DMA.I've done this before with F4s and F7s, but the H5 is kicking my butt and the example code set for the H5 is incomplete and doesn't have an ADC sample similar to this so far.I've put together an IOC file and generated code with no changes from the generated code, and when that code initializes ADC2, the error handler gets called when HAL_ADCEx_MultiModeConfigChannel fails after a call to ADC_MULTI_SLAVE. I'm not sure what it's doing, but I must be missing something in the IOC model since it can't get through the init code.Is there a working example of dual simultaneous for the H5s, or a processor like the H5s that uses the GPDMA unit, or what am I missing in my IOC file?Thanks,Andrei from The Great White No
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.