kw2xrf: adaption to netdev2#5469
kw2xrf: adaption to netdev2#5469jfischer-no wants to merge 2 commits intoRIOT-OS:masterfrom jfischer-no:wip@kw2xrf-seq
Conversation
|
Needs rebase. |
|
Needs rebase and adaption to #4871. |
|
Sorry, another adaption needed: #5495. :/ |
| uint32_t pc; | ||
| uint32_t* orig_sp; | ||
| uint32_t pc = 0; | ||
| uint32_t* orig_sp = NULL; |
There was a problem hiding this comment.
It will/should be removed after rebase.
|
There seems to be more than just moving to netdev2 here. Is it maybe possible to split this up in several PRs? |
|
(I know this is reflected in the description, but not in the title). |
to display actual CCA-Mode ... |
|
@jfischer-phytec-iot: I'm still testing this one. However, you somewhat changed the hardware adress generation, its basically reads backwards from what it was before. Any particular reason to do that? I labeled my nodes with their link-local address - changing the hardware address means changing the lladdr, too - hence, I would have to relabel all (~30) my nodes, which would be a little bit inconvenient 😬 |
|
I looked into the responsible code, but it looks the same as before. But still compiling with current master I get a different hwaddr (and lladdr) compared to this PR? Weird ... |
Yes, i changed it 😄 , sorry. Now, least significant bytes of LL references to the the least significant bytes of CPUID. |
|
So you want to keep it that way, and I have to relabel my nodes? Well, then NACK 😁 ... No, I'm fine with it - I just have to remember it to not get confused, when this one is merged. |
|
Ah, and could you please fix this conflict in |
|
I ran some tests on this PR, I tried to ping a
@jfischer-phytec-iot please set INTRA-PAN flag true if src and dst PAN are equal, see also #5684 and #5685. The latter might fix this already. |
|
I applied #5685, now UDP send and recv works in both directions with |
|
@jfischer-phytec-iot can we get this merged soon? Might be easier to do if not depending on #5487, please adapt/rebase accordingly. If you don't have time for this right now, I'm willing to overtake this PR and make necessary changes, if you don't mind?! |
|
will be done today |
|
Is there consensus on this |
| KW2XRF_IDLE, | ||
| KW2XRF_AUTODOZE, | ||
| } | ||
| kw2xrf_powermode_t; |
There was a problem hiding this comment.
coding style: no newline required
| * @brief Returns Timestamp of the actual received packet | ||
| */ | ||
| uint32_t kw2xrf_get_timestamp(kw2xrf_t *dev); | ||
| #ifdef __cplusplus |
| #define MKW2XDM_IRQSTS3_TMR3IRQ (1 << 2) | ||
| #define MKW2XDM_IRQSTS3_TMR2IRQ (1 << 1) | ||
| #define MKW2XDM_IRQSTS3_TMR1IRQ (1 << 0) | ||
| #define MKW2XDM_IRQSTS3_TMR_IRQ_MASK 0xfu |
There was a problem hiding this comment.
(maybe) put in parentheses, and below, too?
There was a problem hiding this comment.
no, is not necessary
| #define MKW2XDM_PHY_CTRL1_RXACKRQD (1 << 4) | ||
| #define MKW2XDM_PHY_CTRL1_AUTOACK (1 << 3) | ||
| #define MKW2XDM_PHY_CTRL1_XCVSEQ_MASK 0x03u | ||
| #define MKW2XDM_PHY_CTRL1_XCVSEQ_MASK 0x07u |
I will try it. |
|
ping |
1 similar comment
|
ping |
|
@jfischer-phytec-iot we'd like to remove the netdev1 interface after the release. Any chance you prepare this PR until middle of next week so @smlng can take over the netdev2 adoption part of this pr? |
drivers/kw2xrf/kw2xrf_netdev.c
Outdated
| return sizeof(netopt_state_t); | ||
| } | ||
|
|
||
| netopt_state_t _get_state(kw2xrf_t *dev) |
There was a problem hiding this comment.
should be static, otherwise name clash with other drivers, e.g. at86rf233, see Jenkins log here
|
@jfischer-phytec-iot we would really much like to have this adoption a a part of the 2016.01 release so we can remove the obsolete netdev1 API. Is there any change that you squash all your commits until the afternoon??? |
|
@PeterKietzmann I will not make as long as checks are red |
|
needs rebase again, that's why CI does not build |
|
I give up, that was the last drop: @PeterKietzmann @smlng If anyone makes PR against this branch, I can merge and squash it, but I do not have time for this today. |
| /* Clear and disable all interrupts */ | ||
| kw2xrf_write_dreg(dev, MKW2XDM_PHY_CTRL2, 0xff); | ||
| int reg = kw2xrf_read_dreg(dev, MKW2XDM_PHY_CTRL3); | ||
| reg |= MKW2XDM_PHY_CTRL3_WAKE_MSK | MKW2XDM_PHY_CTRL3_PB_ERR_MSK; |
There was a problem hiding this comment.
The cppcheck actually is right. This variable is set, but never read again.
There was a problem hiding this comment.
mhm, maybe a call is missing, in the current driver (kw2xrf.c) I found:
/* Mask all possible interrupts */
reg = kw2xrf_read_dreg(MKW2XDM_PHY_CTRL3);
reg |= MKW2XDM_PHY_CTRL3_WAKE_MSK;
kw2xrf_write_dreg(MKW2XDM_PHY_CTRL3, reg);
kw2xrf_write_dreg(MKW2XDM_IRQSTS1, 0x7f);
kw2xrf_write_dreg(MKW2XDM_IRQSTS2, 0x03);
kw2xrf_write_dreg(MKW2XDM_IRQSTS3, 0xff);
so reg is written back to the register, that is missing here?!
There was a problem hiding this comment.
ah the following line
kw2xrf_write_dreg(dev, MKW2XDM_PHY_CTRL3, 0x03);
here actually 0x03 should be reg because MKW2XDM_PHY_CTRL3_WAKE_MSK | MKW2XDM_PHY_CTRL3_PB_ERR_MSK = 0x03 according to the defines.
so fixing this by either remove reg or better as 0x03 is some magic number with
kw2xrf_write_dreg(dev, MKW2XDM_PHY_CTRL3, reg);
should do
There was a problem hiding this comment.
will check squashed branch against backup
Adapt the kw2xrf driver for the netdev2 interface. This patch also adds overwrites.h, the header provides overwrite values for the kw2xrf PHY.
|
closing, superseded by #6453 |
|
Wanted to try something |
This PR adapts the kw2xrf driver to netdev2 and adds new timer and test modes functionalities.
Also support for CR20A devices will be tested. WIP, not ready for review
depends on
#5485,#5487