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

MESH DFU PROBLEM

Hello,

Here i are using nRF52832 ,softdevice S132 and mesh sdk v3.0.0

For my Application,i need to go with DFU.so i merged my application into the example code of DFU provided by MESH SDK.

As my Application needs BUTTON related functions.so for this i have added this code

hal_buttons_init(button_event_handler);

static void button_event_handler(uint32_t button_number)
{
       switch (button_number)
       {
  /*When switch 0 is pressed*/
           case 0:
           {
            AF_ButtonState = BUTTON0;
                __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- BUTTON0 -----\n");
           }
            break;
  /*When switch 1 is pressed*/
          case 1:
          {
           AF_ButtonState = BUTTON1;
                           __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- BUTTON1 -----\n");
          }
      
           break;
   /*When switch 2 is pressed*/
          case 2:
          {
           AF_ButtonState = BUTTON2;
                           __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- BUTTON2 -----\n");
          }
       
            break;
   /*When switch 3 is pressed*/
          case 3:
          {
           AF_ButtonState = BUTTON3;
                           __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- BUTTON3 -----\n");
          }
             
           break;
   /*When switch 4 is pressed*/                    
          case 4:
          {
           AF_ButtonState = BUTTON4;
                           __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- BUTTON4 -----\n");
          }
          break;
                          
          default:
            AF_ButtonState = BUTTON_IDLE;
            break;
      }
}

so when ever BUTTON actions happen,it is not going to the handler and nothing is printing in the LOG as well.

As given in MESH sdk (SERVER code example).

i have enabled RTT also,

rtt_input_enable(app_rtt_input_handler, RTT_INPUT_POLL_PERIOD_MS);


static void app_rtt_input_handler(int key)
{
    if (key >= '0' && key <= '4')
    {
        uint32_t button_number = key - '0';
        button_event_handler(button_number);
    }
}

As MESH DFU example doesn't have BUTTON related functions,so i have added the above things,but here nothings seems to go quite well with my application.

So i hope could anyone help me in this regards

thank you.

  • Are you sure that the mesh DFU updated successfully? Do you have any logging information you could provide for the mesh dfu? It seems that you initialize the button_event_handler correctly. Have you tried running flashing the example before you try the mesh DFU process? Do the buttons then work as intended?

  • Hi,

    Thanks for ur reply.

    Yeah,Above mentioned DFU process is working fine.i.e,by uploading Softdevice,Bootloader and dfu_package file related to my application of LIGHT_SWITCH_SERVER code,it is entering into DFU_TARGET mode and i can able to upload my DFU_PACKAGE file as many time as i want and for one to one device only.

    Yes,i have tried flashing the example before the mesh dfu process and in that case the buttons doesn't work.

    But,as of now  my application with DFU seems to work with LIGHT_SWITCH_SERVER code only.

    So,i have not gone with MESH DFU code provided in the MESH SDK.

Related