官网的地址

https://xradiotech-developer-guide.readthedocs.io/zh/latest/zh_CN/get-started/

Windows平台搭建

1. 安装Cygwin工具

  • 从Cygwin官方网站下载Cygwin终端setup-x86.exe
  • 运行setup-x86.exe安装Cygwin工具包(注意:安装路径不要包含中文路径或者空格
  • 在安装包选项选择想要安装的工具包(cmake, git, wget, binutils, python, python-pip, zip, unzip, vim等)

Cygwin官方网站:

https://www.cygwin.com/

下载  setup-x86_64.exe

重新安装

再三安装

安装教程请参考

https://blog.csdn.net/chunleixiahe/article/details/55666792

下载 Toolchain: gcc-arm-none-eabi-4_9-2015q2

Windows 版本
https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q2-update/+download/gcc-arm-none-eabi-4_9-2015q2-2
0150609-win32.zip

将 “ gcc-arm-none-eabi-4_9-2015q2-20150609-win32.zip ” 解 压 至 Cygwin 的
“~/tools/gcc-arm-none-eabi-4_9-2015q2” 目录(若“tools” 目录不存在, 则需先创建)。

我存放的地址是

C:\cygwin64\home\xradiotech\tools\gcc-arm-none-eabi-4_9-2015q2

以上操作完成 Windows 环境下 Toolchain 的安装, 且 Toolchain 安装目录与“[sdk]/gcc.mk” 中的“CC_DIR”
变量一致([sdk]表示 SDK 根目录)。
CC_DIR = ~/tools/gcc-arm-none-eabi-4_9-2015q2/bin

鉴于自己的安装目录,需要设置的环境变量如下图所示:

下载SDK

git clone https://github.com/XradioTech/xradio-skylark-sdk.git

我存放的地址是

C:\cygwin64\home\xradiotech\xradio-skylark-sdk

打开Cygwin64 Terminal

进入~/xradiotech/xradio-skylark-sdk/project/foo/gcc

输入 make config

进行芯片选择和晶振配置

make config 1) 执行 SDK 基础配置(根据提示, 进行芯片型号、 高频晶振等配置选择), 该
配置对所有工程生效。 如果需要更改 SDK 基础配置, 可再次执行此命令。
2) 正确执行该命令后, 将在 SDK 根目录下生成“.config” 文件。
3) 必须执行该命令后才可以执行其他编译命令。

编译和镜像创建的命令是:

make build

编译出错如下:

c:/cygwin64/home/tools/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/softfp\libc_nano.a(lib_a-abort.o): In function `abort':
abort.c:(.text.abort+0xa): undefined reference to `_exit'
c:/cygwin64/home/tools/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/softfp\libc_nano.a(lib_a-signalr.o): In function `_kill_r':
signalr.c:(.text._kill_r+0xe): undefined reference to `_kill'
c:/cygwin64/home/tools/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/softfp\libc_nano.a(lib_a-signalr.o): In function `_getpid_r':
signalr.c:(.text._getpid_r+0x0): undefined reference to `_getpid'
collect2.exe: error: ld returned 1 exit status
make: *** [../../../project/project.mk:293:foo.axf] 错误 1

没有找到相关的函数,自己写一个头文件syscalls.h放到工程目录下(和main.c在同一个路径下)

#ifndef SYSCALLS_H
#define SYSCALLS_H

/****************************************************************************

Copyright (c) 2009-2012 by Michael Fischer. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
Neither the name of the author nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
History:
28.03.2009 mifi First Version, based on the original syscall.c from
               newlib version 1.17.0
03.06.2012 mifi Changed _write_r and _sbrk_r. Added __putchar and use
               __HeapLimit to check end of heap.
02.02.2013 nifi Added _exit, _kill and _getpid.
****************************************************************************/

#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>

extern void __putchar (char ch);

/***************************************************************************/

