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.
When I used Fee module,I encountered the following problems.
After reading and writing fee data correctly for 512 times, the data read out is always 0.
My program is as follows, and the running cycle is 50ms.
/***********************************************************/
/*****The call period of this function is 50ms*****/
void testFee(void)
{
uint8 feeWriteBuffer[8]= {0};
uint8 feeReadBuffer[8]= {0};
static uint16 looptime=0U;
uint8 i=0U;
looptime++;
for (i = 0; i < 8U; ++i)
{
feeWriteBuffer[i]=(looptime&0xff);
}
printf("\r\nlooptime=%d",looptime);
TI_Fee_WriteSync(0x01U,&feeWriteBuffer[0]);
printLog("\r\nwrite fee:", &feeWriteBuffer[0], 8U);
TI_Fee_ReadSync(0x01U,0,&feeReadBuffer[0],8U);
printLog("\r\nread fee:", &feeReadBuffer[0], 8U);
}
/******************************************************************/
log is as follows.
looptime=510
write fee: fe fe fe fe fe fe fe fe
read fee: fe fe fe fe fe fe fe fe
looptime=511
write fee: ff ff ff ff ff ff ff ff
read fee: 00 00 00 00 00 00 00 00
looptime=512
write fee: 00 00 00 00 00 00 00 00
read fee: 00 00 00 00 00 00 00 00
looptime=513
write fee: 01 01 01 01 01 01 01 01
read fee: 00 00 00 00 00 00 00 00
looptime=514
write fee: 02 02 02 02 02 02 02 02
read fee: 00 00 00 00 00 00 00 00
I need your help,thank you very much.
Hi David,
Thank you for contacting TI for support.
I started working on your issue and i need to debug this issue. I will try to provide my update ASAP.
--
Thanks & Regards,
Jagadish.
Hi David,
Today i got chance to test this issue and you are right i could see the same issue at my end as well.
And i also noticed that this issue is happening after data full(16KB) of one sector and try to move data to the new sector. This issue is happening at this boundary condition.
And i also noticed this issue is not triggering if i use Async read and write functions, issue is happening while we are using sync functions.
void testFee(void) { uint8 feeWriteBuffer[8]= {0}; uint8 feeReadBuffer[8]= {0}; static uint16 looptime=0U; uint8 i=0U; looptime++; for (i = 0; i < 8U; ++i) { feeWriteBuffer[i]=(looptime&0xff); } printf("\r\nlooptime=%d",looptime); TI_Fee_WriteAsync(0x01U,&feeWriteBuffer[0]); do { TI_Fee_MainFunction(); delay(); Status=TI_Fee_GetStatus(0); } while(Status!=IDLE); printf("\r\nwrite fee:"); for (i=0; i<8; i++) { printf ("%x\t", feeWriteBuffer[i]); } TI_Fee_Read(0x01U,0,&feeReadBuffer[0],8U); do { TI_Fee_MainFunction(); delay(); Status=TI_Fee_GetStatus(0); } while(Status!=IDLE); printf("\r\nread fee:"); for (i=0; i<8; i++) { printf ("%x\t", feeReadBuffer[i]); } }
Could you please test with above code and let me know the result and mean while i am doing further analysis of this behavior at my end.
--
Thanks & regards,
Jagadish.
Hi Jagadish,
Thanks for your quick response.I test this method at my end. And I got the result as follows.
write fee: 01 01 01 01 01 01 01 01
read fee: 00 00 00 00 00 02 c6 a0
The reading fee data operation got inexplicable data,that is why I adopt the Synchronous read-write functions.
Happily,I test another way and got right results.
void testFee(void)
{
uint8 feeWriteBuffer[8]= {0};
uint8 feeReadBuffer[8]= {0};
static uint16 looptime=0U;
uint8 i=0U;
uint16 Status = 0;
looptime++;
for (i = 0; i < 8U; ++i)
{
feeWriteBuffer[i]=(looptime&0xff);
}
printf("\r\nlooptime=%d",looptime);
TI_Fee_WriteSync(0x01U,&feeWriteBuffer[0]);
printLog("\r\nwrite fee:", &feeWriteBuffer[0], 8U);
do
{
TI_Fee_MainFunction();
FeeDelay();
Status=TI_Fee_GetStatus(0);
}
while(Status!=IDLE);
TI_Fee_ReadSync(0x01U,0,&feeReadBuffer[0],8U);
printLog("\r\nread fee:", &feeReadBuffer[0], 8U);
}
But I don't know the reason for the difference.
Thanks & regards,
David.
Hi David,
Happily,I test another way and got right results.
So, is your above created code not creating any issues?
Looks like you are calling "TI_Fee_MainFunction" function for "TI_Fee_WriteSync" as well.
And calling "TI_Fee_ReadSync" without "TI_Fee_MainFunction".
--
Thanks & regards,
Jagadish.