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
We plan to use STM32G0 mcu with UCPD interface and external TCPP03-M20 protection circuit with single bi-directional power path in our smart power bank with replaceable smart battery and USB-C PD dual role power port application. There will be one USB-C PD connector. And there will be TI BQ25731 Buck-Boost Battery Charge Controller with USB-C PD 3.0 OTG Output that is why we need single bi-directional power pathI have several question if anybody could help me:1) We plan to offer special non USB-C PD cable which allows to connect directly 12 - 20 V "not power delivery" power supply to USB-C connector. For this scenario, we would like to be able to control single bi-directional power path through TCPP03-M20 mosfet driver directly to enable this non PD power path to connect to battery charger (BQ25731), is it possible to do so?2) I installed x-cube-tcpp and used NUCLEO-G071RB and X-NUCLEO-DRP1M1 to evaluate the system, I added source and sink PDOs and now I would like to understand, where
I'm using the NUCLEO board NUH723 to develop a project and I need to understand better how the HAL_SAI_Transmit_IT works. In my code I use the HAL_SAI_Transmit_IT to send data to the SAI1 interface --> 48KHz, stereo,32bit: I have to send two buffer of 128 word (Arxbuff31 and Brxbuff31, stereo,32bits), uint8_t DAC_Buffer[BUFFER_SIZE]; // __attribute__ ((aligned (4))); uint8_t ADC_Buffer[BUFFER_SIZE]; // __attribute__ ((aligned (4))); int32_t *p31; q31_t Arxbuff31[128],Brxbuff31[128]; p31=(q31_t *)DAC_Buffer; for(x=0;x<128;x++){ *p31++=Arxbuff31[x]; *p31++=Brxbuff31[x]; } ---- ---- while(!RxDataReady); status=HAL_SAI_Transmit_IT(&hsai_BlockA1,DAC_Buffer,256); ---- RxDataReady=0; ---- In what way the data must be stored in the output buffer (DAC_Buffer) for both the channels ? (I suppose Left4bytes,Right4bytes,Left4bytes,....) The "size" parameter has to set to the 2*128 ? Thank you, Luigi
Hello everyone. I am working on CAN communication with STM32F429I-Disc1 with TJA1050 transceiver. Standard communication works more than fine. What I would like to do next is to interrupt communication while CAN message with certain ID is present on bus. In other words I would like to detect while new message is started to be send, and after ID field I would like to send e.g. 20 0s (dominant bits) on the bus. HAL_CAN_RxFifo0MsgPendingCallback and HAL_CAN_GetRxMessage give access to complete frames. I need deeper and faster solution. Here are my questions:1) Is there a way to solve my task with existing HAL libraries?2) Where callback from HAL_CAN_RxFifo0MsgPendingCallback CAN interupt is done? Is it after complete message is received (and validated by crc check) or just after SOF bit received on the bus? Thank you in advance for your help.
The ST MIcro website offers this free tool link but when I download it, its appears to be resticted as a trial use.I followed the instructions and there was a link on the download page that gets installed, simple and good for a year.Thanks
Hello to alli have build my project as programmer on stm32f103c8t6 to connect as master host to slave one stm32f103c8t6 and program the slave device with code which saved in eeprom connected to the master with i2c it working well with me but I need to remove the eeprom and link the file to the master host programmer as a part of the code generate
I have an STM32L4R5ZI-P board. I have a SD Card connected via a 4-bit SDMMC (I'm using a Pmod SD Card Module).I can successfully read and write to the SD Card using FatFS.I have set up the USB_DEVICE and USB_OTG_FS as described here https://controllerstech.com/stm32-usb-msc/When I connect the micro USB connector at the bottom of the board to my Windows PC I get a "Please insert a disc into USB Drive (F:).". It doesn't look like any memory size, or anything is passed to my PC.The example worked without any other modification on the video.Any ideas?
Hello ST Community, I have setup a SPI master and a SPI slave, both use DMA in Normal mode. The word size is 8-bits and the data size is 8-bytes. The problem is that the slave transmits messages which contains old data. When it should send:MISO: { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }it sends:MISO: { 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 }When it should send:MISO: { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 }it sends:MISO: { 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02 }OBS: The debug gpio is toggled when the ISR finishes and when theTxBuffer is edited in main.This pattern continues for every transfer it contains 3 old bytes.Implementation (slave):The slave updates the response in the main function. int main(void) { HAL_Init(); SystemClock_Config(); MX_GPIO_Init(); MX_DMA_Init(); MX_SPI1_Init(); HAL_SPI_Transm
How to use header file in our code?
hi all A digital voice audio is received from the radio at stm32h753. Is there an example source for using i2s I2S_MODE_MASTER_RX mode? I need audio I2S_MODE_MASTER_RX example source.Help me Thanks
Hi, I am using the STM32H573I-DK eval board. I can able to write and read the data in flash memory (sector 127). But after resetting or power cycle it does not retain the data. that sector fills with 0xFFFFFFFF only. how do fix this issue? Here is my code, #define FLASH_STORAGE_1 0x081FE000 bool answer = true; uint32_t PageError; FLASH_EraseInitTypeDef flashErase; HAL_FLASH_Unlock(); flashErase.TypeErase = FLASH_TYPEERASE_SECTORS; flashErase.Sector = FLASH_SECTOR_127; flashErase.NbSectors = 1; flashErase.Banks = FLASH_BANK_2; volatile HAL_StatusTypeDef status; status = HAL_FLASHEx_Erase(&flashErase, &PageError); if(status == HAL_OK){ for (uint32_t i = 0; i < size; i += 16) { if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_QUADWOD, FLASH_STORAGE_1 + i, (uint32_t)data) != HAL_OK) { answer = false; break; } data += 16; }} HAL_FLASH_Lock(); Thanks Mathan
As title, MCU:STM32L151RET6, use freertos and enable tickless, when run PreSleepProcessing(uint32_t *ulExpectedIdleTime) function sometimes, cause hardfault. the sleep para is PWR_LOWPOWERREGULATOR_ON. but when use PWR_MAINREGULATOR_ON, it's run OK. The mcu sysclk is RCC_MSIRANGE_6, about 4MHz. This phenomenon occurs only on a few boards. Trace code discovery the last code run configPRE_SLEEP_PROCESSING( &xModifiableIdleTime ) in the function __weak void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime ). The performance is close to that of the substandard product? __weak void PreSleepProcessing(uint32_t *ulExpectedIdleTime){*ulExpectedIdleTime = 0;// HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);HAL_PWR_EnterSLEEPMode(PWR_LOWPOWERREGULATOR_ON, PWR_SLEEPENTRY_WFI);}
Hello,I am using STM32G4 series controller. I am using Timer 2 channel 2 as trigger source for Timer 4 and Timer 2 channel 3 for PWM generation. Also Timer4 channel 1 is used for PWM generation. First time both the timers Timer2 and Timer4 starts at exactly same time. I have observed that on DSO by checking position of the PWM pulse of both the timers which starts at exactly same position. When I stop the timer using HAL_TIM_OC_Stop(&htim2, TIM_CHANNEL_2) and HAL_TIM_PWM_Stop(&htim2, TIM_CHANNEL_3); function, Both the timers stops but timers are not starting at the same time again when I start it using HAL_TIM_OC_Start(&htim2, TIM_CHANNEL_2); and HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_3); function. The PWM pulse of both the timers getting shifted and not at the same position even though I have keep the same duty cycle for both the PWM channels.Can anyone help me in this case, how can we stop an restart the timers without using HAL library functions. By ju
I am using "HAL_UART_Transmit" and "HAL_UART_Receive" in the HAL uart driver to perform uart communication. While adding the CRC check to the communication protocol, I am wondering if there's any HAL uart driver API that incorporates CRC check functions, e.g., the sender calls "HAL_UART_Transmit_Until_CRC_Check_Complete" and the receiver calls "HAL_UART_Receive_with_CRC_Check"? So both the sender and receiver API will return when CRC check is complete.
Dear support team,I download recently the last release of Stm32cubeF4 v1.28 and I have the MDK V5.38 installed in my machine, so normally I was expecting that examples will build out of the box but it's not the case.It looks like the project example provided are working only in older version of MDK, I try to change some settings but the compiler version it's not even the same, and I end up with a mess.So my question do you have any migration guide or any steps description that could help to solve this issue.Best regardsBassem taamallah
Hello,I am using the nucleo h755zi-q board on my project. I am having issues with getting the uart driver to work with the LL library. For starters I have the CM4 core disabled via the option bytes and am just working with the CM7. Code for clockConfig:void SystemClock_Config(){ LL_PWR_ConfigSupply(LL_PWR_DIRECT_SMPS_SUPPLY); LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE3); LL_RCC_HSI_Enable(); /* Wait till HSI is ready */ while(LL_RCC_HSI_IsReady() != 1) { } LL_RCC_HSI_SetCalibTrimming(32); LL_RCC_HSI_SetDivider(LL_RCC_HSI_DIV1); LL_RCC_PLL_SetSource(LL_RCC_PLLSOURCE_HSI); LL_RCC_PLL1Q_Enable(); LL_RCC_PLL1_SetVCOInputRange(LL_RCC_PLLINPUTRANGE_8_16); LL_RCC_PLL1_SetVCOOutputRange(LL_RCC_PLLVCORANGE_MEDIUM); LL_RCC_PLL1_SetM(4); LL_RCC_PLL1_SetN(9); LL_RCC_PLL1_SetP(2); LL_RCC_PLL1_SetQ(2); LL_RCC_PLL1_SetR(2); LL_RCC_PLL1_SetFRACN(3072); LL_RCC_
Hi, I want to read flash memory to determine whether or not valid data is in the flash. And if this data can be used in my application. in my code, if I deference a Flash memory address I immediately get a ECCD error. Why is this happening? Thanks,
It seems that, if an error occurs on the last (or only) byte of a HAL_UART_Receive_IT transfer, the HAL_UART_ErrorCallback will not be called until after the HAL_UART_RxCpltCallback - is that right?STM32F0 Cube package.
Hello everyone,I've a project where I'm trying to emulate a mass storage device (MSC) using the STM32F103C8T6. The data itself should be stored on the Serial NOR-Flash (Winbound W25Q64...), operations are done with this library. Using the library in the main()-function, everything works (the library just translates the read/write calls into underlying spi hal). But accessing the flash chip via spi inside the STORAGE_Read_FS or STORAGE_Write_FS functions from the provided mass storage class (MSC), every function call to msc functions causes the HardFault handler to be triggered. Most of the time it's triggered somewhere in the HAL_SPI_TransmitReceive function, sometimes also in the HAL_GPIO_WritePin function. I increased both stack and heap size to 0x1000 bytes, but nothing changed. My guess is that there's memory corruption happening somewhere, but I couldn't find it even after days of research.I would be very grateful if someone could help me to solve this problem.
HiI successfully got the USB DFU bootlader working in 2 hours.This one: https://www.youtube.com/watch?v=n_LDXOQHerUNow i would like to add some encryption to it with a time budget of couple of hours.I am already using python for USB DFU update.What is the quickest way forward?thx
HiI have a sensor board with USB MSC and an EMMC memory chip. Under windows every thing works fine but not under MAC or Android.I am using FATFS and format the card with fomat option = #define FM_ANY 0x07.Does any one have a clue what is going wrong?I assume I have wrong settings:I need to make the card read only for Windows/mac/android, but read/write from STM32 firmware.So in ffconf.h I write:#define _FS_READONLY 0 /* 0:Read/Write or 1:Read only */And in usbd_storage_if.c I write.int8_t STORAGE_IsWriteProtected_HS(uint8_t lun){/* USER CODE BEGIN 12 */return (USBD_FAIL);/* USER CODE END 12 */}This fine with windows but not with mac/android. My card is detected (and works fine) on all platform when it is not write protected. Probably I dont know how to implement write protection.Actually this post suggests to set a write protect bit in uint8_t Mode_Sense10_data[]. But it doesnt work for me either. https://community.st.com/t5/stm32-mcus-embedded-software/read-only-mmc-with-usb-fs-device
Posted on July 02, 2018 at 13:38Hi, im using stm32f7+ freertos+lwip (raw api). My system handles web server and udp data communication. My frame length is 572 bytes and my FPS is 40 (22880 bytes/sec) at start. When i increase the package number to 8 times (8*572*40 = 183040 bytes/sec) it drops a lots of udp packages.(Especially dropping starts after 6 times = 6*572*40=137kbits) The weird thing is: if i decrease it to 22880 bytes/sec again it cant returns the normal situation it still drops. I have to reset for normal again. Im not expert lwip so i think there is a problem about buffers. I need an advice.#ethernet #stm32f7 #lwip #udp #freertos
Hello,I want to test the read and write speed of U5 on the USB flash drive. I have made modifications to the demo (STM32U5G9J-DK2 \ Applications \ USBX \ Ux_Host_HUB_HID_MSC) so that I can observe the read and write speed.#define MASS_TEST_WR_LEN (64*1024)#define MASS_TEST_LEN (ULONG64)(64*1024*1024)But when I write data in 64MByte, there is a transmission timeout issue.How should I solve this problem? thanks!
Hi,I'm developing 3-port USB PD hub device with STM32 USBPD library. I have an issue with powering up device with a PD contract over USBC port when it has already plugged sinks on other ports.Investigation over I2C bus communication show that the issue is caused by CC lines debouncing process, which lasts for 120ms and blocks DPM communication with other ports:I have discovered that this happens in tcpc_set_power function: /* Check tCCDebounce */ while (CAD_tVBUSDebounce < CAD_tVBUSDebounce_threshold) { CAD_tVBUSDebounce = HAL_GetTick() - CAD_tVBUSDebounce_start; /* Need to check that line is still connected */ uint32_t cc1 = 0xFF, cc2 = 0xFF; if (USBPD_BUSY == fusb305_tcpc_get_cc(Port, &cc1, &cc2)) { /* Line has been disconnected */ return USBPD_FAIL; } if (CCNONE == state[Port].CC_Pin) { /* Line has been disconnected */ return USBPD_FAIL; } } which is called by fusb305_tcpc_set_rx_state function in DPM thread.There is a 4ms delay
Hello All, I am planning to port FatFs on the IS25LP064A flash drive to communicate with my STM32H573ii over SPI. The FreeRTOS is running on STM32H573ii.According to the IS25LP064A datasheet, the maximum page size is 256 bytes. The total size of the flash drive is 8 Mbyte.1] Could you help me set the following parameters in FatFs?GET_SECTOR_COUNT = 32768 (8 Mbyte / 256 bytes)GET_SECTOR_SIZE = 256Do I need to set the value of FF_MIN_SS since my maximum page size is 256 bytes?FF_MIN_SS = 2562] As per the datasheet, the erase block size is 4 Kbyte.GET_BLOCK_SIZE = 16 (4 Kbyte / 256 bytes)So Could you help me to find out the values of above parameters? Are they correct?Thanks in advance.
Hallo everyone,As engineer who started to explore the world of MCU's years after my retirement, I regularly encounter problems that puzzle me for some time. However, since I'm stuck for several days now, I decided to ask for assistance by this forum.For my project, I selected a high-performance MCU, (STM32H723VGT6) mounted on a WeAct test-board, because of its price and atractive form-factor.I want to digitize the analoge output of a linear CCD by an ADC with SPI interface. This ADC (ADS8319) needs a rising edge to start a conversion and >1.6us later it expects a serie of 16 Clock pulses to export its data. I have read an attractive solution for such challenge at the 'StackExchange' site, that sends dummy uint16 data to a SPI with DMA, triggered by a Timer.A SPI in Full-Duplex mode, will produce 16 Clock-pulses to transmit an U16 word. The Timer must produce PWM pulses with the wanted frequency for the CCD readout. The rising edge of the pulse will trigger the ADC conversion, while
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.