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: SaBLE-X-R2 Pin initialization issue.

Part Number: CC2640R2F
Other Parts Discussed in Thread: AFE4400

Tool/software: Code Composer Studio

Hello,

I have been working on CC2640R2F launchpad. I have developed a code which runs perfectly with the launchpad.

So following the next step i tried miniaturizing the prototype. For that, i used SaBLE-X-R2 Bluetooth module. I have made a Custom board, that includes AFE4400 and SaBLE-X-R2 with SFH7050 optical sensor.

Since the board files needed to be changed. I followed this file:///C:/Users/mohda/OneDrive/Desktop/Readme-SaBLE-x-R2.html and was able to build, run and detect SaBLE-X-R2 module.

Now i have tried uploading my program (which was running perfectly using CC2640R2F launchpad). My program is based on Custom profile, "Project Zero" Application-based.

The program runs without errors, (i have changed the board files) and gets uploaded, fortunately. Even the BLE is getting advertised. But there seems to be an issue, because the optical sensor (SFH7050) that is supposed to light up after initialization of the program, does not do so. 

After facing this, i back-traced the issue. and tried debugging the programming, step by step.

/* Open pin */

pinHandle = PIN_open(&pinState, pinTable);

if (pinHandle == NULL)

{

while(1); /* Error Initializing the Pins Defined in "pintable" */

}

This is where the issue seems, according to me. The debugger runs in the infinite while(1); loop. Because it has error initializing the custom pins.

This is how i have defined the pins.

/* Pin driver handle */
static PIN_Handle pinHandle;
static PIN_State pinState;


PIN_Config pinTable[] =
{
AFE_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX,
AFE_PDN | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX,
AFE_RST | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX,
AFE_RDY | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_DIS, //PIN_IRQ_POSEDGE,
PIN_TERMINATE
};

and in the board fie:

#define AFE_PDN     IOID_14
#define AFE_RST      IOID_8
#define AFE_CS       IOID_9
#define AFE_RDY     IOID_10

I can't seem to find the issue. Please help me out.