AT91 ARM Thumb Microcontrollers. AT91SAM CAN Bootloader. AT91SAM CAN Bootloader User Notes. 1. Description. 2. Key Features



Similar documents
AVR305: Half Duplex Compact Software UART. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Application Note. C51 Bootloaders. C51 General Information about Bootloader and In System Programming. Overview. Abreviations

General Porting Considerations. Memory EEPROM XRAM

AT91 ARM Thumb Microcontrollers. Application Note. Interfacing a PC Card to an AT91RM9200-DK. Introduction. Hardware Interface

AVR317: Using the Master SPI Mode of the USART module. 8-bit Microcontrollers. Application Note. Features. Introduction

8-bit Microcontroller. Application Note. AVR222: 8-point Moving Average Filter

AVR319: Using the USI module for SPI communication. 8-bit Microcontrollers. Application Note. Features. Introduction

AT89C5131A Starter Kit... Software User Guide

8-bit RISC Microcontroller. Application Note. AVR182: Zero Cross Detector

AVR030: Getting Started with IAR Embedded Workbench for Atmel AVR. 8-bit Microcontrollers. Application Note. Features.

8-bit RISC Microcontroller. Application Note. AVR236: CRC Check of Program Memory

AVR106: C functions for reading and writing to Flash memory. 8-bit Microcontrollers. Application Note. Features. Introduction

8-bit Microcontroller. Application Note. AVR415: RC5 IR Remote Control Transmitter. Features. Introduction. Figure 1.

How to Calculate the Capacitor of the Reset Input of a C51 Microcontroller 80C51. Application Note. Microcontrollers. Introduction

AVR245: Code Lock with 4x4 Keypad and I2C LCD. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

8-bit RISC Microcontroller. Application Note. AVR155: Accessing an I 2 C LCD Display using the AVR 2-wire Serial Interface

8-bit. Application Note. Microcontrollers. AVR282: USB Firmware Upgrade for AT90USB

Quick Start Guide. CAN Microcontrollers. ATADAPCAN01 - STK501 CAN Extension. Requirements

AVR134: Real Time Clock (RTC) using the Asynchronous Timer. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Tag Tuning/RFID. Application Note. Tag Tuning. Introduction. Antenna Equivalent Circuit

8-bit Microcontroller. Application Note. AVR314: DTMF Generator

3-output Laser Driver for HD-DVD/ Blu-ray/DVD/ CD-ROM ATR0885. Preliminary. Summary

8-bit Microcontroller. Application Note. AVR400: Low Cost A/D Converter

8-bit Microcontroller. Application Note. AVR105: Power Efficient High Endurance Parameter Storage in Flash Memory

AVR32110: Using the AVR32 Timer/Counter. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR034: Mixing C and Assembly Code with IAR Embedded Workbench for AVR. 8-bit Microcontroller. Application Note. Features.

8-bit Microcontroller. Application Note. AVR201: Using the AVR Hardware Multiplier

Using CryptoMemory in Full I 2 C Compliant Mode. Using CryptoMemory in Full I 2 C Compliant Mode AT88SC0104CA AT88SC0204CA AT88SC0404CA AT88SC0808CA

AVR32100: Using the AVR32 USART. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

8-bit Microcontroller. Application. Note. AVR204: BCD Arithmetics. Features. Introduction. 16-bit Binary to 5-digit BCD Conversion bin2bcd16

AVR1309: Using the XMEGA SPI. 8-bit Microcontrollers. Application Note. Features. 1 Introduction SCK MOSI MISO SS

USB 2.0 Full-Speed Host/Function Processor AT43USB370. Summary. Features. Overview

AVR442: PC Fan Control using ATtiny13. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Application Note. 8-bit Microcontrollers. AVR270: USB Mouse Demonstration

AT91SAM ARM-based Flash MCU. Application Note

AVR32701: AVR32AP7 USB Performance. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

Application Note. USB Mass Storage Device Implementation. USB Microcontrollers. References. Abbreviations. Supported Controllers

AVR1318: Using the XMEGA built-in AES accelerator. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR1900: Getting started with ATxmega128A1 on STK bit Microcontrollers. Application Note. 1 Introduction

AVR32138: How to optimize the ADC usage on AT32UC3A0/1, AT32UC3A3 and AT32UC3B0/1 series. 32-bit Microcontrollers. Application Note.

