古いmbedのドライバーは約700バイトまでしかサポートしていなかった。
v29より1500バイトをサポートする。
extern "C" void mbed_reset(); mbed_reset();
NVIC_SystemReset();
シリアルターミナルからはbreakを送る([Alt]+[B])
Eagle CAD のデータなどが公開されている。
USBインターフェースの部分はないが、LPC Xpresso等からJTAG書き込みをすれば同じように使える。
EthernetのPHYチップから出力されているリンクとリンク速度のLED用端子は、LPC1768の P1_25 P1_26 にそれぞれ接続されている。
DigitalIn link(P1_25);
DigitalIn speed(P1_26);
EthernetNetIf *eth;
eth = new EthernetNetIf;
or
eth = new EthernetNetIf(ipaddr, netmask, gateway, nameserver);
eth->setup();
__disable_irq();
__enable_irq();
ファイルのタイムスタンプが最新の .bin ファイルが実行される。
最後に書き込んだファイルか、またはタイムスタンプを更新すればいい。(UNIX or Macなら touch コマンド)
BSDでもmountできます。
リトルエンディアンか、ビッグエンディアンか確認した。
// http://ja.wikipedia.org/wiki/%E3%82%A8%E3%83%B3%E3%83%87%E3%82%A3%E3%82%A2%E3%83%B3
#include "mbed.h"
union tag_uEndian {
int in; /* 4Byte */
unsigned short sh[2]; /* 2Byte×2 */
unsigned char ch[4]; /* 1Byte×4 */
};
int main() {
union tag_uEndian En;
En.in = 0x12345678;
printf("INPUT is 0x%x\n",En.in);
printf("short is 0x%x, 0x%x\n",En.sh[0],En.sh[1]);
printf(" char is 0x%x, 0x%x, 0x%x, 0x%x\n",En.ch[0],En.ch[1],En.ch[2],En.ch[3]);
return 0;
}
結果、リトルエンディアンだった。
INPUT is 0x12345678 short is 0x5678, 0x1234 char is 0x78, 0x56, 0x34, 0x12
ARMの「RVCT 3.1 Build Tools - Errors and Warnings」に、エラーやワーニングに対する解決指南が書かれている。
デフォルトではPOSTデータが Content-type: text/html になっており、サーバ側でPOSTデータとして扱われない。
application/x-www-form-urlencoded と指定する。
#include "HTTPClient.h"
:
HTTPClient http;
HTTPText data("application/x-www-form-urlencoded");
:
data.puts("key=val&key=val...");
:
http.post(URI, data, NULL);
:
Please login to post comments.