Why the number of data I sent is wrong when using HAL_SPI_TransmitReceive() ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-10-29 4:04 AM
HAL_SPI_TransmitReceive(&hspi1,tx_sensor_data,rx_sensor_data,8,0);
I want sent 8bytes, but only 2bytes sent, why?
Solved! Go to Solution.
Labels:
- Labels:
-
SPI
This discussion is locked. Please start a new topic to ask your question.
1 ACCEPTED SOLUTION
Accepted Solutions
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-11-11 1:35 AM
I solved it. The general set is wrong. Must set 8 bits not 4bits or 2bits
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-10-29 4:49 AM
You have a timeout of 0, which may be the issue. If you want it to be blocking, use HAL_MAX_DELAY.
If you feel a post has answered your question, please click "Accept as Solution".
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-11-11 1:35 AM
I solved it. The general set is wrong. Must set 8 bits not 4bits or 2bits
