EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

How to match IAR-generated CRC and CRC hardware generated one?

Started by josephleeinus April 8, 2010
For Non-A MSP430F5x device,

In the linker command file
-J2,crc16,,,,,#0xFFFF\00-F7FD
-HFFFF

__checksum is stored in F7FE-F7FF

and the CRC is computed again using the hardware module
{
start address = 0x5C00
end address = 0xF7FD

Loop through the range
retieve data from the address (0ne bytes)
Reverse the bits in the byte
CRCDI = data (1 byte)

return CRCINIRES
}

The CRCs generated by these two approaches are different. The CRCDI_L is not defined for this device. How to configuate these two approach to let them generate the same results?

Thanks

Beginning Microcontrollers with the MSP430

You can either give CRCDI one word at a time, or define CRCDI_L as a byte register.

--- In m..., "josephleeinus" wrote:
>
> For Non-A MSP430F5x device,
>
> In the linker command file
> -J2,crc16,,,,,#0xFFFF\00-F7FD
> -HFFFF
>
> __checksum is stored in F7FE-F7FF
>
> and the CRC is computed again using the hardware module
> {
> start address = 0x5C00
> end address = 0xF7FD
>
> Loop through the range
> retieve data from the address (0ne bytes)
> Reverse the bits in the byte
> CRCDI = data (1 byte)
>
> return CRCINIRES
> }
>
> The CRCs generated by these two approaches are different. The CRCDI_L is not defined for this device. How to configuate these two approach to let them generate the same results?
>
> Thanks
>

Thanks,

CRCDI_L is defined and problem solved.

--- In m..., "old_cow_yellow" wrote:
>
> You can either give CRCDI one word at a time, or define CRCDI_L as a byte register.
>
> --- In m..., "josephleeinus" wrote:
> >
> > For Non-A MSP430F5x device,
> >
> > In the linker command file
> > -J2,crc16,,,,,#0xFFFF\00-F7FD
> > -HFFFF
> >
> > __checksum is stored in F7FE-F7FF
> >
> > and the CRC is computed again using the hardware module
> > {
> > start address = 0x5C00
> > end address = 0xF7FD
> >
> > Loop through the range
> > retieve data from the address (0ne bytes)
> > Reverse the bits in the byte
> > CRCDI = data (1 byte)
> >
> > return CRCINIRES
> > }
> >
> > The CRCs generated by these two approaches are different. The CRCDI_L is not defined for this device. How to configuate these two approach to let them generate the same results?
> >
> > Thanks
>


The 2024 Embedded Online Conference