This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2538NF23 and NV_RESTORE option

Other Parts Discussed in Thread: CC2538

Hello.

I have question which is simular to some which has already been written on this forum.

I have a CC2538FN23 board on which my application runs.

I changed the target device in Target tab:

Also I changed ICF file to the attached: 6518.CC2538_NF23.rar

I changed hal_board_cfg.h  and defined THIS_IS_CC2538NF23:

#if defined HAL_IMG_AREA
#define HAL_NVIC_OSET             512
#if    (HAL_IMG_AREA == 0)
#define HAL_NVIC_ADDR            (HAL_IMG_A_BEG + HAL_NVIC_OSET)
#elif  (HAL_IMG_AREA == 1)
#define HAL_NVIC_ADDR            (HAL_IMG_B_BEG + HAL_NVIC_OSET)
#else
#error  HAL_IMG_AREA is invalid.
#endif
#else
#define HAL_NVIC_ADDR             FLASH_BASE
#endif

#ifndef THIS_IS_CC2538NF23   
#define HAL_NV_PAGE_END           254
#else
#define HAL_NV_PAGE_END           126
#endif

#define HAL_OTA_LEDGER_PAGE       248
#define HAL_OTA_LEDGER_PAGE_ADDR  (FLASH_BASE + (HAL_OTA_LEDGER_PAGE * HAL_FLASH_PAGE_SIZE))

/* ------------------------------------------------------------------------------------------------
 *                         OSAL NV implemented by internal flash pages.
 * ------------------------------------------------------------------------------------------------
 */

// Flash consists of 256 pages of 2 KB.
#define HAL_FLASH_PAGE_SIZE       2048
#define HAL_FLASH_WORD_SIZE       4

// Z-Stack uses flash pages for NV
#define HAL_NV_PAGE_CNT           6
#define HAL_NV_PAGE_BEG           (HAL_NV_PAGE_END-HAL_NV_PAGE_CNT+1)
#define HAL_NV_START_ADDR         ((FLASH_BASE) + (HAL_NV_PAGE_BEG * HAL_FLASH_PAGE_SIZE))

// Factory commmissioning location is now placed in the Lock Bits page.  The
// certificates are stored at the locations defined below.
// NOTE: these addresses MUST match those defined in the associated linker 
// control file (.icf)
// NOTE: Commissioning items are aligned and padded to HAL_FLASH_WORD_SIZE

// 74-byte Implicit Certificate (for binary 283 Key Establishment)
#ifndef THIS_IS_CC2538NF23 
#define HAL_FLASH_IMPLICIT_CERT_283_ADDR  ( 0x0027FED4 )
#else
#define HAL_FLASH_IMPLICIT_CERT_283_ADDR  ( 0x0023FED4 )
#endif
#define HAL_FLASH_IMPLICIT_CERT_283_SIZE  ( 74 + 2 ) // 2-bytes of pad

// 37-byte CA Public Key (for binary 283 Key Establishment)
#ifndef THIS_IS_CC2538NF23 
#define HAL_FLASH_CA_PUBLIC_KEY_283_ADDR  ( 0x0027FF20 )
#else
#define HAL_FLASH_CA_PUBLIC_KEY_283_ADDR  ( 0x0023FF20 )
#endif
#define HAL_FLASH_CA_PUBLIC_KEY_283_SIZE  ( 37 + 3 )  // 3-bytes of pad

// 36-byte Device Private Key (for binary 283 Key Establishment)
#ifndef THIS_IS_CC2538NF23 
#define HAL_FLASH_DEV_PRIVATE_KEY_283_ADDR  ( 0x0027FF48 )
#else
#define HAL_FLASH_DEV_PRIVATE_KEY_283_ADDR  ( 0x0023FF48 )
#endif
#define HAL_FLASH_DEV_PRIVATE_KEY_283_SIZE  ( 36 )

// 48-byte Implicit Certificate (for Key Establishment)
#ifndef THIS_IS_CC2538NF23 
#define HAL_FLASH_IMPLICIT_CERT_ADDR  ( 0x0027FF6C )
#else
#define HAL_FLASH_IMPLICIT_CERT_ADDR  ( 0x0023FF6C )
#endif      
#define HAL_FLASH_IMPLICIT_CERT_SIZE  ( 48 )

// 22-byte CA Public Key (for Key Establishment)
#ifndef THIS_IS_CC2538NF23 
#define HAL_FLASH_CA_PUBLIC_KEY_ADDR  ( 0x0027FF9C )
#else
#define HAL_FLASH_CA_PUBLIC_KEY_ADDR  ( 0x0023FF9C )
#endif     
#define HAL_FLASH_CA_PUBLIC_KEY_SIZE  ( 22 + 2 )  // 2-bytes of pad

// 21-byte Device Private Key (for Key Establishment)
#ifndef THIS_IS_CC2538NF23 
#define HAL_FLASH_DEV_PRIVATE_KEY_ADDR  ( 0x0027FFB4 )
#else
#define HAL_FLASH_DEV_PRIVATE_KEY_ADDR  ( 0x0023FFB4 )
#endif
#define HAL_FLASH_DEV_PRIVATE_KEY_SIZE  ( 21 + 3 )  // 3-bytes of pad

// 8-byte IEEE address (unique for each device)
#ifndef THIS_IS_CC2538NF23 
#define HAL_FLASH_IEEE_ADDR  ( 0x0027FFCC )
#else
#define HAL_FLASH_IEEE_ADDR  ( 0x0023FFCC )
#endif
#define HAL_FLASH_IEEE_SIZE  ( 8 )  // Re-defining Z_EXTADDR_LEN here

// Location of SoC factory IEEE address (Information Page)
#define HAL_INFO_ADDR  0x00280000
#define HAL_INFO_IEEE_OFST  0x028
#define HAL_INFO_IEEE_ADDR  (HAL_INFO_ADDR + HAL_INFO_IEEE_OFST)

But after turning off and turning on my device does not restore network connection.

With the same application I have no troubles on cc2538EM board, where cc2528sf53 is used.

What other settings I have to change to get NV_RESTORE option working?