This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Multiple nRF8001 connecting to one device

Hi all,

I am using the BLE nRF8001 and EFM32 (ARM Cortex M3). I used the following SDK for connecting the modules using ACI (SPI). github.com/.../ble-sdk-efm32

Now I want to use 2 SPIs of my EFM32 in order to connect them to 2 nRF8001, simultaneously. The SDK is able to connect only one SPI to one BLE. What should I change in the code?

Regards Mehdi

Parents
  • The nRF8001 drivers do not support multiple nRF8001s out of the box. The typical changes need The nRF8001 can be used in polling mode and the EFM32 driver for nRF8001 uses it in polling mode. You need to have the pins available, you can share the MISO, MOSI and SCK but you need to have separate lines for REQN and RDYN. The simplest way would be to have 2 code instances of the driver with separate name spaces so that they do not share any of the code or the data (i.e. queues). This will double the code and RAM usage. Another method would be to make the below modifications:

    1. Have 2 data structures instead of the init i.e. aci_state, i.e. Setup data and pins used. Add an instance data member so that you can differentiate between the 2 nRF8001s.
    2. All commands and events will need to have the instance number so that the driver can see which nRF8001 instance needs to be used.
    3. The driver has to be modified so that when the Commands are being generated it maps the instance to the correct ACI s to be used, when the Events are generated the data is tagged with the instance based on the ACI pins the Event was received on.

    I know this is a bit late but I hope it helps other users with a similar question.

Reply
  • The nRF8001 drivers do not support multiple nRF8001s out of the box. The typical changes need The nRF8001 can be used in polling mode and the EFM32 driver for nRF8001 uses it in polling mode. You need to have the pins available, you can share the MISO, MOSI and SCK but you need to have separate lines for REQN and RDYN. The simplest way would be to have 2 code instances of the driver with separate name spaces so that they do not share any of the code or the data (i.e. queues). This will double the code and RAM usage. Another method would be to make the below modifications:

    1. Have 2 data structures instead of the init i.e. aci_state, i.e. Setup data and pins used. Add an instance data member so that you can differentiate between the 2 nRF8001s.
    2. All commands and events will need to have the instance number so that the driver can see which nRF8001 instance needs to be used.
    3. The driver has to be modified so that when the Commands are being generated it maps the instance to the correct ACI s to be used, when the Events are generated the data is tagged with the instance based on the ACI pins the Event was received on.

    I know this is a bit late but I hope it helps other users with a similar question.

Children
No Data
Related