/*int _read_r (struct _reent *r, int file, char * ptr, int len)
{
r = r;
file = file;
ptr = ptr;
len = len;

errno = EINVAL;
return -1;
}
*/
/*************************************************************************/

int _lseek_r (struct _reent *r, int file, int ptr, int dir)
{
r = r;
file = file;
ptr = ptr;
dir = dir;

return 0;
}
/*************************************************************************/

int _write_r (struct _reent *r, int file, char * ptr, int len)
{
r = r;
file = file;
ptr = ptr;

#if 0
int index;

/* For example, output string by UART */
 for(index=0; index<len; index++)
{
if (ptr[index] == '\n')
{
__putchar('\r');
}

__putchar(ptr[index]);
}
#endif

return len;
}

/**************************************************************************/

int _close_r (struct _reent *r, int file)
{
return 0;
}

/***************************************************************************/

/***************************************************************************/

int _fstat_r (struct _reent *r, int file, struct stat * st)
{
r = r;
file = file;

memset (st, 0, sizeof (* st));
st->st_mode = S_IFCHR;
return 0;
}

/***************************************************************************/

int _isatty_r (struct _reent *r, int fd)
{
r = r;
fd = fd;

return 1;
}

/***************************************************************************/

void _exit (int a)
{
a = a;

while(1) {};
}

/***************************************************************************/

int _kill (int a, int b)
{
a = a;
b = b;

return 0;
}

/***************************************************************************/

int _getpid(int a)
{
a = a;

return 0;
}

/*** EOF ***/

#endif /* SYSCALLS_H */

需要在main.c里调用此头文件,最后编译通过!如下所示:

c:/cygwin64/home/tools/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: warning: ../../../lib\libchip.a(hal_board.o) uses 32-bit enums yet the output is to use variable-size enums; use of enum values across objects may fail
c:/cygwin64/home/tools/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: warning: ../../../lib\libchip.a(hal_ccm.o) uses 32-bit enums yet the output is to use variable-size enums; use of enum values across objects may fail
~/tools/gcc-arm-none-eabi-4_9-2015q2/bin/arm-none-eabi-objcopy -O binary -R .xip   foo.axf foo.bin
~/tools/gcc-arm-none-eabi-4_9-2015q2/bin/arm-none-eabi-objcopy -O binary -j .xip foo.axf foo_xip.bin
~/tools/gcc-arm-none-eabi-4_9-2015q2/bin/arm-none-eabi-size foo.axf
   text    data     bss     dec     hex filename
 468924    2464   62716  534104   82658 foo.axf
