IAR RL78 F13 アプリケーション コードをブートローダー コードと統合

こんにちは。ターラー です。


IAR で RL78 F13 MCU を使用しています。
サードパーティが開発されたブートローダーがあります。
このブートローダーのコードで私のアプリケーションの開始アドレスを指定するだけです。

アプリケーション コードをブートローダー コードと統合する必要があります。
手順を教えてくださいませんか。

私は一人のワークスペースをさくせいして、二つのプロジェクトも追加して、".ddf” 
ファイルで"ROM"アドレスを変化してためしてます。

正しいかどうかわかりませんがよろしくお願いします。

Parents
  • ターラーさん、こんにちは。NoMaYです。

    もうひとつデバッグに関して、私が調べてみましたが、以下であろうと思います。

    間違い :

    次に、ブートローダー プロジェクト リンカ設定で、アプリケーションの「.bin」ファイルを追加しました。
    次に、ブートローダー プロジェクト デバッガー設定で、アプリケーションの「.out」ファイルを追加しました

         ↓

    正しい :

    ブートローダー プロジェクト デバッガー設定で、アプリケーションの「.out」ファイルを追加する、だけでよい


    EWB/8.5/rl78/doc/EWRL78_DebuggingGuide.ENU.pdf

    LOADING MULTIPLE DEBUG IMAGES

    Normally, a debuggable application consists of a single file that you debug. However, you can also load additional debug files (debug images). This means that the complete program consists of several debug images.

    Typically, this is useful if you want to debug your application in combination with a prebuilt ROM image that contains an additional library for some platform-provided features. The ROM image and the application are built using separate projects in the IAR Embedded Workbench IDE and generate separate output files.

    If more than one debug image has been loaded, you will have access to the combined debug information for all the loaded debug images. In the Images window you can choose whether you want to have access to debug information for a single debug image or for all images.

    To load additional debug images at C-SPY startup:
    1 Choose Project>Options>Debugger>Images and specify up to three additional debug images to be loaded. For more information, see Images, page 401.
    2 Start the debug session.

    To load additional debug images at a specific moment:
    Use the __loadImage system macro and execute it using either one of the methods described in Using C-SPY macros, page 323.

    To display a list of loaded debug images:
    Choose Images from the View menu. The Images window is displayed, see Images window, page 53


    EWB/8.5/rl78/doc/EWRL78_DebuggingGuide.JPN.pdf

    複数イメージのロード

    通常、デバッグ可能なアプリケーションは、デバッグ対象の 1 ファイルのみで構成されます。ただし、追加のデバッグファイル(イメージ)をロードすることもできます。すなわち、プログラム全体は複数のイメージで構成されることになります。
    この機能は、プラットフォーム提供の機能に関する追加ライブラリが含まれるビルド済 ROM イメージと一緒にアプリケーションをデバッグする場合に便利です。ROM イメージとアプリケーションは、別々のプロジェクトを使用して IAR Embedded Workbench IDE でビルドされ、別々の出力ファイルを生成します。
    複数のイメージがロードされている場合、ロードされたすべてのイメージを合わせたデバッグ情報が表示されます。[イメージ]ウィンドウでは、1 つのイメージまたは全部のイメージのデバッグ情報を表示するかを選択できます。


  • こんにちは。NoMaY さん。

    ありがとうございます。
    わかりました。試してみます。

    1 つの追加クエリです、
    コードをフラッシュする前にプログラム開始アドレスを変更する方法はなんですか。
    たとえば、コードをフラッシュし、デバッグ中にメモリをチェックすると、データは 0x00000000 から書き込まれます。

    アプリケーションを 0x00004000 から開始したいです。

    「.icf」ファイル」のROMの開始を変更しようとして、
    次のコードを追加しました
    /*-Specials-*/
    define symbol __ICFEDIT_intvec_start__ = 0x00000000;
    /*-Memory Regions-*/
    define symbol __ICFEDIT_region_ROM_start__ = 0x00004000;
    define symbol __ICFEDIT_region_ROM_end__ = 0x0001FFFF;
    define symbol __ICFEDIT_region_RAM_start__ = 0x000FDF00;
    define symbol __ICFEDIT_region_RAM_end__ = 0x000FFEFF;

    上記の行は元の .icf ファイルの一部ではありませんでした。

    参照用に .icf および .ddf ファイルを添付しております。

    IARでアプリケーション コードの開始アドレスを変更する方法を教えてくださいませんか。

    ----------------------------------------------------------------------------------------------------------------

    ICF File:

    //-------------------------------------------------------------------------
    // ILINK command file template for RL78 microcontroller R5F10BGG.
    //
    // This file can be used to link object files from the RL78
    // Assembler, IASMRL78, and the C/C++ compiler ICCRL78.
    //
    // This file is generated from the device file:
    // DR5F10BGG.DVF
    // Copyright(C) 2015 Renesas
    //
    // Core type: s3
    //
    // Format version 3.00, File version 1.11
    //-------------------------------------------------------------------------


    /*-Specials-*/
    define symbol __ICFEDIT_intvec_start__ = 0x00000000;
    /*-Memory Regions-*/
    define symbol __ICFEDIT_region_ROM_start__ = 0x00004000;
    define symbol __ICFEDIT_region_ROM_end__ = 0x0001FFFF;
    define symbol __ICFEDIT_region_RAM_start__ = 0x000FDF00;
    define symbol __ICFEDIT_region_RAM_end__ = 0x000FFEFF;
    define exported symbol __link_file_version_2 = 1;

    initialize by copy with simple ranges, packing = auto { rw, R_DATA, R_BSS, R_DATAF, R_BSSF, R_SDATA, R_SBSS };
    do not initialize { section *.noinit };

    define memory mem with size = 1M;


    // Set the symbol __RESERVE_OCD_ROM to 1 to reserve the OCD area for debugging.
    // IDE: Symbol can be defined within the project settings here:
    // "Project"-->"Options..."->"Linker"-->"Config"-->"Configuration file symbol definitions"
    // Symbol definition: __RESERVE_OCD_ROM=1
    // Command line: --config_def __RESERVE_OCD_ROM=1

    if (isdefinedsymbol(__RESERVE_OCD_ROM))
    {
    if (__RESERVE_OCD_ROM == 1)
    {
    reserve region "OCD ROM area" = mem:[from 0x1FE00 size 0x0200];
    }
    }

    // Set the symbol __RESERVE_OCD_TRACE_RAM to 1 to reserve the OCD trace ram area for debugging.
    // IDE: Symbol can be defined within the project settings here:
    // "Project"-->"Options..."->"Linker"-->"Config"-->"Configuration file symbol definitions"
    // Symbol definition: __RESERVE_OCD_TRACE_RAM=1
    // Command line: --config_def __RESERVE_OCD_TRACE_RAM=1

    if (isdefinedsymbol(__RESERVE_OCD_TRACE_RAM))
    {
    if (__RESERVE_OCD_TRACE_RAM == 1)
    {
    reserve region "OCD Trace RAM" = mem:[from 0xFE300 size 0x0200];
    }
    }

    // Set the symbol __RESERVE_HOTPLUGIN_RAM to 1 to reserve the hot plugin area for debugging.
    // IDE: Symbol can be defined within the project settings here:
    // "Project"-->"Options..."->"Linker"-->"Config"-->"Configuration file symbol definitions"
    // Symbol definition: __RESERVE_HOTPLUGIN_RAM=1
    // Command line: --config_def __RESERVE_HOTPLUGIN_RAM=1

    if (isdefinedsymbol(__RESERVE_HOTPLUGIN_RAM))
    {
    if (__RESERVE_HOTPLUGIN_RAM == 1)
    {
    reserve region "Hot Plugin RAM" = mem:[from 0xFE500 size 0x0030];
    }
    }

    define region ROM_near = mem:[from 0x000D8 to 0x0FFFF];
    define region ROM_far = mem:[from 0x000D8 to 0x0FFFF] | mem:[from 0x10000 to 0x1FFFF];
    define region ROM_huge = mem:[from 0x000D8 to 0x1FFFF];
    define region SADDR = mem:[from 0xFFE20 to 0xFFEDF];
    define region RAM_near = mem:[from 0xFDF00 to 0xFFE1F];
    define region RAM_far = mem:[from 0xFDF00 to 0xFFE1F];
    define region RAM_huge = mem:[from 0xFDF00 to 0xFFE1F];
    define region VECTOR = mem:[from 0x00000 to 0x0007F];
    define region CALLT = mem:[from 0x00080 to 0x000BF];
    define region EEPROM = mem:[from 0xF1000 to 0xF1FFF];

    define block NEAR_HEAP with alignment = 2, size = _NEAR_HEAP_SIZE { };
    define block FAR_HEAP with alignment = 2, size = _FAR_HEAP_SIZE { };
    define block HUGE_HEAP with alignment = 2, size = _HUGE_HEAP_SIZE { };
    define block CSTACK with alignment = 2, size = _STACK_SIZE { rw section CSTACK };
    define block INIT_ARRAY with alignment = 2, fixed order { ro section .preinit_array,
    ro section .init_array };
    define block INIT_ARRAY_TLS with alignment = 2, fixed order { ro section .preinit_array_tls,
    ro section .init_array_tls };

    define block OPT_BYTE with size = 4 { R_OPT_BYTE,
    ro section .option_byte,
    ro section OPTBYTE };
    define block SECUR_ID with size = 10 { R_SECUR_ID,
    ro section .security_id,
    ro section SECUID };


    place at address mem:0x00000 { ro section .reset };
    place at address mem:0x00004 { ro section .intvec };
    place at address mem:0x000C0 { block OPT_BYTE };
    place at address mem:0x000C4 { block SECUR_ID };
    if ( _NEAR_CONST_LOCATION_SIZE > 0 )
    {
    "MIRROR": place in [from _NEAR_CONST_LOCATION_START size _NEAR_CONST_LOCATION_SIZE] with mirroring to (_NEAR_CONST_LOCATION_START | 0xF0000) { ro R_CONST,
    ro section .const,
    ro section .switch };
    }

    "CALLT":place in CALLT { R_CALLT0, ro section .callt0 };

    "ROMNEAR":place in ROM_near { R_TEXT, ro section .text};

    "ROMFAR":place in ROM_far { block INIT_ARRAY,
    block INIT_ARRAY_TLS,
    R_TEXTF_UNIT64KP,
    ro section .textf_unit64kp,
    ro section .constf,
    ro section .switchf,
    ro };

    "ROMHUGE":place in ROM_huge { ro section .consth,
    R_TEXTF,
    ro section .textf };

    "RAMNEAR":place in RAM_near { block NEAR_HEAP,
    block CSTACK,
    zi section .iar.dynexit,
    R_DATA,
    rw section .data,
    R_BSS,
    rw section .bss*,
    rw };

    "RAMFAR":place in RAM_far { block FAR_HEAP,
    R_DATAF,
    rw section .dataf,
    rw section .data_unit64kp,
    rw section .bss_unit64kp,
    R_BSSF,
    rw section .bssf* };

    "RAMHUGE":place in RAM_huge { block HUGE_HEAP,
    rw section .hdata,
    rw section .hbss* };

    "SADDRMEM":place in SADDR { rw section .sdata,
    R_SDATA,
    rw section .sbss*,
    R_SBSS,
    rw section .wrkseg };

    -----------------------------------------------------------------------------------------------------

    DDF File:

    ;;-------------------------------------------------------------------------
    ;; Declarations of SFR registers, interrupt vectors, interrupt control
    ;; registers, memory map information and device file name for
    ;; for RL78 microcontroller R5F10BGG.
    ;;
    ;; This file can be used by the RL78 C-SPY debugger,
    ;; all flavours (simulator and emulators).
    ;;
    ;; This declaration file is generated from the device file:
    ;; DR5F10BGG.DVF
    ;; Copyright(C) 2015 Renesas
    ;; Format version V3.00, File version V1.11
    ;;-------------------------------------------------------------------------


    ;;-------------------------------------------------------------------------
    ;; Program start address
    ;;
    ;; Syntax: Start = Address
    ;;
    ;; Address Label or Address
    ;;-------------------------------------------------------------------------
    [ProgramStartAddress]
    Start = __iar_program_start

    ;;-------------------------------------------------------------------------
    ;; Memory information
    ;;
    ;; Syntax: MemoryNN = Name AdrSpace StartAdr EndAdr AccType
    ;;
    ;; NN Counter
    ;; Name Name of zone (legal characters: A-Z, a-z, 0-9, _)
    ;; AdrSpace Must be Memory
    ;; StartAdr Start adress of memory block
    ;; EndAdr End adress of memory block
    ;; AccType Type of access, read-only (R) or read-write (RW)
    ;;
    ;; Used to define address zones within the address space 'Memory'.
    ;;-------------------------------------------------------------------------
    [Memory]
    ;; Name AdrSpace StartAdr EndAdr Acctype
    Memory0 = INT_ROM Memory 0x04000 0x1FFFF R
    Memory1 = INT_RAM Memory 0xFDF00 0xFFEFF RW
    Memory2 = EEPROM Memory 0xF1000 0xF1FFF R
    Memory3 = EXT_SFR Memory 0xF0000 0xF07FF RW


    ;;-------------------------------------------------------------------------
    ;; SFR declaration file
    ;;
    ;; Syntax: File = Filename
    ;;
    ;; Filename Name of SFR declaration file
    ;;-------------------------------------------------------------------------
    [SfrInclude]
    File = ior5f10bgg.sfr


    ;;-------------------------------------------------------------------------
    ;; Interrupt declarations
    ;;
    ;; Syntax: InterruptNN = Id Vector DefPrio Enable Request Priority0 Priorit1
    ;;
    ;; NN Counter
    ;; Id Interupt 'name'
    ;; Vector Interrupt vector number (hex)
    ;; DefPrio Default priority (dec), '-' indicates non maskable interrupt (NMI),
    ;; '0' is highest priority of maskable interrupt
    ;; Enable The SFR register and enable bit
    ;; Request The SFR register and request bit
    ;; Priority0 The SFR register and priority 0 specify bit
    ;; Priority1 The SFR register and priority 1 specify bit
    ;;
    ;; The non-maskable interrupt (NMI, Prio = '-') description has a simpler
    ;; syntax, just name and vector.
    ;;
    ;; The SFR register and bit description follows the standard syntax for bits,
    ;; that is SFRNAME.BITNAME as defined in the SFR file (*.sfr). During the
    ;; interrupt description syntax check the system will verify that the given
    ;; SFRNAME.BITNAME exists, which means that the *.sfr file must be loaded
    ;; without syntax errors into the debugger.
    ;;-------------------------------------------------------------------------
    [InterruptList]
    ;; Id Vector DefPrio Enable Request Priority0 Priority1
    Interrupt0 = RST 0x00 -
    Interrupt1 = INTDBG 0x02 -
    Interrupt2 = INTWDTI 0x04 0 MK0.MK0L.WDTIMK IF0.IF0L.WDTIIF PR00.PR00L.WDTIPR0 PR10.PR10L.WDTIPR1
    Interrupt3 = INTLVI 0x06 1 MK0.MK0L.LVIMK IF0.IF0L.LVIIF PR00.PR00L.LVIPR0 PR10.PR10L.LVIPR1
    Interrupt4 = INTP0 0x08 2 MK0.MK0L.PMK0 IF0.IF0L.PIF0 PR00.PR00L.PPR00 PR10.PR10L.PPR10
    Interrupt5 = INTP1 0x0A 3 MK0.MK0L.PMK1 IF0.IF0L.PIF1 PR00.PR00L.PPR01 PR10.PR10L.PPR11
    Interrupt6 = INTP2 0x0C 4 MK0.MK0L.PMK2 IF0.IF0L.PIF2 PR00.PR00L.PPR02 PR10.PR10L.PPR12
    Interrupt7 = INTP3 0x0E 5 MK0.MK0L.PMK3 IF0.IF0L.PIF3 PR00.PR00L.PPR03 PR10.PR10L.PPR13
    Interrupt8 = INTP4 0x10 6 MK0.MK0L.PMK4 IF0.IF0L.PIF4 PR00.PR00L.PPR04 PR10.PR10L.PPR14
    Interrupt9 = INTSPM 0x10 7 MK0.MK0L.SPMMK IF0.IF0L.SPMIF PR00.PR00L.SPMPR0 PR10.PR10L.SPMPR1
    Interrupt10 = INTP5 0x12 8 MK0.MK0L.PMK5 IF0.IF0L.PIF5 PR00.PR00L.PPR05 PR10.PR10L.PPR15
    Interrupt11 = INTCLM 0x14 9 MK0.MK0H.CLMMK IF0.IF0H.CLMIF PR00.PR00H.CLMPR0 PR10.PR10H.CLMPR1
    Interrupt12 = INTCSI00 0x16 10 MK0.MK0H.CSIMK00 IF0.IF0H.CSIIF00 PR00.PR00H.CSIPR000 PR10.PR10H.CSIPR100
    Interrupt13 = INTIIC00 0x16 11 MK0.MK0H.IICMK00 IF0.IF0H.IICIF00 PR00.PR00H.IICPR000 PR10.PR10H.IICPR100
    Interrupt14 = INTST0 0x16 12 MK0.MK0H.STMK0 IF0.IF0H.STIF0 PR00.PR00H.STPR00 PR10.PR10H.STPR10
    Interrupt15 = INTCSI01 0x18 13 MK0.MK0H.CSIMK01 IF0.IF0H.CSIIF01 PR00.PR00H.CSIPR001 PR10.PR10H.CSIPR101
    Interrupt16 = INTIIC01 0x18 14 MK0.MK0H.IICMK01 IF0.IF0H.IICIF01 PR00.PR00H.IICPR001 PR10.PR10H.IICPR101
    Interrupt17 = INTSR0 0x18 15 MK0.MK0H.SRMK0 IF0.IF0H.SRIF0 PR00.PR00H.SRPR00 PR10.PR10H.SRPR10
    Interrupt18 = INTTRD0 0x1A 16 MK0.MK0H.TRDMK0 IF0.IF0H.TRDIF0 PR00.PR00H.TRDPR00 PR10.PR10H.TRDPR10
    Interrupt19 = INTTRD1 0x1C 17 MK0.MK0H.TRDMK1 IF0.IF0H.TRDIF1 PR00.PR00H.TRDPR01 PR10.PR10H.TRDPR11
    Interrupt20 = INTTRJ0 0x1E 18 MK0.MK0H.TRJMK0 IF0.IF0H.TRJIF0 PR00.PR00H.TRJPR00 PR10.PR10H.TRJPR10
    Interrupt21 = INTRAM 0x20 19 MK0.MK0H.RAMMK IF0.IF0H.RAMIF PR00.PR00H.RAMPR0 PR10.PR10H.RAMPR1
    Interrupt22 = INTLIN0TRM 0x22 20 MK0.MK0H.LIN0TRMMK IF0.IF0H.LIN0TRMIF PR00.PR00H.LIN0TRMPR0 PR10.PR10H.LIN0TRMPR1
    Interrupt23 = INTLIN0RVC 0x24 21 MK1.MK1L.LIN0RVCMK IF1.IF1L.LIN0RVCIF PR01.PR01L.LIN0RVCPR0 PR11.PR11L.LIN0RVCPR1
    Interrupt24 = INTLIN0 0x26 22 MK1.MK1L.LIN0MK IF1.IF1L.LIN0IF PR01.PR01L.LIN0PR0 PR11.PR11L.LIN0PR1
    Interrupt25 = INTLIN0STA 0x26 23 MK1.MK1L.LIN0STAMK IF1.IF1L.LIN0STAIF PR01.PR01L.LIN0STAPR0 PR11.PR11L.LIN0STAPR1
    Interrupt26 = INTIICA0 0x28 24 MK1.MK1L.IICAMK0 IF1.IF1L.IICAIF0 PR01.PR01L.IICAPR00 PR11.PR11L.IICAPR10
    Interrupt27 = INTP8 0x2A 25 MK1.MK1L.PMK8 IF1.IF1L.PIF8 PR01.PR01L.PPR08 PR11.PR11L.PPR18
    Interrupt28 = INTRTC 0x2A 26 MK1.MK1L.RTCMK IF1.IF1L.RTCIF PR01.PR01L.RTCPR0 PR11.PR11L.RTCPR1
    Interrupt29 = INTTM00 0x2C 27 MK1.MK1L.TMMK00 IF1.IF1L.TMIF00 PR01.PR01L.TMPR000 PR11.PR11L.TMPR100
    Interrupt30 = INTTM01 0x2E 28 MK1.MK1L.TMMK01 IF1.IF1L.TMIF01 PR01.PR01L.TMPR001 PR11.PR11L.TMPR101
    Interrupt31 = INTTM02 0x30 29 MK1.MK1L.TMMK02 IF1.IF1L.TMIF02 PR01.PR01L.TMPR002 PR11.PR11L.TMPR102
    Interrupt32 = INTTM03 0x32 30 MK1.MK1L.TMMK03 IF1.IF1L.TMIF03 PR01.PR01L.TMPR003 PR11.PR11L.TMPR103
    Interrupt33 = INTAD 0x34 31 MK1.MK1H.ADMK IF1.IF1H.ADIF PR01.PR01H.ADPR0 PR11.PR11H.ADPR1
    Interrupt34 = INTP6 0x36 32 MK1.MK1H.PMK6 IF1.IF1H.PIF6 PR01.PR01H.PPR06 PR11.PR11H.PPR16
    Interrupt35 = INTTM11H 0x36 33 MK1.MK1H.TMMK11H IF1.IF1H.TMIF11H PR01.PR01H.TMPR011H PR11.PR11H.TMPR111H
    Interrupt36 = INTP7 0x38 34 MK1.MK1H.PMK7 IF1.IF1H.PIF7 PR01.PR01H.PPR07 PR11.PR11H.PPR17
    Interrupt37 = INTTM13H 0x38 35 MK1.MK1H.TMMK13H IF1.IF1H.TMIF13H PR01.PR01H.TMPR013H PR11.PR11H.TMPR113H
    Interrupt38 = INTP9 0x3A 36 MK1.MK1H.PMK9 IF1.IF1H.PIF9 PR01.PR01H.PPR09 PR11.PR11H.PPR19
    Interrupt39 = INTTM01H 0x3A 37 MK1.MK1H.TMMK01H IF1.IF1H.TMIF01H PR01.PR01H.TMPR001H PR11.PR11H.TMPR101H
    Interrupt40 = INTTM03H 0x3C 38 MK1.MK1H.TMMK03H IF1.IF1H.TMIF03H PR01.PR01H.TMPR003H PR11.PR11H.TMPR103H
    Interrupt41 = INTCSI10 0x3E 39 MK1.MK1H.CSIMK10 IF1.IF1H.CSIIF10 PR01.PR01H.CSIPR010 PR11.PR11H.CSIPR110
    Interrupt42 = INTIIC10 0x3E 40 MK1.MK1H.IICMK10 IF1.IF1H.IICIF10 PR01.PR01H.IICPR010 PR11.PR11H.IICPR110
    Interrupt43 = INTST1 0x3E 41 MK1.MK1H.STMK1 IF1.IF1H.STIF1 PR01.PR01H.STPR01 PR11.PR11H.STPR11
    Interrupt44 = INTCSI11 0x40 42 MK1.MK1H.CSIMK11 IF1.IF1H.CSIIF11 PR01.PR01H.CSIPR011 PR11.PR11H.CSIPR111
    Interrupt45 = INTIIC11 0x40 43 MK1.MK1H.IICMK11 IF1.IF1H.IICIF11 PR01.PR01H.IICPR011 PR11.PR11H.IICPR111
    Interrupt46 = INTSR1 0x40 44 MK1.MK1H.SRMK1 IF1.IF1H.SRIF1 PR01.PR01H.SRPR01 PR11.PR11H.SRPR11
    Interrupt47 = INTTM04 0x42 45 MK1.MK1H.TMMK04 IF1.IF1H.TMIF04 PR01.PR01H.TMPR004 PR11.PR11H.TMPR104
    Interrupt48 = INTTM05 0x44 46 MK2.MK2L.TMMK05 IF2.IF2L.TMIF05 PR02.PR02L.TMPR005 PR12.PR12L.TMPR105
    Interrupt49 = INTTM06 0x46 47 MK2.MK2L.TMMK06 IF2.IF2L.TMIF06 PR02.PR02L.TMPR006 PR12.PR12L.TMPR106
    Interrupt50 = INTTM07 0x48 48 MK2.MK2L.TMMK07 IF2.IF2L.TMIF07 PR02.PR02L.TMPR007 PR12.PR12L.TMPR107
    Interrupt51 = INTLIN0WUP 0x4A 49 MK2.MK2L.LIN0WUPMK IF2.IF2L.LIN0WUPIF PR02.PR02L.LIN0WUPPR0 PR12.PR12L.LIN0WUPPR1
    Interrupt52 = INTKR 0x4C 50 MK2.MK2L.KRMK IF2.IF2L.KRIF PR02.PR02L.KRPR0 PR12.PR12L.KRPR1
    Interrupt53 = INTCAN0ERR 0x4E 51 MK2.MK2L.CAN0ERRMK IF2.IF2L.CAN0ERRIF PR02.PR02L.CAN0ERRPR0 PR12.PR12L.CAN0ERRPR1
    Interrupt54 = INTCAN0WUP 0x50 52 MK2.MK2L.CAN0WUPMK IF2.IF2L.CAN0WUPIF PR02.PR02L.CAN0WUPPR0 PR12.PR12L.CAN0WUPPR1
    Interrupt55 = INTCAN0CFR 0x52 53 MK2.MK2L.CAN0CFRMK IF2.IF2L.CAN0CFRIF PR02.PR02L.CAN0CFRPR0 PR12.PR12L.CAN0CFRPR1
    Interrupt56 = INTCAN0TRM 0x54 54 MK2.MK2H.CAN0TRMMK IF2.IF2H.CAN0TRMIF PR02.PR02H.CAN0TRMPR0 PR12.PR12H.CAN0TRMPR1
    Interrupt57 = INTCANGRFR 0x56 55 MK2.MK2H.CANGRFRMK IF2.IF2H.CANGRFRIF PR02.PR02H.CANGRFRPR0 PR12.PR12H.CANGRFRPR1
    Interrupt58 = INTCANGERR 0x58 56 MK2.MK2H.CANGERRMK IF2.IF2H.CANGERRIF PR02.PR02H.CANGERRPR0 PR12.PR12H.CANGERRPR1
    Interrupt59 = INTTM10 0x5A 57 MK2.MK2H.TMMK10 IF2.IF2H.TMIF10 PR02.PR02H.TMPR010 PR12.PR12H.TMPR110
    Interrupt60 = INTTM11 0x5C 58 MK2.MK2H.TMMK11 IF2.IF2H.TMIF11 PR02.PR02H.TMPR011 PR12.PR12H.TMPR111
    Interrupt61 = INTTM12 0x5E 59 MK2.MK2H.TMMK12 IF2.IF2H.TMIF12 PR02.PR02H.TMPR012 PR12.PR12H.TMPR112
    Interrupt62 = INTTM13 0x60 60 MK2.MK2H.TMMK13 IF2.IF2H.TMIF13 PR02.PR02H.TMPR013 PR12.PR12H.TMPR113
    Interrupt63 = INTFL 0x62 61 MK2.MK2H.FLMK IF2.IF2H.FLIF PR02.PR02H.FLPR0 PR12.PR12H.FLPR1


    ;;-------------------------------------------------------------------------
    ;; Device file
    ;;
    ;; Syntax: File = Filename
    ;;
    ;; Filename Name of device file
    ;;-------------------------------------------------------------------------
    [DeviceFile]
    File = DR5F10BGG.DVF


    ;;-------------------------------------------------------------------------
    ;; Memory map information
    ;;
    ;; Syntax: MapNN = StartAdr EndAdr Type Access/Size
    ;;
    ;; NN Counter
    ;; StartAdr Area start address
    ;; EndAdr Area end address
    ;; Type Area type
    ;; Access Area access
    ;;-------------------------------------------------------------------------
    [MemoryMap]
    Map0 = 0x00000, 0x1FFFF, 0x00000, 0x5
    Map1 = 0xFDF00, 0xFFEFF, 0x00001, 0x7
    Map2 = 0xF1000, 0xF1FFF, 0x0000A, 0x1
    Map3 = 0x00000, 0xFFEFF, 0x0000B, 0x5
    Map4 = 0x00000, 0xFFFFF, 0x0000C, 0x3
    Map5 = 0x20000, 0xEEFFF, 0x0000E, 0x8
    Map6 = 0xFFEE0, 0xFFEFF, 0x0000F, 0x3
    Map7 = 0xFFF00, 0xFFFFF, 0x00010, 0x3
    Map8 = 0x00080, 0x000BF, 0x00013, 0x3
    Map9 = 0xFFE20, 0xFFF1F, 0x00016, 0x3
    Map10 = 0xFFF00, 0xFFF1F, 0x00018, 0x3
    Map11 = 0xF0000, 0xF07FF, 0x00024, 0x3
    Map12 = 0xEFFF8, 0xEFFF8, 0x00025, 0x5
    Map13 = 0xF2000, 0xFDEFF, 0x00026, 0x1
    Map14 = 0xF0800, 0xF0FFF, 0x00027, 0x7
    Map15 = 0xEF000, 0xEFFFF, 0x00028, 0x5
    Map16 = 0xFDF00, 0xFE2FF, 0x00029, 0x7
    Map17 = 0xFE300, 0xFE4FF, 0x0002B, 0x7
    Map18 = 0xFE500, 0xFE52F, 0x0002C, 0x7


    ;;-------------------------------------------------------------------------
    ;; Pseudo Emulation RAM support
    ;;
    ;; Syntax: PseudoEmulText = text
    ;;
    ;; text display text
    ;;-------------------------------------------------------------------------
    [PseudoEmul]
    PseudoEmulText = RAM ECC 2bit Error


    ;;-------------------------------------------------------------------------
    ;; Flash block information
    ;;
    ;; Syntax: Blocks = NN
    ;;
    ;; NN Number of flash blocks
    ;;-------------------------------------------------------------------------
    [FlashBlocks]
    Blocks = 0x00000080


    ;;-------------------------------------------------------------------------
    ;; Hot Plug-in support
    ;;
    ;; Syntax: HotPlugIn = support
    ;;
    ;; support true or false
    ;;-------------------------------------------------------------------------
    [OcdData]
    HotPlugIn = true


    ;;-------------------------------------------------------------------------
    ;; Extra data information
    ;;
    ;; Syntax: Prdname = 0xNNNNNNNN
    ;;
    ;; 0xNNNNNNNN PRDNAME number
    ;;-------------------------------------------------------------------------
    [ExtraData]
    Prdname = 0x4754FFFF

    ;;-------------------------------------------------------------------------
    ;; End of file
    ;;-------------------------------------------------------------------------

  • ターラーさん、こんにちは。NoMaYです。

    > データは 0x00000000 から書き込まれます。

    この部分の意味が分かりません。詳しく説明して頂けませんか?

    私の推測として、icfファイルで0x4000番地に配置したコードで、mapファイルでも0x4000番地に配置されていることが確認できているコードが、C-SPYでダウンロードすると0x0番地にダウンロードされてしまう、ということでしょうか?

  • こんにちは。NoMaY さん。

    私の推測として、icfファイルで0x4000番地に配置したコードで、mapファイルでも0x4000番地に配置されていることが確認できているコードが、C-SPYでダウンロードすると0x0番地にダウンロードされてしまう、ということでしょうか?

    >> 

    はい。理解は正しいです。

    アプリケーション コードを 0x00004000 アドレスから開始したいです。

