cpu/cc26x0: add rudimentary interface to support radio core#5496
cpu/cc26x0: add rudimentary interface to support radio core#5496yogo1212 wants to merge 50 commits intoRIOT-OS:masterfrom
Conversation
|
@A-Paul I know this is a big one, but do you mind to be assignee? If yes, feel free to reassign -as usual... |
|
@yogo1212 what do you mean exactly by "no working code is using it"? |
|
@emmanuelsearch the example doesn't work :-D |
| pingCommand.commandID = CMDR_CMDID_PING; | ||
| RFC_DBELL->CMDR = (uint32_t) (&pingCommand); | ||
| while (!RFC_DBELL->CMDSTA); /* wait for cmd execution */ | ||
| printf("rfc_ping fails without a printf reading cmdsta %lu\n", RFC_DBELL->CMDSTA); |
There was a problem hiding this comment.
note that the mere presence of this line affects the evaluation in the interrupt which happens BEFORE this printf is reached oO
can't wait to see if anyone finds the reason
There was a problem hiding this comment.
Not sure if it's related, but I observed print statements in isr
functions (at leat I interpret functions starting with isr_ as such).
AFAIK printing in interrupt routines is never a good idea. If you need some
sort of signaling and the interrupts occur only sparsely then you can
toggle a led or use another variable to somehow mark that an interrupt was
thrown and do the printing in normal execution
Am 03.06.2016 10:39 schrieb "Leon George" [email protected]:
In cpu/cc26x0/periph/rfc.c
#5496 (comment):@@ -131,6 +131,7 @@ bool rfc_ping_test(void)
pingCommand.commandID = CMDR_CMDID_PING;
RFC_DBELL->CMDR = (uint32_t) (&pingCommand);
while (!RFC_DBELL->CMDSTA); /* wait for cmd execution */
- printf("rfc_ping fails without a printf reading cmdsta %lu\n", RFC_DBELL->CMDSTA);
note that the mere presence of this line affects the evaluation in the
interrupt which happens before the printf is reached oO
can't wait to see if anyone finds the reason—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/RIOT-OS/RIOT/pull/5496/files/32f992e5f89b3701bfa6c3de99e0ed2bd6b8e0f6..7bf8ed592f43a05a2d87ef83286c3950b8db726a#r65674010,
or mute the thread
https://github.com/notifications/unsubscribe/AAtHOREcFUflfXwoyi72dPtfYc7XbK9Fks5qH-hXgaJpZM4Isg30
.
|
@yogo1212 @emmanuelsearch I'm currently working on fully implementing the advertising functionality, however both the TI doc and the BLE sepcs are rather poorly written, so it's not as straightforward as it could be... I'm also writing a "guide" on BLE advertising with the CC2650, as I make my way trough the doc: I will make it available on the wiki of the board when things are in an acceptable state. |
cpu/cc26x0/include/cc26x0_rfc.h
Outdated
|
|
||
| #define RFC_DBELL ((cc26x0_rfc_dbell_regs_t *)(RFC_DBELL_BASE)) | ||
|
|
||
| #define CMDR_TYPE_mask 0x3 |
|
@yogo1212, I'm going to look deeper into your code tomorrow (hopefully). As a first step I ask you to enclose the macro literals into braces. Also there are several decimal numbers mixed in sequences of hex numbers. Would be helpful to make this more consistent. |
That is what I consider "Work in progress"? |
|
@A-Paul thank you for your time :-) |
You're welcome. Your example file is -not the only- one created by a HW vendor. Look at the file header. We use them and and leave them as they are. In RIOT code, please use uppercase letters for constants.
In file cpu/cc26x0/include/cc26x0_rfc.h: Even that exception is not strict. Seems that I'm not convinced. |
|
you are absolutely right on that. |
|
@fvcoen found a fault in the fcfg headers -> fixing that |
|
@A-Paul Since you didn't reply (assuming you have just a few more PRs to merge), I turned the remaining Regarding the braces: The RIOT coding guide doesn't seem to include that. Since we want to get this merged, you should just make ultimate decisions. |
My intention was to get more consistent notation. If you want certain groups of defines to "stick out", there is also the option of reordering the blocks.
I prefer to embrace all of them. :D |
|
@yogo1212 I solved the 0x82 mystery! We are actually missing something in the current radio setup. In the function Did I mention that there is absolutely no documentation on teh RFCMODESEL register? I found out about it through this forum thread. I thought it would make more sense if this config were included in this PR rather than a protocol-specific one. |
|
@fvcoen impressive! |
|
Is anyone currently working on this? In addition to setting The additional steps are too verbose to quote. There are some required trim values to set (hf_xosc won't start otherwise), and a rom function to call to actually switch to hf_xosc. |
|
@benemorius hi :-) what starts working after taking those steps you are talking about? |
|
just realised, why... |
I'll open a PR against your cc26x0_rfc branch if that's ok.
Those steps get the microcontroller switched over to hf_xosc, which is required for the radio. (Actually, I suspect the radio may be working already, but you can't tell because hf_rcosc isn't accurate enough.) Then you need only add the code to send ble advertisements and the advertisements will work. Here are the changes, including test code which sends advertisements. I'll either clean this up and then open a PR, or open a PR and then clean it up. I'm actually changing my focus to get 15.4 working now so I don't know how much further I'll go on this. |
|
@benemorius were there any additional steps you have taken to be able to receive beacons broadcasted by RIOT? i've rearranged your changes in here: yogo1212#13. |
|
What is the latest here? |
|
@OlegHahm is there a way that one of you could test https://github.com/benemorius/RIOT/tree/cc26x0_rfc_works? just a five minute check whether that code works ;-) |
|
@yogo1212 maybe you can ask @haukepetersen now that he is more or less back ;) |
|
@yogo1212 I have several TI sensortags available, and could help with testing - please elaborate what to test and how. The referenced repos/branches a kind of outdated compared to latest RIOT master. And whats the difference to the code in this PR? |
|
@emmanuelsearch nice to know @sming hi :-) the code at https://github.com/benemorius/RIOT/tree/cc26x0_rfc_works is supposed to emit beacons but it isn't for me :-( |
|
@smlng ping? |
|
you wang smlng, not me who is sming.
…On Tue, Jun 20, 2017 at 9:59 AM, Martine Lenders ***@***.***> wrote:
@smlng <https://github.com/smlng> ping?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5496 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABVr2ib1cjmTFWkfWdLrsanUnXovkF9gks5sF9AsgaJpZM4Isg30>
.
|
|
No progress > 1 year, closing as memo for now. |
|
@smlng ack |
props to @fvcoen for finding ways to deal with the 'irregularities' of the hardware 👍
i think this should be merged even though no working code is using it.
this should still allow other developers to participate.