cp foo.bin ../image/xr872/app.bin
cp foo_xip.bin ../image/xr872/app_xip.bin
cp -t ../image/xr872 ../../../bin/xradio_v2/boot/xr872/boot_40M.bin ../../../bin/xradio_v2/wlan_bl.bin ../../../bin/xradio_v2/wlan_fw.bin ../../../bin/xradio_v2/wlan_sdd_40M.bin
cd ../image/xr872 && \
chmod a+r *.bin && \
~/tools/gcc-arm-none-eabi-4_9-2015q2/bin/arm-none-eabi-gcc -E -P -CC -D__CONFIG_CHIP_XR872 -D__CONFIG_CHIP_ARCH_VER=2 -D__CONFIG_ARCH_APP_CORE -D__CONFIG_CPU_CM4F -D__CONFIG_HOSC_TYPE=40 -D__CONFIG_LIBC_REDEFINE_GCC_INT32_TYPE -D__CONFIG_LIBC_PRINTF_FLOAT -D__CONFIG_LIBC_SCANF_FLOAT -D__CONFIG_LIBC_WRAP_STDIO -D__CONFIG_MALLOC_USE_STDLIB -D__CONFIG_OS_FREERTOS -D__CONFIG_LWIP_V1 -D__CONFIG_MBEDTLS_VER=0x02100000 -D__CONFIG_MBUF_IMPL_MODE=0 -D__CONFIG_WLAN -D__CONFIG_WLAN_STA -D__CONFIG_WLAN_AP -D__CONFIG_WLAN_MONITOR -D__CONFIG_WIFI_CERTIFIED -D__CONFIG_XIP -D__CONFIG_SECTION_ATTRIBUTE_XIP -D__CONFIG_SECTION_ATTRIBUTE_NONXIP -D__CONFIG_SECTION_ATTRIBUTE_SRAM -D__CONFIG_ROM -D__CONFIG_ROM_FREERTOS -D__CONFIG_ROM_XZ -D__CONFIG_PM -D__CONFIG_OTA -D__CONFIG_OTA_POLICY=0x00 -D__CONFIG_CACHE_POLICY=0x02 -D__CONFIG_MBUF_HEAP_MODE=0 -D__CONFIG_MBEDTLS_HEAP_MODE=0 -D__CONFIG_HTTPC_HEAP_MODE=0 -D__CONFIG_MQTT_HEAP_MODE=0 -D__CONFIG_NOPOLL_HEAP_MODE=0 -D__CONFIG_WPA_HEAP_MODE=0 -D__CONFIG_UMAC_HEAP_MODE=0 -D__CONFIG_LMAC_HEAP_MODE=0 -D__CONFIG_CEDARX_HEAP_MODE=0 -D__CONFIG_AUDIO_HEAP_MODE=0 -D__CONFIG_CODEC_HEAP_MODE=0  -o .image.cfg - < ./image.cfg && \
true && \
../../../../tools/mkimage.exe -O -c .image.cfg -o xr_system.img
cfg string:
{
    "magic" : "AWIH",
    "version" : "0.4",
    "OTA" : {"addr": "1024K", "size": "4K"},
    "image" : {"max_size": "1020K"},
    "count" : 6,
    "section" :
    [
        {"id": "0xa5ff5a00", "bin": "boot_40M.bin", "cert": "null", "flash_offs": "0K", "sram_offs": "0x00268000", "ep": "0x00268101", "attr": "0x1"},
        {"id": "0xa5fe5a01", "bin": "app.bin", "cert": "null", "flash_offs": "32K", "sram_offs": "0x00201000", "ep": "0x00201101", "attr": "0x1"},
        {"id": "0xa5fd5a02", "bin": "app_xip.bin", "cert": "null", "flash_offs": "80K", "sram_offs": "0xffffffff", "ep": "0xffffffff", "attr": "0x2"},
        {"id": "0xa5fa5a05", "bin": "wlan_bl.bin", "cert": "null", "flash_offs": "980K", "sram_offs": "0xffffffff", "ep": "0xffffffff", "attr": "0x1"},
        {"id": "0xa5f95a06", "bin": "wlan_fw.bin", "cert": "null", "flash_offs": "990K", "sram_offs": "0xffffffff", "ep": "0xffffffff", "attr": "0x1"},
        {"id": "0xa5f85a07", "bin": "wlan_sdd_40M.bin", "cert": "null", "flash_offs": "1016K", "sram_offs": "0xffffffff", "ep": "0xffffffff", "attr": "0x1"},
        {}
    ]
}

generate image: xr_system.img

生成镜像文件后就可以进行烧写了,烧写工具phoenixMC.exe在

C:\cygwin64\home\xradiotech\xradio-skylark-sdk\tools

按着BOOT按键上电就进入了升级模式里。

