Other Parts Discussed in Thread: MSP430F249
Hello,
I am porting driver cc3000 Ti module to msp430f249 using cc3000 patch programmer 1.11.1, when it got on LINE1 hang on at LINE2. i don't know why it hang on. this is lastest version.
Thanks
///
unsigned char nvmem_get_mac_address(unsigned char *mac)
{
return nvmem_read(NVMEM_MAC_FILEID, MAC_ADDR_LEN, 0, mac);
}
void main(void)
{
WDTCTL = WDTPW + WDTHOLD;
unsigned short index;
unsigned char *pRMParams;
// init board and request to load with no patches.
// this is in order to overwrite restrictions to write to specific places in EEPROM
initClk();
initLEDs();
initUart();
initDriver(2);
// read MAC address
mac_status = nvmem_get_mac_address(cMacFromEeprom); // LINE1
turnLedOn(LED3);
return_status = 1;
while ((return_status) && (counter < 3))
{
// read RM parameters
// read in 16 parts to work with tiny driver
return_status = 0;
pRMParams = cRMParamsFromEeprom;
for (index = 0; index < 16; index++)
{
return_status |= nvmem_read(NVMEM_RM_FILEID, 8, 8*index, pRMParams);
pRMParams += 8;
}
counter++;
------------------------
------
////
signed long
nvmem_read(unsigned long ulFileId, unsigned long ulLength, unsigned long ulOffset, unsigned char *buff)
{
unsigned char ucStatus = 0xFF;
unsigned char *ptr;
unsigned char *args;
ptr = tSLInformation.pucTxCommandBuffer;
args = (ptr + HEADERS_SIZE_CMD);
// Fill in HCI packet structure
args = UINT32_TO_STREAM(args, ulFileId);
args = UINT32_TO_STREAM(args, ulLength);
args = UINT32_TO_STREAM(args, ulOffset);
// Initiate a HCI command
hci_command_send(HCI_CMND_NVMEM_READ, ptr, NVMEM_READ_PARAMS_LEN);
SimpleLinkWaitEvent(HCI_CMND_NVMEM_READ, &ucStatus);
// In case there is data - read it - even if an error code is returned
// Note: It is the user responsibility to ignore the data in case of an error code
// Wait for the data in a synchronous way. Here we assume that the buffer is
// big enough to store also parameters of nvmem
SimpleLinkWaitData(buff, 0, 0); // LINE2
return(ucStatus);
}
///