AVR353: Voltage Reference Calibration and Voltage ADC Usage. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR120: Characterization and Calibration of the ADC on an AVR. 8-bit Microcontrollers. Application Note. Features. Introduction

Application Note. Migrating from RS-232 to USB Bridge Specification USB Microcontrollers. Doc Control. References. Abbreviations

AVR241: Direct driving of LCD display using general IO. 8-bit Microcontrollers. Application Note. Features. Introduction AVR

Two-wire Automotive Serial EEPROM AT24C01A AT24C02 AT24C04 AT24C08 (1) AT24C16 (2)

AVR1510: Xplain training - XMEGA USART. 8-bit Microcontrollers. Application Note. Prerequisites. 1 Introduction

8-bit Microcontroller. Application Note. AVR461: Quick Start Guide for the Embedded Internet Toolkit. Introduction. System Requirements

AVR033: Getting Started with the CodeVisionAVR C Compiler. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Application Note. 8-bit Microcontrollers. AVR280: USB Host CDC Demonstration. 1. Introduction

Application Note. 8-bit Microcontrollers. AVR272: USB CDC Demonstration UART to USB Bridge

AVR1301: Using the XMEGA DAC. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR2006: Design and characterization of the Radio Controller Board's 2.4GHz PCB Antenna. Application Note. Features.

Two-wire Serial EEPROM AT24C1024 (1)

AVR1922: Xplain Board Controller Firmware. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Application Note. 8-bit Microcontrollers. AVR091: Replacing AT90S2313 by ATtiny2313. Features. Introduction

Atmel AVR4920: ASF - USB Device Stack - Compliance and Performance Figures. Atmel Microcontrollers. Application Note. Features.

AT91 ARM Thumb Microcontrollers. Application Note. GNU-Based Software Development on AT91SAM Microcontrollers. 1. Introduction. 2.

Atmel AVR4921: ASF - USB Device Stack Differences between ASF V1 and V2. 8-bit Atmel Microcontrollers. Application Note. Features.

AVR115: Data Logging with Atmel File System on ATmega32U4. Microcontrollers. Application Note. 1 Introduction. Atmel

AVR1600: Using the XMEGA Quadrature Decoder. 8-bit Microcontrollers. Application Note. Features. 1 Introduction. Sensors

3-output Laser Driver for HD-DVD/ Blu-ray/DVD/ CD-ROM ATR0885. Preliminary. Summary. Features. Applications. 1. Description

AT86RF230 (2450 MHz band) Radio Transceiver... User Guide

AVR287: USB Host HID and Mass Storage Demonstration. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR32788: AVR 32 How to use the SSC in I2S mode. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

USB Test Environment ATUSBTEST- SS7400. Summary

Application Note. 8-bit Microcontrollers. AVR293: USB Composite Device

2-wire Serial EEPROM AT24C1024. Advance Information

Atmel AVR4903: ASF - USB Device HID Mouse Application. Atmel Microcontrollers. Application Note. Features. 1 Introduction

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.

2-Wire Serial EEPROM AT24C32 AT24C64. 2-Wire, 32K Serial E 2 PROM. Features. Description. Pin Configurations. 32K (4096 x 8) 64K (8192 x 8)

AT88CK490 Evaluation Kit

8-bit Microcontroller. Application Note. AVR410: RC5 IR Remote Control Receiver

APPLICATION NOTE. Atmel AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Atmel AVR 8-bit Microcontroller. Introduction.

32-bit AVR UC3 Microcontrollers. 32-bit AtmelAVR Application Note. AVR32769: How to Compile the standalone AVR32 Software Framework in AVR32 Studio V2

Application Note. Atmel ATSHA204 Authentication Modes. Prerequisites. Overview. Introduction

AVR055: Using a 32kHz XTAL for run-time calibration of the internal RC. 8-bit Microcontrollers. Application Note. Features.

Application Note. 8-bit Microcontrollers. AVR307: Half Duplex UART Using the USI Module

How To Prevent Power Supply Corruption On An 8Bit Microcontroller From Overheating

APPLICATION NOTE. AT07175: SAM-BA Bootloader for SAM D21. Atmel SAM D21. Introduction. Features

DIP Top View VCC A16 A15 A12 A7 A6 A5 A4 A3 A2 A1 A0 I/O0 I/O1 I/O2 GND A17 A14 A13 A8 A9 A11 A10 I/O7 I/O6 I/O5 I/O4 I/O3. PLCC Top View VCC A17

