How to check number of nodes (router and end device) joined and leave from coordinator when run program

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to check number of nodes (router and end device) joined and leave from coordinator when run program

1,878 Views
dangthanhnha_nt
Contributor I

Hi All,

I use module JN5169-001-M06 is coordinator, sofeware JN-AN-1217 and sdk JN-SW-4170.

I config default size of the Routing table is 70

#define ZNC_MAX_TCLK_DEVICES    70

When I paired about 60 device into coordinator, after I trying add a device into the coordinator but pair is fail so i want to control number of nodes joined and leave the coordinator.       

How to check number of nodes (router and end device) joined and leave from coordinator when run program ?

How to check size about ram, eeprom, flash of the module Jn5169 coordinator?

Regards,

Nha Dang

Labels (2)
0 Kudos
7 Replies

1,727 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Dang,

 

You could add for debugging purpose, the file appZpsExtendedDebug.c. For example the vDisplayTableSizes(), that will Displays the sizes of the various tables within the PRO stack.

Also, remember:

 

Neighbour Table:

  • Increasing the table size will use more RAM

Child Table Size:

  • Increasing the sub-table size will use more EEPROM for persisted data

Address Map Table

  • Increasing the size of this table will impact both RAM and EEPROM usage

MAC Address Table

  • Increasing the size of this table will impact both RAM and EEPROM usage.

Routing Table

  • The increased size will therefore only affect RAM usage

Hope it helps.

Regards,

Mario

0 Kudos

1,727 Views
dangthanhnha_nt
Contributor I

Hi Mario,

Thank for you reply,

I want to display the stack usage in the module Jn5169 coordinator, sofeware JN-AN-1217 and sdk JN-SW-4170.

So I enable function of file StackMeasure.h

  • vInitStackMeasure(); 
  • tsStackInfo sStackInfo;
  • vGetStackMeasure(&sStackInfo);
    vUtils_Debug("Stack Usage");
    vUtils_DisplayMsg("Total:",sStackInfo.u32TotalSize);
    vUtils_DisplayMsg("Used :",sStackInfo.u32CurrentMeasure);
    vUtils_DisplayMsg("Peak :",sStackInfo.u32PeakMeasure);

I define in Makefile:

STACK_MEASURE          ?= 1

ifeq ($(STACK_MEASURE), 1)
APPSRC += StackMeasure.c
endif

Question:

While I build and load file.bin into coordinator jn5169 it is error :

!!! Trap error
u32PICMR = 0 : u32PICSR = 8000
u32PICMSR = 0 : u32IPMR = 0
u32IHPR = f : u32AINT = 8000 u32PINT 0
EPCR = b452e : EEAR = 5d1de2f4
Stack dump:
4007ca4 : 00000330
4007ca8 : 000827c3
4007cac : 04000110
4007cb0 : 000b452e
4007cb4 : 5d1de2f4
.......

.......

File log_Stack_dump_coordi.txt is log error i print from uart after i config Enable all debug output.

Please let know the solution how to solve this error?

 

Regards,

Nha Dang

0 Kudos

1,727 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Nha Dang,

I tried by my side and it works as expected.

pastedImage_1.png

Please see the modifications that I did. Look at the MC STACK_MEASURE comments

1. I added the StackMeasure.c/.h files into the common folders.

2. Makefile.

###############################################################################
# commands options
# enable optional commands as required per applicaion.
#
#NETWORK_RECOVERY       ?= 0
#[MC STACK_MEASURE]
STACK_MEASURE          = 1
#
###############################################################################
.
.
.
#[MC STACK_MEASURE]
ifeq ($(STACK_MEASURE), 1)
CFLAGS += -DSTACK_MEASURE
endif
.
.
.
#[MC STACK_MEASURE]
ifeq ($(STACK_MEASURE), 1)
APPSRC += StackMeasure.c
endif

 3.  Add the next code in the app_serial_commands.c

//[MC STACK_MEASURE]
#ifdef STACK_MEASURE
#include "StackMeasure.h"
#endif
.
.
.
.
.
PRIVATE void vProcessCommand(void)
{
.
.
.
//[MC STACK_MEASURE]
#ifdef STACK_MEASURE  
    else if (0 == stricmp((char*)token, "measure"))
    {

        tsStackInfo    sStackInfo;

        vGetStackMeasure( &sStackInfo );

        DBG_vPrintf ( TRUE, "\r\n TotalSize: %d, uPeakMeasure: %d, Current: %d ",
                                                sStackInfo.u32TotalSize,
                                                sStackInfo.u32PeakMeasure,
                                                sStackInfo.u32CurrentMeasure );
    }
#endif
.
.
}

