-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added example on using high speed CRC calculation for IAR
- Loading branch information
GiPa
committed
Aug 6, 2013
1 parent
bb38c02
commit 771752f
Showing
24 changed files
with
6,436 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
This example project uses the high speed CRC feature of the RL78. | ||
|
||
It has been tested on the RL78G14 TB (64K device, R5F104LE) | ||
|
||
The project is for IAR Embedded Workbench. | ||
|
||
After the aplication started, LED1 keeps blinking to show the code has been flashed correctly and is working past the CRC calculation stage. | ||
|
||
If the CRC calculation is correct, LED2 gets turned on. | ||
|
||
|
||
The settings for IAR Workbench to calculate the checksum are as follows: CRC16 (0x11021 polynomial), size 2, keep complement 'as is', MSB first, 32-bit checksum unit size, initial value 0x0 | ||
|
||
This is equivalento to the following settings made in the linker script: | ||
|
||
-J2,crc16,L,,CHECKSUM,,0x0=0x0-0xFFFB | ||
|
||
|
||
The checksum is placed in location 0xFFFC-0xFFFD | ||
|
||
-Z(CONST)CHECKSUM=0xFFFC-0xFFFD | ||
|
||
|
||
The high speed CRC sum is computed over flash range 0x0 t0 0xFFFB | ||
|
||
-Hff -h0x0000-0xFFFB | ||
|
||
|
||
|
||
|
||
The project can be flashed via the renesas flash programmer software. | ||
A workspace and project for the renesas flash programmer is placed in the TB_flash folder, to flash the application using the E1 emulator. | ||
|
||
However the E1 emulator cannot be used for debugging within IAR since the rom monitor firmware is included in the last 512/256 bytes of the flash and conflicts with the CRC signature placement in the last 4 bytes of the flash. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<RfpWorkspace> | ||
<ProductVersion>2.01.01.00</ProductVersion> | ||
<FormatVersion>2.0</FormatVersion> | ||
<WindowMode>1</WindowMode> | ||
<ActiveProjectName>TB_flash</ActiveProjectName> | ||
<Name project="TB_flash"> | ||
<RelativePath>TB_flash\TB_flash.rpj</RelativePath> | ||
<ActiveProgramName>E:\git\RL78\G14\crc_calculation\Debug\Exe\crc_calculation.mot</ActiveProgramName> | ||
<ProgramName>E:\git\RL78\G14\crc_calculation\Debug\Exe\crc_calculation.mot</ProgramName> | ||
<UserBoot>0</UserBoot> | ||
</Name> | ||
</RfpWorkspace> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<RfpProject> | ||
<ProductVersion>2.01.01.00</ProductVersion> | ||
<Class Guid="7b634d76-252e-4043-850a-eb471438cc19"> | ||
<Instance Guid="482908f5-78ac-4466-9c14-dad044d95a43"> | ||
<FormatVersion>1.02</FormatVersion> | ||
<TargetDeviceType>132</TargetDeviceType> | ||
<IsE1E20Emulator>True</IsE1E20Emulator> | ||
<ParameterFileName>.\Device\RL78\R5F104LE.pr5</ParameterFileName> | ||
<SelectToolName>E1</SelectToolName> | ||
<DeviceName>R5F104LE</DeviceName> | ||
<DeviceProductName>R5F104LE</DeviceProductName> | ||
<Port>Uart</Port> | ||
<CommunicationSpeed>Speed1000000Bps</CommunicationSpeed> | ||
<SupplyPower_E1>Target</SupplyPower_E1> | ||
<SupplyOscillator>Target</SupplyOscillator> | ||
<OscillatingFrequencyTarget>32.00</OscillatingFrequencyTarget> | ||
<OscillatingFrequencyMini2>Osc4Mhz</OscillatingFrequencyMini2> | ||
<MultiplyRate>1.00</MultiplyRate> | ||
<OperationMode>Chip</OperationMode> | ||
<StartBlock>000</StartBlock> | ||
<EndBlock>063</EndBlock> | ||
<StartBlockDataF>000</StartBlockDataF> | ||
<EndBlockDataF>003</EndBlockDataF> | ||
<UserTargetVoltage /> | ||
<IsCheckingBlank>True</IsCheckingBlank> | ||
<IsVerifying>False</IsVerifying> | ||
<IsSettingSecurityFlags>False</IsSettingSecurityFlags> | ||
<IsVerifyingChecksum>False</IsVerifyingChecksum> | ||
<IsSetOptionByte>False</IsSetOptionByte> | ||
<IsSetSecuritId>False</IsSetSecuritId> | ||
<IsResetPortHiZ>False</IsResetPortHiZ> | ||
<IsTargetResetMessage>False</IsTargetResetMessage> | ||
<IsWideVoltageMode>False</IsWideVoltageMode> | ||
<IsHexCheckRomSize>False</IsHexCheckRomSize> | ||
<IsDisableChipErasing>False</IsDisableChipErasing> | ||
<IsDisableBlockErasing>False</IsDisableBlockErasing> | ||
<IsDisableProgramming>False</IsDisableProgramming> | ||
<IsDisableReading>False</IsDisableReading> | ||
<IsDisableBootBlockClusterReprogramming>False</IsDisableBootBlockClusterReprogramming> | ||
<EndBootBlock>003</EndBootBlock> | ||
<ResetVectorAddress>000000</ResetVectorAddress> | ||
<StartFlashSelfBlock>000</StartFlashSelfBlock> | ||
<EndFlashSelfBlock>063</EndFlashSelfBlock> | ||
<OptionByte0>FFFFFFFF</OptionByte0> | ||
<OptionByte1>FFFFFFFF</OptionByte1> | ||
<OptionByte2>FFFFFFFF</OptionByte2> | ||
<OptionByte3>FFFFFFFF</OptionByte3> | ||
<OptionByte4>FFFFFFFF</OptionByte4> | ||
<OptionByte5>FFFFFFFF</OptionByte5> | ||
<OptionByte6>FFFFFFFF</OptionByte6> | ||
<OptionByte7>FFFFFFFF</OptionByte7> | ||
<OptionByte8>FFFFFFFF</OptionByte8> | ||
<SecurityId>FFFFFFFFFFFFFFFFFFFFFFFF</SecurityId> | ||
<CommandType>Autoprocedure</CommandType> | ||
<HexaFileName>C:\work\projects\applilet_G14\crc_calculation\Debug\Exe\crc_calculation.mot</HexaFileName> | ||
<HexaFileChecksumType>Arithmetic</HexaFileChecksumType> | ||
<HexaFileChecksumAreaType>Hexfile</HexaFileChecksumAreaType> | ||
<HexaFileChecksumAreaStart>00000000</HexaFileChecksumAreaStart> | ||
<HexaFileChecksumAreaEnd>0000FFFD</HexaFileChecksumAreaEnd> | ||
<HexaFileChecksumAreaStartDataF>--------</HexaFileChecksumAreaStartDataF> | ||
<HexaFileChecksumAreaEndDataF>--------</HexaFileChecksumAreaEndDataF> | ||
<UcpSettings>Enabled=FALSE | FilePath= | AllData=TRUE | StartPoint=0 | EndPoint=0 | Overwrite=FALSE</UcpSettings> | ||
</Instance> | ||
</Class> | ||
</RfpProject> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,217 @@ | ||
|
||
///****************************************************************************** | ||
//* DISCLAIMER | ||
//* This software is supplied by Renesas Electronics Corporation and is only | ||
//* intended for use with Renesas products. No other uses are authorized. This | ||
//* software is owned by Renesas Electronics Corporation and is protected under | ||
//* all applicable laws, including copyright laws. | ||
//* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING | ||
//* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT | ||
//* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE | ||
//* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. | ||
//* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS | ||
//* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE | ||
//* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR | ||
//* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE | ||
//* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. | ||
//* Renesas reserves the right, without notice, to make changes to this software | ||
//* and to discontinue the availability of this software. By using this software, | ||
//* you agree to the additional terms and conditions found by accessing the | ||
//* following link: | ||
//* http://www.renesas.com/disclaimer | ||
//* | ||
//* Copyright (C) 2011, 2013 Renesas Electronics Corporation. All rights reserved. | ||
//******************************************************************************/ | ||
|
||
///* | ||
//******************************************************************************* | ||
//* File Name : md_lnkr5f104le.xcl | ||
//* Version : Applilet3 for RL78/G14 V2.00.00.08 [12 Apr 2013] | ||
//* Device(s) : R5F104LE | ||
//* Tool-Chain : IAR Systems iccrl78 | ||
//* Description : This is the IAR link file. | ||
//* Creation Date: 29.07.2013 | ||
//******************************************************************************* | ||
//*/ | ||
//------------------------------------------------------------------------- | ||
// XLINK command file template for RL78 microcontroller R5F104LE. | ||
// | ||
// This file can be used to link object files from the RL78 | ||
// Assembler, ARL78, and the C/C++ compiler ICCRL78. | ||
// | ||
// This file is generated from the device file: | ||
// DR5F104LE.DVF | ||
// Copyright(C) 2011 Renesas | ||
// Format version V3.00, File version V1.20 | ||
//------------------------------------------------------------------------- | ||
|
||
//------------------------------------------------------------------------- | ||
// The following segments are defined in this template link file: | ||
// | ||
// INTVEC -- Interrupt vectors. | ||
// CLTVEC -- Calltable vectors. | ||
// RCODE -- Code used by C/C++ startup and run-time library. | ||
// CODE -- Code used by __near_func, __interrupt and __callt functions. | ||
// XCODE -- Code used by __far_func functions. | ||
// NEAR_CONST_ -- Constants used by __near const. | ||
// FAR_CONST -- Constants used by __far const. | ||
// SADDR_x -- Variables used by __saddr. | ||
// NEAR_x -- Variables used by __near. | ||
// FAR_x -- Variables used by __far. | ||
// NEAR_HEAP -- The heap used by near data model. | ||
// FAR_HEAP -- The heap used by far data model. | ||
// SWITCH -- Switch tables used by near code model. | ||
// FSWITCH -- Switch tables used by far model. | ||
// DIFUNCT -- Dynamic initialization vector used by C++ | ||
// | ||
// Where _x could be one of: | ||
// | ||
// _Z -- Initialized data (initvalue = 0 or without init value). | ||
// _I -- Initialized data (initvalue != 0). | ||
// _ID -- The initial values of _I. | ||
// _N -- Uninitialized data, used by __no_init. | ||
//------------------------------------------------------------------------- | ||
|
||
-D_CRC_TEST_FLASH_END=0xFFFB | ||
//------------------------------------------------------------------------- | ||
// Define CPU | ||
//------------------------------------------------------------------------- | ||
|
||
-cRL78 | ||
|
||
//------------------------------------------------------------------------- | ||
// Size of the stack. | ||
// Remove comment and modify number if used from command line. | ||
//------------------------------------------------------------------------- | ||
|
||
//-D_CSTACK_SIZE=80 | ||
|
||
//------------------------------------------------------------------------- | ||
// Size of the heaps. | ||
// Remove comment and modify number if used from command line. | ||
//------------------------------------------------------------------------- | ||
|
||
//-D_NEAR_HEAP_SIZE=400 | ||
//-D_FAR_HEAP_SIZE=4000 | ||
|
||
//------------------------------------------------------------------------- | ||
// Near constant location. | ||
// 0 -> 0xF0000-0xFFFFF mirrored in rom area 0x00000 - 0x0FFFF | ||
// 1 -> 0xF0000-0xFFFFF mirrored in rom area 0x10000 - 0x1FFFF | ||
// 2 -> Writeable constants | ||
// Remove comments and modify number if used from command line. | ||
//------------------------------------------------------------------------- | ||
|
||
//-D_NEAR_CONST_LOCATION=0 | ||
//-D_NEAR_CONST_LOCATION_START=02000 | ||
//-D_NEAR_CONST_LOCATION_END=0E8FF | ||
|
||
|
||
//------------------------------------------------------------------------- | ||
// Allocate the read only segments that are mapped to ROM. | ||
//------------------------------------------------------------------------- | ||
//------------------------------------------------------------------------- | ||
// Interrupt vector segment. | ||
//------------------------------------------------------------------------- | ||
-Z(CODE)INTVEC=00000-0007F | ||
|
||
//------------------------------------------------------------------------- | ||
// CALLT vector segment. | ||
//------------------------------------------------------------------------- | ||
-Z(CODE)CLTVEC=00080-000BF | ||
|
||
//------------------------------------------------------------------------- | ||
// OPTION BYTES segment. | ||
//------------------------------------------------------------------------- | ||
-Z(CODE)OPTBYTE=000C0-000C3 | ||
|
||
//------------------------------------------------------------------------- | ||
// SECURITY_ID segment. | ||
//------------------------------------------------------------------------- | ||
-Z(CODE)SECUID=000C4-000CD | ||
|
||
//------------------------------------------------------------------------- | ||
// Near constant segments. | ||
//------------------------------------------------------------------------- | ||
--segment_mirror @NEAR_CONST=NEAR_CONST_ID | ||
-Z(CONST)NEAR_CONST_ID=_NEAR_CONST_LOCATION_START-_NEAR_CONST_LOCATION_END | ||
-Z(DATA)NEAR_CONST=(_NEAR_CONST_LOCATION_START+F0000)-(_NEAR_CONST_LOCATION_END+F0000) | ||
|
||
//------------------------------------------------------------------------- | ||
// Startup, Runtime-library, Near, Interrupt | ||
// and CALLT functions code segment and near switch. | ||
//------------------------------------------------------------------------- | ||
// -Z(CODE)RCODE,CODE=000D8-0FDFF | ||
// -Z(CONST)SWITCH=000D8-0FDFF | ||
-Z(CODE)RCODE,CODE=000D8-_CRC_TEST_FLASH_END | ||
-Z(CONST)SWITCH=000D8-_CRC_TEST_FLASH_END | ||
|
||
|
||
|
||
//------------------------------------------------------------------------- | ||
// Near data initializer segments. | ||
//------------------------------------------------------------------------- | ||
// -Z(CONST)NEAR_ID=[000D8-0FDFF]/10000 | ||
// -Z(CONST)SADDR_ID=[000D8-0FDFF]/10000 | ||
// -Z(CONST)DIFUNCT=[000D8-0FDFF]/10000 | ||
-Z(CONST)NEAR_ID=[000D8-_CRC_TEST_FLASH_END]/10000 | ||
-Z(CONST)SADDR_ID=[000D8-_CRC_TEST_FLASH_END]/10000 | ||
-Z(CONST)DIFUNCT=[000D8-_CRC_TEST_FLASH_END]/10000 | ||
|
||
//------------------------------------------------------------------------- | ||
// Allocate the read/write segments that are mapped to RAM. | ||
//------------------------------------------------------------------------- | ||
//------------------------------------------------------------------------- | ||
// EEPROM segment. | ||
// Note: This segment will not be automatically created | ||
// and it will not be initialised by CSTARTUP! | ||
//------------------------------------------------------------------------- | ||
-Z(DATA)EEPROM=F1000-F1FFF | ||
|
||
//------------------------------------------------------------------------- | ||
// Short address data and workseg segments. | ||
//------------------------------------------------------------------------- | ||
-Z(DATA)WRKSEG=FFE20-FFEDF | ||
-Z(DATA)SADDR_I,SADDR_Z,SADDR_N=FFE20-FFEDF | ||
|
||
//------------------------------------------------------------------------- | ||
// Near data segments. | ||
//------------------------------------------------------------------------- | ||
-Z(DATA)NEAR_I,NEAR_Z,NEAR_N=FE900-FFE1F | ||
|
||
//------------------------------------------------------------------------- | ||
// Far data segments. | ||
//------------------------------------------------------------------------- | ||
-Z(DATA)FAR_Z=[FE900-FFE1F]/10000 | ||
|
||
//------------------------------------------------------------------------- | ||
// Heap segments. | ||
//------------------------------------------------------------------------- | ||
-Z(DATA)NEAR_HEAP+_NEAR_HEAP_SIZE=FE900-FFE1F | ||
|
||
|
||
//------------------------------------------------------------------------- | ||
// Stack segment. | ||
//------------------------------------------------------------------------- | ||
-Z(DATA)CSTACK+_CSTACK_SIZE=FE900-FFE1F | ||
|
||
//------------------------------------------------------------------------- | ||
// Select the output file format if used from command line. | ||
// Remove comment to select the file format if used from command line. | ||
//------------------------------------------------------------------------- | ||
//-Fdebug | ||
|
||
|
||
//------------------------------------------------------------------------- | ||
// CRC specific options | ||
//------------------------------------------------------------------------- | ||
-Hff -h0x0000-0xFFFB | ||
|
||
// -Jsize,algo,flag,sym,seg,align,m#val | ||
-J2,crc16,L,,CHECKSUM,,0x0=0x0-0xFFFB | ||
|
||
-Z(CONST)CHECKSUM=0xFFFC-0xFFFD | ||
|
||
//------------------------------------------------------------------------- | ||
// End of File | ||
//------------------------------------------------------------------------- |
Oops, something went wrong.