ATF15xx Product Family Conversion. Application Note. ATF15xx Product Family Conversion. Introduction

AVR444: Sensorless control of 3-phase brushless DC motors. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

STK 500, AVRISP, AVRISP

AVR068: STK500 Communication Protocol. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

8-bit RISC Microcontroller. Application Note. AVR910: In-System Programming

APPLICATION NOTE. Atmel AT02985: User s Guide for USB-CAN Demo on SAM4E-EK. Atmel AVR 32-bit Microcontroller. Features. Description.

APPLICATION NOTE. Atmel AT04389: Connecting SAMD20E to the AT86RF233 Transceiver. Atmel SAMD20. Description. Features

Application Note. Atmel CryptoAuthentication Product Uses. Atmel ATSHA204. Abstract. Overview

How To Use An Atmel Atmel Avr32848 Demo For Android (32Bit) With A Microcontroller (32B) And An Android Accessory (32D) On A Microcontroller (32Gb) On An Android Phone Or

8051 Flash Microcontroller. Application Note. A Digital Thermometer Using the Atmel AT89LP2052 Microcontroller

Table of Contents. Section 1 Introduction Section 2 Getting Started Section 3 Hardware Description

AVR151: Setup and Use of the SPI. Introduction. Features. Atmel AVR 8-bit Microcontroller APPLICATION NOTE

Atmel AVR1017: XMEGA - USB Hardware Design Recommendations. 8-bit Atmel Microcontrollers. Application Note. Features.

APPLICATION NOTE. Authentication Counting. Atmel CryptoAuthentication. Features. Introduction

2-wire Serial EEPROM AT24C512

AVR125: ADC of tinyavr in Single Ended Mode. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

APPLICATION NOTE. Atmel LF-RFID Kits Overview. Atmel LF-RFID Kit. LF-RFID Kit Introduction

USER GUIDE EDBG. Description

Step Motor Controller. Application Note. AVR360: Step Motor Controller. Theory of Operation. Features. Introduction

AVR1321: Using the Atmel AVR XMEGA 32-bit Real Time Counter and Battery Backup System. 8-bit Microcontrollers. Application Note.

Transcription:

User Notes 1. Description The CAN bootloader SAM-BA Boot4CAN allows the user to program the different memories and registers of any Atmel AT91SAM product that includes a CAN without removing them from the system and without the need of a preprogrammed application. The CAN bootloader manages communication with an external device (host) through the CAN network. It implements a CAN protocol which translates serial CAN communication frames into memory and register accesses. 2. Key Features Key features of the are: ARM Thumb Compatible SAM-BA Boot4CAN Protocol CAN Used as Physical Layer 7 ISP CAN Identifiers Relocatable ISP CAN Identifiers Software Autobaudrate Mode In-system Programming Commands Read/Write Byte/Halfword/Word Read/Write Buffers Read/Write Configuration Bytes: CAN Node Number CAN Relocatable Identifier Segment Autobaudrate Parameters Configuration Start Application Command Interface with AT91Boot_DLL dll for ISP Usage AT91 ARM Thumb Microcontrollers AT91SAM CAN Bootloader 1

3. Bootloader Configuration Table 3-1 lists the different configuration bytes used by the bootloader. Their value can be accessed through a set of commands. See Special Commands on page 15.. Table 3-1. Configuration Bytes Description Mnemonic Description Default Value Flash Address NNB Node NumBer 0xFF 0x100_F00 CRIS CAN Re-locatable Identifier Segment 0xFF 0x100_F04 ABM AutoBaud Mode 0xFF 0x100_F08 PROPAG Propagation Segment 0xFF 0x100_F0C PHASE1 Phase Segment 1 0xFF 0x100_F10 PHASE2 Phase Segment 2 0xFF 0x100_F14 BRP Baudrate Prescaler 0xFF 0x100_F18 All the configuration bytes are located in the Flash memory starting at address 0x100_F00. Before connecting a CAN node in a point-to-point connection for the first time, the user must take care that the default values are 0xFF (see Hardware and Software Constraints on page 17). 2

