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.

RTOS/CC2640R2F: GAP_DeviceInit exception or INVALIDPARAMETER

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640,

Tool/software: TI-RTOS

During the bootup process, when I call GAP_DeviceInit() I either get an exception or I get a failure (with return code: INVALIDPARAMETER).

Both calls are identical except for the profileRole parameter.

When calling GAP_DeviceInit with profileRole == 0x00 (i.e. uninintialized) I get the return code INVALIDPARAMETER

When calling GAP_DeviceInit with profileRole == 0x04 (i.e. GAP_PROFILE_PERIPHERAL) I get an exception as shown below.

How can I fix this issue so that I can successfully call GAP_DeviceInit()?

  • Hello Matthew,

    I've never experienced this with any of our embedded sample applications on the CC2640R2 LaunchPad. Note that GAP_DeviceInit is called by the GAPRole task. Can you provide more context on how you are able to reproduce this problem on the LaunchPad?

    Best wishes
  • I originally did not modify the GAPRole Task code but noticed that advertisement data was unable to be set in my application task. Looking deeper into the this I started checking return codes of some of the GAP_ api calls and found that GAP_DeviceInit was failing w/ INVALIDPARAMETER (the documentation indicates that this is due to passing the wrong GapProfile parameter). I then tried hard-coding GAP_PROFILE_PERIPHERAL (0x04) in the GAP_DeviceInit call and saw the exception.
  • Is this related to your CC2640 to CC2640R2F ported project in your other post? If so, did you follow the porting guide? This could be mismatched header files.

    Best wishes

  • Yes. It's the same project. I did follow the porting guide.

    Which header mismatch could cause this?
  • Matt,

    is this error coming from a stock simple_peripheral example or some other example from an SDK (also which SDK version)? If you did following the porting guide, which version did you start with and which version are you porting to?

    As Jeff mentioned before, typically the GAP Bond Manger calls GAP_DeviceInit() (see GAPRole_StartDevice()). Are you invoking GAP_DeviceInit separately or just through the bond manager?
  • Hey Tom,

    First off, thank you for your quick responses. I really appreciate this.

    I have an existing project on a CC2640 which works well and is stable. In order to use OAD I migrated the project to the CC2640R2 hardware (in order to get additional flash space, since I was maxed out on the CC2640) and got the following off-the-shelf projects working from the simplelink_cc2640r2_sdk_1_00_00_22 SDK:

    - bim_oad_offchip
    - simple_peripheral_cc2640r2lp_stack
    - simple_peripheral_cc2640r2lp_app_oad_offchip

    I successfully booted the board and ran multiple OAD's using BTool

    After this I imported my CC2640 project's source code and made the changes detailed in the porting guide (migrate event scheduling code from Semaphores to Events, updated header file includes, etc.).

    Since then I've hit a number of Task and BLE API issues. The issue of the day is the one detailed above, where I see a number of BLE API calls failing, including GAP_DeviceInit().

    GAP_DeviceInit() is called in my application's init function through a call to GAPRole_StartDevice(). GAPRole_StartDevice() is called after VentoProfile_RegisterAppCBs() and before GAPBondMgr_Register().