Revision as of 09:36, 16 November 2013 by Craig Peacock (Talk | contribs)

Using the Microchip IEEE 802.15.4 Radio on the BeagleBone Black

To load support for the Microchip MRF24J40 execute the following:

#echo BB-BONE-MRF24J40 > /sys/devices/bone_capemgr.8/slots

This should result in following kernel debug messages:

[  883.483409] bone-capemgr bone_capemgr.8: part_number 'BB-BONE-MRF24J40', version 'N/A'
[  883.483585] bone-capemgr bone_capemgr.8: slot #6: specific override
[  883.483660] bone-capemgr bone_capemgr.8: bone: Using override eeprom data at slot 6
[  883.483716] bone-capemgr bone_capemgr.8: slot #6: 'Bone-MRF24J40,00A0,Signal 11 Softwa,BB-BONE-MRF24J40'
[  883.484028] bone-capemgr bone_capemgr.8: slot #6: Requesting firmware 'cape-bone-mrf24j40-00A0.dtbo' for board-name 'Bone-MRF24J40', version '00A0'
[  883.484113] bone-capemgr bone_capemgr.8: slot #6: dtbo 'cape-bone-mrf24j40-00A0.dtbo' loaded; converting to live tree
[  883.484629] bone-capemgr bone_capemgr.8: slot #6: #2 overlays
[  883.594180] edma-dma-engine edma-dma-engine.0: allocated channel for 0:43
[  883.594350] edma-dma-engine edma-dma-engine.0: allocated channel for 0:42
[  883.595019] mrf24j40: probe(). IRQ: 205
[  883.599630] bone-capemgr bone_capemgr.8: slot #6: Applied #2 overlays.

Kernel Patch Typo - Incompatible with baseboard

The current kernel patches has a typo in the /kernel/firmware/capes/cape-bone-mrf24j40-00A0.dts that may cause the cape manager to report it is incompatible with the baseboard. i.e.:

[  417.682368] bone-capemgr bone_capemgr.8: slot #8: Requesting firmware 'cape-bone-mrf24j40-00A0.dtbo' for board-name 'Bone-MRF24J40', version '00A0'
[  417.682392] bone-capemgr bone_capemgr.8: slot #8: dtbo 'cape-bone-mrf24j40-00A0.dtbo' loaded; converting to live tree
[  417.682595] bone-capemgr bone_capemgr.8: slot #8: Incompatible with baseboard for 'BB-BONE-MRF24J40'
[  417.692228] bone-capemgr bone_capemgr.8: slot #8: Failed verification 

If this is the case, change the following line

compatible = "ti,beaglebone", "ti-beaglebone-black";

to

compatible = "ti,beaglebone", "ti,beaglebone-black"; 

and rebuild.

I/O Conflict with HDMI

The MRF24J40 shares I/O (P9.31) with the HDMI Interface. If you don't disable the HDMI interface on boot (or unload it - glup), the following error may result:

[   23.701229] bone-capemgr bone_capemgr.8: slot #7: Requesting firmware 'cape-bone-mrf24j40-00A0.dtbo' for board-name 'Bone-MRF24J40', version '00A0'
[   23.715092] bone-capemgr bone_capemgr.8: slot #7: dtbo 'cape-bone-mrf24j40-00A0.dtbo' loaded; converting to live tree
[   23.726858] bone-capemgr bone_capemgr.8: slot #7: BB-BONE-MRF24J40 conflict P9.31 (#5:BB-BONELT-HDMI)
[   23.736629] bone-capemgr bone_capemgr.8: slot #7: Failed verification

To disable the HDMI interface, see the example at the bottom of this page.

Testing MRF24J40 Hardware

The easiest way of testing your MRF24J40 interface hardware is using izchat to send simple text messages between two 802.15.4 interfaces. Izchat is part of the Linux Zigbee User Space Tools

Device 1:

# echo BB-BONE-MRF24J40 > /sys/devices/bone_capemgr.9/slots
# iz add wpan-phy0
Registered new device ('wpan0') on phy wpan-phy0
# iz set wpan0 777 8001 11
# ifconfig wpan0 up
# izchat 777 8001 8002
> hello
how are you?

Device 2:

# echo BB-BONE-MRF24J40 > /sys/devices/bone_capemgr.9/slots
# iz add wpan-phy0
Registered new device ('wpan0') on phy wpan-phy0
# iz set wpan0 777 8002 11
# ifconfig wpan0 up
# izchat 777 8002 8001
hello
> how are you?