4. Device Initialization 5. CAN Autobaudrate Initialization follows the steps described below: 1. Stack setup for ARM supervisor mode 2. Setup the Embedded Flash Controller 3. Main oscillator frequency detection 4. Switch Master Clock on Main Oscillator 5. Copy code into SRAM 6. C variable initialization 7. PLL setup: PLL is initialized to generate a system clock of 24 MHz 8. Disable of the Watchdog and enable of the user reset 9. CAN PIO, Clock and CAN transceiver configuration 10. Jump to SAM-BA Boot4CAN sequence (see SAM-BA Boot4CAN on page 4) The supported baudrates are 100 Kbits, 125 Kbits, 250 Kbits, 500 Kbits and 1 Mbit/s. 5.1 CAN Autobaudrate Limitation The CAN autobaud implemented in SAM-BA Boot4CAN is efficient only in point-to-point connection because, in this case, the transmit CAN message is repeated until a hardware acknowledge is done by the receiver. This configuration corresponds to a host trying to send CAN frames until the CAN node with SAM-BA Boot4CAN acknowledges one (Figure 6-3 on page 8). The bootloader can acknowledge an in-coming CAN frame only if a configuration is found. This functionality is not guaranteed on a network with several CAN nodes. 3

6. SAM-BA Boot4CAN This section describes how to start the CAN Bootloader and the higher level protocol over the CAN called SAM-BA Boot4CAN. The CAN is used to transmit information and has the following configuration: Standard CAN Frame compliant with CAN Specification 2.0A (Identifier size is 11 bits long) Frame: Data Frame Baudrate: software autobaud performed by the bootloader. 6.1 SAM-BA Boot4CAN Initialization The SAM-BA Boot4CAN initialization principle is to: Check for User Configuration bytes. Wait for CAN Connecting messages and execute if necessary the Software AutoBaudrate (see Figure 6-1). There are two ways to initialize the CAN controller: Use the Software Autobaudrate Use the User Configuration Bytes stored in the CAN Baudrate Register (CAN_BR) of the product. The user configuration bytes to be used are, respectively: PROPAG: Propagation Time Segment: This part of the bit time is used to compensate for the physical delay times within the network. PHASE1 and PHASE2: Phase 1 and Phase 2 Segment: The Phase-Buffer- Segments are used to compensate for edge phase errors. These segments can be lengthened (PHASE1) or shortened (PHASE2) by resynchronization. BRP: Baudrate Prescaler: This field allows user to program the period of the CAN system clock to determine the individual bit timing. Note: Refer to the full product datasheet for more information on CAN Bit Timing Programmation. The choice between these two solutions is made with the ABM Configuration Byte: ABM = 0xFF: the Software Autobaudrate is performed. ABM is different from 0xFF: the CAN_BR register configuration is used. 4

Figure 6-1. SAM-BA Boot4CAN Initialization CAN Controller Initialization ABM = 0xFF? Yes No Read PROPAG value Read PHASE1 value Read PHASE2 value Read BRP value PROPAG or PHASE1 or PHASE2 or BRP = 0xFF? Yes No CAN Baudrate Register (CAN_BR) Configuration CAN Errors? Yes No Enter Autobaud Mode Autobaud Successful No Yes SAM-BA Boot4CAN Initialization Completed 5

6.2 SAM-BA Boot4CAN Protocol This protocol is used to: 6.2.1 Generic CAN Data Frame Description Initiate the communication Read/Write Byte/Half-word/Word Read/Write Data Buffers Read/Write Configuration Bytes Jump to a specified address Identifier Field Control Field Data Field 11-bit 1 byte 8 bytes max Identifier: identifies the frame. Only the standard mode (11-bit) is used. Control: contains the DLC information in 4 bits (number of data in Data field). Data: Data field consists of zero to eight bytes. The interpretation within the frame depends on the Identifier field. 6.2.2 Command Description Once SAM-BA Boot4CAN initialization is complete, the application runs in an infinite loop waiting for different commands (Table 6-1) Table 6-1 lists the CAN message identifiers defined to manage this protocol: Table 6-1. Commands Available through the SAM-BA Boot4CAN Identifier Action Value Initial Value CAN_ID_SELECT_NODE Open/Close a communication with a node 0x[CRIS]0 0x0 CAN_ID_WR_CMD Initiate a Write Buffer Command 0x[CRIS]1 0x1 CAN_ID_WR_DATA Write a Buffer 0x[CRIS]2 0x2 CAN_ID_RD_DATA Read a Buffer 0x[CRIS]3 0x3 CAN_ID_RD Read a Byte/Half-word/Word 0x[CRIS]4 0x4 CAN_ID_WR Write a Byte/Half-word/Word 0x[CRIS]5 0x5 CAN_ID_SPC_CMD Special Commands 0x[CRIS]6 0x6 It is possible to allocate a new value for CAN ISP identifiers by writing the byte CRIS with the base value for the group of identifier s(figure 6-2). The maximum value for CRIS is 0x7F. All values superior to 0x7F will be considered as a 0x00 value. 6

