英飞凌XC2000系列 CAN BOOTLADER 资料

所需积分/C币:12 2019-02-16 15:27:49 1.45MB PDF
18
收藏 收藏
举报

详细介绍了如何开发 CAN BootLoader 程序 汽车电子目前都需要CAN BOOTLOADER 开发
infineon AP16164 Flash Progamming via CAN BSL (Bootstrap Loader) Device 1 Revision History: V1.0 2009-10 Previous Version (s) Page Subjects(major changes since last revision) This is the first release We listen to your comments Is there any information in this document that you feel is wrong, unclear or missing? Your feedback will help us to continuously improve the quality of this document. Please send your proposal (including a reference to this document)to ipdcc@infineon.cc Application Note V1.0,2009-10 infineon AP16164 Flash Progamming via CAN BSL (Bootstrap Loader) Table of contents Table of contents Introduction and Requirements Hardware Requirements 画 CAN BSL Bootstrap Loader) in the XC2000/XE166 Entering the CAn bsl 55678 2.2 Loading the User Code 2.3 Exiting CAN BSL 8 General System Description 3.1 Master board 3.1.1 Transmitter Program (Project File: CAN_ BSLMaster 12 3.1.2 Receiver Program(Project File: CAN Loader) 13 Application Software(Project File: MainApplication XE16x) 13 3.2 Slave board 14 XC2000/XE166 Internal Flash Programming 15 4.1 The Internal Flash Memory 15 4.2 Flash driver 16 Communication Protocol 17 Process commands 17 5.1.1 Sector Erasing Operation 17 5.1.2 Flash Page Programming Operation 17 5.1.3 Application reset for the standard start 18 5.14 Application Reset for the CAN BSL Mode 18 5.1.5 Download an Application EXample Code ····· 18 Using this Application Note Running this Application Note without HiTOP5 21 Appendix 23 8.1 Hardware Bugs 8.2 Hex Code 24 8.3 XC2000/XE166 Easy Board v1. 24 8.4 XC2000/XE166 Easy board v2.0 and v3.0 25 85 Script File: AppNote16164 CAN BSL.scm 25 Application Note V1.0,2009-10 infineon AP16164 Flash Progamming via CAN BSL (Bootstrap Loader) Introduction and Requirements Introduction and Requirements The Infineon XC2000/XE166 Family of devices(Table 1)include a built-in CAN Bootstrap Loader(CAN BSL) Using the CAN BSL, it is possible to load code or data into the internal Psram of the device via the MultICAN interface. What is not available however, is a built-in mechanism for internal flash programming This application note will demonstrate how to program the internal flash of XC2000/XE166 devices via the CaN BSL Table 1 XC2000/XE166XE166 Derivative with CAN BSL Derivative Package XC228X. XC228XM PG-LQFP-144 XC226X, XC226XM. XC226XN PG-LQFP-100 XC238X, XC238XA PG-LQFP-144 XC236X. XC236XA. XC236XB PG-LQFP-100 XC233XA. XC233XB PG-LQFP-64 XC2786×,XC2785X PG-LQFP-144 XC2766×,XC2765X,XC2764X PG-LQFP-100 XE167. XE167M PG-LQFP-144 XE164, XE164M. XE164N PG-LQFP-100 XE162M. XE162N PG-LQFP-64 XE169H.XC229XH PG-LQFP-176(coming soon) XE167H. XC228XH PG-LQFP-144(coming soon) The example described makes use of the Tasking compiler tool. However to debug and download readable Hex files, it is possible to directly use the Hitex tool(HiTOP53)included in the Infineon UConnect-CAN XE164 kit 1.1 Hardware Requirements The following hardware is required for the example described in this application note Two XC2000/XE 16x boards If a compiler and debug tool are already installed, the application software can run in any two Infineon Easy Kit boards equipped with a target device listed in Table 1. The Infineon UConnect-CAN XE164 comes with a free compiler and debug tool development suite a size limited evaluation version ). In the example described in this document, the UConnect-CAN XE164 is the host board, while the XE167 FM Easykit with active CAN BSL, acts as the slave board Terminal program; MTTTY for example This is used to give commands to the host and to display actual states and error messages can bUs cable CAN Analyzer tool (optional) Application Note V1.0,2009-10 infineon AP16164 Flash Progamming via CAN BSL (Bootstrap Loader) CAN BSL (Bootstrap Loader) in the XC2000/XE166 2 CAN BSL Bootstrap Loader)in the XC2000/XE166 a built-in CAN Bootstrap Loader(BsL)is implemented in the Infineon XC2000/XE 166 family of devices CAN BSL provides a mechanism to load program code or data via the multican module into the Psram of a device, and to start executing the loaded code from address E0 0000H(address of the first transmitted byte) The CAN BSL is an integrated mechanism that can be selected via port configuration during a system start after a Power-on Reset, or through write configuration registers and trigger then a software reset. For more details please see Chapter 2.1 The Can BSL uses a CAn node 0 interface and configures the MultcAN module to the baud rate of the host device Once communication has been established, the BSL receives a defined number of messages(the number defined in the host) for downloading the code or data. the received code or data is sequentially written to the Psram Once the download has finished the program code that has been loaded is executed and the BsL is terminated The complete load sequence is based on the following three Can standard frames Initialization frame sent by the external host to XC2000/XE166 Acknowledge frame sent by the XC2000/XE166 to the external host Data frames sent by the external host to the XC2000/XE166 The initialization frame is used in the xc 2000/XE 166 device for baud rate detection After successful baud rate detection, the XC2000/XE166 reports to the external host via the acknowledge frame Data frames can then be transmitted from the host to the Xc2000/XE166 device. Data frames are always transmitted in 8 bytes Table 2 CAN Bootstrap Loader Frames Frame Type Parameter Description Initialization Frame ldentifier 1 1-bit. don 't care DLC=8 Data byte 0-1 0×5555 Data byte 2-3 acknowledge message identifier AcK ID use bits [13: 0], bit 13=IDE) Data byte 4-5 Data Message Count MSG CNT Must be <=1 FEOH for 64KBytes SPRAM, see Chapter 2.2 For example; MSG CNT=0x200 for 0000H-OFFFH (4KBytes) Data byte 6-7 Data Message Identifier MsG ID Acknowledge Identifier ACK ID as received bytes [3: 2]of the Initialization Frame Frame DLC=4 Data byte 0-1 BTR register value in XC2000 Data byte 0-1 Data bytes [3.2]of the Initialization Frame Data frame Identifier Data Message Identifier MsG ID as sent by data bytes [7: 6]of the Initialization frame DLC=8 Data byte 0-7 Data Bytes, assigned to increasing destination(PSRAM) addresses Application Note V1.0,2009-10 infineon AP16164 Flash Progamming via CAN BSL (Bootstrap Loader) CAN BSL (Bootstrap Loader) in the XC2000/XE166 2.1 Entering the CAN BSL The XC2000/XE166 enters CAN BSL mode, when the CAN BSL mode is selected within the startup configuration upon a reset signal Bit field HWCFG=XXX 101b in register STSTAT indicates the CAN BSL mode Bit field HWcfG is updated either by: Hardware: with a pull-up/down resistor when the configuration pins P102-0 has the value 101 at Power-On or after an Internal Application Reset Software: when 000xX101b is written into bit field SWRSTCON SWCFG and an Application Reset is triggered with SWRSTCON SWBOOT=1 Software Boot configuration selection) Note: To directly generate a software reset request trigger, either use the instruction SRST, or set bit SWRSTCON. SWRSTREQ =1 Notes 1. Because of a hardware bug(see Chapter 8.1 RESET_ X.002 )the bit field HWCFG in the register STSTAT is unable to indicate the actual start-up mode selected in early XC2000/XE166 devices. This bug is fixed in the M, N-, 5, H- series of devices (see Table 1) 2. The type of software reset should be configured first (RSTCONO. SW=1xb 3. The type of instruction (SRST) is defined via bit field RSTCONO CPU 4. 01 is reserved. It can not be configured for RSTCoNo CPU or RSTCONO Sw 5. For example code, please see Chapter 8.2 The CaN BSL initializes the multican as follows: can node o of the multican module is used Message Object 0(Mo0) is configured as Receive Object to receive the initialization and data frame Message Object 1(MO1) is configured as Transmit object to transmit the acknowledge frame CAN input/output pins P2 6=RXDCO and P2.5=TXDC0 RXSEL=0X0003 In CAn Bsl the system clock is provided by osc HP circuitry(supplied by a external oscillator or an external clock source). fsys: =fosc is selected by SYSCONO CLKSEL=01b During the initialization phase The Bit Timing Mode is used for baud rate detection and analysis of the bit timing The Analyzer Mode is used to monitor the can frame without active participation All Acceptance Mask bits of the receive object MOO are OFF After the initialization phase The Analyzer Mode is switched off. The bit timing mode for Can node0 does not change BTR is set with the calculated value and SJw=01b All Acceptance Mask bits of the receive object MO0 are ON: CAN_MOAMRO=01FFF, FFFFH Application Note V1.0,2009-10 infineon AP16164 Flash Progamming via CAN BSL (Bootstrap Loader) CAN BSL (Bootstrap Loader) in the XC2000/XE166 22 Loading the User Code The sequence for loading the user code is as follows The code is downloaded starting at address 0E0, 0000H Consecutive data bytes are stored at incrementing After receipt of the last CAN data frame, the Bootstrap Loader sequence is finished and executes a jump to address 0e0, 0000 XC2000/XE166 has 64K PSRAM(OEO,0000H-OEO, FFFFH), but the last 255 bytes are dedicated to the on chip firmware; i.e. If code or data is downloaded to that area it will be overwritten afterwards by the on-chip firmware. Therefore the maximum CAN message count(MSG_cNt)in the initialization frame is 8192-32 2.3 Exiting CAn bsl After the Bootstrap Loader has been activated, the Watchdog Timer and the Debug system are disabled The Debug system and Watchdog Timer are released automatically when the BSL terminates after having received a set number of messages from the host(the number of messages is defined via a variable in the host) The CAN BSL is also aborted after a Power On Reset, if the non-BSL port configuration has been used(see Chapter 2. 1) Application Note V1.0,2009-10 infineon AP16164 Flash Progamming via CAN BSL (Bootstrap Loader) General System Descriptio General System Description as host device. the UConnect-CAN XE164 is connected to a pc via a jtag/Uart interface. The xe164 should be in Standard Start mode As slave device, the XE167FM Easy Kit is connected to the host via a Can interface. The XE167FM should be in active can bsl mode This application note describes software for the host board. the host device takes control of the slave device via the Can bus, while commands are received and process status changes are reported via the JTAG/UART interface to the PC COM port CAN BUS CAN node 0 CAN node o Receive upgrade Transmit upgrade Uconnect XE164 application Sw via Host board Easy Kit XE167M application SW from can bus in CAN the can bus in (standard start Slave board CAN BSL mode BSL mode and standard start mode mode) program then into the internal flash JTAG ASC Download hex files and report status information via jTAG心UART Figure 1 System Overview There are three different pieces of code(three Tasking projects for the host device associated with this application Transmitter Program: cAn BSLMaster Initializes the MulticaN module in the host device(including the Can transmit pins and configuring the initialization frame) to establish the communication with the slave Defines a port pin to signal the process of starting, data transmission, and termination of the download sequence Initializes the Usic module and configures loco as the asc interface to communicate with the pc com pr Code should be compiled for the location of the internal flash at address oC1, 0000H Receiver program CAN Loader Must first be downloaded to the slave device in active can bsl mode After a successful download this code will be executed It contains commands for a 'handshake between the host and slave devices Defines a port pin to signal the process status on the slave board Code should be compiled for the location of the internal PSRAM, at address 0E0,0000- Application Note V1.0,2009-10 infineon AP16164 Flash Progamming via CAN BSL (Bootstrap Loader) General System Description Application Software: Main Application XE16x This is the upgrade software In this application note we create a MulticaN module application. Can objects are configured in order that the slave can receive messages from the host and also execute commands Code should be compiled for the location of the internal flash, at address 0Co,0000 Uconnect XE164 XE167M Easy Kit CAN Loader xE0.0000 0×E0,0000 CAN BSLMaster' 0xC1,0000 New Application code to be downloaded Old Application code to MMainApplication XE16X e upgraded 0xC0.0000 0xC00000 Figure 2 Memory Map Application Note 10 V1.0,2009-10

...展开详情
试读 26P 英飞凌XC2000系列 CAN BOOTLADER 资料
立即下载 低至0.43元/次 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
关注 私信
上传资源赚积分or赚钱
最新推荐
英飞凌XC2000系列 CAN BOOTLADER 资料 12积分/C币 立即下载
1/26
英飞凌XC2000系列 CAN BOOTLADER 资料第1页
英飞凌XC2000系列 CAN BOOTLADER 资料第2页
英飞凌XC2000系列 CAN BOOTLADER 资料第3页
英飞凌XC2000系列 CAN BOOTLADER 资料第4页
英飞凌XC2000系列 CAN BOOTLADER 资料第5页
英飞凌XC2000系列 CAN BOOTLADER 资料第6页

试读结束, 可继续读2页

12积分/C币 立即下载 >