Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPI slave interface send out the first bit wrong. #128

Open
1 of 2 tasks
Winnaries opened this issue Sep 11, 2021 · 1 comment
Open
1 of 2 tasks

SPI slave interface send out the first bit wrong. #128

Winnaries opened this issue Sep 11, 2021 · 1 comment

Comments

@Winnaries
Copy link

Winnaries commented Sep 11, 2021

  • BUG REPORT
  • FEATURE REQUEST

BUG REPORT

Expected behavior

The first bit transmitted to the master, after READ_BLOCK, is 0xff.

Actual behavior

The first bit transmitted to the master, after READ_BLOCK, is 0x7f where the first and MSB is dropped, as you can see in the picture.

image

Test code

Please follow this implementation https://github.com/kendryte/kendryte-standalone-demo/tree/develop/spi_slave, but instead of initializing test_data_temp[1024] values via master's WRITE_BLOCK, please initialize it on the slave to the values in the shown in the picture above. Notice that we have to reorder the bytes as followed, because default frame_width for READ_BLOCK is 32.

FYI: Those values are a part of JPEG header, namely the first four bytes.

/* slave test_data init */
test_data_temp[0] = 0xe0; 
test_data_temp[1] = 0xff; 
test_data_temp[2] = 0xd8; 
test_data_temp[3] = 0xff; 

Document version

Q: Which branch are you on? If you know the Git revision then add it here as well.
A: develop

Hardware

Which hardware do you use?
A: Sipeed M1W

System

Q: What system do you use?
A: linux_x86

@ramonaerne
Copy link

Did you notice that the pin setup is wrong
spi_master.c#L27 MISO and MOSI pin are the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants