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
Hello,We are using the USB HAL library on our custom board with an STM32H753VIT6. We have an external PHY chip (USB3300) and USB_OTG_HS. At the moment, we are using the USB to receive custom protobuf packets with a bandwidth at around 480 kbps. We have also written some additional overhead for our custom packets.Everything works mostly fine. However, after a second of running, some of our variables get corrupted. By looking at the build-analyzer in CubeIDE, I found that the RAM, namely the .bss section, was being set to garbage from 0x2400162c onwards. This was hUsbDeviceHS.ep_out[1].rem_length. I am not sure whether this variable is relevant to the problem or it is just a coincidence.I know that this could be from our own code somewhere that has a memory-leak, but I am wondering if this has been found before. I tried searching online but found nothing. Otherwise, are there any tips specific to STM32 to tracking down the cause?Thanks,
Hi allI'm currently working on getting the SD Card Interface (SDMMC1) to run on my Nucleo U575 board. I'm adapting the Fx_uSD_File_Edit Example of the STM32U575I-EV board.I'm running into problems when it comes to opening the SD Card media. In fx_media_open.c, media_ptr -> fx_media_driver_status has a value of 144 (FX_IO_ERROR). I expect the value should set be back to 0 (FX_SUCCESS) in (media_ptr -> fx_media_driver_entry) (media_ptr) (at comment "/*Invoke the driver to read the boot sector.*/). In my case, it isn't reset to 0 but stays at 144 instead.Unfortunately I can't find the linked function to have a deeper look debugging. Could someone please assist and tell me where to find this function? Or maybe even telling me, what setting the error could be caused by :Dcheers
Is my assumption right?When you have code like this: *(hospi->pBuffPtr - 1) = SPI3->RXDR; and you set a breakpoint on this line (so that is stops before this instruction is executed),but you have the SFR page open, to see the registers of the peripheral device, here SPI3, including the content of "register" RXDR (which is a FIFO!):it "will" go wrong?What could (seems to) happen:the open SFR page reads also the register RXDRbut this is a FIFO!so, the debugger view "grabs" the data from the FIFO (and it looks correct what you see as data there)and when you continue: you do not get the same value from this register (FIFO): it was read already read (and removed from the FIFO) - your variable assignment "goes wrong"So, my conclusion would be:if you have code where it reads from a FIFOset the breakpoint ONLY after the read instruction (not before or at the instruction reading "also" from this FIFO register)Assume, that a debugger view (SFR page open and displaying the content
Running STM32CubeIDE 1.14.0 with X--CUBE-FREERTOS/CMSIS RTOS2.Earlier I added tasks. Now I am unable to add tasks consistently; occasionally works, but usually fails. No problem deleting. Looks like... Anyone seen this?
I've successfully modified the MDMA_RepeatBlock_Rotation example for the stm32h735g-dk to do 90 degree rotation (main_repeat_block.c). Now I want to use linked-list mode.The way I implemented it currently is to use repeated block transfer to transfer one line from source to a destination column. Then I repeat this transfer for every line, but shifted by one pixel. Since the source and destination increment/decrement only supports 1,2,4 and 8 bytes I use a block size of 1 pixel and use display height as the number of blocks. Every block will have an offset equal to the width of the screen so it shifts to the next line. Since the screen and source image is not square I had to implement some offsets.The only disadvantage of this method is that it requires calling the transfer for every row, so 272 transfers in my case. I could do this in an interrupt but I prefer a 100% DMA solution since I don't want many thousands of interrupts per second.If I can use 272 nodes in a linked list the
Hello everybodyUnfortunately I'm stuck with the problem when using the ADC4 of the STM32U575 VIT6Q revision 01:Everything works as with the already implemented ADC1, the initialization, starting conversions, the EOC interrupts and reading the data register (ADC4_DR) but I only get 0 out of it, when reading from GPIOB pins.I've tested the following configurations on the respective GPIO pins (all configured the same, in analog mode):ADC4_IN14 on the internal VBAT signal: working (so ADC4 is actually sampling and delivering values correctly)ADC4_IN9 on PA4: working (so ADC4 principally also works on GPIO pins)ADC4_IN1 on PC0: workingADC4_IN2 on PC1: workingADC4_IN18 on PB0: not workingADC4_IN19 on PB1: not workingdigital input on PB1: working (so the pin is actually getting a valid signal 0 or 1, depending on the applied voltage)ADC1_IN7 on PA2: workingADC1_IN16 on PB1: working (so the analog frontend of GPIOB is working with ADC1)By working i mean delivering values other than 0 (when con
I am using STM32F407 Discovery Board for my audio project. There is a PDM mems microphone on this board. I want to get sound signal over I2S with DMA. For that ı am using SWV graph in İDE. I tried all ı found on the internet. ı have a few questions to make sure I am right. I think ı need to convert PDM data to PCM for meaningful graph. Is that right? I actually used the pdm2pcm library to do that. But all ı get is random numbers, it seems. Then, I try to observe the PDM signal with oscilloscope. The data signal was coming in two voltage levels. Is that normal for the PDM signal?image below is taken at start of the run.yellow signal is I2S CK(pb10), Cyan signal is data(pc3) I started this project with an analog mic. It was success. The ADC codes not necessary for I2S;
Hi all,I have a problem on my current design. My setup... .I have a mqtt client connected to a broker. I use the lwip library together with freertos STMCube provides. So it's mainly default. I have one task for sending and receiving. Now all works for a long time. No problem. But for any reason it stalls after a while unpredictably and do not come back as usual. My task is in blocking mode and my work around for now is i placed a watchdog in that task which gets invoked. But that is not they way it should be. I need some hints where to look up in code or has any one a idee?
I'm still trying to get the USB CDC example to work on my STM32F072 disco board. I dug out my ancient Ellisys USB tracker and I can see enumeration looks good. When I hook up to Teraterm all I get is NAKs though. What should that be telling me?
I'm testing out using an SD card on the STM32U575I-EV. The example project I'm using is from the STM32CubeU5 MCU package (Projects\STM32U575I-EV\Applications\FileX\Fx_uSD_File_Edit).I'm able to insert an SDHC (32GB; FAT32 format) card, see the green LED blink (indicating successful read/write), disconnect the card, reconnect to my Windows 10 device, and see the "STM32.TXT" file.But when I want to try changing the format of the card to exFAT, it doesn't work anymore. I tried that same SDHC and also an SDXC that I had in the office, and both had the same issue. I ran the debugger on the project for both cards, and both return FX_BOOT_ERROR after calling fx_media_open().Is exFAT supported by FileX? I did some light research but haven't found anything saying it isn't possible. If it is supported, could I get some help with figuring out why it's not working for my setup?
I am almost running out of limitations in my STM32L0 MCU as flash is divided into three sections.bootloader+user application+ota firmware. I have implemented a successful OTA at the moment. I am verifying the size of the OTA but I need to know if there is a quick and easy method to verify the OTA firmware before replacing the user application with it. Thank you.
Dear Team, We are developing half bridge LLC Converter using your micro-controller STM32G474RET6. We want to use HRTIM module for this purpose. We are using STM32CubeIDE for programming. Please support us to enable Burst Mode and having configurations in IDE.
I'm sure I'm missing something here but for the life of me I can't see it.TIM2 CH1+CH2 are in use as encoder inputs but I believe I should still be able to generate a basic PWM output on CH3 at the same time?Code is all generated by Cube IDE and it reports no problems, I'm using the LL libraries rather than the HAL, this is the generated initialisation code in tim.c: /* TIM2 init function */ void MX_TIM2_Init(void) { /* USER CODE BEGIN TIM2_Init 0 */ /* * TIM2 is Encoder 2 + PWM output 2 */ /* USER CODE END TIM2_Init 0 */ LL_TIM_InitTypeDef TIM_InitStruct = {0}; LL_TIM_OC_InitTypeDef TIM_OC_InitStruct = {0}; LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; /* Peripheral clock enable */ LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM2); LL_IOP_GRP1_EnableClock(LL_IOP_GRP1_PERIPH_GPIOA); LL_IOP_GRP1_EnableClock(LL_IOP_GRP1_PERIPH_GPIOB); /**TIM2 GPIO Configuration PA15 ------> TIM2_CH1 PB3 ------> TIM2_CH2 */ GPIO_InitStruct.Pin = ENC2_As_Pin; GPIO_
If I generate a 2kHz interrupt process using a basic timer and perform several SPI communications with DMA during that cycle, the generation of the 2kHz interrupt process is delayed by roughly the interrupt time in DMA.Can you please provide a solution to avoid the delay?The following excerpted source is included for reference.■stm32f7xx_it.c/* 2 kHz cycle task */void TIM7_IRQHandler(void){/* USER CODE BEGIN TIM7_IRQn 0 *//* USER CODE END TIM7_IRQn 0 */HAL_TIM_IRQHandler(&htim7);/* USER CODE BEGIN TIM7_IRQn 1 *//* USER CODE BEGIN Callback 1 */StartCommunication();/* USER CODE END TIM7_IRQn 1 */}void DMA2_Stream4_IRQHandler(void){/* USER CODE BEGIN DMA2_Stream4_IRQn 0 *//* USER CODE END DMA2_Stream4_IRQn 0 */HAL_DMA_IRQHandler(&hdma_spi5_tx);/* USER CODE BEGIN DMA2_Stream4_IRQn 1 */if(hdma_spi5_tx.State == HAL_DMA_STATE_BUSY || hdma_spi5_rx.State == HAL_DMA_STATE_BUSY){return;}StartCommunication();/* USER CODE END DMA2_Stream4_IRQn 1 */}■main.cvoid StartCommunication(){static in
HiI have a custom board with an EMMC connected STM32F446.My write access to EMMC for 16 kbytes is quite fast (2-3 ms). EMMC during the write operation consumes some 50 milli ampere more than during the its idle state. This would be fine, but as far as I see the EMMC consume this 50 ma for about 800 ms.So again my write operation takes 2-3 ms, but emmc is wasting power for 800 ms.What can I do? Shall I send a slee cmd?apparently there is no sleep cmd in the driver?From the STM32H7 repository I see these 2 functions:HAL_StatusTypeDef HAL_MMC_AwakeDevice(MMC_HandleTypeDef *hmmc);HAL_StatusTypeDef HAL_MMC_SleepDevice(MMC_HandleTypeDef *hmmc)Why arer they not there in the f4 code?Thx
We have been building boards for years using the STM32F407ZET6. Our system uses a USART bootloader from a host processor running Android that uses stm32ld to do the bootloading. It has worked pretty much flawlessly for years. Recently we started receiving boards that failed after doing the write unprotect. stm32ld waits for 200ms for the system to come back after it executes a system reset before sending the 7F to put it back in bootload mode. This has not been a problem until now. Apparently it is now taking longer than it used to. We have only noticed this on processors with Revision Y in the marking with "226" date codes. We removed the processor and put an older one on in its place and it worked fine so it's definitely the processor.1) What is the maximum amount of time that the system reset should take after doing a write unprotect with an internally generated system reset? I can modify stm32ld to change the wait time. 800ms looks like it works, but that was just a guess. I'd rath
Hello, I am currently working on a project where I need to configure a NUCLEO F411RE Board as an I2C slave. It will be connected to a Raspberry Pi Master. I am able to detect the NUCLEO on the raspberry Pi, however I am unsure how to get the read byte. I created a simple code where when the byte received is 0x01 or 0x10 the LED should turn on, if it receives anything else it turns off. However this doesn't seem to be working. This is the code I am using:uint8_t buffer[0];for (;;){HAL_I2C_Slave_Receive(&hi2c1, (uint8_t *)buffer, sizeof(buffer), HAL_MAX_DELAY);if ((*buffer == 0x01)|| (*buffer == 0x10)){HAL_GPIO_WritePin (GPIOA, GPIO_PIN_5, GPIO_PIN_SET);HAL_Delay (100);}else{HAL_GPIO_WritePin (GPIOA, GPIO_PIN_5, GPIO_PIN_RESET);HAL_Delay (100);}}If anyone can help me with this issue, it would be greatly appreciated. (I am sending a 0x01 on the Raspberry Pi side)
Good morning everyone,I have an application where a STM32G474 as SPI master interacts with another ST controller as SPI slave. These are full-duplex DMA transfers of about 500 bytes at 10MBit transfer rate. The slave signals that it is alive via a digital output and then communication starts. This also works stably so far. However, if the slave loses its "life signal" once communication has started, either because it has made a mistake itself or because the data is faulty due to coupling and the whole thing has to be resynchronized, then the SPI-DMA does not restart.I can understand that the master goes into the expected states to reset the SPI and then restart, but there is no physical restart. The clock signal and also MOSI remain permanently low after the transfer has been stopped. I'm probably just missing a little something to restart the SPI, but I can't figure it out at the moment. Maybe someone here has an idea where my error is.Below is my initialization code and how I reset t
The system consists of three modules: a 4G module, a GNSS module, and an STM32 processor, with the modules connected to the STM32 via UART. In terms of program functionality, the STM32 needs to implement data forwarding and saving. It receives data from the GNSS module, forwards it to the 4G module while creating a copy to save on the SD card; it also receives data from the 4G module, forwards it to the GNSS module while creating a copy to save on the SD card as well.To achieve the above logic, I have used UART DMA、Ringbuf and Free-RTOS. UART DMA is set to DMA circular reception mode with HT, TC, and UART IDLE interrupt enabled. Data is first transferred to a fixed DMA Buff through DMA, then manually moved to Ringbuf in the callback function. In the processing function, data from Ringbuf is moved to the SD Ringbuf and to the sending Ringbuf. Corresponding operations, such as SD card writing and DMA sending, are executed in their respective threads.This is roughly the framework of
I went through the following documentation available from STM on FDCAN bootloader:AN5405 - FDCAN protocol used in the STM32 bootloaderAN2606 - STM32 microcontroller system memory boot moderm0468 - Reference manualJump to bootloader code used: (Reference link : https://community.st.com/s/article/STM32H7-bootloader-jump-from-application)void ASYSTR_jump_to_bootloader(void){ uint32_t i=0; void (*SysMemBootJump)(void); /* Set the address of the entry point to bootloader */ volatile uint32_t BootAddr = 0x1FF09800; /* Disable all interrupts */ __disable_irq(); /* Disable Systick timer */ SysTick->CTRL = 0; /* Set the clock to the default state */ HAL_RCC_DeInit(); /* Clear Interrupt Enable Register & Interrupt Pending Register */ for (i=0;i<5;i++) { NVIC->ICER[i]=0xFFFFFFFF; NVIC->ICPR[i]=0xFFFFFFFF; } /* Re-enable all interrupts */ __enable_irq(); /* Set up the jump to bootloader address + 4 */ SysMemBootJump = (void (*)(void)) (*((uint32_t *) ((BootAddr + 4)))); /* Set the
Facing problem with run UART interrupt when receiving data.In that case I'm getting data but most of lost and receiving after some delay.If anyone solved this kind of problem than help me for this.
Hi team,Can you help for resolve the below PWM generation issue,we are using STM32H7A3ZIT6 controller, in that for the PWM generation configured Advanced Timer 1 with the below configuration and we are getting the PWM wave like below pic. But we need exact square wave PWM. can you please help to resolve this issue, and can you suggest what kind of parameter we need to configure? we configure presale value as 63: we configure presale value as 1: Note :-But we need set clock cycle a 20ms,
Say that HAL_UART_Transmit function is concurrently called by two tasks.So far, I know such a function is blocking, but I am not 100% sure that because of that it shall not be locked before usage if a concurrent task is going to call it.
Hi guys,I really need your help.I'm trying to divide two numbers.. But the result is still 0. Analyzind the disassembling the commands are not those of FPU unit. I enable the FPU in the Properties/MCU Setting.Here the simple code:uint32_t A = __HAL_TIM_GET_CLOCKDIVISION(&htim3)+1; // result is 1uint32_t B = HAL_RCC_GetPCLK2Freq(); // result is 84000000float D = A/B; // result is 0double E = A / B; // result is 0long double F = A / B; // result is 0double G = 1 / 5; // result is 0uint32_t H = 10/3; // result is 3double I = 10/3; // result is 3Any ideasThanks
I want to send the character array button_image[] through uart of NUCLEO-H743ZI2 board to the LCM display.Please check the attached button_image.c file for your reference where the array is initialised to corresponding hex data.The array consist of 2076 bytes. I am using t_bool TransferFlashImage( uint8 *img_data, uint32 img_size, err_code *err); function for flashing the LCM.In my main.c file, I have declared a pointer as follows:uint8_t *img_data=button_image;Now I am expecting img_data is pointing to all the 2076 bytes. But, It is holding only 4 bytes . I want to send all 2076 bytes through TransferFlashImage(img_data,img_size,err); so that the LCM will be flashed. Please let me know how I can send all the 2076 bytes to LCM.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.