User Tools

Site Tools


doc:crazyradio:usb:index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:crazyradio:usb:index [2013-08-03 01:54]
fred Fixed typos
doc:crazyradio:usb:index [2020-05-12 14:12] (current)
kimberly
Line 1: Line 1:
-====== Usb and Radio protocol of the Crazyradio dongle ======+<WRAP center round important 60%> 
 +This page has deprecated and moved to the new documentation framework of the main Bitcraze website. Please go to [[https://www.bitcraze.io/documentation/system/]] 
 +</WRAP> 
 + 
 + 
 + 
 +====== USB and Radio protocol of the Crazyradio dongle ======
  
 The Crazyradio dongle is based on a Nordic semiconductor nRF24LU1 chip. The radio communication is done using the Nordic "Enhanced ShockBurst™" packet protocol in PTX mode with acknowledge. Variable sized packet, from 1 to 32 bytes, can be send and acknowledged by the copter. The acknowledgement packet can contain a payload from 0 to 32 Bytes. The Crazyradio dongle is based on a Nordic semiconductor nRF24LU1 chip. The radio communication is done using the Nordic "Enhanced ShockBurst™" packet protocol in PTX mode with acknowledge. Variable sized packet, from 1 to 32 bytes, can be send and acknowledged by the copter. The acknowledgement packet can contain a payload from 0 to 32 Bytes.
  
-This page documents the protocol used in version 0.40 of the Crazyradio dongle. Future version (up to 1.0) will be kept compatible.+This page documents the protocol used in version 0.52 of the Crazyradio dongle. Future version (up to 1.0) will be kept compatible
 + 
 +===== Radio configuration ===== 
 + 
 +Crazyradio is configured in PTX mode. It can communicate with Nordic chips compatible with the nrf24L family (at least nrf24L01p, nRF51 and nRF52 tested). In order to communicate with the Crazyradio the target has to be configure correctly: 
 + 
 +  * PRX mode 
 +  * One active pipe with the address configured in the Crazyradio dongle, by default it is 0xE7E7E7E7E7 
 +  * 5 byte address 
 +  * Dynamic payload length enable 
 +  * Payload with ack enable 
 + 
 +The Crazyflie is already configured that way. The relevant source code can be seen in [[https://github.com/bitcraze/crazyflie-firmware/blob/02a2b6d48800334ed455144d9061226418fab7b7/hal/src/radiolink.c#L163|radiolink.c]].
  
 ===== USB protocol ===== ===== USB protocol =====
Line 166: Line 184:
 ^ bmRequestType ^ bRequest                 ^ wValue   ^ wIndex ^ wLength ^ data    ^ ^ bmRequestType ^ bRequest                 ^ wValue   ^ wIndex ^ wLength ^ data    ^
 |          0x40 | START_SCAN_CHANNELS (0x21) | Start    | Stop   | Length  | Packet  | |          0x40 | START_SCAN_CHANNELS (0x21) | Start    | Stop   | Length  | Packet  |
-|          0xC0 | GET_SCAN_CHANNELS (0x21)   | Zero     | Zero   63      | Result  |+|          0xC0 | GET_SCAN_CHANNELS (0x21)   | Zero     | Zero   64      | Result  |
  
 Scan a range of channels and compile a list of channel from which an ACK has been received. The command START_SCAN_CHANNELS should be executed first with start being the first scanned channel and stop the last one. Those should be within 0 to 125. The data is the packet payload sent on each channel, it should be at least one byte long. Scan a range of channels and compile a list of channel from which an ACK has been received. The command START_SCAN_CHANNELS should be executed first with start being the first scanned channel and stop the last one. Those should be within 0 to 125. The data is the packet payload sent on each channel, it should be at least one byte long.
Line 172: Line 190:
 All parameters, except the channel, are used unmodified during the scan. If the data rate is set to 2MBPs the scan is done every second channel. To get the list of channels that answered, GET_SCANN_CHANNELS should be called just after a scan. Up to 63 bytes are returned corresponding to up to 63 channels on which the packet was acknowledged. All parameters, except the channel, are used unmodified during the scan. If the data rate is set to 2MBPs the scan is done every second channel. To get the list of channels that answered, GET_SCANN_CHANNELS should be called just after a scan. Up to 63 bytes are returned corresponding to up to 63 channels on which the packet was acknowledged.
  
-NoteAfter scanning, the channel will be set to the last scanned channel.+<WRAP center round info> 
 +//**Note**// 
 +After scanning, the channel will be set to the last scanned channel. 
 +</WRAP> 
 +<WRAP center round important> 
 +//**Warning**// 
 +On some platform, an empty scan will return a buffer of 64 bytes. This is though to be a USB host implementation bug, see [[https://github.com/bitcraze/crazyradio-firmware/issues/9|ticket #9]] in the Crazyradio firmware project. If a buffer of more than 63 bytes is returned, it means that no channel have been received. 
 +</WRAP> 
  
 ==== Launch bootloader ==== ==== Launch bootloader ====
doc/crazyradio/usb/index.1375487655.txt.gz · Last modified: 2015-07-15 16:30 (external edit)