芯之联 XR872 快速入门相关推荐

  1. SpringBoot快速入门(IDEA联网版)

    SpringBoot快速入门 目录 SpringBoot快速入门 @[TOC](目录) SpringBoo介绍 1.新建空项目 2.查看maven版本 3.创建新模块 4.springboot联网功能 ...

  2. 一文快速入门分库分表中间件 Sharding-JDBC (必修课)

    书接上文 <一文快速入门分库分表(必修课)>,这篇拖了好长的时间,本来计划在一周前就该写完的,结果家庭内部突然人事调整,领导层进行权利交接,随之宣布我正式当爹,紧接着家庭地位滑落至第三名, ...

  3. HTML/CSS快速入门

    Web概念 JavaWeb 使用java语言开发基于互联网的项目 软件架构 C/S架构:Client/Server 客户端/服务器 用户本地有一个客户端程序,在远程有一个服务端程序 如QQ,英雄联盟. ...

  4. Python3快速入门(五)——Python3函数

    Python3快速入门(五)--Python3函数 一.函数定义 1.函数定义 Python 定义函数使用 def 关键字,一般格式如下: def function_name(parameter_li ...

  5. Thymeleaf 3 – Thymeleaf 3和Spring MVC快速入门

    Thymeleaf 3发布到达. 新版本带来了许多新功能,例如HTML5支持以及不带标记的文本模板支持– [# th:utext="${thymeleaf.version}" /] ...

  6. Dash的快速入门将使您在5分钟内进入“ Hello World”

    by Anuj Pahade 由Anuj Pahade Dash的快速入门将使您在5分钟内进入" Hello World" (This quick intro to Dash wi ...

  7. 不会几个框架,都不好意思说搞过前端: Vue.js - 60分钟快速入门

    Vue.js--60分钟快速入门 Vue.js是当下很火的一个JavaScript MVVM库,它是以数据驱动和组件化的思想构建的.相比于Angular.js,Vue.js提供了更加简洁.更易于理解的 ...

  8. python notebook软件_Jupyter notebook快速入门教程(推荐)

    本文主要介绍了Jupyter notebook快速入门教程,分享给大家,具体如下: 本篇将给大家介绍一款超级好用的工具:Jupyter notebook. 为什么要介绍这款工具呢? 如果你想使用Pyt ...

  9. [.net 面向对象程序设计进阶] (2) 正则表达式 (一) 快速入门

    [.net 面向对象程序设计进阶] (2) 正则表达式 (一) 快速入门 1. 什么是正则表达式? 1.1 正则表达式概念 正则表达式,又称正则表示法,英文名:Regular Expression(简 ...

最新文章

  1. 在Ubuntu18.04上安装opencv 3.4.1
  2. C#线程调用带参数的方法 ~
  3. Reflection in .net
  4. java 解析xls 文件_java简单解析xls文件的方法示例【读取和写入】
  5. linux 安装 mysql off,linux下安装mysql
  6. 方向盘左右能摇动_金澳小贴士——通过方向盘,竟能看出这些汽车故障!
  7. nvidia-smi 显示无进程,但GPU显存被占用
  8. 每天Leetcode 刷题 初级算法篇-数学问题-计数质数
  9. 我为什么要使用Webpack?
  10. Android移动开发基础案例教程 第3章 Activity
  11. php手机号最新正则表达式,最新手机号码正则表达式
  12. ArcGIS 在线地图加载插件介绍
  13. 算法题目打卡:Ques20201012
  14. 【洛谷】P3537 [POI2012]SZA-Cloakroom
  15. Oracle函数——字符函数
  16. 用文本挖掘回顾2017年的一些人与事
  17. 专访《王者荣耀》团队 附天美L1工作室照片
  18. LeetCode数据库题目汇总一(附答案)
  19. h5引入json_H5页面内使用JSON动画
  20. dvwa中的xss(跨站脚本)攻击

热门文章

  1. jQuery遍历页面中的标签
  2. 天津web前端培训:一个过来人告诉你如何轻松学习web
  3. 从零开始学版图(二)-----------差分放大电路
  4. 产品思考 - 程序猿实际上性价比比较低
  5. 学习3D游戏建模需要英语很好吗?
  6. linux6.5多网卡激活,Centos 6.5双网卡bond绑定教程
  7. ubuntu16.10开启telnet办法
  8. 心灵战争服务器维护,心灵战争8.3服务器开启公告说明
  9. 建立Windows下面的syslog日志服务器
  10. syslog 华为 服务器_LINUX 操作记录到syslog,并发送到syslog服务器上