How to set the FRXTH bit in STM32F407vgt6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-27 3:49 AM
Hello Everyone,
I am now looking for something like the LL_SPI_SetRxFIFOThreshold() function that I can use with the STM32F407vgt6 is there a good way?
What we want to do is, as an example, using the LL_SPI_SetRxFIFOThreshold() function, we want to add a process called LL_SPI_SetRxFIFOThreshold(SPI2, LL_SPI_RX_FIFO_TH_QUARTER)
Thank you in advance.
Solved! Go to Solution.
- Labels:
-
STM32CubeIDE
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-27 7:52 AM
hello @baby_chicken
the procedure for the STM32H742 is different from the STM32F7, in fact:
To set the threshold level for the RXFIFO (Receive FIFO) in SPI communication on the STM32H7, you need to configure the FTHLV (FIFO Threshold Level) bits in the SPI control register. Here are the steps to do this:
-
Determine the Data Frame Size: The FTHLV value must be programmed as a multiple of the number of frames/data access. For example:
- If 32-bit access is used for up to 8-bit frames, FTHLV should be a multiple of 4.
- If 16-bit access is used for up to 8-bit frames or 32-bit access for up to 16-bit frames, FTHLV should be a multiple of 2.
-
Set the RXFIFO Threshold: The RXFIFO threshold setting must be always higher or equal to the read access size to avoid spurious extra data reads. The FIFO data access less than the configured data size is forbidden. One complete data frame must be always accessed at minimum.
-
Configure the SPI Control Register: Write the appropriate value to the FTHLV bits in the SPI control register.
You can verify all this on the paragraph 55.4.14 of the RM0477.
The LL function used to Set threshold of FIFO that triggers a transfer event (FTHLV bit) is:
void LL_SPI_SetFIFOThreshold(SPI_TypeDef *SPIx, uint32_t Threshold);
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-27 4:14 AM
Hello @baby_chicken
As i've told you before, this bit is not available on the STM32F407 MCU. So, you can't sit it or right to it. For such a configuration, you may have to use another product (STM32F7 for example).
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-27 4:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-27 7:52 AM
hello @baby_chicken
the procedure for the STM32H742 is different from the STM32F7, in fact:
To set the threshold level for the RXFIFO (Receive FIFO) in SPI communication on the STM32H7, you need to configure the FTHLV (FIFO Threshold Level) bits in the SPI control register. Here are the steps to do this:
-
Determine the Data Frame Size: The FTHLV value must be programmed as a multiple of the number of frames/data access. For example:
- If 32-bit access is used for up to 8-bit frames, FTHLV should be a multiple of 4.
- If 16-bit access is used for up to 8-bit frames or 32-bit access for up to 16-bit frames, FTHLV should be a multiple of 2.
-
Set the RXFIFO Threshold: The RXFIFO threshold setting must be always higher or equal to the read access size to avoid spurious extra data reads. The FIFO data access less than the configured data size is forbidden. One complete data frame must be always accessed at minimum.
-
Configure the SPI Control Register: Write the appropriate value to the FTHLV bits in the SPI control register.
You can verify all this on the paragraph 55.4.14 of the RM0477.
The LL function used to Set threshold of FIFO that triggers a transfer event (FTHLV bit) is:
void LL_SPI_SetFIFOThreshold(SPI_TypeDef *SPIx, uint32_t Threshold);
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-27 8:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-27 8:37 AM
Almost the same question in this thread: https://community.st.com/t5/stm32cubeide-mcus/quot-ll-spi-setrxfifothreshold-was-not-declared-in-this-scope/td-p/712486
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-27 9:00 AM
