-
Notifications
You must be signed in to change notification settings - Fork 257
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
Bluetooth Low Energy #5
Comments
Hi Ahmed, this is a matter of supporting a specific radio model for a given Bluetooth-enabled platform. Which Bluetooth platform (board/SoC) were you interested in specifically, and what sample would you like to run - could you describe the use case in more detail, this would help us with setting our priorities. |
We are trying to simulate a bluetooth mesh network on a board of any type.
Most probably we will edit the nordic nrf52 on-off sample on the board type
you support.
…On Wed, 11 Apr 2018, 17:38 Michael Gielda, ***@***.***> wrote:
Hi Ahmed, this is a matter of supporting a specific radio model for a
given Bluetooth-enabled platform. Which Bluetooth platform (board/SoC) were
you interested in specifically, and what sample would you like to run -
could you describe the use case in more detail, this would help us with
setting our priorities.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AgXmv2itLQTOiuNqqc2wr5Wlq6QD4grEks5tniODgaJpZM4SS2KG>
.
|
Hi Ahmed, we do not at this point support any Bluetooth peripherals, but it's definitely something we'd like to do if there is enough need for it. I'll mark this as a feature request. |
Hi, I am interested in testing nrf52 as well but unfortunately not via Zephyr's bluetooth stack, but NRF SDK. Since the bluetooth stack is a binary blob in nRF SDK, perhaps a way of work is to mock supervisor calls instead of actual peripheral beneath it? Is it supported somehow? I guess it would enable Renode in the uglier projects, where you are dependent on vendor's impl |
I am interested in this as well. Especially with the NimBLE stack. |
Is Bluetooth peripheral support enable for nRF52840DK if yes, can you share some sample code? |
@jain0nikhil while we do have the nRF52840 chip supported, it does not yet have radio connectivity. |
@PiotrZierhoffer is there any plan for supporting Bluetooth Peripheral. |
is there any board which support radio connectivity in renode which I can refer for adding support for nRF? |
We have some 802.15.4 radios you can look at, for example CC2538 or CC2520. The communication layer will be similar, but we have no bt radios at the moment. nRF52840 BT is not in the nearest scope, so I can't give you any specifics. Regarding your other question: you need to adjust the flash location in the repl file and in your linker scripts. That's not enough information to say anything specific though. |
As of very recently, I was able to get a simulation going with zephyr on nrf52840 using the heart-rate samples and have a connection between a central and peripheral. See this PR in infrastructure repo. Wasn't sure if I could hijack this issue, or if I should open another one for that PR, given this seems to be about zephyr bluetooth samples with renode. Haven't tried any soft-devices yet with renode, but ultimately would be interested in that too as a I have a few projects using them. However, to get simulations going, a completely open source implementation has been indispensable for education and troubleshooting. Was hoping that experience with zephyr might transfer well to simulations with soft-devices. |
Was able to get a softdevice-based peripheral advertising. Used the Nordic SDK 17.1.0 and SD 7.2.0. Based on the ble_app_hrs demo with some modifications to disable the security related features as peripheral models don't currently support. Quickly tried connection with the central from same example set, but that unfortunately didn't work. Requires a few simple fixes to peripheral models, which I did on top of existing bluetooth PR here in branch bluetooth-softdevice. Wasn't sure if changes should stack on top of existing PR, as it might redundantly contain the existing PR's commits. I attach the modified ble_app_hrs main.c and *.resc for reference. Can go in a bit more detail on building with that SDK or just supply the binaries if desired. One other important caveat is that simulation seems to need to run at 1 us quantum. Anything more, and the peripheral will advertise once, but then effectively halts with WFE as scheduling with timer0 gets messed up. Compare values to drive timer events seem to be somewhat aware of time passing. Overall, trying to workout issues with no source code (i.e. just the soft device binary) is unsurprisingly a bit tricky. Given Nordic seems to be moving on to open source Zephyr based solutions for the future anyways, probably turn my attention to enabling more features (e.g. security) with that SDK. |
If you have time you can give NimBLE a try. It is used as the BLE stack in RIOT and MyNewt. Espressif also uses a fork for their ESP32 with FreeRTOS. So, I guess you can also use it in FreeRTOS. |
Would like to cross-check models against another stack. So far, basics seem to work with zephyr and at least advertising with softdevice. If NimBLE hardware implementation is similar enough, it might already function as well. Spent an hour or so with MyNewt, unfortunately wasn't able to get it to build an acceptable elf of the blehr sample in nimble repo targeting the nrf52840. Have any direction there? Didn't try RIOT. Perhaps have better luck with their getting started docs. Doesn't matter if RIOT or MyNewt, whichever one is easiest, but need some sample apps, preferably a central and peripheral that implements hr, like the sample apps for Zephyr. With that, it could be assessed whether or not NimBLE functions on renode with the PR branch Unfortunately, my time is limited for platform ramp up / education in near term. Would probably prefer spending effort in near term towards expanding out zephyr-based solutions since I already have a foothold there. |
I also don't have any experience with MyNewt. I can help you with RIOT though, if you want to. If you give me your contact, I can probably make some time in order to help you with this. If you point me into a direction how I can run the elf with the BLE implementation, I am happy to give it a try. |
Attempts with RIOT went a little better. Setting up was just cloning the repo, putting arm toolchain on path and calling There was at least one issue in the RTC model. IRQ was being gated on event enable, and that's not how the hardware works as can be seen in the nrf52840 product spec, so that needs to be fixed and pushed to PR. So advertising seems to work, but connection with central not quite working yet. Didn't see a central example in riot repo, so was just using the zephyr central to try to connect. Central sees advertising from riot peripheral, and sends a connect request, but things don't get established. Will have to investigate more. If you'd like to try hacking some yourself, the build docs are here. Which is basically just install pre-reqs and run build.sh from cloned renode repo. The current bluetooth capabilities require build from source, since it's ongoing PR. You'll need the bluetooth-work branch from my forks of renode and renode-infrastructure. Attaching script file I used. You would need to update paths to bins to where they are on your system. If that's way too brief to be of much use, you can try dropping me a line at grifcj@gmail.com. |
Great that the build process works. I am not so much into the low level Bluetooth stack. I will give it eventually a try. Thanks for the pointer to the resources. |
With the BLE support for nRF52840 we released (with enormous help from @grifcj) I believe I can close this issue. If any other issues related to BLE are encountered, let's track them separately https://antmicro.com/blog/2022/04/developing-and-testing-ble-on-nrf52840-with-renode-and-zephyr/ |
radio not emulated well at all, but if we raise an interrupt we can get progress: #0 PowerCC26XX_standbyPolicy () at dpl/PowerCC26X2_nortos.c:104 renode#1 0x00004f10 in SemaphoreP_pend (handle=handle@entry=0x200006c8 <rfObject+80>, timeout=timeout@entry=4294967295) at dpl/SemaphoreP_nortos.c:234 renode#2 0x00003628 in RF_pendCmd (bmEvent=8070450532247928842, ch=1, h=0x20000678 <rfObject>) at /project/source/ti/drivers/rf/RFCC26X2_multiMode.c:5156 renode#3 RF_pendCmd (h=0x20000678 <rfObject>, ch=<optimized out>, bmEvent=<optimized out>) at /project/source/ti/drivers/rf/RFCC26X2_multiMode.c:5090 renode#4 0x0000104a in EasyLink_init (params=0x200056d0) at ../easylink/EasyLink_nortos.c:1081 renode#5 0x00000458 in mainThread (arg0=0x0 <resetVectors>) at ../rfEasyLinkEchoRx_nortos.c:138 renode#6 0x000015a2 in main () at ../main_nortos.c:61 waiting on "wfi" instruction (machine-0) cpu DisassembleBlock 0x5a80 Executing: cpu DisassembleBlock 23168 0x00005a80: 8000 strh r0, [r0] 0x00005a82: bf30 wfi 0x00005a84: f3af8000 nop.w 0x00005a88: 4628 mov r0, r5 then issue sysbus.nvic SetPendingIRQ 1 oops - seems I just issued a reset ; not very helpful (can see localProgramStart symbol) # causes continuation sysbus.nvic Reset Could not yet understand where to place a break point. logFile @examples.log - does not capture the console interaction, so harder to understand at what point I injected an interrupt via the console. some problem with ccTask, resulted in using dotnet build (add --net everywhere). but mono seems to be fine.
I have been trying to run the zephyr bluetooth samples but with no luck. Does renode support BLE peripheral?
The text was updated successfully, but these errors were encountered: