Home
TriCore AUDO-F Flash Using Bootstrap Loader
Contents
1. address 0xD4000000 Once Loader 2 received the BootROM jumps to the start address of the secondary loader Loader 2 is executed In this application note Loader 2 is stored in the file loader2 hex Its functionality is to receive further bytes from the PC and store them in SPRAM following its own code section at address 0xD4000080 The file loader3 hex contains this further received code Loader 3 After Loader 3 is downloaded to SPRAM and executed it will first establish the communication between PC and the target device and then carry out flash operations Application Note 5 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader ASC Bootstrap Loading 2 1 Loader 2 Before the Loader 2 can receive further bytes from the PC a basic device initialization needs to be done Due to the size constraint of 128 bytes this startup code must be as small as possible Once the device jumps to address 0xD4000000 its configuration status is as follows e The ENDINIT bit is cleared System control registers that are protected by the ENDINIT feature can be modified e The watchdog timer is enabled which means that the device will be reset if the watchdog timer is not disabled within a certain period of time e The serial interface ASCO is configured The baud rate is the same as calculated by the BootROM code e The clock system has been reset from Precaler Mode to PLL Freerunning Mode Thus the de
2. already erased yes ee End of file mode 4 bl_send_header mark sector as erased Figure 6 1 Flash erasing procedure implemented in bl_erase_flash Application Note 31 V 1 1 2008 11 oe AP32132 Cinfineon TriCore AUDO F Flash Download via Bootstrap Loader TriLoad HOST Program Example y bl_erase_flash Read HEX line Address continuous yes End of file no _ size of write buffer gt 0 yes bl_send_data send remaining bytes bl_send_data send remaining bytes bl_send_EOT v nd bl_send_EOT f mode 0 bl_send_header v Store bytes from HEX file in write buffer size of write buffer gt 256 no t yes bl_send_data Delete the first 256 bytes in write buffer Figure 6 2 Programming procedure implemented in bl_download_pflash Application Note 32 V 1 1 2008 11 oe AP32132 Cinfineon TriCore AUDO F Flash Download via Bootstrap Loader List of Provided Files 7 List of Provided Files The following project files are provided in this application note 7 1 Tasking VX toolset for Tricore v3 0r1 Loader 2 Tasking Loader2 e Loader2 c e Loader2 Isl e tc1767 Isl Debug Loader2 hex e additional files automatically generated by Tasking Loader 3 Tasking Loader3 e cstart c e cstart h e main c e Loader3 Isl e tc1767 Isl e Debug Loader3 hex
3. e C C Build gt Settings gt e C C Compiler gt Allocation gt Threshold for putting data in __near 0 e C C Compiler gt Optimization gt Optimization level 2 Optimize more e C C Compiler gt Optimization gt Trade off between speed and size Level4 Size e Linker gt Output Format Check Generate Intel Hex format file Size of addresses 4 Linker gt Libraries Uncheck Link default libraries e Linker gt Miscellaneous Uncheck Include debugger synchronization utility The Linker Script Language file CANLoader I sI defines 5120 0x1400 bytes in SPRAM memory of type rom starting from address 0xD4000000 and 68 Kbytes in LDRAM of type ram starting from address 0xD0000000 CSA stack heap and global variables are located in LDRAM The reset start address is set to 0xD4000000 Note The actual code size of CANLoader is less than the assumed 0x1400 bytes which permits changes of the code If a changed CANLoader exceeds the size of 0x1400 bytes a new starting address for SPRAM user code see Chapter 5 4 must be taken care of 1 In the case that another AUDO F device is used the same setting applies Application Note 18 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader CAN Bootstrap Loading 3 1 2 GNU Project Settings The HighTec GNU settings for CANLoader project define one build target RAM The output file CANLoader elf is created in the subdirec
4. example flash program the project LED_Blinking which toggles some LEDs controlled by Port 5 is provided for both toolchains as well The file LED_Blinking hex can be downloaded to flash memory Note Depending on the application toggling Port 5 of the target device might not always be suitable The TriLoad HOST program is developed in Microsoft Visual C 6 0 TriLoad supports both the ASC and CAN interface TriLoad also supports flash programming for TriCore devices other than the AUDO F family Upon program start the user must specify which device shall be programmed Application Note 1 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader Introduction In general this example includes the following source code which will be introduced in detail in later sections In the folder Tasking Loader2 ASC BSL Loader 2 both the source files and the HEX file developed using TASKING VX TriCore Toolset is provided In the folder GNU Loader2 ASC BSL Loader 2 both the source files and the HEX file developed using the HighTec GNU TriCore Compiler is provided In the folder Tasking Loader3 ASC BSL Loader 3 both the source files and the HEX file developed using TASKING VX TriCore Toolset is provided In the folder GNU Loader3 ASC BSL Loader 3 both the source files and the HEX file developed using the HighTec GNU TriCore Compiler is provided In the folder Tasking CANLoader CAN BSL Lo
5. gt Pre post build steps gt Post build steps tricore objcopy O ihex RAM Loader2 elf RAM Loader2 hex e RAM gt Pre post build steps gt Post build steps tricore objdump_ t RAM Loader2 elf The final output file Loader2 hex is created in the subdirectory RAM The linker description file Loader2 Id in the project s root directory defines the entire available memory of the TC1767 device The only memory used is the SPRAM code memory 0xD4000000 0xD4000080 The startup section is located at address 0xD4000000 1 In the case that another AUDO F device is used the same setting applies Application Note 8 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader ASC Bootstrap Loading 2 2 Loader 3 Loader 3 implements the flash routines and establishes the communication between PC and the target device Since Loader 2 provides only a simple initialization of the device the following further initialization steps are done at startup of Loader 3 e Set the stack pointers for user and interrupt stack e initialize the call depth counter e initialize the CSA list These steps permit the usage of regular function calls It is implemented in the file ctr0 s which is a modified version of the default HighTec startup code For the Tasking variant of Loader 3 the startup code is contained in the file cstart c The main part of Loader 3 main c implements flash routines providing the follo
6. meets the size constraint of 128 bytes required by the target device and the user will be informed of an exceedance already during compilation The reset start address is set to 0xD4000000 1 In the case that another AUDO F device is used the same setting TC1767 applies Application Note 7 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader ASC Bootstrap Loading 2 1 2 GNU Project Settings The HighTec GNU settings for the Loader 2 project define one build target RAM The output file Loader2 elf is created in the subdirectory RAM If build target RAM does not exist the user must create it to comply with the following project settings Beside the default configuration the build options for this build target must be configured as follows e RAM gt Compiler settings Check Do not link against the default crt0 s e RAM gt Compiler settings Check Do not link against standard system startup files e RAM gt Compiler settings gt Check Optimize generated code for size e RAM gt Compiler settings gt Check Tricore 1767 e RAM gt Linker settings gt Other linker options add line WI Loader2 Id nocrt0 nostartfiles RAM gt Linker settings gt Other linker options add line mepu te1767 e RAM gt gt Linker settings gt Other linker options add line T Loader2 Id e RAM gt Linker settings gt Other linker options add line WI Map mapfile Ist e RAM
7. of Infineon Technologies Life support devices or systems are intended to be implanted in the human body or to support and or maintain and sustain and or protect human life If they fail it is reasonable to assume that the health of the user or other persons may be endangered TC1767 TC1797 TC1736 Revision History V 1 1 2008 11 Previous Version s none Version Subjects major changes since last revision V1 0 Initial release for TC 1767 TC1797 and TC1736 V1 1 Additional support for flash programming via CAN interface We Listen to Your Comments Any information within this document that you feel is wrong unclear or missing at all Your feedback will help us to continuously improve the quality of this document Please send your proposal including a reference to this document to mcdocu comments infineon com pza infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader Introduction 1 Introduction The TriCore microcontrollers of the AUDO Future AUDO F family TC1767 TC1797 and TC1736 have a built in Bootstrap Loading BSL mechanism that can be used for flash programming readers can refer to the BootROM chapter of the User s Manual However the TriCore family does not provide any hard coded Bootstrap Loader routines for flash programming small programs embedded in the BootROM to carry out flash functions e g writing reading erasing verification e
8. the target device Data Block Byte 0 Byte 1 Bytes 2 257 Bytes 258 262 Byte 263 Block 0x00 256 code byt Not Check e x code es ecksum 0201 y Used Code bytes Data content The data content of SPRAM is not verified After each received data block the device sends 0x55 to the PC as acknowledgement or the according error code Application Note 26 V 1 1 2008 11 o AP32132 Cinfineon TriCore AUDO F Flash Download via Bootstrap Loader Communication Protocol EOT Block Byte 0 Bytes 1 14 Byte 15 Block Not Type Checksum oxb2 weed After each received EOT block the device sends either 0x55 to the PC as acknowledgement or the according error code 5 4 Mode 3 Execute User Program in SPRAM Header Block ByteO Byte1 Byte 2 14 Byte 15 Block Mode Not Check 0x06 0x03 Used sum The command causes a jump to the SPRAM user code base address 0xD4001400 The device will exit BSL mode after sending 0x55 as acknowledgement 5 5 Mode 4 Erase Flash Sector Header Block ByteO Byte1 Bytes 2 5 Bytes 6 9 Bytes 10 14 Byte 15 Bock Mode Sector Sector Not Check 0200 0x04 Address Size Used sum SectorAddress 32bit Address of the flash sector to be erased The address must be a valid sector address see Chapter 4 an address error will occur otherwise Byte 2 indicates the highest address byte while Byte 5 indicates th
9. used in case of DFlash programming After each received data block the device sends either 0x55 to the PC as acknowledgement or an error code EOT Block Byte 0 Bytes 1 14 Byte 15 Block Not Type Checksum 0202 Used After each received EOT block the device sends either 0x55 to the PC as acknowledgement or an error code Application Note 25 V 1 1 2008 11 oe AP32132 Cinfineon TriCore AUDO F Flash Download via Bootstrap Loader Communication Protocol 5 2 Mode 1 Execute User Program in PFlash Header Block ByteO Byte 1 Byte 2 14 Byte 15 Block Mode Not Check 0x06 0x01 Used sum The command causes a jump to the flash base address 0xA0000000 The device will exit BSL mode after sending 0x55 as acknowledgement 5 3 Mode 2 Program SPRAM Header Block ByteO Byte 1 Bytes 2 5 Byte 6 14 Byte 15 Block Mode Address een Checksum Address 32bit Starting address of the SPRAM section to be programmed The address must be 4 byte aligned and in a valid range see Chapter 4 Otherwise an address error will occur Byte 2 indicates the highest byte while Byte 5 indicates the lowest byte After reception of the header block the device sends 0x55 as acknowledgement or an error code in case of an invalid block The loader enters a loop waiting to receive the subsequent data blocks in the following format The loop is terminated by sending an EOT block to
10. 000 OxA0003FFF 0x4000 1 0xA0004000 OxAO0007FFF 0x4000 2 0xA0008000 OxAOOODFFF 0x4000 3 0xA000C000 OxAOOOFFFF 0x4000 4 0xA0010000 OxA0013FFF 0x4000 5 0xA0014000 0xA0017FFF 0x4000 6 0xA0018000 OxA001DFFF 0x4000 7 0xA001C000 OxA001FFFF 0x4000 8 0xA0020000 OxAO03FFFF 0x20000 9 0xA0040000 OxAOO7FFFF 0x40000 10 0xA0080000 OxAOODFFFF 0x40000 11 0xA00CO0000 OxAOOFFFFF 0x40000 12 0xA0100000 0OxA013FFFF 0x40000 13 0xA0140000 OxA017FFFF 0x40000 14 0xA0180000 0xA01DFFFF 0x40000 15 0xA01C0000 OxAO1FFFFF 0x40000 Application Note 20 V 1 1 2008 11 Cinfineon yicore AP32132 AUDO F Flash Download via Bootstrap Loader Flash Memory Organization DFlash includes 64 Kbyte of additional data flash memory DFlash sector Address range Size in bytes 0 OxAFE00000 OxAFEO7FFF 0x8000 1 OxAFE10000 OxAFE17FFF 0x8000 The SPRAM memory is not subdivided into sectors or pages and can be programmed byte by byte TC1767 includes 24 Kbytes of SPRAM in an address range of OxD4000000 OxD4005F FF 4 2 TC1797 In TC1797 the flash module PFlashO includes 2 MB of PFlash memory PFlashO sector Address range Size in bytes 0 0xA0000000 OxA0003FFF 0x4000 1 0xA0004000 OxAO0007FFF 0x4000 2 0xA0008000 OxAOOODFFF 0x4000 3 0xA000C000 OxAOOOFFFF 0x4000 4 0xA0010000 OxA0013FFF 0x4000 5 0xA0014000 0xA0017FFF 0x4000 6 0xA0018000 OxA001D
11. Application Note V 1 1 November 2008 AP32132 TriCore AUDO F Flash Download Using Bootstrap Loader Microcontrollers Never stop thinking Edition 2008 11 Published by Infineon Technologies AG St Martin Strasse 53 81669 M nchen Germany Infineon Technologies AG 2008 All Rights Reserved LEGAL DISCLAIMER THE INFORMATION GIVEN IN THIS APPLICATION NOTE IS GIVEN AS A HINT FOR THE IMPLEMENTATION OF THE INFINEON TECHNOLOGIES COMPONENT ONLY AND SHALL NOT BE REGARDED AS ANY DESCRIPTION OR WARRANTY OF A CERTAIN FUNCTIONALITY CONDITION OR QUALITY OF THE INFINEON TECHNOLOGIES COMPONENT THE RECIPIENT OF THIS APPLICATION NOTE MUST VERIFY ANY FUNCTION DESCRIBED HEREIN IN THE REAL APPLICATION INFINEON TECHNOLOGIES HEREBY DISCLAIMS ANY AND ALL WARRANTIES AND LIABILITIES OF ANY KIND INCLUDING WITHOUT LIMITATION WARRANTIES OF NON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OF ANY THIRD PARTY WITH RESPECT TO ANY AND ALL INFORMATION GIVEN IN THIS APPLICATION NOTE Information For further information on technology delivery terms and conditions and prices please contact your nearest Infineon Technologies Office www infineon com Warnings Due to technical requirements components may contain dangerous substances For information on the types in question please contact your nearest Infineon Technologies Office Infineon Technologies Components may only be used in life support devices or systems with the express written approval
12. FFF 0x4000 7 0xA001C000 OxA001FFFF 0x4000 8 0xA0020000 OxAOO03FFFF 0x20000 9 0xA0040000 OxAOO7FFFF 0x40000 10 0xA0080000 OxAOODFFFF 0x40000 11 0xA00CO0000 OxAOOFFFFF 0x40000 12 0xA0100000 0OxA013FFFF 0x40000 13 0xA0140000 OxA017FFFF 0x40000 14 0xA0180000 0xA01DFFFF 0x40000 15 0xA01C0000 OxAO1FFFFF 0x40000 Application Note 21 V 1 1 2008 11 Cinfineon yicore AP32132 AUDO F Flash Download via Bootstrap Loader Flash Memory Organization DFlash includes 64 Kbyte of additional data flash memory DFlash sector Address range Size in bytes 0 OxAFE00000 OxAFEO7FFF 0x8000 1 OxAFE10000 OxAFE17FFF 0x8000 In addition to flash module PFlashO TC1797 includes a second flash module PFlash1 which belongs to Program Memory Unit PMU1 PFlash1 sector Address range Size in bytes 0 0xA0200000 OxA0203FFF 0x4000 1 0xA0204000 OxA0207FFF 0x4000 2 0xA0208000 OxAO20DFFF 0x4000 3 0xA020C000 OxAO20FFFF 0x4000 4 0xA0210000 0OxA0213FFF 0x4000 5 0xA0214000 OxA0217FFF 0x4000 6 0xA0218000 0xA021DFFF 0x4000 7 0xA021C000 OxA021FFFF 0x4000 8 0xA0220000 OxA023FFFF 0x20000 9 0xA0240000 0xA027FFFF 0x40000 10 0xA0280000 OxAO2DFFFF 0x40000 11 OxA02C0000 OxAO2FFFFF 0x40000 12 0xA0300000 OxA033FFFF 0x40000 13 0xA0340000 OxA037FFFF 0x40000 14 0xA0380000 OxAO3DFFFF 0x40000 15 0xA03C0000 OxAO3FFFFF 0x40000 The SPRAM mem
13. Loader 3 or CANLoader establish a communication structure to receive commands from the PC HOST The HOST sends commands via transfer blocks Three types of blocks are defined 1 Header Block Byte 0 Byte 1 Bytes 2 14 Byte 15 Block type Mode Mode specific content Checksum 0x00 The header block has a length of 16 bytes 2 Data Block Byte 0 Byte 1 Bytes 2 257 Bytes 258 262 Byte 263 Block Verifi Not type cation 256 data bytes Used Checksum 0x01 option The data block has a length of 264 bytes 3 EOT Block Byte 0 Bytes 1 14 Byte 15 Block aes Not Used Checksum 0x02 The EOT block has a length of 16 bytes The action required by the HOST is indicated in the Mode byte of the header block The flash loader program waits to receive a valid header block and performs the corresponding action The correct reception of a block is judged by its checksum which is calculated as follows The XOR sum of all block bytes excluding block type byte and checksum byte itself The different modes specify the flash routines that will be executed by the loader The modes and their corresponding communication protocol are described as follows In ASC BSL mode all block bytes are sent at once via the UART interface In CAN BSL mode each block to be sent must be split into 8 byte parts and sent in a sequence of CAN Data Frames This yields 2 CAN frames for Header and EOT b
14. ROM LED_Blinking hex e additional files automatically generated by HighTec LED_Blinking_SPRAM GNU LED_Blinking_SPRAM src crt0 s src main c e src reg176x h LED_Blinking SPRAM Id e RAM LED_ Blinking SPRAM hex e additional files automatically generated by HighTec Application Note 34 V 1 1 2008 11 oe AP32132 Cinfineon TriCore AUDO F Flash Download via Bootstrap Loader List of Provided Files 7 3 Microsoft Visual C 6 0 TriLoad v1 2 Example HOST program TriLoad The source files are included in a Microsoft Visual C 6 0 project e TriLoad cpp e TriLoad_API cpp e TriLoad_API h e Device_Memory h AUDO F Loader2 hex needs to be in the C project folder AUDO F Loader3 hex needs to be in the C project folder AUDO F CANLoader hex needs to be in the C project folder AUDO F LED _Blinking hex needs to be in the C project folder AUDO F LED_Blinking SPRAM hex needs to be in the C project folder AUDO F DFlash_data hex needs to be in the C project folder e FTCJTAG ib e FTCJTAG dIl e FTCJTAG h e FTD2XX dll e additional files automatically generated by Microsoft Visual C Application Note 35 V 1 1 2008 11 oe AP32132 Cinfineon TriCore AUDO F Flash Download via Bootstrap Loader Reference Documents 8 Reference Documents Document Description Location TC1767 User s Manual User s Manual for th
15. SER LED red Figure 3 1 Infineon XC164CM UCAN start kit used as USB to CAN bridge The target device is connected to the start kit via the Target CAN Connector 1 5V 6 GND 2 DIO3 7 CAN1H 3 CAN2L 8 CAN1L 4 CAN2H 9 DIO2 5 AIN1 10 DIO1 Figure 3 2 Target CAN Connector of the XC164CM UCAN start kit The following pins must be connected e CAN1 L of the start kit to the CANOL pin of the target device board e CAN1H of the start kit to the CANOH pin of the target device board Figure 3 3 shows a hardware setup for this application PC XC164CM CAN BUS Target UCAN start kit CANIL CANOL USB Port q gt TriCore CAN1H CANOH CAN Transceiver Figure 3 3 Hardware setup for flash programming using TriLoad Application Note 12 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader CAN Bootstrap Loading The USB to CAN transceiver in the XC164CM UCAN start kit is automatically started by TriLoad The blinking red LED indicates the running application The start kit should be the only USB device connected to the PC Note The TriLoad example code is developed for the XC164CM UCAN start kit only If another USB to CAN bridge is used the TriLoad routines to send and receive CAN messages must be adapted The flash loader program CANLoader is independent from the USB to CAN bridge The bootloader procedure is shown in Figure 3 4 PC Bootstrap HOST Loader Setup CAN Interfa
16. ader both the source files and the HEX file developed using TASKING VX TriCore Toolset is provided In the folder GNU CANLoader CAN BSL Loader both the source files and the HEX file developed using the HighTec GNU TriCore Compiler is provided In the folder Tasking LED_Blinking the flash example program both the source files and the HEX file developed using the TASKING VX TriCore Toolset is provided In the folder GNU LED_Blinking the flash example program both the source files and the HEX file developed using the HighTec GNU TriCore Compiler is provided In the folder Tasking LED_Blinking_SPRAM the SPRAM example code both the source files and the HEX file developed using the TASKING VX TriCore Toolset is provided In the folder GNU LED_Blinking SPRAM the SPRAM example code both the source files and the HEX file developed using the HighTec GNU TriCore Compiler is provided In the folder TriLoad an example HOST program that demonstrates the whole process of flash programming The project files can be compiled with Microsoft Visual C 6 0 Application Note 2 V 1 1 2008 11 infin n AP32132 eo TriCore AUDO F Flash Download via Bootstrap Loader ASC Bootstrap Loading 2 ASC Bootstrap Loading The communication between PC and the target device is established via the ASC interface Figure 2 1 shows a hardware setup for this application in which the following two pins are used as RxD and TxD respectively e receive pi
17. ce lt lt Send CAN Initialization Frame Send CAN Acknowledge Frame q Send CANLoader 5120 bytes in 640 Data Frames p Call CANLoader CANLoader Routines Send Command refer to Chapter 5 Call Flash mee H Routine p Response Code refer to Chapter 5 tV K OO HHH C Figure 3 4 The bootloader procedure for flash programming CAN Bootstrap Loader mode is entered upon a device reset if the following values are applied at the configuration pins PO 7 0 of Port 0 PO 7 0 010xxxx0 Application Note 13 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader CAN Bootstrap Loading The configuration pins are usually connected to a DIP switch on the TriCore board Assuming that P0 0 is connected to switch pin 1 and the remaining pins accordingly as for TriBoard EasyKit and EBeam board the DIP switch configuration looks as follows 1234567 8 sHHEDE E Figure 3 5 DIP switch configuration on the TriCore board for CAN BSL On means high level signal at the pin After entering Bootstrap Loader mode the device switches the clock system from initial PLL Freerunning Mode VCO base frequency to Prescaler Mode with a frequency divider of 1 Hence the system frequency becomes equal to the frequency of an external crystal which must be obligatorily connected between XTAL1 XTAL2 pins if a Bootstrap Load
18. d on the clock frequency in Prescaler Mode The frequency divider that decreases the system frequency is disabled by setting it to 0 e The watchdog timer is disabled e The ENDINIT bit is set e Stack pointers for user and interrupt stack are set e The call depth counter is initialized e The CSA list is initialized These steps are implemented in the file ctr0 s which is a modified version of the default HighTec startup code For the Tasking variant of CANLoader the startup code is basically contained in the file cstart c The main part of CANLoader main c implements flash routines providing the following features e Erase flash sectors e program flash pages e verify a programmed flash page e protect PFlash 1 Some system control registers are protected by the ENDINIT feature These registers can only be modified if the ENDINIT bit is cleared Please refer to the ENDINIT function description in the User s Manual Please refer to Chapter 4 Flash Memory Organization ed Application Note 16 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader CAN Bootstrap Loading e program SPRAM memory e execute flash user code starting from address 0xA0000000 e execute SPRAM user code starting from address 0xD4001400 The flash protection enables a write protection of PFlash Erase or program attempts result in a protection error if flash is protected Upon receiving the pr
19. ding flash routine is executed The communication structure is described in Chapter 5 1 Please refer to Chapter 4 Flash Memory Organization Application Note 9 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader ASC Bootstrap Loading 2 2 1 Tasking Project Settings Beside the default configuration the Tasking project settings for Loader 3 need to be configured as follows e C C Build gt Processor gt AUDO Future Family gt Check TC1767 e C C Build gt Settings gt e C C Compiler gt Allocation gt Threshold for putting data in __near 0 e C C Compiler gt Optimization gt Optimization level 1 Optimize C C Compiler gt Optimization gt Trade off between speed and size Level4 Size e Linker gt Output Format Check Generate Intel Hex format file Size of addresses 4 e Linker gt Libraries Uncheck Link default libraries Linker gt Miscellaneous Uncheck Include debugger synchronization utility The Linker Script Language file Loader3 IsI defines 4896 0x1320 bytes in SPRAM memory of type rom starting from address 0xD4000080 and 68 Kbytes in LDRAM of type ram starting from address 0xD0000000 CSA stack heap and global variables are located in LDRAM The reset start address is set to 0xD4000080 Note The actual code size of Loader 3 is less than the assumed 0x1320 bytes which permits changes of the code If a changed Loader 3 e
20. e The main program TriLoad cpp initializes ASC or CAN BSL and sends Loader 2 and Loader 3 or CANLoader respectively to the target device The user must specify the HEX file to be downloaded and the target memory for programming Application Note 30 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader TriLoad HOST Program Example An example HEX file is provided for each memory type e PFlash led_blinking hex e DFlash DFlash_data hex e SPRAM led_blinking SPRAM hex If PFlash is protected the user needs to enter two correct passwords to unprotect the flash Then the user code is downloaded to PFlash and the flash is protected if desired Finally the user can execute the downloaded code from either PFlash or SPRAM The flash erasing procedure is shown in Figure 6 1 The procedure is implemented in the function bl_erase_flash The PFlash programming procedure is shown in Figure 6 2 The procedure is implemented in the function bl_download_pflash The procedures for DFlash and SPRAM programming are implemented accordingly Note TriLoad also supports programming of TriCore devices other than the AUDO F family Upon program start the user must specify which device shall be programmed The HEX files according to supported TriCore families are included in subfolders e g AUDO F AUDO NG in the project folder Read HEX line Determine flash sector according to address Sector
21. e http Awww infineon com TC1767 device TC1797 User s Manual User s Manual for the http Awww infineon com TC1797 device TC1736 User s Manual User s Manual for the http www infineon com TC1736 device ap3208231_tc176x_examples colle Collection of software http www infineon com ction pdf examples for TC176x devices tc_v131_instructionset_v__138 pdf Instruction set for http www infineon com TriCore V1 3 and V1 3 1 architecture Infineon FLASH Samples pdf Reference samples http www infineon com for programming Infineon on chip flash memory devices U CAN XC164CM System description of http Awww infineon com SystemDescription pdf the UCAN XC164CM start kit USB to CAN bridge Application Note 36 V 1 1 2008 11
22. e additional files automatically generated by Tasking CANLoader Tasking CANLoader e cstart c e cstart h e main c e CANLoader lsl e tc1767 Isl e Debug CANLoader hex e additional files automatically generated by Tasking LED Blinking Tasking LED_Blinking e cstart c e cstart h e main c e LED_Blinking lsl e tc1767 Isl e Debug LED_Blinking hex e additional files automatically generated by Tasking LED_Blinking SPRAM Tasking LED_Blinking_SPRAM e cstart c e cstart h e main c e LED_ Blinking SPRAM IsI Application Note 33 V 1 1 2008 11 oe AP32132 Cinfineon TriCore AUDO F Flash Download via Bootstrap Loader List of Provided Files e tc1767 Isl Debug LED_Blinking_SPRAM hex e additional files automatically generated by Tasking 7 2 HighTec GNU Toolchain for Tricore v3 4 5 1 Loader 2 GNU Loader2 src Loader2 s src reg176x h e Loader2 Id RAM Loader2 hex e additional files automatically generated by HighTec Loader 3 GNU Loader3 src crt0 s src main c e src reg176x h e Loader3 ld RAM Loader3 hex e additional files automatically generated by HighTec CANLoader GNU CANLoader src crt0 s src main c e src reg176x h e CANLoader lId e ARAM CANLoader hex e additional files automatically generated by HighTec LED_Blinking GNU LED_Blinking e src main c e src reg176x h LED_Blinking ld
23. e lowest byte SectorSize 32bit Size of the flash sector to be erased The size must be a valid sector size see Chapter 4 Byte 6 indicates the highest address byte while Byte 9 indicates the lowest byte The device sends either 0x55 to the PC as acknowledgement or an error code Application Note 27 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader Communication Protocol 5 6 Mode 6 Protect Unprotect PFlash Header Block Byte 0 Byte1 Bytes 2 5 Byte6 9 Byte 10 Byte 11 12 Byte 13 14 Byte 15 pike Mode User User Flash Protection Not Check 0200 0x06 Password1 Password2 Module Config Used sum UserPassword1 32bit First user password Byte 2 indicates the highest byte while Byte 5 indicates the lowest byte UserPassword2 32bit Second user password Byte 6 indicates the highest byte while Byte 9 indicates the lowest byte FlashModule PFlash module to be protected 0 PFlashO 1 PFlash1 X PFlashX ProtectionConfig 16bit Selection of the flash sectors to be protected The protection configuration word has the following structure ProtectionConfig bit scheme 15 14 13 12 11 9 8 7 6 5 4 3 2 1 4 0 S15 S13 S11 0 0 0 S14 S12 S10 S9 S8 S7 S6 S5 S4 S3 S2 S1 SO Sn 0 Sector n will not be protected Sn 1 Sector n will be protected Sector 10 15 can only be protected in pair
24. er mode is selected upon power on The crystal frequency must be at least 10 MHz Further on the HOST sends the Initialization CAN Frame to the device The CAN Bus baud rate used by the HOST is automatically detected based on this frame Initialization Frame Parameter Description Identifier 11 bit don t care DLC 8 Data Length Code 8 bytes within this CAN frame Data Byte 0 0x55 Data Byte 1 0x55 Data Byte 2 Acknowledge Message Identifier ACKID low byte Data Byte 3 Acknowledge Message Identifier ACKID high byte Data Byte 4 Data Message Count DMSGC low byte Data Byte 5 Data Message Count DMSGC high byte Data Byte 6 Data Message Identifier DMSGID low byte Data Byte 7 Data Message Identifier DMSGID high byte Data Message Count DMSGC specifies the number of CAN Data Frames sent subsequently to the device Data Message Identifier DMSGID specifies the identifier that all subsequent CAN Data Frames must carry The identifier will be internally stored in the device and every Application Note 14 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader CAN Bootstrap Loading incoming CAN Data Frame will be checked for the same identifier Only 11 bit out of the 16 bit are stored internally as identifier The upper 3 bits of the 16 bit word will be disregarded and the remaining word will be right shifted by 2 This yields the 11 bit identifier A
25. fter reception of a correct initialization frame the device sends back the Acknowledge Frame Acknowledge Frame Parameter Description Identifier Acknowledge Message Identifier ACKID as received by data bytes 3 2 of the initialization frame DLC 4 Data Length Code 4 bytes within this CAN frame Data Byte 0 1 Contents of bit timing register Data Byte 2 3 Copy of acknowledge identifier from initialization frame After the device has sent the acknowledge frame it enters a loop waiting to receive exactly the number of CAN Data Frames specified by DMSGC Each data frame carries 8 bytes of data content Data Frame Parameter Description Identifier Data Message Identifier DMSGID as sent by data bytes 7 6 of the initialization frame and transformed as described above DLC 8 Data Length Code 8 bytes within this CAN frame Data Byte 0 7 Data bytes assigned to increasing destination addresses in SPRAM DMSGC specifies the number of 640 data frames 5120 bytes These 5120 0x1400 bytes represent the CANLoader program and will be stored at the beginning of PMI Scratchpad RAM SPRAM base address 0xD4000000 Once CANLoader received the BootROM jumps to its start address CANLoader is executed In this application note CANLoader is stored in the file CANLoader hex Note The UCAN USB to CAN bridge does not provide any high speed CAN bus connection The programming procedure using UCAN i
26. heap and global variables are located in LDRAM Note The actual code size of CANLoader is less than the assumed 0x1400 bytes which permits changes of the code If a changed CANLoader exceeds the size of 0x1400 bytes a new starting address for SPRAM user code see Chapter 5 4 must be taken care of 1 In the case that another AUDO F device is used the same setting applies Application Note 19 V 1 1 2008 11 infin n AP32132 Ineo TriCore AUDO F Flash Download via Bootstrap Loader Flash Memory Organization 4 Flash Memory Organization The devices of the AUDO F family have at least one Program Memory Unit PMUO The following memories belong to the Program Memory Unit e PFlash Flash memory for code or constant data called Program Flash e DFlash additional flash memory used for emulation of EEPROM data called Data Flash PFlash and DFlash memories are characterized by their sector architecture and by their page structure Sectors are flash memory partitions of different sizes The flash modules and sectorization of the AUDO F devices are shown in the following tables Flash erasure is sector wise Sectors are subdivided into pages Flash memory programming is page wise A PFlash page contains 256 bytes A DFlash page contains 128 bytes 4 1 TC1767 In TC1767 the flash module PFlashO includes 2 MB of PFlash memory PFlashO sector Address range Size in bytes 0 0xA0000
27. lock and 33 CAN frames for a Data block The CAN Data Frames must carry the same identifier as specified in DMSGID refer to Chapter 3 Application Note 24 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader Communication Protocol 5 1 Mode 0 Program Flash Page Header Block ByteO Byte 1 Byte 2 5 Byte 6 14 Byte 15 Block Mode Page Not 0x06 0x00 Address Used Checksum PageAddress 32bit Address of the flash page to be programmed The address must be 256 byte aligned 128 byte aligned for DFlash and in a valid range see Chapter 4 Otherwise an address error will occur Byte 2 indicates the highest byte while Byte 5 indicates the lowest byte After reception of the header block the device sends either 0x55 as acknowledgement or an error code in case of an invalid block The loader enters a loop waiting to receive the subsequent data blocks in the following format The loop is terminated by sending an EOT block to the target device Data Block Byte 0 Byte 1 Bytes 2 257 Bytes 258 262 Byte 263 Block Verifi Not type cation 256 code bytes Used Checksum 0x01 option VerificationOption Set this byte to 0x01 to request a verification of the programmed page bytes If this byte is 0x00 no verification is performed Code bytes Page content Since a DFlash page contains only 128 bytes the second 128 bytes are irrelevant and not
28. n RxD at pin P3 0 TC1767 TC1736 or P5 0 TC1797 respectively e transmit pin TxD at pin P3 1 TC1767 TC1736 or P5 1 TC1797 respectively PC Target COM Figure 2 1 The connection between a PC and the target system for TriCore Bootstrap Loading The flash loader itself is divided into two parts Loader 2 and Loader 3 The bootloader procedure is shown in Figure 2 2 1 The built in Bootstrap Loading mechanism handles the first interaction between PC and target device and can be considered as Loader 1 Application Note 3 V 1 1 2008 11 oe AP32132 Cinfineon TriCore AUDO F Flash Download via Bootstrap Loader ASC Bootstrap Loading PC Bootstrap HOST Loader Initialize l Serial Interface p Send 0x00 gt gt Send 0xD5 Send Loader 2 128 bytes j Call Loader 2 4896 bytes p Send Loader 3 Send 0x55 Checksum Call Loader 3 Flash Send Command refer to Chapter 5 Call Flash Routine Response Code refer to Chapter 5 PC Figure 2 2 The bootloader procedure for flash programming To run this program the first step is to make the target device enter BSL mode Application Note 4 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader ASC Bootstrap Loading ASC Bootstrap Loader mode is entered upon a device reset if the following values are applied at the configuration pins PO 7 0 of Port 0 PO 7 0 10101xx0 The config
29. only be modified if the ENDINIT bit is cleared Please refer to the ENDINIT function description in the User s Manual 2 The actual code size of Loader 3 is less than 4896 bytes Please refer to Chapter 2 2 for further details Application Note 6 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader ASC Bootstrap Loading 2 1 1 Tasking Project Settings Since the code size of Loader 2 is limited to 128 bytes the startup code automatically created by Tasking must be replaced by the user startup code function __initdevice The code does neither define any stack nor initializes the stack pointer Hence the usage of function calls is not possible Therefore functions are defined as inline Beside the default configuration the Tasking project settings need to be configured as follows e C C Build gt Processor gt AUDO Future Family gt Check TC1767 e C C Build gt Settings gt e C C Compiler gt Allocation gt Threshold for putting data in near 0 e C C Compiler gt Optimization gt Optimization level 0 None e Linker gt Output Format Check Generate Intel Hex format file Size of addresses 4 e Linker gt Libraries Uncheck Link default libraries Linker gt Miscellaneous Uncheck Include debugger synchronization utility The Linker Script Language file Loader2 IsI defines 128 bytes in SPRAM memory of type rom starting from address 0xD4000000 This
30. ory is not subdivided into sectors or pages and can be programmed byte by byte TC1797 includes 40 Kbytes of SPRAM in an address range of OxD4000000 OxD4009F FF Application Note 22 V 1 1 2008 11 infin n AP32132 Ineo TriCore AUDO F Flash Download via Bootstrap Loader Flash Memory Organization 4 3 TC1736 In TC1736 the flash module PFlash0 includes 1MB of PFlash memory PFlash0 sector Address range Size in bytes 0 0xA0000000 OxAO0003FFF 0x4000 1 0xA0004000 OxAO0007FFF 0x4000 2 0xA0008000 OxAOOODFFF 0x4000 3 0xA000C000 OxAOOOFFFF 0x4000 4 0xA0010000 OxA0013FFF 0x4000 5 0xA0014000 0xA0017FFF 0x4000 6 0xA0018000 OxA001DFFF 0x4000 7 0xA001C000 OxA001FFFF 0x4000 8 0xA0020000 OxAOO03FFFF 0x20000 9 0xA0040000 0OxA007FFFF 0x40000 10 0xA0080000 OxAOODFFFF 0x40000 11 0xA00CO0000 OxAOOFFFFF 0x40000 DFlash includes 32 Kbyte of additional data flash memory DFlash sector Address range Size in bytes 0 OxAFE00000 OxAFEO3FFF 0x4000 1 OxAFE10000 OxAFE13FFF 0x4000 The SPRAM memory is not subdivided into sectors or pages and can be programmed byte by byte TC1736 includes 8 Kbytes of SPRAM in an address range of OxD4000000 0xD4001F FF Application Note 23 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader Communication Protocol 5 Communication Protocol The flash loader programs
31. otection command the protection status of the flash is checked Unprotected flash memory will be protected using two 32bit user passwords Protected flash memory will be unprotected using the same passwords Protection of DFlash is not possible Warning For AUDO F devices the flash protection and unprotection can be performed up to 4 times only For erasing and programming flash the sector and page address must be specified respectively An invalid address e g an address that is not within the flash boundaries results in an address error The memory organization for TC 1767 TC1797 and TC1736 is described in Chapter 4 Flash user code is executed starting from the PFlash base address 0xA0000000 Since CANLoader occupies the first 0x1400 bytes in SPRAM programming SPRAM is only possible starting from address 0xD4001400 Thus SPRAM user code is executed starting from this address CANLoader defines a communication protocol to receive commands from the PC Based on the command received the corresponding flash routine is executed The communication structure is described in Chapter 5 Application Note 17 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader CAN Bootstrap Loading 3 1 1 Tasking Project Settings Beside the default configuration the Tasking project settings for CANLoader need to be configured as follows C C Build gt Processor gt AUDO Future Family gt Check TC1767
32. s Note Not all AUDO F devices have 16 PFlash sectors In the case that sector n does not exist Bit Sn should be set to 0 Please refer to Chapter 4 for detailed information about the flash sectorization After sending an acknowledgement the device needs to be reset All erase or program commands sent to a flash protected device will cause a protection error If the PFlash is unprotected it will be protected after sending this header block The same block sent with the same passwords to a flash protected device will unprotect the PFlash Protection of DFlash is not possible Warning For AUDO F devices the flash protection and unprotection can be performed up to 4 times only Application Note 28 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader Communication Protocol 5 7 Response Code to the HOST The flash loader program will let the HOST know whether a block has been successfully received and whether the requested flash routine has been successfully executed by sending out a response code Response Code Description 0x55 Acknowledgement no error OxFF Invalid block type OxFE Invalid mode OxFD Checksum error OxFC Invalid address OxFB Error during flash erasing OxFA Error during flash programming OxF9 Verification error OxF8 Protection error Application Note 29 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Boot
33. s tricore objcopy O ihex RAM Loader3 elf RAM Loader3 hex e RAM gt Pre post build steps gt Post build steps tricore objdump_ t RAM Loader3 elf The final output file Loader3 hex is created in the subdirectory RAM The linker description file Loader3 Id in the project s root directory defines the entire available memory of the TC1767 device The only memory used is the SPRAM code memory 0xD4000080 0xD4001400 and the internal LDRAM with a size of 68 Kbytes starting from address 0xD0000000 CSA stack heap and global variables are located in LDRAM Note The actual code size of Loader 3 is less than the assumed 0x1320 bytes which permits changes of the code If a changed Loader 3 exceeds the size of 0x1320 bytes Loader 2 must be adapted to this size A new starting address for SPRAM user code see Chapter 5 4 must be taken care of 1 In the case that another AUDO F device is used the same setting applies Application Note 11 V 1 1 2008 11 infin n AP32132 n 0 TriCore AUDO F Flash Download via Bootstrap Loader CAN Bootstrap Loading 3 CAN Bootstrap Loading The communication between PC and the target device is established via the CAN interface Since the regular PC does not have any CAN Bus interface a USB to CAN bridge is used The TriLoad HOST program example uses the Infineon XC164CM UCAN start kit for this purpose 1 Target CAN Connector 2 USB Connector 3 COM LED yellow 4 RUN LED green 5 U
34. s slower compared to ASC BSL 1 The actual code size of CANLoader is less than 5120 bytes Please refer to Chapter 3 1 1 for further details Application Note 15 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader CAN Bootstrap Loading 3 1 CANLoader Before the CANLoader can provide flash programming functionality a further device initialization needs to be done Once the device jumps to address 0xD4000000 its configuration status is as follows e The ENDINIT bit is cleared System control registers that are protected by the ENDINIT feature can be modified e The watchdog timer is enabled which means that the device will be reset if the watchdog timer is not disabled within a certain period of time e The CAN interface CANO is configured The CAN baud rate is the same as calculated by the BootROM code e The clock system has been reset from Precaler Mode to PLL Freerunning Mode Thus the device runs with a different clock frequency than the frequency used for baud rate calculation which means that the actual baud rate does not match anymore the baud rate used by the HOST CAN interface e Stack pointers and Context Save Areas CSA are not initialized e Interrupt and trap vectors are not defined Based on the above conditions CANLoader does the following initialization e The clock system is reset to Prescaler Mode since the baud rate calculation of the CANO interface was base
35. strap Loader TriLoad HOST Program Example 6 TriLoad HOST Program Example The TriLoad HOST program developed in C uses the above communication structure Chapter 5 The file TriLoad_API cpp contains the API for direct communication with Loader 3 or CANLoader The API includes the following functions API Function Description init_uart Initialize PC COM interface init_ucan_uart Initialize PC COM interface and the UCAN XC164CM USB to CAN bridge init ASC_BSL Initialize ASC BSL send_loader2 Send the Loader 2 send_loader3 Send the Loader 3 send_CANinit_frame Send the CAN Initialization Frame send_CANdata_frame Send a CAN Data Frame send_CANLoader Send the CANLoader bl_send_header Send header block via ASC interface bICAN_send_header Send header block via CAN interface bl_send_data Send data block via ASC interface bICAN_send_data Send data block via CAN interface bl_ send EOT Send EOT block via ASC interface bICAN_ send EOT Send EOT block via CAN interface bl_erase_flash Erase PFlash DFlash sectors bl_download_pflash Download code to PFlash bl_download_dflash Download code to DFlash bl_download_spram Download code to SPRAM make_flash_image Create a flash image from HEX file make_flash_hexfile Generate a dummy HEX file to fill the entire flash The code is not executabl
36. tc Thus a flash loader program providing flash programming routines must be implemented by the user In TriCore family Asynchronous Serial Interface ASC BSL and Controller Area Network CAN BSL are supported This example will demonstrate Bootstrap Loading using both interfaces The target device is connected to a PC via one of the interfaces The flash loader system demonstrated in this application note consists of two parts e The flash loader program is sent to the target device using the built in Bootstrap Loading mechanism Once sent and executed the flash loader program establishes a communication protocol to receive commands from a HOST program a program running on the PC that controls the flash programming of the target device e The HOST program running on a PC uses the communication protocol defined by the flash loader It sends flash programming commands and the code bytes to be programmed The HOST program may vary with the specific application it is used for Thus the HOST program in this application note is considered to be an example The flash loader programs for ASC and CAN BSL are developed for two arbitrary toolchains e Tasking VX toolset for Tricore v3 0r1 http www tasking com tricore e HighTec GNU Toolchain for Tricore v3 4 5 1 http www hightec rt com The project files for both toolchains provided in this example are completely independent from each other The user can choose either toolchain As an
37. tory RAM If build target RAM does not exist the user must create it to comply with the following project settings Beside the default configuration the build options for this build target must be configured as follows e RAM gt Compiler settings Check Do not link against the default crt0 s e RAM gt Compiler settings Check Do not link against standard system startup files e RAM gt Compiler settings gt Check Optimize generated code for size e RAM gt Compiler settings gt Check Tricore 1767 e RAM gt gt Linker settings gt Other linker options add line WI CANLoader Id nocrt0 nostartfiles RAM gt Linker settings gt Other linker options add line mepu te1767 e RAM gt Linker settings gt Other linker options add line T CANLoader Id e RAM gt Linker settings gt Other linker options add line WI Map mapfile Ist e RAM gt Pre post build steps gt Post build steps tricore objcopy O ihex RAM CANLoader elf RAM CANLoader hex e RAM gt Pre post build steps gt Post build steps tricore objdump_ t RAM CANLoader elf The final output file CANLoader hex is created in the subdirectory RAM The linker description file CANLoader Id in the project s root directory defines the entire available memory of the TC1767 device The only memory used is the SPRAM code memory 0xD4000000 0xD4001400 and the internal LDRAM with a size of 68 Kbytes starting from address 0xD0000000 CSA stack
38. uration pins are usually connected to a DIP switch on the TriCore board Assuming that P0 7 is connected to switch pin 1 and the remaining pins accordingly as for TriBoard EasyKit and EBeam board the DIP switch configuration looks as follows 1234567 8 OOO E OO O Figure 2 3 DIP switch configuration on the TriCore board for ASC BSL On means high level signal at the pin After entering Bootstrap Loader mode the device switches the clock system from initial PLL Freerunning Mode VCO base frequency to Prescaler Mode with a frequency divider of 1 Hence the system frequency becomes equal to the frequency of an external crystal which must be obligatorily connected between XTAL1 XTAL2 pins if a Bootstrap Loader mode is selected upon power on The crystal frequency must be at least 10 MHz Further on the HOST sends 0x00 Based on this byte the baud rate used by the PC will be automatically detected by the target device The TriCore device supports baud rates of up to 115200 bits s The ASC interface will be initialized for 8 data bits and 1 stop bit Once the baud rate is detected and the ASC interface is configured 0xD5 is sent back to the PC in case of success Then the Bootstrap Loader enters a loop and waits to receive exactly 128 bytes from the HOST These 128 bytes represent the secondary loader Loader 2 and will be stored at the beginning of PMI Scratchpad RAM SPRAM base
39. vice runs with a different clock frequency than the frequency used for baud rate calculation which means that the actual baud rate does not match anymore the baud rate used by the PC COM interface e Stack pointers and Context Save Areas CSA are not initialized e Interrupt and trap vectors are not defined Based on the above conditions Loader 2 does the following initialization e The clock system is reset to Prescaler Mode since the baud rate calculation of the ASCO interface was based on the clock frequency in Prescaler Mode The frequency divider that decreases the system frequency is disabled by setting it to 0 The according clock system registers can be modified since the ENDINIT bit is cleared e The watchdog timer is disabled The watchdog timer register can be modified as well since the ENDINIT bit is cleared e The ENDINIT bit is set Subsequently the code enters a loop waiting to receive exactly 48967 0x1320 size of Loader 3 bytes which are stored in SPRAM starting from address 0xD4000080 Each byte written to memory is read back and the XOR sum with the previous bytes is calculated After reception of the 4896 bytes the Loader 2 sends 0x55 and XOR checksum to the PC Finally a jump to address 0xD4000080 is performed in order to execute Loader 3 The entire code is contained in the files Loader2 c Tasking and Loader2 s GNU 1 Some system control registers are protected by the ENDINIT feature These registers can
40. wing features Erase flash sectors e program flash pages e verify a programmed flash page e protect PFlash e program SPRAM memory e execute flash user code starting from address 0xA0000000 e execute SPRAM user code starting from address 0xD4001400 The flash protection enables a write protection of PFlash Erase or program attempts result in a protection error if flash is protected Upon receiving the protection command the protection status of the flash is checked Unprotected flash memory will be protected using two 32bit user passwords Protected flash memory will be unprotected using the same passwords Protection of DFlash is not possible Warning For AUDO F devices the flash protection and unprotection can be performed up to 4 times only For erasing and programming flash the sector and page address must be specified respectively An invalid address e g an address that is not within the flash boundaries results in an address error The memory organization for TC 1767 TC1797 and TC1736 is described in Chapter 4 Flash user code is executed starting from the PFlash base address 0xA0000000 Since Loader 2 and Loader 3 occupy the first 0x1400 bytes in SPRAM programming SPRAM is only possible starting from address 0xD4001400 Thus SPRAM user code is executed starting from this address Loader 3 defines a communication protocol to receive commands from the PC Based on the command received the correspon
41. xceeds the size of 0x1320 bytes Loader 2 must be adapted to this size A new starting address for SPRAM user code see Chapter 5 4 must be taken care of 1 In the case that another AUDO F device is used the same setting applies Application Note 10 V 1 1 2008 11 infin n AP32132 0 TriCore AUDO F Flash Download via Bootstrap Loader ASC Bootstrap Loading 2 2 2 GNU Project Settings The HighTec GNU settings for Loader 3 project define one build target RAM The output file Loader3 elf is created in the subdirectory RAM If build target RAM does not exist the user must create it to comply with the following project settings Beside the default configuration the build options for this build target must be configured as follows e RAM gt Compiler settings Check Do not link against the default crt0 s e RAM gt Compiler settings Check Do not link against standard system startup files e RAM gt Compiler settings gt Check Optimize generated code for size e RAM gt Compiler settings gt Check Tricore 1767 e RAM gt Linker settings gt Other linker options add line WI Loader3 Id nocrt0 nostartfiles RAM gt Linker settings gt Other linker options add line mepu te1767 e RAM gt gt Linker settings gt Other linker options add line T Loader3 Id e RAM gt Linker settings gt Other linker options add line WI Map mapfile Ist e RAM gt Pre post build steps gt Post build step
Download Pdf Manuals
Related Search
Related Contents
Standard Solution Package OptiFlex 2 CG09-es - Sistemas para Pintar Sport Spot® Désinsectisation_règles de base FEPS Version 6.3 Benutzerhandbuch 1 5 VORWORT 2 WLAN 簡易取扱説明書 Epson R800 Photo Printer User Manual Hunter 44372 User's Manual Copyright © All rights reserved.
Failed to retrieve file