Ignore:
Timestamp:
Apr 5, 2019, 9:26:53 PM (5 years ago)
Author:
coas-nagasima
Message:

mbed関連を更新
シリアルドライバをmbedのHALを使うよう変更
ファイルディスクリプタの処理を更新

Location:
asp3_tinet_ecnl_arm/trunk/asp3_dcre/target/gr_peach_gcc
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • asp3_tinet_ecnl_arm/trunk/asp3_dcre/target/gr_peach_gcc/Makefile.target

    r352 r374  
    3030endif
    3131
     32CDEFS := $(CDEFS) -DUSE_ARM_FPU
     33COPTS := $(COPTS) -mfloat-abi=hard
     34
    3235#
    3336#  MPCoreの種類の定義
     
    5558        CDEFS := $(CDEFS) -DTOPPERS_EXECUTE_ON_ROM
    5659        #LDSCRIPT = $(TARGETDIR)/gr_peach_rom.ld
    57         LDSCRIPT = $(SRCDIR)/mbed/targets/TARGET_RENESAS/TARGET_RZ_A1H/device/TOOLCHAIN_GCC_ARM/RZA1H.ld
     60        LDSCRIPT = $(SRCDIR)/mbed/targets/TARGET_RENESAS/TARGET_RZA1XX/TARGET_RZ_A1H/device/TOOLCHAIN_GCC_ARM/RZA1H.ld
    5861else
    5962        CDEFS := $(CDEFS) -DTOPPERS_EXECUTE_ON_RAM
  • asp3_tinet_ecnl_arm/trunk/asp3_dcre/target/gr_peach_gcc/cfg_dmy.c

    r352 r374  
    11#include "MBRZA1H.h"
     2#include <stdlib.h>
    23
    3 IRQHandler _kernel_inh_table[Renesas_RZ_A1_IRQ_MAX+1];
     4IRQHandler _kernel_inh_table[RZ_A1_IRQ_MAX+1];
    45uint32_t _kernel_excpt_nest_count = 0;
    56
     
    2324{
    2425}
     26
    2527void _kernel_irq_handler()
    2628{
     
    3133}
    3234
    33 void _start()
     35void __libc_init_array()
    3436{
    3537}
     38
     39void *memset(void *dst, int c, size_t size)
     40{
     41        return NULL;
     42}
     43
     44void *memcpy(void *dst, void * src, size_t size)
     45{
     46        return NULL;
     47}
     48
     49int main()
     50{
     51}
     52
     53void exit(int exitcd)
     54{
     55}
  • asp3_tinet_ecnl_arm/trunk/asp3_dcre/target/gr_peach_gcc/tSIOPortGRPeach.cdl

    r352 r374  
    5050 */
    5151import_C("gr_peach.h");
    52 import_C("rza1.h");
     52import_C("device.h");
    5353
    5454/*
    5555 *  FIFO内蔵シリアルコミュニケーションインタフェース用 簡易SIOドライバ
    5656 */
    57 import("tSCIF.cdl");
     57import("tMbedSerial.cdl");
    5858
    5959/*
     
    7373        call                    sSIOPort        cSIOPort;
    7474        [inline] entry  siSIOCBR        eiSIOCBR;
    75 
    76         /*
    77          *  割込み要求ライン操作のための結合
    78          */
    79         call    sInterruptRequest       cRxInterruptRequest;
    80         call    sInterruptRequest       cTxInterruptRequest;
    8175};
    8276
     
    8579 *  ト)のセルタイプ
    8680 */
    87 [active]
    8881composite tSIOPortGRPeach {
    8982        /*
     
    9790         */
    9891        attr {
    99                 uintptr_t       baseAddress;                            /* ベースアドレス */
    100                 INTNO           rxInterruptNumber;                      /* 受信割込み番号 */
    101                 INTNO           txInterruptNumber;                      /* 送信割込み番号 */
    102                 PRI                     isrPriority = 1;                        /* ISR優先度 */
    103                 PRI                     interruptPriority = -4;         /* 割込み優先度 */
     92                int32_t tx;                                                             /* 送信Pin */
     93                int32_t rx;                                                             /* 受信Pin */
    10494                uint32_t        baudRate = 115200;                      /* ボーレートの設定値 */
    10595        };
     
    10898         *  SIOドライバ
    10999         */
    110         cell tSCIF SCIF {
    111                 baseAddress = composite.baseAddress;
     100        cell tMbedSerial MbedSerial {
     101                tx          = composite.tx;
     102                rx          = composite.rx;
    112103                baudRate    = composite.baudRate;
    113104                ciSIOCBR    = SIOPortMain.eiSIOCBR;
     
    119110        cell tSIOPortGRPeachMain SIOPortMain {
    120111                ciSIOCBR            => composite.ciSIOCBR;
    121                 cSIOPort            = SCIF.eSIOPort;
    122                 cRxInterruptRequest = RxInterruptRequest.eInterruptRequest;
    123                 cTxInterruptRequest = TxInterruptRequest.eInterruptRequest;
     112                cSIOPort            = MbedSerial.eSIOPort;
    124113        };
    125114        composite.eSIOPort => SIOPortMain.eSIOPort;
    126 
    127         /*
    128          *  SIOの受信割込みサービスルーチンと割込み要求ライン
    129          */
    130         cell tISR RxISRInstance {
    131                 interruptNumber = composite.rxInterruptNumber;
    132                 isrPriority     = composite.isrPriority;
    133                 ciISRBody       = SCIF.eiRxISR;
    134         };
    135         cell tInterruptRequest RxInterruptRequest {
    136                 interruptNumber   = composite.rxInterruptNumber;
    137                 interruptPriority = composite.interruptPriority;
    138         };
    139 
    140         /*
    141          *  SIOの受信割込みサービスルーチンと割込み要求ライン
    142          */
    143         cell tISR TxISRInstance {
    144                 interruptNumber = composite.txInterruptNumber;
    145                 isrPriority     = composite.isrPriority;
    146                 ciISRBody       = SCIF.eiTxISR;
    147         };
    148         cell tInterruptRequest TxInterruptRequest {
    149                 interruptNumber   = composite.txInterruptNumber;
    150                 interruptPriority = composite.interruptPriority;
    151         };
    152115};
    153116
     
    157120 *  サンプルプログラムが使うポートが,SIOPortTarget1に固定されているた
    158121 *  め,ポート1とポート3を入れ換えている.具体的には,SIOPortTarget1は
    159  *  SCIFのチャネル2(チャネル番号は0から始まるので,ポート3のこと)に,
    160  *  SIOPortTarget3はSCIFのチャネル0につながっている.
     122 *  MbedSerialのチャネル2(チャネル番号は0から始まるので,ポート3のこと)に,
     123 *  SIOPortTarget3はMbedSerialのチャネル0につながっている.
    161124 */
    162125[prototype]
    163126cell tSIOPortGRPeach SIOPortTarget1 {
    164127        /* 属性の設定 */
    165         baseAddress       = C_EXP("SCIF2_BASE");
    166         rxInterruptNumber = C_EXP("INTNO_SCIF2_RXI");
    167         txInterruptNumber = C_EXP("INTNO_SCIF2_TXI");
     128        tx = C_EXP("P6_3");
     129        rx = C_EXP("P6_2");
    168130};
    169131
     
    171133cell tSIOPortGRPeach SIOPortTarget2 {
    172134        /* 属性の設定 */
    173         baseAddress       = C_EXP("SCIF1_BASE");
    174         rxInterruptNumber = C_EXP("INTNO_SCIF1_RXI");
    175         txInterruptNumber = C_EXP("INTNO_SCIF1_TXI");
     135        tx = C_EXP("P2_5");
     136        rx = C_EXP("P2_6");
    176137};
    177138
     
    179140cell tSIOPortGRPeach SIOPortTarget3 {
    180141        /* 属性の設定 */
    181         baseAddress       = C_EXP("SCIF0_BASE");
    182         rxInterruptNumber = C_EXP("INTNO_SCIF0_RXI");
    183         txInterruptNumber = C_EXP("INTNO_SCIF0_TXI");
     142        tx = C_EXP("P4_12");
     143        rx = C_EXP("P4_13");
    184144};
    185145
     
    187147cell tSIOPortGRPeach SIOPortTarget4 {
    188148        /* 属性の設定 */
    189         baseAddress       = C_EXP("SCIF3_BASE");
    190         rxInterruptNumber = C_EXP("INTNO_SCIF3_RXI");
    191         txInterruptNumber = C_EXP("INTNO_SCIF3_TXI");
     149        tx = C_EXP("P2_14");
     150        rx = C_EXP("P2_15");
    192151};
    193152
     
    195154cell tSIOPortGRPeach SIOPortTarget5 {
    196155        /* 属性の設定 */
    197         baseAddress       = C_EXP("SCIF4_BASE");
    198         rxInterruptNumber = C_EXP("INTNO_SCIF4_RXI");
    199         txInterruptNumber = C_EXP("INTNO_SCIF4_TXI");
     156        tx = C_EXP("P4_14");
     157        rx = C_EXP("P4_15");
    200158};
    201159
     
    203161cell tSIOPortGRPeach SIOPortTarget6 {
    204162        /* 属性の設定 */
    205         baseAddress       = C_EXP("SCIF5_BASE");
    206         rxInterruptNumber = C_EXP("INTNO_SCIF5_RXI");
    207         txInterruptNumber = C_EXP("INTNO_SCIF5_TXI");
     163        tx = C_EXP("P5_3");
     164        rx = C_EXP("P5_4");
    208165};
    209166
     
    211168cell tSIOPortGRPeach SIOPortTarget7 {
    212169        /* 属性の設定 */
    213         baseAddress       = C_EXP("SCIF6_BASE");
    214         rxInterruptNumber = C_EXP("INTNO_SCIF6_RXI");
    215         txInterruptNumber = C_EXP("INTNO_SCIF6_TXI");
     170        tx = C_EXP("P8_8");
     171        rx = C_EXP("P8_9");
    216172};
    217173
     
    219175cell tSIOPortGRPeach SIOPortTarget8 {
    220176        /* 属性の設定 */
    221         baseAddress       = C_EXP("SCIF7_BASE");
    222         rxInterruptNumber = C_EXP("INTNO_SCIF7_RXI");
    223         txInterruptNumber = C_EXP("INTNO_SCIF7_TXI");
    224 };
     177        tx = C_EXP("P5_0");
     178        rx = C_EXP("P5_1");
     179};
     180
     181[prototype]
     182cell tSIOPortGRPeach SIOPortTarget9 {
     183        /* 属性の設定 */
     184        tx = C_EXP("P8_14");
     185        rx = C_EXP("P8_15");
     186};
     187
     188[prototype]
     189cell tSIOPortGRPeach SIOPortTarget10 {
     190        /* 属性の設定 */
     191        tx = C_EXP("P8_13");
     192        rx = C_EXP("P8_11");
     193};
     194
     195[prototype]
     196cell tSIOPortGRPeach SIOPortTarget11 {
     197        /* 属性の設定 */
     198        tx = C_EXP("P11_10");
     199        rx = C_EXP("P11_11");
     200};
     201
     202[prototype]
     203cell tSIOPortGRPeach SIOPortTarget12 {
     204        /* 属性の設定 */
     205        tx = C_EXP("P6_6");
     206        rx = C_EXP("P6_7");
     207};
     208
     209[prototype]
     210cell tSIOPortGRPeach SIOPortTarget13 {
     211        /* 属性の設定 */
     212        tx = C_EXP("P5_6");
     213        rx = C_EXP("P5_7");
     214};
     215
     216[prototype]
     217cell tSIOPortGRPeach SIOPortTarget14 {
     218        /* 属性の設定 */
     219        tx = C_EXP("P11_1");
     220        rx = C_EXP("P11_2");
     221};
     222
     223[prototype]
     224cell tSIOPortGRPeach SIOPortTarget15 {
     225        /* 属性の設定 */
     226        tx = C_EXP("P7_4");
     227        rx = C_EXP("P7_5");
     228};
  • asp3_tinet_ecnl_arm/trunk/asp3_dcre/target/gr_peach_gcc/tSIOPortGRPeachMain_inline.h

    r352 r374  
    5757         */
    5858        cSIOPort_open();
    59 
    60         /*
    61          *  SIOの割込みマスクを解除する.
    62          */
    63         cRxInterruptRequest_enable();
    64         cTxInterruptRequest_enable();
    6559}
    6660
     
    7771         */
    7872        cSIOPort_close();
    79 
    80         /*
    81          *  SIOの割込みをマスクする.
    82          */
    83         cRxInterruptRequest_disable();
    84         cTxInterruptRequest_disable();
    8573}
    8674
  • asp3_tinet_ecnl_arm/trunk/asp3_dcre/target/gr_peach_gcc/target_kernel_impl.c

    r352 r374  
    4747#include "arm.h"
    4848#include "rza1.h"
    49 #include "scif.h"
    50 #include "core_pl310.h"
    51 #include "us_ticker_api.h"
     49
     50/*
     51 * C++のグローバルコンストラクタ呼び出し
     52 */
     53void __libc_init_array()
     54{
     55        /* グローバルコンストラクタでOS APIを呼び出す場合は、
     56           タスクが起動してから行う */
     57}
    5258
    5359/*
     
    209215 *  セルタイプtPutLogGRPeach内に実装されている関数を直接呼び出す.
    210216 */
    211 extern void     tPutLogGRPeach_initialize(void);
     217extern void tPutLogGRPeach_initialize(void);
    212218
    213219/*
     
    294300        rza1_config_port(RZA1_PORT_P(6), led, set);
    295301}
    296 
    297 void us_ticker_init(void)
    298 {
    299 }
    300 
    301 uint32_t us_ticker_read()
    302 {
    303         ER ret;
    304         SYSTIM now;
    305 
    306         ret = get_tim(&now);
    307         if(ret != E_OK)
    308                 return 0;
    309 
    310         return now;
    311 }
    312 
    313 void us_ticker_set_interrupt(timestamp_t timestamp)
    314 {
    315         Asm("bkpt #0");
    316 }
    317 
    318 void us_ticker_disable_interrupt(void)
    319 {
    320 }
    321 
    322 void us_ticker_clear_interrupt(void)
    323 {
    324 }
    325 
    326 void wait(float s)
    327 {
    328         wait_us(s * 1000000.0f);
    329 }
    330 
    331 void wait_ms(int ms)
    332 {
    333         wait_us(ms * 1000);
    334 }
    335 
    336 void wait_us(int us)
    337 {
    338         ER ret;
    339 
    340         ret = dly_tsk(us);
    341         if (ret == E_CTX){
    342                 uint32_t start = us_ticker_read();
    343                 while ((us_ticker_read() - start) < (uint32_t)us);
    344         }
    345 }
    346 
    347 //#include <errno.h>
    348 #define ENOSYS          38
    349 
    350 __attribute__((weak))
    351 long SYS_poll()
    352 {
    353         return -ENOSYS;
    354 }
    355 
    356 __attribute__((weak))
    357 long SYS_open()
    358 {
    359         return -ENOSYS;
    360 }
    361 
    362 __attribute__((weak))
    363 void SYS_set_tid_address()
    364 {
    365         return 0;//-ENOSYS;
    366 }
    367 
    368 __attribute__((weak))
    369 void SYS_mmap2()
    370 {
    371         return 0;//-ENOSYS;
    372 }
    373 
    374 __attribute__((weak))
    375 void ARM_SYS_set_tls(long a)
    376 {
    377         __asm__ __volatile__("mcr p15,0,%0,c13,c0,3" :: "r"(a));
    378         return 0;
    379 }
    380 
    381 __attribute__((weak))
    382 void SYS_exit_group()
    383 {
    384         ext_ker();
    385 }
    386 
    387 __attribute__((weak))
    388 void SYS_exit()
    389 {
    390         ext_ker();
    391 }
Note: See TracChangeset for help on using the changeset viewer.