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

Adapting examples for NRF52840 dongle PCA10059

Greeting to Nordic Team!

I'm new to nordic devices as well as Q&A section, so apologies in advance if I make any mistakes raising a question.

Two things I would like to discuss:

Intro and adaptions I have made so far:

I have got two NRF52840 dongle, but no nrf52DK. I have downloaded and installed nrfConnect, Segger Embedded Studio, and SDK 15.2.0 as well as SDK15.3.0 (I wasn't sure which one I will be needing)I have gone through coule of tutorials fro BLE and Adapting examples for dongle links as follows:

1. https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-advertising-a-beginners-tutorial

2. https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-services-a-beginners-tutorial

3. https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial

and finally for adapting examples for dongle

https://devzone.nordicsemi.com/nordic/short-range-guides/b/getting-started/posts/nrf52840-dongle-programming-tutorial

Example in use: blinky_app

The first problem :

      I faced was as guided in the dongle programming tutorial, I can't see any preprocessor definitions rather the it says "inherit" and when I click three dots besides it, I find the text box complete empty and nothing over there. Do I need to write all of the stuff shown in the tutorial by myself or it appears by itself and I just need to remove the PCA10056 and replace it with PCA10059. If so, why my preprocessor definitions seems empty. same is case with the linker option it says "inherit" and the text box for linker is empty. Please provide an explanation for this.

Also in a thread I read, I need to explicitly undefine the board I'm not using(in this case it would be PCA10056). Link https://devzone.nordicsemi.com/f/nordic-q-a/43760/adapting-the-blinky-example-from-the-nrf52840-dk-to-the-nrf52840-dongle/171455#171455. Do you confirm this? 

The main Issue:

    I wish to create a project on nrf52840 dongle that accepts data from android app and stores it on SD card and later retrive it and send it to the desktop computer, all these is expected to happen over BLE. One of my friend has created an android app which has a form like structure which accepts several information from the user like Name, age, address, nature of complaints, complaints, etc. So far I'm able to connect my NRF52840 dongle with the android app and nothing further than that. Which SDK examples should I refer for my project? Or do I need to write completely different program for my project? as said earlier this my first time working with NRF device previously I have extensively worked with Arduinos and ESPs.

waiting for timely help and valuable guidance. Thanks in advance

Parents
  • Hi,

    If so, why my preprocessor definitions seems empty. same is case with the linker option it says "inherit" and the text box for linker is empty. Please provide an explanation for this.

    The reason you only see "inherit" is that you have not selected the common configuration. "Release" and "Debug" both inherit from "Common", and that is where you should do your changes. Please see this screenshot:

    Also in a thread I read, I need to explicitly undefine the board I'm not using(in this case it would be PCA10056). Link https://devzone.nordicsemi.com/f/nordic-q-a/43760/adapting-the-blinky-example-from-the-nrf52840-dk-to-the-nrf52840-dongle/171455#171455. Do you confirm this? 

    No. There is no need to undefine the other board, just remove the definition in the first place, and add the correct one for the dongle.

    Regarding your application, there are no examples that do this for you, but you can find several relevant examples in the SDK. You can find an SD card example under HW peripheral examples and several relevant BLE peripheral examples. You can also find examples of USB CDC for communication with the computer over USB if that is the intention.

    Please note that I recomend obtaining an nRF52840 DK to do the development since having a debugger is essential when sorting out issues.

    Br,

    Einar

  • I changed the setting to common and then I right click on the project and hit build. I am using ble_app_uart example now. it gave me couple of errors. I am attaching a screenshot of the same. what am I missing now? is uart example not meant to be used with dongle? if so what is the alternate example which would serve the purpose of uart example

  • What kind of tutorials are you looking for (what is it you want to achieve now)?

    The tutorial for ble_app_uart where I can see what to do next or like what? I don't know what should I be looking for next I have managed to successfully uploaded the code to the dongle and now I want to test it. 

    (As discussed before, the nRF52840 dongle does not have an onboard debugger, and for that reason, it is a good idea to also have an nRF52840 DK to work with where you can debug your application. Once it works, you can program it to a dongle.)

    As said earlier I can't afford to get any DK as it is way too expensive and moreover my client requires to use dongle in his project and he's not going to bear those expenses for DK. I am looking forward to get help from your forum only that's the last option I have got 

  • Hi,

    Chirantan Kansara said:
    The tutorial for ble_app_uart where I can see what to do next or like what? I don't know what should I be looking for next I have managed to successfully uploaded the code to the dongle and now I want to test it.

    The UART/Serial Port Emulation over BLE example (ble_app_uart) documentation describes how you can test the example in the "Testing" section.

    Chirantan Kansara said:
    As said earlier I can't afford to get any DK as it is way too expensive and moreover my client requires to use dongle in his project and he's not going to bear those expenses for DK.

    Do you have another external SWD debugger you use? If not, then I suspect the cost of not having a DK is larger then obtaining one, since not being able to use a debugger is likely to significantly increase the time you need to spend.

  • looks like uploading a ble_app_uart disables the USB port of dongle. Do you confirm this?

    Because I am about to get it sildered on another PCB which powers it externally. In that case which pin I should feed into the power? is it 3V or 5V? the schematics lacks the source from where VDDnrf is extrcated. Pin VBUS of dongle goes to two different locations on the VBUS port of USB port. Which pin should I connect the external power supply to? 

  • Hi,

    Chirantan Kansara said:
    looks like uploading a ble_app_uart disables the USB port of dongle. Do you confirm this?

    Yes. USB is only enabled when configured and enabled by the software. If the bootloader is running (for instance after pressing the sideways reset button), USB is always active. If not, it depends on what the application firmware is doing. The ble_app_uart does not use USB, and therefor it is not active.

    Chirantan Kansara said:
    Because I am about to get it sildered on another PCB which powers it externally. In that case which pin I should feed into the power? is it 3V or 5V? the schematics lacks the source from where VDDnrf is extrcated. Pin VBUS of dongle goes to two different locations on the VBUS port of USB port. Which pin should I connect the external power supply to? 

    If you want to power it with 5 V from USB, then just hook it up on VBUS. If you want to provide 3 V, then connect it as described under External regulated source and supply it through the plated half-hole marked VDD OUT.

  • Okay I got it working and ble_app_uart is perfectly working fine now. I connected my dongle pins with arduino and developed a parser in arduino so that it shows me whatever data t receives on UART.

    Few further questions...

    Now I am planning to store that data into micro SD card which will be handled by the arduino I know I am doing it the long way as dongle could have itself done all this part but its fine, so my question is once I put all that data into micro sd card I wish to send it back to the app. the fetching of data from sd card would be done by arduino what I expect to know is doe ble_app_uart supports getting data on its two pins via serial and send it back to app over bluetooth?

Reply
  • Okay I got it working and ble_app_uart is perfectly working fine now. I connected my dongle pins with arduino and developed a parser in arduino so that it shows me whatever data t receives on UART.

    Few further questions...

    Now I am planning to store that data into micro SD card which will be handled by the arduino I know I am doing it the long way as dongle could have itself done all this part but its fine, so my question is once I put all that data into micro sd card I wish to send it back to the app. the fetching of data from sd card would be done by arduino what I expect to know is doe ble_app_uart supports getting data on its two pins via serial and send it back to app over bluetooth?

Children
  • Hi,

    Chirantan Kansara said:
    what I expect to know is doe ble_app_uart supports getting data on its two pins via serial and send it back to app over bluetooth?

    The ble_app_uart example demonstrates how to tunnel UART over BLE, which is basically what you describe. So yes, it is supported. It might be that you need to do some minor modifications, though, but you should anyway see the examples as something you can use as a reference or starting point, and adapt to your needs.

  • I got it through as well yesterday and I realized it was really stupid of me to ask that!.

    My next concern is I want to send an image and a audio file from app to dongle. My friend who developed that app says image and audio are represented by long string of characters. So my question is, Is it possible to receive the image and audio file just like I am receiving other data? what is the maximum length of the string that can be accommodated over this communication?

    Thanks in advance

  • Hi,

    UART itself is byte-oriented, and there is no length limitation there per se. There are other "length's" you may run into (internal buffer sizes), MTU etc, but that should not matter. The UART example uses a string buffer scaled by BLE_NUS_MAX_DATA_LEN, but that is just for that application. I don't think it makes sense to think of this as strings if you are transferring audio/images or similar, but rather just a stream of data. But this is all up to you.

Related