AnsweredAssumed Answered

ADI PWR INIT - uart bf70x

Question asked by bretcj7 on Aug 29, 2016
Latest reply on Sep 30, 2016 by Jithul_Janardhanan

I was able to get the char_echo program running on the BF706 even though it says it for the 707.


I have ported this code to a new project but everytime it runs it says the call below failes:


if(adi_pwr_Init(0, CLKIN) != ADI_PWR_SUCCESS)
REPORT_ERROR("Failed to initialize power service \n");

Which calls the adi_pwr_Init from the adi_pwr_v2.c file.


Here is that code and it always returns "ADI_PWR_DEVICE_IN_USE"


ADI_PWR_RESULT adi_pwr_Init(
uint32_t const nDeviceNum,
uint32_t const clkin)
/* Get pointer to the device information */
ADI_PWR_DEVICE *pDevice = &gPWRDevice[nDeviceNum];

#ifdef ADI_DEBUG
/* Check if the given device number is within the range of number
* devices present in the processor

#endif /* ADI_DEBUG */

/* Check if the device instance is in use */
if(pDevice->bInitialized != false)
pDevice->bInitialized = true;

pDevice->pDevData->clkin = clkin;


Is there something I'm missing here?  The documentation is vague so there isn't much to go off of.  Remember i'm running a BF706 with the sample char echo code from the BF707.


One thing to note is that the &gPWRDevice variable always seems to be in scope and is set before this method is called making me think its global and already in memory.  But what is setting the bInitialized to true?