-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mrf24j40 #5792
Mrf24j40 #5792
Conversation
Cool! |
@PeterKietzmann, you have the device available at HAW? |
0x78, 0x70, 0x68, 0x60, 0x58, 0x50, 0x48, 0x40, | ||
0x38, 0x30, 0x28, 0x20, 0x18, 0x10, 0x08, 0x00 }; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a lot of empty space o___o
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello miri64,
thanks a lot for the hint - I 'll make a correction tomorrow.
Regards,
Neo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a small hint why the mrf24j40 doesn't send data up to now.
The MRF24J40 seem to expect a different FIFO format for Receive FIFO and Transmit-Normal-FIFO. If I interpret the figure 3-11 inside the datasheet it seems that the TX FIFO needs the "Header Length" inserted at address 0.
Has anyone an idea where/how to get the header length?
Regards,
Neo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand the figure 3-11 of the datasheet right and if netdev2 is configured to use long-address mode - then the "Header Length" is 23 - is this correct?
Regards,
Neo
Hi @Nenaco! Is this PR still WIP? Where are you at? |
Hello Peter, Regards, Am 05.10.2016 um 08:37 schrieb Peter Kietzmann:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the default values provided in #5977
/** | ||
* @brief Maximum possible packet size in byte | ||
*/ | ||
#define MRF24J40_MAX_PKT_LENGTH (127) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider using the values provided in #5977 instead
*/ | ||
#define MRF24J40_MIN_CHANNEL (11U) | ||
#define MRF24J40_MAX_CHANNEL (26U) | ||
#define MRF24J40_DEFAULT_CHANNEL (26U) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dito
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition, you should set this channel during initialization.
EDIT: After startup, ifconfig
showls channel 0
but 802.15.4 has no channel 0.
* | ||
* @todo Read some global network stack specific configuration value | ||
*/ | ||
#define MRF24J40_DEFAULT_PANID (0x0023) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yido
* 31 -> -0dB | ||
*/ | ||
|
||
#define MRF24J40_DEFAULT_TXPOWER (31U) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dito
/** | ||
* @brief Device descriptor for MRF24J40 radio devices | ||
*/ | ||
typedef struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't there be a "uint8_t header_len" in this struct? As used in mrf24j40.c, line 202.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The driver works for me with some minor changes, see: mrf24j40-test My test setup consists of two nucleo-f401 boards and two mrf24j40 modules. The branch in the link above also has a driver test in the tests folder. This is an adaptation of the at86rf2xx test, it sends raw 802.15.4 messages. I have also tested the "gnrc_networking" and "gnrc_border_router" examples, they both work. Thank you for this driver! |
* 24 -> Value = 0xD3 | ||
* 25 -> Value = 0xE3 | ||
* 26 -> Value = 0xF3 | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of the upper block, just mentino the page where to find this mapping.
tmp = mrf24j40_reg_read_short(dev, MRF24J40_REG_TXMCR); | ||
tmp &= 0b11100000; | ||
tmp |= 0b00011000; | ||
tmp |= 0b00000100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there not macros for this usage? It would be cool to see what's gonging on here.
mrf24j40_reg_write_short(dev, MRF24J40_REG_WAKECON, MRF24J40_WAKECON_MASK__IMMWAKE); /* enable Immediate Wake-up mode */ | ||
|
||
/* set default options */ | ||
mrf24j40_set_option(dev, NETDEV2_IEEE802154_PAN_COMP, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Option has been removed within #5897
@phectori what exactly was needed to get gnrc_networking running? Did you try to communicate with an other device than mrf24j40? Are you in charge of a sniffer (e.g. RasPi + 802.15.4 radio)? |
@PeterKietzmann Alle the changes are in the branch I referred to before. The changes are also listed in this commit: commit In summary:
I don't quite understand why the first change is necessary, maybe you have an idea? I only tested the mrf24j40 with another mrf24j40, both on the same board (nucleo-f401). I do not have a raspberry pi + 802.15.4 radio setup right now. |
Thanks for your quick answer! Yes, I already used your branch and it is really helpful. However, you must have added the |
Yes, I have added the module to the application Makefile, like in this branch. Hmm, I'm not sure about the channel. The driver should use channel 26 as defined in mrf24j40_internal.c. The four first bits of that register define the channel, but I have no way to check this actually happens. |
Hello Peter, Regards P.S. sorry for the delay - I was outside for some days Am 15.11.2016 um 16:12 schrieb Peter Kietzmann:
|
@Nenaco you should definitely address all comments and take care of the code until it fits our coding conventions and works as expected (see our Developement Procedures and Contribution Guidlines). A rebase on the latest RIOT master would be great. In the end (still not defined when this will be) I will merge your code into RIOT master, but not integrate it by myself. |
Hello Peter,
Neo Am 16.11.2016 um 08:56 schrieb Peter Kietzmann:
|
Any progress here? @Nenaco If you have no time to finish the driver, I have no problem starting a new PR and making the changes suggested here. |
Work in progress - Support for radio module MRF24J40. Please feel free to make changes and help to make this radio work together with netdev2.