4. app_start.c

//[MC STACK_MEASURE]
#ifdef STACK_MEASURE
#include "StackMeasure.h"
#endif
.
.
.
PUBLIC void vAppMain(void)
{
.
.
.
#if (JENNIC_CHIP_FAMILY == JN516x)
    /* Initialise the stack overflow exception to trigger if the end of the
     * stack is reached. See the linker command file to adjust the allocated
     * stack size. */
    vAHI_SetStackOverflow(TRUE, (uint32)&_stack_low_water_mark);
#endif

    //[MC STACK_MEASURE]
#ifdef STACK_MEASURE
    vInitStackMeasure ( );
#endif
.
.
.
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Regards,

Mario

0 Kudos

1,727 Views
dangthanhnha_nt
Contributor I

Hi Mario,

Thank you for reply,

I can used StackMeasure.c/h with the coordinator.

How to display the ram, PDM eeprom,  stack usage in the module Jn5169 Router, sofeware JN-AN-1217 and sdk JN-SW-4170?

Regards,

Nha Dang

0 Kudos

1,727 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Dang,

You can use the same process that the coordinator is doing.

Initialize the stack measurements as early as possible in the code:
vInitStackMeasure();

To display the stack usage:
---------------------------

tsStackInfo sStackInfo;

vGetStackMeasure(&sStackInfo);
vUtils_Debug("Stack Usage");
vUtils_DisplayMsg("Total:",sStackInfo.u32TotalSize);
vUtils_DisplayMsg("Used :",sStackInfo.u32CurrentMeasure);
vUtils_DisplayMsg("Peak :",sStackInfo.u32PeakMeasure);

Please look at the next document for the EEPROM information.

https://www.nxp.com/docs/en/user-guide/JN-UG-3087.pdf 

17.1 Initialisation

Regards,

Mario

0 Kudos

1,727 Views
dangthanhnha_nt
Contributor I

Hi Mario,

Thank you for reply,

I used StackMeasure.c/h  to display the stack usage and i want to find the document information about Peak Stack, Current Stack, Total Stack. where can I find it? (Document or Reference).

To display the stack usage:
---------------------------

tsStackInfo sStackInfo;

vGetStackMeasure(&sStackInfo);
vUtils_Debug("Stack Usage");
vUtils_DisplayMsg("Total:",sStackInfo.u32TotalSize);
vUtils_DisplayMsg("Used :",sStackInfo.u32CurrentMeasure);
vUtils_DisplayMsg("Peak :",sStackInfo.u32PeakMeasure);

Regards,

Nha Dang

0 Kudos

1,727 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi,

Unfortunately, we do not provide any document for this c file.

However, you could take a reference to the next comment.

/*
 Other than by continuously monitoring the stack pointer which is impractical,
 the simplest method to see the extent of stack usage is to fill the unused stack
 area with a known pattern then look for the watermark level that the stack has
 overwritten.



 NOTE: The stack is used by both the application AND the network layers
    ( 802.15.4, ZigBee and JenNet), so the stack size can be larger
    than expected.



       --------------------------  STACK_START_ADDR
      |       Stack grows down   |
      |         |                |
      |         V                |<------  u32CurrentMeasure
      |                          |
       ..........................   pu32MonitorStartAddr
      |          |
      |          |
      |          |
      |          |
      |      Fill Pattern        |<-------  u32PeakMeasure
      |      Fill Pattern        |
      |      Fill Pattern        |
      |      Fill Pattern        |
      |      Fill Pattern        |
      |      Fill Pattern        |
      |      Fill Pattern        |
      |      Fill Pattern        |
      |      Fill Pattern        |
      |      Fill Pattern        |
       --------------------------   pu32StackEndAddr
      |      Application         |
      |        BSS               |
      |                          |
       --------------------------
      |                          |
      |                          |
      |       Application        |
      |  Code               |
      |                          |
      |                          |
      |                          |
      |                          |
      |                          |
      |                          |
       --------------------------

Regards,

Mario

0 Kudos