-CRc


This option specifies whether to perform the CRC operation.

[Specification format]

-CRc=address=operation-range[/operation-method][(initial-value)][:endian]
    operation-range:= start-end[,start-end]... [V1.01]
                      {start-end|section}[,{start-end|section}]... [V1.02 or later]
    operation-method:= {16-CCITT-MSB-LITTLE-4|16-CCITT-LSB|SENT-MSB} [V1.01]
                       {CCITT|16-CCITT-MSB|16-CCITT-MSB-LITTLE-4|16-CCITT-MSB-
                        LITTLE-2|16-CCITT-LSB|16|SENT-MSB|32-ETHERNET} [V1.02 or later]
    endian:= {BIG|LITTLE}[-size-offset]

 

-

Interpretation when omitted

The CRC operation and outputting the result are not performed.

[Detailed description]

-

CRC (cyclic redundancy check) operation is done for the specified range of load objects in the order from the lower to the higher addresses, and the result is output to the specified output address in the specified endian.

-

Specify the output address for address.
The range that can be specified is 0x0 to 0xFFFFF.

-

Specify the operation range (start address and end address) for start and end.
The range that can be specified is 0x0 to 0xFFFFF.

-

Specify one of the following as the operation method.

Operation Method

Description

CCITT

[V1.02 or later]

The result of CRC-16-CCITT operation is obtained with the MSB first, an initial value of 0xFFFF, and inverse of XOR performed.

The generator polynomial is x16+x12+x5+1.

16-CCITT-MSB

[V1.02 or later]

The result of CRC-16-CCITT operation is obtained with the MSB first.

The generator polynomial is x16+x12+x5+1.

16-CCITT-MSB-LITTLE-4

The input is handled in little endian in 4-byte units and the result of CRC-16-CCITT operation is obtained with the MSB first.

The generator polynomial is x16+x12+x5+1.

16-CCITT-MSB-LITTLE-2

[V1.02 or later]

The input is handled in little endian in 2-byte units and the result of CRC-16-CCITT operation is obtained with the MSB first.

The generator polynomial is x16+x12+x5+1.

16-CCITT-LSB

The result of CRC-16-CCITT operation is obtained with the LSB first.

The generator polynomial is x16+x12+x5+1.

16

[V1.02 or later]

The result of CRC-16 operation is obtained with the LSB first.

The generator polynomial is x16+x15+x2+1.

SENT-MSB

The input is handled in little endian in the lower 4-bit units of one byte and the result of SENT-compliant CRC operation is obtained with the MSB first and an initial value of 0x5.

The generator polynomial is x4+x3+x2+1.

32-ETHERNET

[V1.02 or later]

The result of CRC-32-ETHERNET operation is obtained with an initial value of 0xFFFFFFFF, inverse of XOR performed, and the bits reversed.

The generator polynomial is x32+x26+x23+x22+x16+x12+x11+x10+x8 +x7+x5+x4 +x2 +x+1.

When the specification of the operation method is omitted, it is assumed that 16-CCITT-MSB-LITTLE-4 has been specified.

-

Specify the initial value for the operation for initial-value.
The specifiable value ranges from 0x0 to 0xFFFFFFFF when the operation method is 32-ETHERNET and from 0x0 to 0xFFFF for other cases. When the specification of the initial value is omitted, operation is performed on the assumption that 0x5 has been specified for the operation method of SENT-MSB, 0xFFFF for CCITT, 0xFFFFFFFF for 32-ETHERNET, and 0x0 for other cases.

-

Specify the endian, size, and offset for endian.
The following shows the available combinations.

-

LITTLE

-

LITTLE-2-0

-

LITTLE-4-0

-

BIG

-

BIG-2-0

-

BIG-4-0

-

When the endian specification of big or little is omitted, the endian is the same as that of the input object file.

-

When the operation result is output to the specified output address, data is written in the byte order specified as BIG or LITTLE at the specified offset from the beginning of the area allocated with the specified size. 0 is output from the beginning of the allocated area until immediately before the offset location.

