nrf52-ble-image-transfer-demo for nRF52840 Dongle

Hello everyone!
I'd like to implement the nrf52-ble-image-transfer-demo with a nRF52840 Dongle, for a small low-power image transfer application. My question now is, how do I need to alter the code so it would run on the dongle?

Thanks for your help,

Paul

  • Hi Paul

    I was able to get the example to build by changing the board definition in the project from BOARD_PCA10056 to BOARD_PCA10059, removing the UART configuration in main.c (remove uart_init() and any reference to it), and by adding a clause in the camera_init() function to check for the BOARD_PCA10059 define:

    static void camera_init(void)
    {
    #if defined(BOARD_PCA10056)
    	#if(PCA10056_USE_FRONT_HEADER == 1)
    			m_camera_init.pinScl = 13;
    			m_camera_init.pinSda = 15;
    			m_camera_init.pinSck = 21;
    			m_camera_init.pinMiso = 23;
    			m_camera_init.pinMosi = 25;
    			m_camera_init.pinCsn = 32 + 9;
    	#else
    			m_camera_init.pinScl = 27;
    			m_camera_init.pinSda = 26;
    			m_camera_init.pinSck = 32 + 15;
    			m_camera_init.pinMiso = 32 + 14;
    			m_camera_init.pinMosi = 32 + 13;
    			m_camera_init.pinCsn = 32 + 12;
    	#endif
    #elif defined(BOARD_PCA10040)
        m_camera_init.pinScl = 27;
        m_camera_init.pinSda = 26;
        m_camera_init.pinSck = 25;
        m_camera_init.pinMiso = 24;
        m_camera_init.pinMosi = 23;
        m_camera_init.pinCsn = 22;
    #elif defined(BOARD_PCA10059)
        // Set your pin assignment here
    #else
    #error Board not defined or not supported
    #endif    
        arducam_mini_2mp_open(&m_camera_init);
        arducam_mini_2mp_setResolution(OV2640_320x240);
    }

    If you do the same, and add the correct pin configuration in the camera_init() function to set up the SPI and I2C interfaces, then in theory it should run on the dongle. 

    I say 'in theory' because I haven't tested it myself, I will leave that to you Wink

    Best regards
    Torbjørn

  • Hi Torbjørn,

    Thanks for your answer! I got the example to build this way as well. However, I cannot write it on the dongle. I do think however that the problem there is somewhere else. As I understood it, to program the dongle I need to generate the HEX file of the code, copy this file into the programmer of the nRF Connect for Desktop, and then simply write it onto the dongle. I have put the dongle into bootloader mode by pressing the reset button beforehand. The programmer then asks for a user input: "please select the SoftDevice required by the application firmware", and gives me a bunch of options to choose from. This, however, gets not asked if I simply try to write the blinky example onto the dongle. 

    Would you happen to know where the problem is here?

    Thank you very much,

    Paul

  • I was able to write it onto the dongle by adding the s140_nrf52_7.0.1_softdevice.hex file

  • Hi Paul

    That is good news. Does the application seem to run OK?

    If everything is working you should see it advertise. 

    Best regards
    Torbjørn 

Related