ETP 521 Using adb to test SPI between OCURA and DRONA

Wikis > ETP 521 Using adb to test SPI between OCURA and DRONA



1.1 To test SPI communication (read and write) between DRONA and OCURA, using adb shell


2.1 Drona:, version: 816ee47
2.1.1 SPI is slave
2.1.2 Need to connect to ICD to run in debug mode
2.2 OCURA board with android installed


3.1 Create a hex file (binary file) with desired 32 byte
3.1.1 Download HxD: (read/write binary file), and launch it
3.1.2 Set bytes per low to 32, and type in any data you want, then save that (the file extension can be ignored)


3.2 Connect PC to OCURA with USB cable, using command window, type in adb devices to see if the OCURA can be detected. (Refer to ETP 514 for attribute usage)
3.3 Copy the hex file to WiRa:
3.3.1 adb push filename /sdcard/
3.3.2 note that the /sdcard/ directory is not the real SD card, it’s located in the first directory of USB storage
3.4 Type in “adb shell” to enter the command line mode of Android
3.5 Navigate to /sys/bus/spi/drivers/marc_basic/spi0.1
3.6 Enable SPI using echo “-I” > spi
3.7 Write file to transfer (MOSI)
3.7.1 cat /sdcard/filename > transfer
3.7.2 Pause the code (either pause and set any breakpoint)
3.7.3 Check DRONA variable “WRRXPacket” using “New Watch” (See 3.9 the picture in the next page)
3.7.4 The result should be the same as what we have set in the hex file
3.8 Read file to transfer (MISO)
3.8.1 cat transfer > /sdcard/filename
3.8.2 Copy the file from WiRa to PC (You can enable the USB storage and directly copy the file out
3.8.3 Check if the data in it is correct. If the MOSI data from OCURA is meaningless for DRONA, then OCURA would receive 32 bytes of 0x55 (See 3.10 the picture in the next page)