-

When the size and offset are omitted, the size is assumed to be 2 bytes and the offset is assumed to be 0.

-

When the -space option is not specified, the -space=FF option is assumed for CRC operation for the unused areas in the operation range.
Note that 0xFF is only assumed for CRC operation for the unused areas, but the areas are not actually filled with 0xFF.
Operation is done from the lower to the higher addresses of the specified operation range.

[Example of use]

Example 1.

>rlink *.obj -form=stype -start=.SEC1,.SEC2/1000,.SEC3/2000 -crc=2FFE=1000-2FFD -output=out.mot=1000-2FFF

 

 

-crc option: -crc=2FFE=1000-2FFD

CRC operation is done for the area from 0x1000 to 0x2FFD and the result is output to address 0x2FFE.

When the -space option is not specified, the -space=FF option is assumed for CRC operation for the unused areas in the operation range.

 

-output option: -output=out.mot=1000-2FFF

As the -space option is not specified, nothing is output to out.mot for the unused areas.

0xFF is assumed for CRC operation for the unused areas, but the areas are not actually filled with 0xFF.

Caution 1.

The CRC output location cannot be included in the operation range.

Caution 2.

The CRC output location should be included in the output range specified by the -output option.

Example 2.

>rlink *.obj -form=stype -start=.SEC1/1000,.SEC2/1800,.SEC3/2000 -space=7F -crc=2FFE=1000-17FF,2000-27FF -output=out.mot=1000-2FFF

 

 

-crc option: -crc=2FFE=1000-17FD,2000-27FF

CRC operation is done for two areas from 0x1000 to 0x17FD and from 0x2000 to 0x27FF, and the result is output to address 0x2FFE.

Multiple non-contiguous operation ranges can be specified as the target of CRC operation.

 

-space option: -space=7F

For unused areas in the specified operation ranges, the value (0x7F) specified by the -space option is used for CRC operation.

 

-output option: -output=out.mot=1000-2FFF

As the -space option is specified, data for the unused areas is output to out.mot.

The unused areas are filled with 0x7F.

Caution 1.

CRC operation is not done in the order of the operation range specifications. CRC is calculated in the order from the lower to the higher addresses.

Caution 2.

When both the -crc option and the -space option are specified, "random" or a value larger than 2 bytes must not be specified in the -space option. Be sure to specify a 1-byte value.

 

Example 3.

>rlink *.obj -form=stype -start=.SEC1,.SEC2/1000,.SEC3/2000 -crc=1FFE=1000-1FFD,2000-2FFF -output=flmem.mot=1000-1FFF

 

 

-crc option: -crc=1FFE=1000-1FFD,2000-2FFF

CRC operation is done for areas from 0x1000 to 0x1FFD and from 0x2000 to 0x2FFF, and the result is output to address 0x1FFE.

When the -space option is not specified, the -space=FF option is assumed for CRC operation for the unused areas in the operation range.

 

-output option: -output=flmem.mot=1000-1FFF

As the -space option is not specified, nothing is output to flmem.mot for the unused areas.

0xFF is assumed for CRC operation for the unused areas, but the areas are not actually filled with 0xFF.

[Remark]

-

This option does not take effect when multiple load module files are input.

-

[V1.06 or earlier]

This option is valid only when the -form={stype|hexadecimal} option is specified.

[V1.07 or later]

This option will be valid only if the -form={stype | hexadecimal | bin} option is specified.

-

When the -space option is not specified and the operation range includes an empty area that is not output, 0xFF is assumed to be stored in the unused area during CRC operation.

-

An error will occur if the CRC operation range includes an overlaid area.

-

The following is CRC type mapping from OC78K0R (the object converter of the RL78,78K0R C compiler package CA78K0R (sold separately)) to the optimizing linker.

OC78K0R

Optimizing Linker

HIGH

16-CCITT-MSB-LITTLE-4

HIGH(SENT)

SENT-MSB

GENERAL

16-CCITT-LSB