Jul 31, 2019
08:27 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 31, 2019
08:27 PM
Hi Support team,
On DAP module TSv2.3, CRC-6 algorithm is not correct on section 1.8.3. We cannot get correct CRC value for transmitting packets. The result of function GetCrc cannot pass CRC Check at all.
Does anyone report similar issue?
Thanks!
On DAP module TSv2.3, CRC-6 algorithm is not correct on section 1.8.3. We cannot get correct CRC value for transmitting packets. The result of function GetCrc cannot pass CRC Check at all.
Does anyone report similar issue?
Thanks!
- Tags:
- IFX
4 Replies
Aug 01, 2019
01:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 01, 2019
01:33 AM
Here are the codes from the document:
const unsigned crc6Polynom =0x03; // x**6 + x + 1
unsigned CalcCrc(unsigned crcValue, unsigned thisbit) {
unsigned m = crcValue & crc6Polynom;
while (m > 0) {
thisbit ^= (m & 1);
m >>= 1;
}
return (((thisbit << 6) | crcValue) >> 1);
}
// obtain CRC6 for sending (6 bit)
unsigned GetCrc(unsigned crcValue) {
unsigned crc6 = 0; int i;
for (i = 0; i < 6; i++) {
crcValue = CalcCrc(crcValue, 0);
crc6 |= (crcValue & 0x20) | (crc6 >> 1);
crcValue &= 0x1F; // remove output bit
}
return (crc6);
}
// Calculate CRC6
for (i = 1; i < nDataBits; i++) { // Startbit excluded
thisBit = (unsigned)((telegram >> i) & 0x1);
crcValue = CalcCrc(crcValue, thisBit);
}
/* now send telegram + GetCrc(crcValue) */
// Check CRC6
unsigned crcValue = 0x3f;
int i;
unsigned thisBit;
for(i=1; i thisBit = (unsigned)((telegram>>i)&0x1);
crcValue = CalcCrc(crcValue, thisBit);
}
if(crcValue!=0) { /* put error handler here */ }
This is not the standard CRC6 algorithm. The issue is function GecCrc.
const unsigned crc6Polynom =0x03; // x**6 + x + 1
unsigned CalcCrc(unsigned crcValue, unsigned thisbit) {
unsigned m = crcValue & crc6Polynom;
while (m > 0) {
thisbit ^= (m & 1);
m >>= 1;
}
return (((thisbit << 6) | crcValue) >> 1);
}
// obtain CRC6 for sending (6 bit)
unsigned GetCrc(unsigned crcValue) {
unsigned crc6 = 0; int i;
for (i = 0; i < 6; i++) {
crcValue = CalcCrc(crcValue, 0);
crc6 |= (crcValue & 0x20) | (crc6 >> 1);
crcValue &= 0x1F; // remove output bit
}
return (crc6);
}
// Calculate CRC6
for (i = 1; i < nDataBits; i++) { // Startbit excluded
thisBit = (unsigned)((telegram >> i) & 0x1);
crcValue = CalcCrc(crcValue, thisBit);
}
/* now send telegram + GetCrc(crcValue) */
// Check CRC6
unsigned crcValue = 0x3f;
int i;
unsigned thisBit;
for(i=1; i
crcValue = CalcCrc(crcValue, thisBit);
}
if(crcValue!=0) { /* put error handler here */ }
This is not the standard CRC6 algorithm. The issue is function GecCrc.
Aug 02, 2019
03:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 02, 2019
03:03 AM
Got this issue solved. The CRC algorithm on document is TOTALLY wrong.
Aug 22, 2019
06:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 22, 2019
06:40 AM
Hi Robinliuy,
may I ask you to share how you could solve this problem ?
I'm currently facing same issue. Impossible to pass the CRC6 check. I got the same C-Like code in my reference document.
Thanks in advance.
Best regards.
may I ask you to share how you could solve this problem ?
I'm currently facing same issue. Impossible to pass the CRC6 check. I got the same C-Like code in my reference document.
Thanks in advance.
Best regards.
Oct 29, 2021
12:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 29, 2021
12:01 AM
Dear sir,
i am also intersted in DAP.
could you please tell me where could find DAP module TSv2.3 ?
i could not search it from website.
thank you.
This widget could not be displayed.