FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
5982 Discussions

SPI Slave to Avalon-MM escape problem

DRaineyNAL
Beginner
168 Views

I am using the SPI-Slave to Avalon-MM IP to communicate with a MAX10 FPGA from a host processor (current test is on DE10-Lite board). In general everything is working. I can read and write devices and memory on the bus, with one exception.  When I try to write data that has an IDLE character as the last byte sent, the data is not written correctly.

 

For example, to write the data 4A 00 00 00 to address 00 04 00 00, I produce the following escaped packet which is sent to the SPI port:

Data to Send: 00 00 00 4A
Address and Data: 00 04 00 00 00 00 00 4A
Escaped Address and Data: 00 04 00 00 00 00 00 4A
Full Command Pkt: 7A 7C 00 04 00 00 04 00 04 00 00 00 00 00 7B 4A
Final SPI escaped data sent: 7A 7C 00 04 00 00 04 00 04 00 00 00 00 00 7B 4D 6A

 

When I read this location, the data is 4D 00 00 00, as if the spi slave is ignoring the escape byte and treating the escape (4D) as a normal character. This DOES NOT happen if the 4A is anywhere but in the final byte.  If I leave out the escape character, the 4A is ignored as an IDLE byte. 

What am I doing wrong? Every other data write to this area of memory works perfectly. It is only data values that contain 4A in the last byte sent that are a problem.

 

I'm not sure this is the correct forum for this post, please redirect me if necessary.

0 Kudos
1 Solution
DRaineyNAL
Beginner
162 Views

I actually just resolved this issue. The problem was not in the write packet. The problem was that when I read the value back I was not properly handling the escape at the end of the packet. This problem is resolved.

View solution in original post

1 Reply
DRaineyNAL
Beginner
163 Views

I actually just resolved this issue. The problem was not in the write packet. The problem was that when I read the value back I was not properly handling the escape at the end of the packet. This problem is resolved.

Reply