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

My application board do not run example project

Dear

                               

                                I have finished completed the Blue tooth Mesh light-switch example function testing , secure button dfu and secure buttonless dfu on DK and dongle of nrf52840 chips.

                                Right now I build a testing circuit by nrf52840 module which was bought from vendor (The vendor said the modules are  bran-new which mean there is nothing in the nrf52840 chips). The circuit is built according to No5 circuit configuration schematic of nrf54280 datasheet(on page 593). A 3v3 exteral power connect to VDD and VDDH; Vbus be connect to USB power separately, which should be 5V. A SWD interface be connect to P19 of Dk(pca10056).

Below is some experiments I did and the result:

 

E1: Example:  open_bootloader of nRF5_SDK_16.0.0_98a08e2 : which locat at "nRF5_SDK_16.0.0_98a08e2\examples\dfu\open_bootloader\pca10056_usb_debug"

The " open_bootloader_usb_mbr_pca10056_debug.emProject" project be programmed to the module by SES through P19 of pca10056.

Every thing is ok. Becouse the LED blink to show it have enter the DFU state

Then I programmed the s140.hex and light_switch_server_nrf52840_xxAA_s140_7.0.1.hex to the module by USB with a 3v3 exteral power(The PCA10056 board be disconnected). the process looks good. But the code do not run, the led still blink after I push the reset button. there also is not any advertisements and LED also stay off.

E2: Example: secure_bootloader of nRF5_SDK_16.0.0_98a08e2 : which locat at "nRF5_SDK_16.0.0_98a08e2\examples\dfu\secure_bootloader\pca10056_usb_debug" and " nRF5_SDK_16.0.0_98a08e2\examples\dfu\secure_bootloader\pca10056_s140_ble_debug"

In this experiment, I will try 2 example project for USB dfu and ble dfu

After the module be erased by "nrfjprog -e" command through SWD interface which connect to P19 of pca10056, I programmed those 2 projects severally by SES and SWD interface.

After programmed "secure_bootloader_usb_mbr_pca10056_debug.emProject ", the desktop programmer tools can connect the module and also can write " the s140.hex and light_switch_server_nrf52840_xxAA_s140_7.0.1.hex". but the example code still do not run. it is same with E1.

After programmed " secure_bootloader_ble_s140_pca10056_debug.emProject ", the led is correct like as PCA10056 board, but there is not any advertisements.

 

The RF parts of the module does not work all the time. the light-switch server code can not be started by bootloader althrough it can be started on PCA10056 board.

 

Q1: Is there anything special we need to do to make a new NRF52840 chip work properly? (For example, the hard disk needs to be formatted before use)

Q2: Those testing result show me that the light-switch server code make the all of the pin stop output? why?

Q3: Is there any key to lock the flash so that the application code can not be write to flash?

 

Thanks,

 

Di-sheng

Parents Reply Children
  • Hi Hung Bui

    Thanks for your reply.

    Yes, I have verify every code on PCA10056 or PCA10059, I also verify that example of BLE(blinky) and Mesh(light-switch server) be loaded by open_bootloader DFU which are through USB and secure_bootloader DFU which through USB or BLE. For buttonless dfu, I also completed the verification by modify the blinky example of BLE and light-switch server example of Mesh (I just want to try a DFU on BLE level). For Mesh DFU, I still do not do, I want try that after those examples be verified on application board.

    Because of the reasons above I do not understand why the DFU can running on the application board, but example code not, althrough the code by loaded by bootloader. Would you help me to think about what reasons can cause the error.

    Do you know whether the examples project code (ble_app_blinky of SDK and light-switch server of Mesh) uses the  32.768kHZ exteral low frequency clock of nrf52840. Because my application circuit is same with the No5 circuit configuration schematic of nrf54280 datasheet(on page 593) except the 32.768kHZ exteral crystal oscillator circuit which I do not solder any componets.

     

    Thanks,

    Best Regards,

    Di-sheng

      

  • Hi Hung Bui

    Thanks for your blog, I have read it when I try to the DFU function before. It is useful.

    In last post, I said that the dfu can runing on application board. This is correct, because there is not "DfuTarg" can be found by connecter tools of my phone after I programmed the " pca10056_s140_ble_debug" of secure_bootloader to the application board which was erasured. which mean the dfu do not running on the board too.

    the open-bootloader project can work on the application board, because the LED is blink and the desk-program tools can fing the board and can programming example code into the board by USB interface, althrough the example code do not work on the board.

    The everythings I did on the application board have been done on the PCA10056 or PCA10059

    Thanks,

    Best Regards,

    Di-sheng

  • Hi Diseng, 

    Yes the mesh example uses the 32kHz crystal. 

    If you want to run with the internal RC you need to set NRF_SDH_CLOCK_LF_SRC = 0 in sdk_config.h

    I would suggest you to: 

    1. Try to flash the example directly on the development board using programming interface not DFU. You would need the programming interface for debugging anyway. 

    2. Try to do DFU with simple example , blinking LED for example, before you test with mesh example. 

  • Hi Hung

    I add the 32kHz crystal and the dfu code running correct now. I will try to run the light-switch server code tomorrow. 

    I have other question about the code of the light-switch server example:

    I read the  code of simple_hal.c, showed below:

    /*****************************************************************************
    * IRQ handler(s)
    *****************************************************************************/

    #if BUTTON_BOARD
    void GPIOTE_IRQHandler(void)
    {
    NRF_GPIOTE->EVENTS_PORT = 0;
    for (uint8_t i = 0; i < BUTTONS_NUMBER; ++i)
    {
    /* Check that the event was generated by a button press, and reject if it's too soon (debounce).
    * NOTE: There is a bug with this at the wrap-around for the RTC1 where the button could be
    * pressed before HAL_BUTTON_PRESS_FREQUENCY has passed a single time. It doesn't matter practically.
    */

    ////////////2020-0828 button debug start
    #if defined(BOARD_PCA10059) && !defined(BOARD_LSM100)
    if ((~NRF_GPIO1->IN & (1 << (m_buttons_list[i]))) &&
    TIMER_DIFF(m_last_button_press, NRF_RTC1->COUNTER) > HAL_BUTTON_PRESS_FREQUENCY)
    #else
    if ((~NRF_GPIO->IN & (1 << (m_buttons_list[i]))) &&
    TIMER_DIFF(m_last_button_press, NRF_RTC1->COUNTER) > HAL_BUTTON_PRESS_FREQUENCY)
    #endif ////////////2020-0828 button debug end
    {
    m_last_button_press = NRF_RTC1->COUNTER;
    m_button_handler_cb(i);
    }
    }
    }
    #endif

    I did not find the "m_button_handler_cb(i)" code in whole sulotion and nordic webs. Would you can help me to find it. I want to know what  does it.

    Thanks,

    B,Rs,

    Di-sheng

  • Hi, 

    If you have a look at hal_buttons_init() function, you can find that the input cb of this function will be assigned as the m_button_handler_cb . In the example it's button_event_handler()

Related