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

No Button event handled when running Mesh Light Switch Demo (Mesh SDK 3.1.0), SDK nRF5_SDK_15.2.0_9412b96, Latest released dongles.

Hello, I'm starting evaluation of the Mesh Light Switch Demo both on DK PCA10056 and on Dongles PCA10059. I 'm using SEGGER IDE and made sure to properly set target in Preprocessor for each bulld.

Everything is working fine with the DK ( Loading the target via Jlink from SEGGER, provisioning with IOS apps, remote command of LED1 from IOS, local command of LEDS from buttons, exit of Mesh with Button3 and so on).

When loading the same built code recompiled for Dongle (PCA10059) along with SoftDevice S140 6.1.0 into the Dongles with nrfProgram Apps, Dongle start properly, all the provisioning goes great (Leds flashing and full config on IOS), remote control of LED from IOs works fine BUT neither Server nor Client react to onboard single pushbutton event. The Reset button is working fine, I checked the full chain of GPIO configuration into the example code and can confirm that SW1 mapping for the dongle is properly set into pca10059.h (#define BUTTON_1       NRF_GPIO_PIN_MAP(1,6)) so can't really understand why static void button_event_handler(uint32_t button_number) never gets called upon button push event (I added Led flashing into this function and see that when testin the same code onto DK...) Can anybody help me there please ?

 Thank you

Parents
  • Hi,

    Have you changed the define from BOARD_PCA10056 to BOARD_PCA10059 in the preprocessor definitions? Also, have you added defined(BOARD_PCA10056) to the BUTTON_BOARD define found in simple_hal.h?

  • Yes I did add BOARD_PCA10059 to the BUTTON_BOARD define and also changed BOARD_PCA10056 to BOARD_PCA10059 in both Common and release preprocessor definition.

    Looking further into the sequential call from Main.c of initialize(void), it looks like hal_leds_init() of simple_hal.c is getting its definition of  NRF_GPIO from nrf51_to_nrf52840.h and there is only P0 GPIOs definition in there.

    /* GPIO */
    /* GPIO port was renamed to P0. */
    #define NRF_GPIO NRF_P0
    #define NRF_GPIO_BASE NRF_P0_BASE

    Same issue for hal_buttons_init.

    So if I understand well, at least SW1(P1.06) and LD2 Green(P1.09) would not be declared for a dongle.

    Shouldn't there be some similar declaration and initialization for P1 GPIO range ? 

    Thanks

  • Just to complement: it seems that JDTS had the exact same issue a month ago in his question : " NRF52840 Dongle missing Green Led on LD2" and it seems that SDK is not mapping LD2 and SW1 button properly per his testing. 

    Could you please investigate ? There are functions like nrf_gpio_latches_read in nrf_gpio.h which use the notion of GPIO_REG_LIST which cumulates NRF_P0 and NRF_P1 mapping, but I can't find any equivalent GPIO initialization function associating GPIO_REG_LIST

Reply
  • Just to complement: it seems that JDTS had the exact same issue a month ago in his question : " NRF52840 Dongle missing Green Led on LD2" and it seems that SDK is not mapping LD2 and SW1 button properly per his testing. 

    Could you please investigate ? There are functions like nrf_gpio_latches_read in nrf_gpio.h which use the notion of GPIO_REG_LIST which cumulates NRF_P0 and NRF_P1 mapping, but I can't find any equivalent GPIO initialization function associating GPIO_REG_LIST

Children
No Data
Related