
Example Project One Image Bootloader RL78 Family Rev.1.00 RL78 One Image Bootloader Example September 17, 2020 Introduction This example project was created to simplify the understanding and creation of bootloader programs on the RL78. The RL78 has a unique flash interface called the Flash Self-programming Library (FSP). This example project shows the use of the FSP along with hardware features such as boot swap and the general hardware CRC. Note that a bootloaders design is completely custom. Depending upon your projects requirements and limitations your bootloader will be different. This module shows only one possible example, modifications can and should be made to adapt it to your specific requirements. Target Device The following is a list of devices that are currently supported by this example program: RL78/G14: R5F104ML Contents 1. Terminology....................................................................................................................................... 3 2. Overview ........................................................................................................................................... 4 2.1 Hardware ........................................................................................................................................... 4 2.2 Software ............................................................................................................................................ 4 2.2.1 RL78 Bootloader ...................................................................................................................... 4 2.2.2 RL78 Application ...................................................................................................................... 4 2.2.3 PC Program .............................................................................................................................. 5 2.3 CRC ................................................................................................................................................... 5 2.4 Tools .................................................................................................................................................. 5 2.4.1 E2 Studio .................................................................................................................................. 5 2.4.2 CCRL ........................................................................................................................................ 5 2.4.3 SREC CAT ............................................................................................................................... 5 3. System Architecture and Design ....................................................................................................... 6 3.1 Embedded Memory Allocation .......................................................................................................... 6 3.1.1 Boot Swap ................................................................................................................................ 6 3.1.2 Monitor Areas ........................................................................................................................... 7 3.2 Program Images ................................................................................................................................ 7 3.2.1 Application Image ..................................................................................................................... 7 3.2.2 Bootloader Image ..................................................................................................................... 8 3.2.3 Combined Image .................................................................................................................... 10 3.3 Embedded Code Flow ..................................................................................................................... 11 3.3.1 Downloading the Image ......................................................................................................... 11 3.3.2 Flashing the Image ................................................................................................................. 12 3.3.3 System Execution ................................................................................................................... 12 4. Source Code Architecture ............................................................................................................... 14 R11AN0470EU0100 Rev.1.00 Page 1 of 27 August 31, 2018 RL78 Family r11an0470eu0100-bootloader-one-image 4.1 RL78 Bootloader ............................................................................................................................. 14 4.1.1 Sections .................................................................................................................................. 14 4.1.2 Code Generator Output .......................................................................................................... 15 4.1.3 Flash Libraries ........................................................................................................................ 15 4.1.4 Relevant Defined Values ........................................................................................................ 15 4.2 RL78 Application ............................................................................................................................. 16 4.2.1 Sections .................................................................................................................................. 16 4.2.2 Code Generator Output .......................................................................................................... 17 4.2.3 Flash Libraries ........................................................................................................................ 18 4.2.4 Relevant Defined and Global Values ..................................................................................... 18 4.2.5 Post-Build Processes ............................................................................................................. 18 4.3 PC Application ................................................................................................................................. 19 4.3.1 Overview ................................................................................................................................ 19 4.3.2 COM Port ............................................................................................................................... 19 4.3.3 File Reader ............................................................................................................................. 20 4.4 Srec Batch Files .............................................................................................................................. 20 4.4.1 CRC Generation ..................................................................................................................... 20 4.4.2 Full File Generation ................................................................................................................ 20 4.4.3 Application File Generation .................................................................................................... 20 5. Running the Sample Program ......................................................................................................... 22 5.1 Building the RL78 Projects .............................................................................................................. 22 5.1.1 Importing the Projects ............................................................................................................ 22 5.1.2 Building the BootLoader Project ............................................................................................. 23 5.1.3 Building the BootApplication Project ...................................................................................... 23 5.2 Setting up the hardware .................................................................................................................. 24 5.2.1 Run mode ............................................................................................................................... 24 5.2.2 UART Communication............................................................................................................ 24 5.2.3 Power ..................................................................................................................................... 24 5.3 Running the PC Application ............................................................................................................ 24 5.3.1 Selecting a COM port ............................................................................................................. 25 5.3.2 Selecting the file to download ................................................................................................ 25 5.3.3 Download ............................................................................................................................... 26 Bootloader - One Image Rev.1.00 Page 2 of 27 September 17, 2020 RL78 Family r11an0470eu0100-bootloader-one-image 1. Terminology There is a lot of similar terminology in this document that references to specific locations in memory. These are described in the sections as they are introduced, but to alleviate confusion please reference the below table. Boot A Denotes the physical memory location from address
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages31 Page
-
File Size-