GR-SAKURA
GR-KURUMI
GR-COTTON
GR-CITRUS
GR-PEACH
GR-KAEDE
GR-ADZUKI
GR-LYCHEE
GR-ROSE
GR-MANGO(*)
SNShield
Web Compiler
IDE for GR
TOPPERS関連
女子美コラボ
その他
※プロデューサミーティング中
作り方使い方資料
イベント関連
作品記事
体験記事
ライブラリ
ツール
その他・過去ファイル
GR-KAEDE_Sketch_V1.00.zip の Makefile 中のコンパイルオプション
CFLAGS :=-Wall -I"$(GNU_PATH)rx-elf/include" -I. -I"$(GNU_PATH)lib/gcc/rx-elf/$(GCC_VERSION)/include" -I"$(GNU_PATH)rx-elf/include/c++/$(GCC_VERSION)/" -I"$(GNU_PATH)rx-elf/include/c++/$(GCC_VERSION)/rx-elf/64-bit-double/" -ffunction-sections -fno-function-cse -fsigned-char -fdata-sections -mno-balign -DDEBUG -DGRKAEDE -DGRSAKURA -DARDUINO=144 -DCPPAPP -D__RX_LITTLE_ENDIAN__=1 -D__T4__ -g2 -g -flto -mlittle-endian-data -m64bit-doubles -mcpu=rx64m
最適化オプション `-O2' とかがないですね。なんか効率悪いコード吐くなと思ったらこれが原因か。`GRKAEDE' と `GRSAKURA' と `ARDUINO' がデファインされてるのもどうかという感じ。
参考: GR-SAKURA_Sketch_V2.02.zip の Makefile 中のコンパイルオプション
CFLAGS :=-Wall -I"$(GNU_PATH)rx-elf/include" -I. -I"$(GNU_PATH)lib/gcc/rx-elf/$(GCC_VERSION)/include" -I"$(GNU_PATH)rx-elf/include/c++/$(GCC_VERSION)/" -I"$(GNU_PATH)rx-elf/include/c++/$(GCC_VERSION)/rx-elf/64-bit-double/" -ffunction-sections -fno-function-cse -fsigned-char -fdata-sections -mno-balign -DTESTING=1 -DGRSAKURA -DARDUINO=100 -DCPPAPP -D__RX_LITTLE_ENDIAN__=1 -D__T4__ -O2 -flto -mlittle-endian-data -mcpu=rx600 -m64bit-doubles
pins_arduino.h の中でデジタルピンの数が
#define NUM_DIGITAL_PINS 66
となっていますが、下記の各テーブルの要素がそれぞれ 67 個あり、上の値も 67 が正しい感じです。
const uint8_t PROGMEM digital_pin_to_bit_PGM[] const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] const uint8_t PROGMEM digital_pin_to_port_PGM[]
私は
-DDEBUG
が無いと嬉しいです.
pins_arduino.h の中で、
が定義されてますがそれぞれは
と共通であり、別のピンとして定義する意味がないと思います。
恐らくは
にも信号が出ているということだと思いますが、別のピン番号を与えるのではなく、ピンマップにこれらのピンは共通であることを明記した方が誤解が生じず良いのでは。
PIN_IO36(PD0)~PIN_IO43(PD7) はボード上にピンが出ておらずSDRAMに直結されているため利用ができません。将来的なボードの改版を想定して予約しているということでしょうか?
どこにこの質問を書こうか悩んじゃいますが、とりあえず書かせてください。
サーボライブラリで割り当てるPINは、どのPINを指定しても可能でしょうか?
基本 GR-SAKURA と同じ筈なので、digitalWrite() できるピン(要は54以外)なら割り当て可能な筈です。
gr_common/core/pins_arduino.h の
302 _offset(PORT5), /* PIN_IO26(P52) */ 303 _offset(PORT5), /* PIN_IO27(P53) */ 304 _offset(PORT5), /* PIN_IO28(P54) */ 376 2, /* PIN_IO26(P52) */ 377 3, /* PIN_IO27(P53) */ 378 4, /* PIN_IO28(P54) */ 450 _BV(2), /* PIN_IO26(P52) */ 451 _BV(0), /* PIN_IO27(P60) */ 452 _BV(4), /* PIN_IO28(P54) */
451行目が多分間違ってます(それか303行目と377行目が間違い)。
CN17のピンがデジタルI/Oとして割り当てられてないようですが、もったいないので割り当てるべき。
GR-KAEDE の PIN_IO27 はやはり P53 が正しい模様。
/* GR-KAEDE Sketch Template V1.00 */ #include <Arduino.h> const int port = 5; const int bit = 3; void setup() { volatile uint8_t* pmr = portModeRegister(port); volatile uint8_t* pdr = portDirectionRegister(port); BCLR(pmr, bit); BSET(pdr, bit); } void loop() { volatile uint8_t* out = portOutputRegister(port); BSET(out, bit); delay(1000); BCLR(out, bit); delay(1000); }
gr_common/rx64m/iodefine.h の
22659 //64Mポ?EチE?E?E?E??E?E?E?ング
と
22726 //64Mポ?EチE?E?E?E??E?E?E?ング
の 2 行が文字化けしてるようです。
あと、
28811 #define SLIBXR128 ICU.SLIBXR128.BYTE // CMT2 CMI2 28812 #define SLIBXR129 ICU.SLIBXR129.BYTE // TPU2 TGI2A ~ 中略 ~ 28899 #define SLIBR206 ICU.SLIBR206.BYTE 28900 #define SLIBR207 ICU.SLIBR207.BYTE
構造体メンバ名(レジスタ名)でレジスタをマクロ定義するという変なことをされてますが、これに気が付かずに、例えば
ICU.SLIBXR128.BYTE = 0;
と書くとプリプロセッサに
ICU.ICU.SLIBXR128.BYTE.BYTE = 0;
と展開されるためコンパイルが通りません。
恐らくはソースの記述を短くすることを意図して行っていることと思いますが、ライブラリでそれを利用してる箇所が
gr_common/core/usb_hal.c 2060 SLIBXR137 = SLIBNO(USB0,USBI0);
gr_common/core/wiring.c 463 SLIBXR129 = SLIBNO(TPU2,TGI2A);
の 2 箇所しかなく大してメリットはないようであり、いたずらにユーザを混乱させるだけなのでやめていただきたい。
できれば修正していただきたい。
gr_common/core/WString.h:155: // character acccess acccess → access gr_common/lib/Ethernet/utility/T4_src/ip.c:203: if ((pip->ip_dst[0] & 0xf0) == 0xe0) /* multicast addresss */ addresss → address gr_common/core/usb_core.c:749: /*Interface descriptor is avalable through Configuration descriptor only.*/ gr_common/core/usb_core.c:751: /*Endpoint descriptor is avalable through Configuration descriptor only.*/ avalable → available gr_common/lib/LiquidCrystal/LiquidCrystal.cpp:99: // before sending commands. Arduino can turn on way befer 4.5V so we'll wait 50 befer → before gr_common/core/usb_cdc.c:97:/*Data Bufer for SET_CONTROL_LINE_STATE data*/ bufer → buffer gr_common/core/wiring.c:487: CMT1.CMCR.BIT.CMIE = 1; //compair match int. en. compair → compare gr_common/core/Stream.h:28:// compatability macros for testing compatability → compatibility gr_common/core/usb_hal.c:2020: /*Configire Pipes/Endpoints */ configire → configure gr_common/core/usb_hal.c:1430: /*Often commented as it slows it down coniderably.*/ coniderably → considerably gr_common/core/wiring_analog.c:213: // for consistenty with Wiring, which doesn't require a pinMode consistenty → consistently gr_common/core/usb_hal.c:1763: /*This is a conveniant point to tell user that USB is connected. */ conveniant → convenient gr_common/lib/EEPROM/utilities/r_flash_api_rx600.c:23:* Copyright (C) 2010(2011) Renesas Electronics Corpration corpration → corporation gr_common/lib/Servo/Servo.h:53: * If _useTimerX is defined then TimerX is a 16 bit timer on the curent board curent → current gr_common/rx64m/iodefine.h:82: * Modified 25 Sep 2014 by Yoshinobu Shishido : Append #defaine SLIBXR128~143/SLIB144~207,Selectble Interrupt B(CMT2, TPU2, USB0) #defaine → #define gr_common/lib/Ethernet/utility/driver/t4_driver.c:124:Functions (Use definiton function that called from T4 library) definiton → definition gr_common/lib/Ethernet/utility/driver/r_ether.c:796: /* Magic packet detecion mode */ detecion → detection gr_common/lib/SD/SD.cpp:402: // parent is now the parent diretory of the file! diretory → directory gr_common/lib/Ethernet/utility/driver/r_ether.c:160: * defined with section pragma directives to easly locate them easly → easily gr_common/lib/Ethernet/Ethernet.cpp:18:#define RING_SIZ (1<<10) /*exsample 1024 = 1<<10*/ exsample → example gr_common/lib/Firmata/Boards.h:99:Port Access Inline Funtions: funtions → functions gr_common/lib/SD/SD.cpp:28: and to create a directory heirarchy. gr_common/lib/SD/SD.cpp:291: bottom of the directory heirarchy. gr_common/lib/SD/SD.cpp:542: Makes a single directory or a heirarchy of directories. gr_common/lib/SD/SD.cpp:553: Remove a single directory or a heirarchy of directories. gr_common/lib/SD/SD.h:79: // Create the requested directory heirarchy--if intermediate directories heirarchy → hierarchy gr_common/lib/Ethernet/utility/T4_src/r_dhcp_client.c:343: case 54: // OPTION No.54 : Server Identiffer identiffer → identifer gr_common/lib/Ethernet/utility/T4_src/ether.c:96: * -5 : LAN controller stauts is 'ILLEAGAL' or need reset. gr_common/lib/Ethernet/utility/T4_src/ether.c:116: /* Illeagal len: discard the received data */ illeagal → illegal gr_common/lib/Ethernet/utility/driver/r_ether.h:78: * The value of flag and the situation which is indicatived of by the value. gr_common/lib/Ethernet/utility/driver/r_ether.h:85: * The flag which indicatived of the situation that the interrupt of Link Up/Down occur. gr_common/lib/Ethernet/utility/driver/r_ether.h:87: * The value of flag and the situation which is indicatived of by the value. gr_common/lib/Ethernet/utility/driver/r_ether.h:100: * The value of flag and the situation which is indicatived of by the value. indicatived → indicative gr_common/lib/SoftwareSerial/SoftwareSerial.cpp:289:#if _DEBUG // for scope: pulse pin as overflow indictator gr_common/lib/SoftwareSerial/SoftwareSerial.cpp:363:#if _DEBUG // for scope: pulse pin as overflow indictator indictator → indicator gr_common/core/usb_hal.c:236:/*HW Initalisation for USB 0 function*/ initalisation → initialisation gr_common/core/usb_hal.c:1991:* Description : Enable and Initiailise the USB perhipheral. initiailise → initialise gr_common/core/usb_core.c:30: Initilaises the HAL. gr_common/core/usb_core.h:30:* Initilaises the HAL. gr_common/core/usb_hal.c:253:* Description : Initilaises this USB HAL layer. initilaises → initialises gr_common/core/usb_cdc.c:752:* Description : Initilise this modules data. initilise → initialise gr_common/lib/Ethernet/utility/driver/t4_driver.c:330:Functions (Interrput handler) interrput → interrupt gr_common/core/usb_hal.c:1855: /*Send another packet (possibly zero legth)*/ gr_common/core/usb_hal.c:1867: /*Send another packet (possibly zero legth)*/ legth → length gr_common/lib/Ethernet/utility/T4_src/ether.c:475: /* 0 padding when the pakcet lenght is less than 60 byte */ lenght → length gr_common/lib/Stepper/Stepper.cpp:19: connects to only 2 microcontroler pins, inverts the signals received, gr_common/lib/Stepper/Stepper.h:19: connects to only 2 microcontroler pins, inverts the signals received, microcontroler → microcontroller gr_common/rx64m/hardware_setup.cpp:102: // Enable the PFSWE midification. midification → modification gr_common/lib/Servo/Servo.h:96:#define REFRESH_INTERVAL 20000 // minumim time to refresh servos in microseconds minumim → minimum gr_common/lib/Ethernet/utility/r_config/r_t4_rx_config.h:34: Now, T4 config file is "config_tcpudp.c". Please modefy "config_tcpudp.c" directly. modefy → modify gr_common/lib/Ethernet/utility/driver/r_ether_local.h:128: * modifed to support little endian CPU mode. modifed → modified gr_common/lib/Ethernet/Ethernet.cpp:891:/* mothing to do 20150527 review */ mothing → nothing gr_common/lib/Ethernet/utility/driver/r_ether.c:561: * isn't used for notifing the Link Up/Down to external device. gr_common/lib/Ethernet/utility/driver/r_ether.c:588: * isn't used for notifing the Link Up/Down to external device. notifing → notifying gr_common/core/usb_cdc.c:511:* Description : Callback saying that an error has occoured in a gr_common/core/usb_hal.c:260:* _fpError: Callback function, Error occoured. gr_common/core/usb_hal.c:1666:* Description : VBUS interrupt has occoured. occoured → occurred gr_common/core/usb_core.c:169:* a control data out occours for a setup packet gr_common/core/usb_core.c:174:* error occours. gr_common/core/usb_hal.c:2274:* the USB interrupt occours. occours → occurs gr_common/lib/Ethernet/utility/T4_src/ether.c:475: /* 0 padding when the pakcet lenght is less than 60 byte */ pakcet → packet gr_common/core/usb_hal.c:255:* Enables the USB perhipheral ready for enumeration. gr_common/core/usb_hal.c:1991:* Description : Enable and Initiailise the USB perhipheral. perhipheral → peripheral gr_common/core/Tone.cpp:27:0005 B Hagman 09/11/23 Scanned prescalars for best fit on 8 bit timers gr_common/core/Tone.cpp:151: // 8 bit timers will require changing prescalar values, gr_common/core/Tone.cpp:152: // whereas 16 bit timers are set to either ck/1 or ck/64 prescalar gr_common/core/Tone.cpp:246: uint8_t prescalarbits = 0b001; gr_common/core/Tone.cpp:258: // if we are using an 8 bit timer, scan through prescalars to find the best fit gr_common/core/Tone.cpp:262: prescalarbits = 0b001; // ck/1: same for both timers gr_common/core/Tone.cpp:266: prescalarbits = 0b010; // ck/8: same for both timers gr_common/core/Tone.cpp:271: prescalarbits = 0b011; gr_common/core/Tone.cpp:277: prescalarbits = _timer == 0 ? 0b011 : 0b100; gr_common/core/Tone.cpp:282: prescalarbits = 0b101; gr_common/core/Tone.cpp:288: prescalarbits = _timer == 0 ? 0b100 : 0b110; gr_common/core/Tone.cpp:293: prescalarbits = _timer == 0 ? 0b101 : 0b111; gr_common/core/Tone.cpp:302: TCCR0B = prescalarbits; gr_common/core/Tone.cpp:308: TCCR2B = prescalarbits; gr_common/core/Tone.cpp:321: prescalarbits = 0b001; gr_common/core/Tone.cpp:325: prescalarbits = 0b011; gr_common/core/Tone.cpp:331: TCCR1B = (TCCR1B & 0b11111000) | prescalarbits; gr_common/core/Tone.cpp:336: TCCR3B = (TCCR3B & 0b11111000) | prescalarbits; gr_common/core/Tone.cpp:340: TCCR4B = (TCCR4B & 0b11111000) | prescalarbits; gr_common/core/Tone.cpp:344: TCCR5B = (TCCR5B & 0b11111000) | prescalarbits; gr_common/core/Tone.cpp:246: uint8_t prescalarbits = 0b001; gr_common/core/Tone.cpp:262: prescalarbits = 0b001; // ck/1: same for both timers gr_common/core/Tone.cpp:266: prescalarbits = 0b010; // ck/8: same for both timers gr_common/core/Tone.cpp:271: prescalarbits = 0b011; gr_common/core/Tone.cpp:277: prescalarbits = _timer == 0 ? 0b011 : 0b100; gr_common/core/Tone.cpp:282: prescalarbits = 0b101; gr_common/core/Tone.cpp:288: prescalarbits = _timer == 0 ? 0b100 : 0b110; gr_common/core/Tone.cpp:293: prescalarbits = _timer == 0 ? 0b101 : 0b111; gr_common/core/Tone.cpp:302: TCCR0B = prescalarbits; gr_common/core/Tone.cpp:308: TCCR2B = prescalarbits; gr_common/core/Tone.cpp:321: prescalarbits = 0b001; gr_common/core/Tone.cpp:325: prescalarbits = 0b011; gr_common/core/Tone.cpp:331: TCCR1B = (TCCR1B & 0b11111000) | prescalarbits; gr_common/core/Tone.cpp:336: TCCR3B = (TCCR3B & 0b11111000) | prescalarbits; gr_common/core/Tone.cpp:340: TCCR4B = (TCCR4B & 0b11111000) | prescalarbits; gr_common/core/Tone.cpp:344: TCCR5B = (TCCR5B & 0b11111000) | prescalarbits; gr_common/core/Tone.cpp:27:0005 B Hagman 09/11/23 Scanned prescalars for best fit on 8 bit timers gr_common/core/Tone.cpp:258: // if we are using an 8 bit timer, scan through prescalars to find the best fit prescalar → prescaler gr_common/lib/Ethernet/utility/driver/r_ether.c:578: /* no proccess */ gr_common/lib/Ethernet/utility/driver/r_ether.c:602: /* no proccess */ gr_common/lib/Ethernet/utility/driver/r_ether.c:607: /* no proccess */ gr_common/lib/Ethernet/utility/T4_src/r_dns_client.h:97: DNS_PROC_NUM /* the number of proccess */ proccess → process gr_common/lib/Ethernet/utility/driver/r_ether.c:105: * Private global function prototyes prototyes → prototypes gr_common/lib/Ethernet/Ethernet.cpp:127: if(count < 2){ /*can not record any more DATA SIZE QUE*/ gr_common/lib/Ethernet/Ethernet.cpp:129: Serial.print("<T4:t4_udp_callback:dataSizeQue:can not record any more DATA SIZE QUE>"); gr_common/lib/Ethernet/Ethernet.cpp:140: if(count < recvSiz.dword){ /*can not record any more UDP PACKET SIZE QUE*/ gr_common/lib/Ethernet/Ethernet.cpp:142: Serial.print("<T4:t4_udp_callback:UDP PACKET Que:can not record any more UDP PACKET SIZE QUE>"); gr_common/lib/Ethernet/Ethernet.cpp:149: Serial.print(""); gr_common/lib/Ethernet/Ethernet.cpp:154: Serial.print(""); gr_common/lib/Ethernet/Ethernet.cpp:159: for (i=0; i<recvSiz.dword; i++){ /*ring buffer que_ing*/ gr_common/lib/Ethernet/Ethernet.cpp:1106: byteq_err = R_BYTEQ_Get(hdl_forSize, &recvSiz.byte[1]); /*que size upper read*/ gr_common/lib/Ethernet/Ethernet.cpp:1109: Serial.print("T4:EthUDP:parsePacket:R_BYTEQ_Get(que_size_upper)="); gr_common/lib/Ethernet/Ethernet.cpp:1114: byteq_err = R_BYTEQ_Get(hdl_forSize, &recvSiz.byte[0]); /*que size lower read*/ gr_common/lib/Ethernet/Ethernet.cpp:1117: Serial.print("T4:EthUDP:parsePacket:R_BYTEQ_Get(que_size_lower)="); gr_common/lib/Ethernet/utility/T4_src/ip.h:74:#define _ICMPV6_GRP_QUE (130) que → queue gr_common/lib/Ethernet/Ethernet.cpp:752: Serial.println("DNS_PROC_RECEIVEING_REQUEST_WAIT"); gr_common/lib/Ethernet/utility/T4_src/r_dns_client.c:146: /* E.wait to complete receiveing request*/ gr_common/lib/Ethernet/utility/T4_src/r_dns_client.c:264: dns_mng.proc = DNS_PROC_RECEIVEING_REQUEST_WAIT; /* proc <- e="" wait="" to="" complete="" receiveing="" request="" gr_common="" lib="" ethernet="" utility="" t4_src="" r_dns_client="" h:92:="" dns_proc_receiveing_request_wait="" receiving="" c:545:="" if="" 0="" parblk="" completed="" receving="" ether="" c:406:="" regist="" the="" new="" entry="" arp="" table="" register="" cpp:15:static="" t_ipv4ep="" g_remoteipv4ep="" remort="" host="" ip="" port="" remote="" c:527:="" is="" already="" exist="" but="" not="" resoleved="" c:585:="" do="" use="" maxretry="" when="" resolved="" h:65:typedef="" struct="" dns_resouce_record_structure="" h:75:="" dns_resouce_record="" h:82:="" resouce_record="" resouce="" resource="" cpp:146:="" recvsiz="" dword=""> 0){ /*reveive success*/ reveive → receive gr_common/lib/Ethernet/utility/r_config/r_t4_http_server_rx_config.h:50:// 1: displays index page, 0: serches default_file_name gr_common/lib/Ethernet/utility/r_config/r_t4_http_server_rx_config.h:53:// If indexes == 0, HTTPd serches index.htm in specified directory. serches → searches gr_common/lib/Servo/Servo.h:27: The sequence used to sieze timers is defined in timers.h sieze → seize? gr_common/core/usb_hal.c:1232: read somne data.*/ somne → some gr_common/core/wiring_digital.c:189:// - changed to a switch statment; added 32 bytes but much easier to read and maintain. statment → statement gr_common/lib/Ethernet/utility/T4_src/ether.c:96: * -5 : LAN controller stauts is 'ILLEAGAL' or need reset. stauts → status gr_common/core/WString.h:98: // concatenation is considered unsucessful. gr_common/lib/LiquidCrystal/LiquidCrystal.cpp:263: return 1; // assume sucess sucess → success gr_common/lib/Ethernet/utility/T4_src/tcp.c:159: _ptcb->rtchk_cnt = 0; // timeer count for re-transmit timeer → timer gr_common/core/HardwareSerial.cpp:513: // the hardware finished tranmission (TXC is set). tranmission → transmission gr_common/core/usb_cdc.c:205:* Blocks untill string has been written or error. gr_common/core/usb_cdc.c:279: /*This can not complete untill connected*/ gr_common/core/usb_cdc.c:328: /*This can not complete untill connected*/ gr_common/core/usb_hal.c:1281: /* Write data to the IN Fifo untill have written a full packet gr_common/core/usb_hal.c:1385: /* Write data to the IN Fifo untill have written a full packet gr_common/core/usb_hal.c:1524: /* Write data to the IN Fifo untill have written a full packet untill → until
ありがとうございます。んー、etherとusb開発者が多い!?e2studioを使っていれば大体スペルチェックが入るはずなんですけどね。、と自分チェックを棚に上げてすみませんがご指摘箇所修正します。
> e2studioを使っていれば大体スペルチェックが入るはずなんですけどね。
なんとそんな機能があったとは。要らん骨折ったな…。
SAKURA と KAEDE でライブラリが現状 fork してますが、統合はされないんでしょうか?
これからWebコンパイラにアップするE1.10では、下記対応をしたいと思います。すみませんが一部そのままでいきます。多分画処理ミドルで色々要望をいただくと思いますので、反映するときに検討させていただきます。
・O2オプションがない。
→修正付加すると、JPEGエンコードが正常に動作しないため、一旦付加してE1.10を出します。
・NUM_DIGITAL_PINSは67とすべき
→修正
・-DDEBUGをやめて欲しい
→削除
・_BV(0), /* PIN_IO27(P60) */が間違っている
・iodefine.hの文字化け
→すみませんが、原文分からないためRX64Mだけ残します。
・選択型割り込みのレジスタ(例SLIBXR128)のマクロ定義で混乱生みそう。
→変更後の動作確認含めて今後検討します。
・多箇所のスペルミス
→今後正式バージョンで対応します。
細かい事ですが、このページのLEDのピンマップと、
gadget.renesas.com/.../kaede.html
実際の対応が、並びが逆になっていませんか?
ライブラリで定義されてるピン番号の対応では上から
PIN_LED0 PIN_LED1 PIN_LED2 PIN_LED3
となっており、基板のシルクは上から
LED1 LED2 LED3 LED4
となってますね。GR-SAKURA もこの辺ずれてた気がします。