Figure 6-2. CAN Identifier Remapping Remapped CAN Identifiers 0x7F6 0x7F0 SAM-BA Boot4CAN Identifiers CAN_ID_SPC_CMD CAN_ID_RD CAN_ID_WR CAN_ID_RD_DATA CAN_ID_WR_DATA CAN_ID_WR_CMD CAN_ID_SELECT_NODE 0x[CRIS]0 0x000 7

6.2.3 Open and Close Communication The communication with a device (CAN node) must be opened prior to initiation of any communication. To open communication with the device, the host must send a connecting CAN message (CAN_ID_SELECT_NODE) with the node number (NNB) passed in parameter. If the node number passed is equal to 0xFF then the CAN bootloader accepts the communication (see Figure 6-3). Figure 6-3. Point To Point Connection Host CAN Dongle CAN Bus Node Number (NNB) = 0xFF (Default Value) Node x Otherwise the node number passed in parameter must be equal to the local Node Number (NNB) (see Figure 6-4). Figure 6-4. Network Connection Host NNB = 0x00 Node 0 NNB = 0x01 NNB = 0x02 NNB = n Node 1 Node 2 Node x CAN Dongle CAN Bus 6.2.3.1 Request from Host Before opening a new communication with another device, the current device communication must be closed with its connecting CAN message (CAN_ID_SELECT_NODE). Identifier Length data[0] CAN_ID_SELECT_NODE 1 Node Number (NNB) Note: NNB is the Node Number Byte to which the host wants to talk. 8

6.2.3.2 Answer from Bootloader Identifier Length data[0] data[1] Comment CAN_ID_SELECT_NODE 2 Boot Version 0x00 0x01 The communication is closed The communication is opened Note: data[0] contains the bootloader version. If the communication is closed, then no other messages are managed by the bootloader. 6.2.3.3 Example Open The Communication: Identifier Length Data HOST CAN_ID_SELECT_NODE 01 FF BOOTLOADER CAN_ID_SELECT_NODE 02 01 01 9

6.2.4 Read Byte/Half-word/Word Command This command allows the user to read bytes, half-words or words at a specified address. 6.2.4.1 Request from Host This operation can be executed only with a device previously opened in communication. Identifier Length data[0] data[1] data[2] data[3] data[4] Description 0x05 Read a byte CAN_ID_RD 5 0x06 Address Read a half word 0x08 Read a word 6.2.4.2 Answer from Bootloader Identifier Length data[0] 1 Byte Value CAN_ID_RD 6.2.4.3 Example 2 Half Word Value 4 Word Value Read A Byte at address 0x202000: Identifier Length Data HOST CAN_ID_RD 05 05 00 20 20 00 BOOTLOADER CAN_ID_RD 01 69 10

6.2.5 Write Byte/Half-word/Word Command This command allows the user to write bytes, half-words or words at a specified address. 6.2.5.1 Request from Host This operation can be executed only with a device previously opened in communication. Identifier Length data[0:3] data[4] data[5] data[6] data[7] Description CAN_ID_WR 5 Value - Write a byte 6 Address Value - Write a half word 8 Value Write a word 6.2.5.2 Answer from Bootloader Identifier Length data[0] Description CAN_ID_WR 1 0x00 Command OK 6.2.5.3 Example Write A Word at address 0x202030 (value = 0xCAFEDECA): Identifier Length Data HOST CAN_ID_WR 08 00 20 20 30 CA FE DE CA BOOTLOADER CAN_ID_WR 01 00 11

