⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 compiling_notes.txt

📁 at90can系列单片机can_bootloader_example
💻 TXT
字号:

CAN_BOOT_LOADER_EXAMPLE_GCC for AT90CAN128/64/32
================================================


Compiling notes versus targeted device using:
- AVRStudio 413528 + Plug-in GCC
- WINAVR 20070122

Date: March 2007

---- USING AN EXTERNAL MAKEFILE IS NOT NECESARY ----

1/ Select the targeted device in:
    Edit Current Configuration Options-> General -> Device :
        either: at90can128
        either: at90can64
            or: at90can32

2/ Select the optimization:
    Edit Current Configuration Options-> General -> Optimization :
          -Os :  Optimize for size is working well !

3/ Select Options:
    Edit Current Configuration Options-> General :
             X : Unsigned Chars
             X : Unsigned Bitfields
             
4/ To have more information on the project, select:
    Edit Current Configuration Options-> General :
             X : Generate Map File
             X : Generate List File
           note: Create Hex File is selected by default

5/ Selection of all the directories of the project and the library (The selection
   of the  AVR GCC library is automatic):
    Edit Current Configuration Options-> Include Directories

6/ Re-allocation of the code (The Bootloader code must be flashed in the
   "Bootloader Flash Section - Because the code is larger than 4K, the 8K section
   will be used:
    Edit Current Configuration Options-> Memory Settings :
           Add -> Memory Type = Flash 
                  Name        = .text
                  Address(hex)= 0xf000 for at90can128
                              = 0x7000 for at90can64
                              = 0x3000 for at90can32 

7/ Allocation of the "boot_conf[]" array (see Note1):
    Edit Current Configuration Options-> Memory Settings :
           Add -> Memory Type = Flash 
                  Name        = .bootconf
                  Address(hex)= 0xff80 for at90can128
                              = 0x7f80 for at90can64
                              = 0x3f80 for at90can32
 
        Note1:
        ===== The allocation of the "boot_conf[]" array is important because
              "boot_conf[]" must not be in the same flash page than the flash
              functions. In fact, an erase & write action cannot be executed
              where the program is running ! The call order of the object files
              for linking can protect us. When using the Plug-in GCC, this order
              is done when the list of project (*.c) files is entered.  
              Typical list order to avoid mal-functionning:
               1 - main_can_uart_bootloader_example.c
               2 - flash_boot_drv.c
               3 - flash_boot_lib.c
               4 - flash_api_lib.c
               5 - can_drv.c
               6 - reduced_can_lib.c
               7 - can_isp_protocol.c
               8 - eeprom_lib.c
              12 - isp_lib.c 
 
8/ Allocation of the "flash_api-wr_block()" API:
    Edit Current Configuration Options-> Memory Settings :
           Add -> Memory Type = Flash 
                  Name        = .flashapi
                  Address(hex)= 0xfffd for at90can128
                              = 0x7ffd for at90can64
                              = 0x3ffd for at90can32 


Rename of the Hex files:
    for at90can128: file name = can128_bootloader_example_gcc.hex
    for at90can64 : file name =  can64_bootloader_example_gcc.hex
    for at90can32 : file name =  can32_bootloader_example_gcc.hex


======================

Note 1: 
    Total number of errors: 0 
    Total number of warnings: 0
                                
Note 2:
    AT90CAN128:      Program: 5 632 bytes
                        Data:   320 bytes
    AT90CAN64 & 32:  Program: 5 316 bytes
                        Data:   320 bytes

                        
======================
Options to try to kill not used code & data:

-ffunction-sections -fdata-sections

======================
In the Makefile, at "size: ${TARGET}" paragraph.

Add commands to have the size of:
- the sections:
	@avr-size -C -Ax --mcu=${MCU} ${TARGET}
- the librairies and drivers:
	@avr-size --mcu=${MCU} ${OBJECTS}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -