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

Deigning BLE sensor Network

I want to extend the ble_app_multilink_central for pca10028 Example to be able to communicate with a sensor via SPI and then initiate a connection with another pca10028. but I have a problem with the SPI driver, after testing i found out that this function bsp_configuration() stops the program from executing.

in another attempt to solve the problem i tried to make this example spi_master_with_spi_slave as my template. it is a peripheral example that doesn't require a softdevice but when i tried to program the SoftDevice first (because i will need it later for designing the NW) but then while flashing the program i get Error in Keil: Flash download Failed cortex M0 and i cant figure out the reason for that.

  • What is the ble_app_multilink_central_s120_spi_pca10028 example? It doesn't exist in our SDK. You need to explain what you are doing or include some code showing what you are doing. Please edit/update your question. In your other attemt you get an error because you are trying to flash your application on top of the SoftDevice in flash. It is better to start with a BLE example and then include SPI. But get the SPI to work without SoftDevice first.

  • the example i am referring to is ble_app_multilink_central. i explain more what i want to achieve: a sensor connected with a DK via spi, the DK as a SPI master read the data from the sensor and then start scanning when a valid data(authentication data) is read from the sensor. then send this data to another DK. i have managed now to use the SPI with S130. int main(void) { // Initialization of various modules. app_trace_init(); LEDS_CONFIGURE(LEDS_MASK); LEDS_OFF(LEDS_MASK); buttons_init(); ble_stack_init(); client_handling_init(); device_manager_init(); scan_start();

    spiInit();
    	
    		send_data();  //send SPI frames
    
    		for (;;)
    	{
    		power_manage();
    
    	}
    

    } i am a beginner in BLE development. should it here that send_data(); send a SPI frame and then the code will enter power_manage(); and scan for BLE devices?

  • If you are a beginner in BLE I strongly suggest you don't start with a central example, but a peripheral example. For example ble_app_hrs, ble_app_uart or ble_app_template, with the S110 SoftDevice. Usually it is the peripheral that has the sensor connected to it, and sends the data to the central device.

    Why a peripheral? A peripheral only has one connection to one central. We have more examples for peripherals. There is better access to centrals to test with, Master Control Panel for PC, nRF Master Control Panel for Android and so on.

    You should be in a connection if you want to send data, the peripheral advertises and the central scans. If the central sees and attractive advertising packet it sends a connection request, and they make a connection. Then the central discovers what services and characteristics(these contain your data) that are available on the peripheral. Then the peripheral can send data to the central. The central can also send data to the peripheral. Examine how this is implemented in our examples.

    This and this may be helpful to you.

Related