6.2.6 Read Data Buffer Command This command allows the user to read a buffer. 6.2.6.1 Request from Host This operation can be executed only with a device previously opened in communication. To start the read operation, the Host sends a Read Data Buffer CAN message (CAN_ID_RD_DATA) with the start address and the end address passed in parameter. If the number of data to read is greater than 8 bytes, the device splits them into blocks of 8 bytes to be transferred to the host. Identifier Length data[0:3] data[4:7] Description CAN_ID_RD_DATA 8 Start Address End Address Read bytes from start address to end address 6.2.6.2 Answer from Bootloader Identifier Length data[n] CAN_ID_RD_DATA n Values 6.2.6.3 Example Read Data from 0x200000 to 0x200009: Identifier Length Data HOST CAN_ID_RD_DATA 08 00 20 00 00 00 20 00 09 BOOTLOADER CAN_ID_RD_DATA 08 01 23 45 67 89 AB CD EF BOOTLOADER CAN_ID_RD_DATA 02 EA FF 12

6.2.7 Write Data Buffer Command This command allows the user to write a buffer in the device. 6.2.7.1 Request from Host This operation can be executed only with a device previously opened in communication. 1. The first step is to indicate the range address to write. 2. The second step is to transmit the data. The host must take care to transmit 8 data bytes in a CAN message when possible. To start the write operation, the host sends a Write Command CAN message (CAN_ID_WR_CMD) with the start address and the end address passed in parameter. Identifier Length data[0:3] data[4:7] Description CAN_ID_WR_CMD Up to 8 Start Address End Address Initiate Write Data Buffer Command 6.2.7.2 Answer from Bootloader Identifier Length data[0] Description CAN_ID_WR_CMD 1 0x00 Command OK 6.2.7.3 Request from Host The second step is to send data to write. The host must send a Write Data CAN message (CAN_ID_WR_DATA) with up to 8 data per message and must wait for the device answer before sending the next data. Identifier Length data[0]... data[7] Description CAN_ID_WR_DATA up to 8 x... x Data to be written 6.2.7.4 Answer from Bootloader The device has three possible answers: If the device is ready to receive new data, it sends a Write Data CAN message (CAN_ID_WR_DATA) with the result Wait for New Command passed in parameter. If the device has finished the programming, it sends a Write Data CAN message with the result Command OK passed in parameter. If the device is not supposed to write data, it sends a Write Data CAN message with the result Command Not OK passed in parameter.. Identifier Length data[0] Description CAN_ID_WR_DATA 1 0x00 0x01 0x02 Command OK Command Not OK Wait for New Command 13

6.2.7.5 Example Write 0x55 from 0x200000 to 0x200008: Identifier Length Data // Initiate Data Buffer Write HOST CAN_ID_WR_CMD 08 00 20 00 00 00 20 00 08 BOOTLOADER CAN_ID_WR_CMD 01 00 // Write Data Buffer HOST CAN_ID_WR_DATA 08 55 55 55 55 55 55 55 55 BOOTLOADER CAN_ID_WR_DATA 01 02 // Wait For New Command HOST CAN_ID_WR_DATA 01 55 BOOTLOADER CAN_ID_WR_DATA 01 00 // Command OK // Try to make a unwanted transfer HOST CAN_ID_WR_DATA 01 55 BOOTLOADER CAN_ID_WR_DATA 01 01 // Command NOK 14

6.2.8 Special Commands This command allows the user to read or write configuration bytes. A jump to a specified address is also available. This operation can be executed only with a device previously opened in communication. 6.2.8.1 Prerequisite Embedded Flash Controller Flash Mode Register (EFC_FMR) must be programmed correctly before using one of these commands (except for the Jump to a specified address command). 6.2.8.2 Request from Host Identifier Length data[0] data[1] data[2] data[3] data[4] Description 0x00 Read NNB 0x01 Read CRIS 0x02 Read ABM 2 0x00 0x03 - Read PROPAG 0x04 Read PHASE1 0x05 Read PHASE2 0x06 Read BRP CAN_ID_SPC_CMD 0x00 0x01 0x02 Write NNB Write CRIS Write ABM 3 0x1 0x03 Value - Write PROPAG 0x04 Write PHASE1 0x05 Write PHASE2 0x06 Write BRP 5 0x2 Address Jump to a specified address 6.2.8.3 Answer from Bootloader Answer to a Special Read Command: Identifier Length data[0] Description CAN_ID_SPC_CMD 1 Value Read the Configuration Byte Answer to a Special Write Command: Identifier Length data[0] Description CAN_ID_SPC_CMD 1 0x00 Command OK Note: No answer is returned by the bootloader for a Jump Command. 15

6.2.8.4 Example Read the CAN Re-locatable Identifier Segment (CRIS = 0x7F): Identifier Length data HOST CAN_ID_SPC_CMD 02 00 01 BOOTLOADER CAN_ID_SPC_CMD 01 7F Write the Node Number Value (NNB) value to 0xCA: Identifier Length data HOST CAN_ID_SPC_CMD 03 01 00 CA BOOTLOADER CAN_ID_SPC_CMD 01 00 Jump at address 0x100000: Identifier Length data HOST CAN_ID_SPC_CMD 05 02 00 10 00 00 16

7. Hardware and Software Constraints The first 4 Kbytes in the Flash memory are reserved for the CAN Bootloader Application (0x100_000 to 0x100_FFF). All the configuration bytes are located in the Flash memory starting at address 0x100_F00. Before connecting a CAN node in a point-to-point connection for the first time, the user must take care that their default values are 0xFF (See Bootloader Configuration on page 2.). SAM-BA Boot4CAN copies itself in the SRAM and uses a block of internal SRAM for variables and stacks. In consequence, the user area starts at address 0x202_000. Embedded Flash Controller Flash Mode Register (EFC_FMR) must be programmed correctly prior to using Special Read or Write Commands. 17

8. Revision History Table 8-1. Doc. Rev. 6220A Revision History Comments First issue. Change Request Ref. 18

19

Atmel Corporation 2325 Orchard Parkway San Jose, CA 95131, USA Tel: 1(408) 441-0311 Fax: 1(408) 487-2600 Regional Headquarters Europe Atmel Sarl Route des Arsenaux 41 Case Postale 80 CH-1705 Fribourg Switzerland Tel: (41) 26-426-5555 Fax: (41) 26-426-5500 Asia Room 1219 Chinachem Golden Plaza 77 Mody Road Tsimshatsui East Kowloon Hong Kong Tel: (852) 2721-9778 Fax: (852) 2722-1369 Japan 9F, Tonetsu Shinkawa Bldg. 1-24-8 Shinkawa Chuo-ku, Tokyo 104-0033 Japan Tel: (81) 3-3523-3551 Fax: (81) 3-3523-7581 Atmel Operations Memory 2325 Orchard Parkway San Jose, CA 95131, USA Tel: 1(408) 441-0311 Fax: 1(408) 436-4314 Microcontrollers 2325 Orchard Parkway San Jose, CA 95131, USA Tel: 1(408) 441-0311 Fax: 1(408) 436-4314 La Chantrerie BP 70602 44306 Nantes Cedex 3, France Tel: (33) 2-40-18-18-18 Fax: (33) 2-40-18-19-60 ASIC/ASSP/Smart Cards Zone Industrielle 13106 Rousset Cedex, France Tel: (33) 4-42-53-60-00 Fax: (33) 4-42-53-60-01 1150 East Cheyenne Mtn. Blvd. Colorado Springs, CO 80906, USA Tel: 1(719) 576-3300 Fax: 1(719) 540-1759 Scottish Enterprise Technology Park Maxwell Building East Kilbride G75 0QR, Scotland Tel: (44) 1355-803-000 Fax: (44) 1355-242-743 RF/Automotive Theresienstrasse 2 Postfach 3535 74025 Heilbronn, Germany Tel: (49) 71-31-67-0 Fax: (49) 71-31-67-2340 1150 East Cheyenne Mtn. Blvd. Colorado Springs, CO 80906, USA Tel: 1(719) 576-3300 Fax: 1(719) 540-1759 Biometrics/Imaging/Hi-Rel MPU/ High Speed Converters/RF Datacom Avenue de Rochepleine BP 123 38521 Saint-Egreve Cedex, France Tel: (33) 4-76-58-30-00 Fax: (33) 4-76-58-34-80 Literature Requests www.atmel.com/literature Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN ATMEL S TERMS AND CONDI- TIONS OF SALE LOCATED ON ATMEL S WEB SITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDEN- TAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and product descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel s products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life. Atmel Corporation 2006. All rights reserved. Atmel, logo and combinations thereof, Everywhere You Are and others are registered trademarks or trademarks of Atmel Corporation or its subsidiaries. ARM, the ARMPowered logo and others are the registered trademarks or trademarks of ARM Ltd. Other terms and product names may be trademarks of others. Printed on recycled paper.