Reply
  • こんにちは。NoMaY さん。

    私の推測として、icfファイルで0x4000番地に配置したコードで、mapファイルでも0x4000番地に配置されていることが確認できているコードが、C-SPYでダウンロードすると0x0番地にダウンロードされてしまう、ということでしょうか?

    >> 

    はい。理解は正しいです。

    アプリケーション コードを 0x00004000 アドレスから開始したいです。

Children
  • ターラーさん、こんにちは。NoMaYです。

    私もicfファイルの書き換え方法(icfファイルの文法)を知らないです。マニュアルの以下の章に文法の記載がありますので、一度読んで下さい。正直なところ、私も、trial and errorで調べる、ことになりますので、時間が掛かります。このような問題であれば、年間20万円だったと以前にかふぇルネで見掛けましたが、IAR社に年間保守費用を支払われておられると思いますので、正直なところ、IAR社に尋ねた方が早く解決するだろうと私は推測します。(問題の分類から考えると、IAR社に問い合わせて拒絶されることは無いだろう、と私には思われます。)

    ぱっと見では、以下はシンボルを定義しているだけですので、そもそもコードの配置は変化しないと思われます。mapファイルを確認されたとのことですが、もう一度確認して頂けませんか?0x4000番地に配置されていないだろうと推測されるのです。

    > 「.icf」ファイル」のROMの開始を変更しようとして、次のコードを追加しました

    /*-Specials-*/
    define symbol __ICFEDIT_intvec_start__ = 0x00000000;
    /*-Memory Regions-*/
    define symbol __ICFEDIT_region_ROM_start__ = 0x00004000;
    define symbol __ICFEDIT_region_ROM_end__ = 0x0001FFFF;
    define symbol __ICFEDIT_region_RAM_start__ = 0x000FDF00;
    define symbol __ICFEDIT_region_RAM_end__ = 0x000FFEFF;

     
    wwwfiles.iar.com/rl78/EWRL78_DevelopmentGuide.ENU.pdf#page=405

    The linker configuration file

    ・ Overview
    ・ Declaring the build type
    ・ Defining memories and regions
    ・ Regions
    ・ Section handling
    ・ Section selection
    ・ Using symbols, expressions, and numbers
    ・ Structural configuration

    Before you read this chapter you must be familiar with the concept of sections, see Modules and sections, page 88.


    wwwfiles.iar.com/rl78/EWRL78_DevelopmentGuide.JPN.pdf#page=371

    リンカ設定ファイル

    ・ 概要
    ・ メモリおよび領域の定義
    ・ 領域
    ・ セクションの取扱い
    ・ セクションの選択
    ・ シンボル、式、数値の使用
    ・ 構造化設定

    この章を読む前に、セクションのコンセプトについて知っておく必要があります。84 ページのモジュールおよびセクションを参照してください。


    [メモ]

    2022/09/30現在 (日本語版はバージョンが大変古いので注意する必要がありそうです。)

    wwwfiles.iar.com/rl78/EWRL78_DevelopmentGuide.ENU.pdf

    EDITION NOTICE
    Fifth edition: November 2019
    Part number: DRL78_I-5
    This guide applies to version 4.x of IAR Embedded Workbench® for the Renesas RL78 microcontroller family.
    The IAR C/C++ Development Guide for RL78 replaces all versions of the IAR C/C++ Compiler Reference Guide for RL78 and the IAR Linker and Library Tools Reference Guide.
    Internal reference: BB5, csrct2010.1, V_110411, IJOA.


    wwwfiles.iar.com/rl78/EWRL78_DevelopmentGuide.JPN.pdf

    改版情報
    第2 版: 2015 年5 月
    部品番号: DRL78_I-2-J
    本ガイドは、ルネサス RL78 マイクロコントローラファミリ用IAR Embedded Workbench® のバージョン2.x に適用する。
    『RL78 用IAR C/C++ コンパイラユーザガイド』は、すべてのバージョンの『RL78 用IAR C/C++ コンパイラリファレンスガイド』および『IAR リンカおよびライブラリツールリファレンスガイド』の内容に代わるものです。
    内部参照: M18、csrct2010.1、V_110411、IJOA。