- Prerequisites
- SPRESENSE build environment.
- Copy ghifp directory to examples directory of SPRESENSE.
(e.g.)
$ cp -r ./GacruxTest/GeneralTest/ghifp ./spresense/examples
- Enable ghifp application and peripheral interface.
(e.g.)
$ cd ./spresense/sdk
$ ./tools/config.py -m
-
Examples ---> Gacrux Host I/F protocol test
-
CXD56xx Configuration --> Peripheral Option
- Check the peripheral interface used as Host I/F.
-
Build and burn nuttx.spk to SPRESENSE.
- Send "ghifp" to nuttx console, then you can see the help.
nsh> ghifp
[0]:ghifp
ghifp [arg1] ([arg2] [arg3] ...)
arg list
- INIT
- DEINIT
- CHGSTAT [stat]
e.g. "ghifp chgstat 1"
- TXFW [fw_path]
e.g. "ghifp txfw /mnt/spif/test.bin"
- EXECFW
- UARTCONF [baudrate No] [flow control No]
e.g. "ghifp uartconf 6 0"
- I2CCONF [speed No]
e.g. "ghifp i2cconf 1"
- SPICONF [data frame size No]
e.g. "ghifp spiconf 1"
- DBGSEND [len] [hex binary(text)]
e.g. "ghifp dbgsend 4 001188FF"
- DBGRECV [0 or 1]
e.g. "ghifp dbgrecv 1"
- DBGFSEND [path]
e.g. "ghifp dbgfsend /mnt/spif/test.bin"
- CHGIF [interface num]
e.g. "ghifp chgif 1"
- SETDIVSZ [one packet size]
e.g. "ghifp setdivsz 4086"
- SETADDR [hex target address]
It is only effective when interface type is I2C.
e.g. "ghifp setaddr 24"
- SETDFS [data frame size]
It is only effective when interface type is SPI.
e.g. "ghifp setdfs 16"
- SETSPICLK [clock No]
It is only effective when interface type is SPI.
e.g. "ghifp setspiclk 2"
- DBGTXFW [virtual_file_sz] [div_sz] [total_pkt_type] [pkt_no_type]
e.g. "ghifp dbgtxfw 20480 4086 0 0
-
Command list
-
INIT
- Initialize ghifp application. You must execute this command at first.
-
DEINIT
- Terminate ghifp application.
-
CHGSTAT [stat]
- Send command to switch Gacrux system state.
- [stat] 0 -> Request to delete FW on NVM and re-start. 1 -> Request FW re-start. 2 -> Request to wake up from deep sleep state. 3 -> Request to change state to deep sleep.
- Send command to switch Gacrux system state.
-
TXFW [fw_path]
- Send command to transfer firmware.
- [fw_path] FW path name.
- Send command to transfer firmware.
-
EXECFW
- Send command to execute FW.
-
UARTCONF [baudrate No] [flow control No]
- Change UART settings.
- [baudrate No] 0 -> 4800bps 1 -> 9600bps 2 -> 14400bps(Not support) 3 -> 19200bps 4 -> 38400bps 5 -> 57600bps 6 -> 115200bps 7 -> 230400bps 8 -> 460800bps 9 -> 921600bps 10 -> 1Mbps
- [flow control No] 0 -> Flow control OFF. 1 -> Flow control ON.
- Change UART settings.
-
I2CCONF [speed No]
- Change I2C settings.
- [speed No] 0 -> -100Kbps 1 -> -1Mbps(400Kbps in SPRESENSE)
- Change I2C settings.
-
SPICONF [data frame size No]
- Change SPI settings.
- [data frame size No] 0 -> 8bit 1 -> 16bit
- Change SPI settings.
-
DBGSEND [len] [hex binary(text)]
- Send arbitrary binary for debug.
- [len] Binary len.
- [hex binary(text)] Hex binary format in text.
- Send arbitrary binary for debug.
-
DBGRECV [0 or 1]
- Enable debug receive mode.
- [0 or 1] On or Off debug receive mode.
- Enable debug receive mode.
-
DBGFSEND [path]
- Send arbitrary file for debug.
- [path] File path to send.
- Send arbitrary file for debug.
-
CHGIF [interface num]
- Change Host I/F type.
- [interface num] 0 -> UART 1 -> I2C 2 -> SPI
- Change Host I/F type.
-
SETDIVSZ [one packet size]
- Change division size when TXFW.
- [one packet size] Division size.
- Change division size when TXFW.
-
SETADDR [hex target address]
- Change I2C target address.
It is only effective when interface type is I2C.
- [hex target address] Target address in one byte hex.
- Change I2C target address.
It is only effective when interface type is I2C.
-
SETDFS [data frame size]
- Change SPI data frame size.
It is only effective when interface type is SPI.
- [data frame size] Data frame size(Only 8 or 16).
- Change SPI data frame size.
It is only effective when interface type is SPI.
-
SETSPICLK [clock No]
- Change SPI frequency.
It is only effective when interface type is SPI.
- [clock No] 0 -> 1300000Hz 1 -> 2600000Hz 2 -> 5200000Hz 3 -> 6500000Hz 4 -> 7800000Hz 5 -> 9750000Hz 6 -> 13000000Hz
- Change SPI frequency.
It is only effective when interface type is SPI.
-
DBGTXFW [virtual_file_sz] [div_sz] [total_pkt_type] [pkt_no_type]
- Transmit FW for test.
- [virtual_file_sz] Virtual file size
- [div_sz] File division size
- [total_pkt_type] OPR configuration of total packet size. 0 -> Normal 1 -> Always zero 2 -> Invalid(Normal + 1) 3 -> Change value(+) in middle 4 -> Change value(-) in middle
- [pkt_no_type] 0 -> Normal 1 -> Increment from zero 2 -> No increment 3 -> Over increment 4 -> Over total packet size
- Transmit FW for test.
-