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.

CCS/CC2640R2F: CC2640R2: Adding NVS into simple_peripheral project failed because of no BOADR_NVS0 in Board.h

Part Number: CC2640R2F

Tool/software: Code Composer Studio

When I add "NVS_open(Board_NVS0, &nvsParams)" into main.c , however , there is no BOADR_NVS0 in Board.h, as shown in picture 1. The correct Board.h in nvs project is shown in picture 2 .As a result ,"rebuild simple_peripheral project failed" , as shown in picture 3.


picture 1

picture 2

picture 3

My steps of adding  functions related to NVS into main.c of simple_peripheral project is as followed:

/************************ main.c **********************************/

/******************************************************************
 * INCLUDES
 */
//添加NVS的头文件
#include <ti/drivers/NVS.h>
//添加NVS的硬件的头文件,需要用新版的头文件替代旧版的头文件
#include "board.h"
......

/******************************************************************
 * GLOBAL VARIABLES
 */

//定义NVS的句柄,结构体,参数
NVS_Handle nvsHandle;
NVS_Attrs regionAttrs;
NVS_Params nvsParams;
......

/******************************************************************
 * Main
 */

int main()
{
  ......
  //NVS初始化
  NVS_init();
  //NVS参数初始化
  NVS_Params_init(&nvsParams);
  //NVS打开,得到句柄
  nvsHandle = NVS_open(Board_NVS0, &nvsParams);
  //如果没有得到NVS句柄,也就是NVS打开失败,就停止程序
  if (nvsHandle == NULL) 
  {
      Display_printf(dispHandle, 0, 0, "NVS_open() failed.");
      return (NULL);
  }
  //将NVS句柄与存储区域结构体对应起来,其中包含区域基地址,区域大小,擦除扇区大小三个参数
  NVS_getAttrs(nvsHandle, &regionAttrs);
  ......
}

......

Attachments:
1、the positon of simple_peripheral project in my computer is as followed:
C:\ti\simplelink_cc2640r2_sdk_1_40_00_45\examples\rtos\CC2640R2_LAUNCHXL\ble5stack\simple_peripheral

2、the positon of nvs project in my computer is as followed:
C:\ti\simplelink_cc2640r2_sdk_1_40_00_45\examples\rtos\CC2640R2_LAUNCHXL\drivers\nvs

3、my complete workspace of simple_peripheral project can be downloaded from here:

1884.CCSworkspace141.rar

4、you can download the simplelink_cc2640r2_sdk_1_40_00_45 from the following website:
dev.ti.com/.../

5、my develop invironment:
CCS:Code Composer Studio 7.2.0
SDK:simplelink_cc2640r2_sdk_1_40_00_45
hardware:CC26640R2 develop kit

  • Hello Heng,

    We do not provide a NVS example with our BLE sample applications, and as such, we have not tested this configuration.

    It looks like you have somehow eclipsed the board file which defines the RF frontend and bias configuration. I would recommend you review the board file section in the documentation:
    software-dl.ti.com/.../index.html

    Best wishes
  • Thanks for you reply!

    I have read the "Running the SDK on Custom Boards" documentation, however, it doesn't help with my issue.

    In order to util NVS in simple_peripheral project of CC2640R2 , "BOADR_NVS0 " and some functions related to NVS must be added into "Board.h" and "Board.c".

    Could you just provide me with more specific documentations related with using NVS in simple_peripheral project?