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.

cc2640: Controll GPIO from BIM

Part Number: CC2640

Hi all,

I need to set a LED inside BIM. For that, added code inside bspSpiOpen(), but LED is not lighting. 

External OAD method. is being used

void bspSpiOpen(uint32_t bitRate, uint32_t clkPin)

{
#ifdef BOOT_LOADER
/* GPIO power && SPI power domain */
PRCMPowerDomainOn(PRCM_DOMAIN_PERIPH | PRCM_DOMAIN_SERIAL);
while (PRCMPowerDomainStatus(PRCM_DOMAIN_PERIPH | PRCM_DOMAIN_SERIAL)
!= PRCM_DOMAIN_POWER_ON);

/* GPIO power */
PRCMPeripheralRunEnable(PRCM_PERIPH_GPIO);
PRCMLoadSet();
while (!PRCMLoadGet());
#endif

/* SPI power */
//ROM_PRCMPeripheralRunEnable(PRCM_PERIPH_SSI0);
ROM_PRCMPeripheralRunEnable(PRCM_PERIPH_SSI1);
PRCMLoadSet();
while (!PRCMLoadGet());


IOCPinTypeGpioOutput(IOID_5);
GPIO_setDio(IOID_5);

IOCPinTypeGpioOutput(IOID_27);
GPIO_setDio(IOID_27);

...

...

}

Anything else to be done? 

Thanks a lot for help.

  • Hi Anil,

    It appears you're doing it correctly - perhaps the pins are being pulled in a way you aren't expecting. DIO5 looks to have a pull-up resistor on it (so I'm very surprised you didn't see anything) but that isn't the case for DIO_27. I'm not sure why you're not seeing anything. Did you also try clearing the IO?

    You could check the within the debugger to make sure the registers are actually being set.

    Regards,
    Rebel
  • Hi Anil pc,

    Do you call IOCPinTypeGpioOutput for your GPIO?