首頁 > 評(píng)測(cè) > ARM中的R,一款Cortex R內(nèi)核開發(fā)板:三星ARTIK 055開發(fā)體驗(yàn)
ARM中的R,一款Cortex R內(nèi)核開發(fā)板:三星ARTIK 055開發(fā)體驗(yàn)
- [導(dǎo)讀]
- 三星公司的Exynos系列處理器針對(duì)IoT市場(chǎng)目前推出了兩款: Exynos i S111, Exynos i T200. S111是針對(duì)NB-IoT市場(chǎng)的, T200即本文評(píng)測(cè)的這款針對(duì)WiFi市場(chǎng). 就T200而言, 無論是開發(fā)工具, 還是配套SDK的完善度, 都是比較優(yōu)秀的. 但是缺點(diǎn)是來的太遲了, T200這款芯片可以大約對(duì)標(biāo)樂鑫的ESP32.
Contact your local distributor for more details on DS-5.
除了上述原因之外, T200的開發(fā)還涉及到SDK的問題. 目前這個(gè)SDK包含了TizenRT操作系統(tǒng)與一大堆的中間件. 三星公司使用arm-none-eabi-gcc作為編譯器, 一來是GCC系列對(duì)于類POSIX系統(tǒng)(TizenRT基于Nuttx系統(tǒng), 是一個(gè)類POSIX的操作系統(tǒng))的支持比ARM公司的工具要好, 二來也是個(gè)開源(也意味著免費(fèi))的方案.
圖 TizenRT操作系統(tǒng)的框圖
表 整個(gè)軟件架構(gòu)包含的中間件/驅(qū)動(dòng)列表
Demo1: cJSON測(cè)試
開發(fā)第一個(gè)自定義的應(yīng)用: cJSON測(cè)試. cJSON是個(gè)輕量級(jí)的json庫. 這種庫用于Cortex R系列的內(nèi)核上非常合適. cJSON的官方git地址: https://github.com/DaveGamble/cJSON
clone或者下載下來, 將源代碼置于ARTIK工程的源代碼目錄下. 只需要這四個(gè)文件:
cJSON.c cJSON.h cJSON_Utils.c cJSON_Utils.h
不需要任何改動(dòng), 在要使用cJSON的文件中包含"cJSON.h"即可開始使用這個(gè)庫.
測(cè)試代碼也是從官方的測(cè)試用例中摳出來的:
typedef struct str_poi_record
{
const char *precision;
double lat;
double lon;
const char *address;
const char *city;
const char *state;
const char *zip;
const char *country;
}poi_record;
/* Our "days of the week" array: */
const char *str_weekdays[7] =
{
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
};
/* Our matrix: */
const int numbers[3][3] =
{
{0, -1, 0},
{1, 0, 0},
{0 ,0, 1}
};
/* Our "gallery" item: */
const int ids[4] = { 116, 943, 234, 38793 };
/* Our array of "records": */
const poi_record fields[2] =
{
{
"zip",
37.7668,
-1.223959e+2,
"",
"SAN FRANCISCO",
"CA",
"94107",
"US"
},
{
"zip",
37.371991,
-1.22026e+2,
"",
"SUNNYVALE",
"CA",
"94085",
"US"
}
};
/* Create a bunch of objects as demonstration. */
static int print_preallocated(cJSON *root)
{
/* declarations */
char *out = NULL;
char *buf = NULL;
char *buf_fail = NULL;
size_t len = 0;
size_t len_fail = 0;
/* formatted print */
out = cJSON_Print(root);
/* create buffer to succeed */
/* the extra 5 bytes are because of inaccuracies when reserving memory */
len = strlen(out) + 5;
buf = (char*)malloc(len);
if (buf == NULL)
{
printf("Failed to allocate memory.\n");
exit(1);
}
/* create buffer to fail */
len_fail = strlen(out);
buf_fail = (char*)malloc(len_fail);
if (buf_fail == NULL)
{
printf("Failed to allocate memory.\n");
exit(1);
}
/* Print to buffer */
if (!cJSON_PrintPreallocated(root, buf, (int)len, 1)) {
printf("cJSON_PrintPreallocated failed!\n");
if (strcmp(out, buf) != 0) {
printf("cJSON_PrintPreallocated not the same as cJSON_Print!\n");
printf("cJSON_Print result:\n%s\n", out);
printf("cJSON_PrintPreallocated result:\n%s\n", buf);
}
free(out);
free(buf_fail);
free(buf);
return -1;
}
/* success */
printf("%s\n", buf);
/* force it to fail */
if (cJSON_PrintPreallocated(root, buf_fail, (int)len_fail, 1)) {
printf("cJSON_PrintPreallocated failed to show error with insufficient memory!\n");
printf("cJSON_Print result:\n%s\n", out);
printf("cJSON_PrintPreallocated result:\n%s\n", buf_fail);
free(out);
free(buf_fail);
free(buf);
return -1;
}
free(out);
free(buf_fail);
free(buf);
return 0;
}
/* Create a bunch of objects as demonstration. */
static void create_objects(void)
{
/* declare a few. */
cJSON *root = NULL;
cJSON *fmt = NULL;
cJSON *img = NULL;
cJSON *thm = NULL;
cJSON *fld = NULL;
- 本文系21ic原創(chuàng),未經(jīng)許可禁止轉(zhuǎn)載!
網(wǎng)友評(píng)論
- 聯(lián)系人:巧克力娃娃
- 郵箱:board@21ic.com
- 我要投稿
-
歡迎入駐,開放投稿
- NRF52810藍(lán)牙數(shù)字耳機(jī)找人定制
預(yù)算:¥30005天前
- 125KW模塊式PCS軟硬件外包開發(fā)
預(yù)算:¥1100000015小時(shí)前
- 12V汽車啟動(dòng)電源項(xiàng)目BMS設(shè)計(jì)
預(yù)算:¥50000023小時(shí)前
- 數(shù)據(jù)可視化軟件 開發(fā)
預(yù)算:¥5000023小時(shí)前
- PLC項(xiàng)目調(diào)試修改
預(yù)算:¥100001天前
- 起動(dòng)電機(jī)控制器開發(fā)
預(yù)算:¥1100001天前