0%

为Atmel-SAM4S-Xplained-Pro编译安装NuttX系统

编译Nuttx

Atmel SAM4S Xplained Pro

简介

  • Core

    • ARM Cortex-M4 with 2 Kbytes of cache running at up to 120 MHz
    • Memory Protection Unit (MPU)
    • DSP Instruction Set
    • Thumb ® -2 instruction set
  • Memories

    • Up to 2048 Kbytes embedded Flash with optional dual-bank and cache memory, ECC, Security Bit and Lock Bits
    • Up to 160 Kbytes embedded SRAM
    • 16 Kbytes ROM with embedded boot loader routines (UART, USB) and IAP routines
    • 8-bit Static Memory Controller (SMC): SRAM, PSRAM, NOR and NAND Flash support
  • 同步nuttxnuttx-apps两个源代码,它们两个平级目录.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    ~$ git clone https://github.com/apache/incubator-nuttx nuttx
    ~$ git clone https://github.com/apache/incubator-nuttx-apps.git apps

    ~$ cd nuttx
    # 列出所有支持板子.
    ~$ tools/configure.sh -L | grep "sam"
    ~$ tools/configure.sh -l sam4s-xplained-pro:nsh
    ~$ cp boards/arm/sam34/sam4s-xplained-pro/configs/nsh/defconfig .config
    ~$ cp boards/arm/sam34/sam4s-xplained-pro/scripts/Make.defs .

    # 这里使用一个 第三方的工具链(gcc-arm-none-eabi-6-2017-q2-update) arm-none-eabi- 也可以编译成功.选择 CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y


    ~$ export PATH=/fullpath/gcc-arm-none-eabi-6-2017-q2-update/bin:$PATH
    ~$ make CROSSDEV=arm-none-eabi-

    # 查看交㕚工具链支持的CPU特性.
    ~$ arm-none-eabi-g++ -print-multi-lib
    .;
    thumb;@mthumb
    fpu;@mfloat-abi=hard
    armv6-m;@mthumb@march=armv6s-m
    armv7-m;@mthumb@march=armv7-m
    armv7e-m;@mthumb@march=armv7e-m
    armv7-ar/thumb;@mthumb@march=armv7
    cortex-m7;@mthumb@mcpu=cortex-m7
    armv7e-m/softfp;@mthumb@march=armv7e-m@mfloat-abi=softfp@mfpu=fpv4-sp-d16
    armv7e-m/fpu;@mthumb@march=armv7e-m@mfloat-abi=hard@mfpu=fpv4-sp-d16
    armv7-ar/thumb/softfp;@mthumb@march=armv7@mfloat-abi=softfp@mfpu=vfpv3-d16
    armv7-ar/thumb/fpu;@mthumb@march=armv7@mfloat-abi=hard@mfpu=vfpv3-d16
    cortex-m7/softfp/fpv5-sp-d16;@mthumb@mcpu=cortex-m7@mfloat-abi=softfp@mfpu=fpv5-sp-d16
    cortex-m7/softfp/fpv5-d16;@mthumb@mcpu=cortex-m7@mfloat-abi=softfp@mfpu=fpv5-d16
    cortex-m7/fpu/fpv5-sp-d16;@mthumb@mcpu=cortex-m7@mfloat-abi=hard@mfpu=fpv5-sp-d16
    cortex-m7/fpu/fpv5-d16;@mthumb@mcpu=cortex-m7@mfloat-abi=hard@mfpu=fpv5-d16

  • 下面错误,可以打开源码位置,注释掉它.

1
2
3
4
arch/arm/src/imxrt/Kconfig:1114: syntax error
arch/arm/src/imxrt/Kconfig:1113: invalid option
make: *** [tools/Makefile.unix:471: olddefconfig] Error 1
ERROR: failed to refresh

使用BuildRoot构建指交叉工具链

  • buildroot nuttx
  • 这里是使用NuttX提供的修改后的BuildRoot版本.通过buildroot编译出一个特殊版本的交叉工具链,再用它去编译出最终的nuttx系统镜像.buildroot的源码目录与nuttx,nuttx-apps也是平级的目录.在实践过程中开启了BR2_GCC_CORTEX_M4F_SP导致下面的DBUG里出错的原因.也就是说Atmel SAM4S Xplained Procortex-m4内核,但是它不带FPU,强选FPU肯定是出错的,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
~$ git clone https://bitbucket.org/nuttx/buildroot.git buildroot
~$ cp configs/cortexm4f-eabi-defconfig-4.7.4 .config
# 配置一个合适的版本,这里是:binutils-2.26.1 ,gcc-4.7.4,gdb-8.0.1,因为是cortexm4f-eabi-defconfig-4.7.4,所以这里选择gcc-4.7.4
# 在nuttx配置时,选择 CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y,使用第三方如上面是选择 CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y
~$ make menuconfig
~$ make
# 这里最终的配置是如下:
~$ grep -v '^$\|^#' .config
BR2_HAVE_DOT_CONFIG=y
BR2_arm=y
BR2_cortex_m3=y
BR2_GCC_CORTEX=y
BR2_ARM_EABI=y
BR2_ARCH="arm"
BR2_GCC_TARGET_TUNE="cortex-m3"
BR2_GCC_TARGET_ARCH="armv7-m"
BR2_GCC_TARGET_ABI="aapcs-linux"
BR2_WGET="wget --passive-ftp"
BR2_SVN="svn co"
BR2_ZCAT="zcat"
BR2_BZCAT="bzcat"
BR2_TAR_OPTIONS=""
BR2_DL_DIR="$(BASE_DIR)/dl"
BR2_STAGING_DIR="$(BUILD_DIR)/staging_dir"
BR2_NUTTX_DIR="$(TOPDIR)/../nuttx"
BR2_TOPDIR_PREFIX=""
BR2_TOPDIR_SUFFIX=""
BR2_GNU_BUILD_SUFFIX="pc-elf"
BR2_GNU_TARGET_SUFFIX="nuttx-eabi"
BR2_PREFER_IMA=y
BR2_PACKAGE_BINUTILS=y
BR2_BINUTILS_VERSION_2_26_1=y
BR2_BINUTILS_VERSION="2.26.1"
BR2_EXTRA_BINUTILS_CONFIG_OPTIONS=""
BR2_PACKAGE_GCC=y
BR2_GCC_VERSION_4_7_4=y
BR2_GCC_SUPPORTS_SYSROOT=y
BR2_GCC_SUPPORTS_DOWN_PREREQ=y
BR2_GCC_DOWNLOAD_PREREQUISITES=y
BR2_GCC_VERSION="4.7.4"
BR2_EXTRA_GCC_CONFIG_OPTIONS=""
BR2_INSTALL_LIBSTDCPP=y
BR2_PACKAGE_GDB_HOST=y
BR2_GDB_VERSION_8_0_1=y
BR2_PACKAGE_GDB_TUI=y
BR2_GDB_VERSION="8.0.1"
BR2_PACKAGE_GENROMFS=y
BR2_PACKAGE_KCONFIG_FRONTENDS=y
BR2_KCONFIG_VERSION_4_11_0_1=y
BR2_KCONFIG_FRONTENDS_VERSION="4.11.0.1"
BR2_LARGEFILE=y
BR2_TARGET_OPTIMIZATION="-Os -pipe"

# 编译成功后可以使用: arm-nutxx-eabi-g++ -print-multi-lib
BR2_ENABLE_MULTILIB=y
BR2_LARGEFILE=y
BR2_SOFT_FLOAT=y
BR2_TARGET_OPTIMIZATION="-Os -pipe"
  • 如果成功会生成如下的目录.注意,如果开启了BR2_ENABLE_MULTILIB=yBR2_SOFT_FLOAT=y生成的目标目录是build_arm_nofpu,否则生成的目录就是build_arm.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
~$ tree -L 2 build_arm_hf/
build_arm_hf/
├── root
└── staging_dir
├── arm-elf -> arm-nuttx-eabi
├── arm-nuttx-eabi
├── bin
├── include
├── lib
├── libexec
├── share
└── usr

10 directories, 0 files
  • 测试工具链
1
2
3
4
5
~$ export PATH=`pwd`/build_arm_hr/staging_dir/bin:$PATH
~$ arm-nuttx-eabi-g++ -print-multi-lib
.;
thumb;@mthumb
fpu;@mfloat-abi=hard
  • 如果出现下面的错误,在make menuconfig选择一个高版本的gdb尝试一下.
    1
    2
    3
    4
    /fullpath/buildroot/toolchain_build_arm_hf/gdb-7.9.1/gdb/python/python.c: In function ‘_initialize_python’:
    /fullpath/buildroot/toolchain_build_arm_hf/gdb-7.9.1/gdb/python/python.c:1690:3: error: too few arguments to function ‘_PyImport_FixupBuiltin’
    _PyImport_FixupBuiltin (gdb_module, "_gdb");

  • 如果出现gcc编译时无法下载mpc,mpfr,gmp的依赖包时,查看一下toolchain_build_arm_hf/gcc-4.9.4/contrib/download_prerequisites.修改版本号,或者下载的地址.

gcc-4.7.4的补丁

  • 在构建交㕚工具链时如果出现下面的错误
1
2
3
4
In file included from .../gcc-4.7.4/gcc/cp/except.c:990:0:
cfns.gperf: At top level:
cfns.gperf:101:1: error: 'gnu_inline' attribute present on 'libc_name_p'
cfns.gperf:26:14: error: but not here
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
~$ cat > toolchain/gcc/4.7.4/gnu_inline.patch <<EOF
diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
index 68acd3d..953262f 100644
--- a/gcc/cp/cfns.gperf
+++ b/gcc/cp/cfns.gperf
@@ -22,6 +22,9 @@ __inline
static unsigned int hash (const char *, unsigned int);
#ifdef __GNUC__
__inline
+#ifdef __GNUC_STDC_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
#endif
const char * libc_name_p (const char *, unsigned int);
%}
diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
index 1c6665d..6d00c0e 100644
--- a/gcc/cp/cfns.h
+++ b/gcc/cp/cfns.h
@@ -53,6 +53,9 @@ __inline
static unsigned int hash (const char *, unsigned int);
#ifdef __GNUC__
__inline
+#ifdef __GNUC_STDC_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
#endif
const char * libc_name_p (const char *, unsigned int);
/* maximum key range = 391, duplicates = 0 */
EOF

GCC-4.7.4的编译错误

1
2
3
4
5
6
7
8
9
10
make[4]: Entering directory '/fullpath/buildroot/toolchain_build_arm_nofpu/gcc-4.7.4-build/libiberty/testsuite'
make[4]: Nothing to be done for 'install'.
make[4]: Leaving directory '/fullpath/buildroot/toolchain_build_arm_nofpu/gcc-4.7.4-build/libiberty/testsuite'
make[3]: Leaving directory '/fullpath/buildroot/toolchain_build_arm_nofpu/gcc-4.7.4-build/libiberty'
/bin/bash: line 3: cd: arm-nuttx-eabi/libgcc: No such file or directory
make[2]: *** [Makefile:10334: install-target-libgcc] Error 1
make[2]: Leaving directory '/fullpath/buildroot/toolchain_build_arm_nofpu/gcc-4.7.4-build'
make[1]: *** [Makefile:2115: install] Error 2
make[1]: Leaving directory '/fullpath/buildroot/toolchain_build_arm_nofpu/gcc-4.7.4-build'
make: *** [toolchain/gcc/gcc-nuttx-4.x.mk:159: /fullpath/buildroot/toolchain_build_arm_nofpu/gcc-4.7.4-build/.installed] Error 2
  • 编译时出现上面的错误,这好像是这个GCC版本的问题,在4.9.x好像没有出这样的错误,同是查看了各级的config.log与各级的Makefile也没有找出问题,后来只有进入到编译的目录内toolchain_build_arm/gcc-4.7.4-build内直接运行make,无错的话再回到buildroot内,再运行make这里就正常完成了.

配置NuttX系统

1
2
3
4
5
6
7
8
9
10
~$ tools/configure.sh -l  sam4s-xplained-pro:nsh
~$ cp boards/arm/sam34/sam4s-xplained-pro/configs/nsh/defconfig .config
~$ cp boards/arm/sam34/sam4s-xplained-pro/scripts/Make.defs .
~$ make menuconfig
~$ make
[...]
LD: nuttx
make[1]: Leaving directory '/fullpath/nuttx/arch/arm/src'
CP: nuttx.hex
CP: nuttx.bin
  • Nuttx的最终配置如下:
1
~$ grep -v '^$\|^#' .config
  • 编译时出现下面错误,这个有可能是配置时没有选择CONFIG_ARCH_IRQPRIO=y,然后就去make后的结果.通过搜索nuttx源码时发现,getcontrol(void)是定义在arch/arm/include/armv7-m/irq.h里的内联函数.最终在arch/arm/src/chip/sam_start.c前面,添加#include <nuttx/irq.h>就可以了.
1
2
3
/fullpath/nuttx/staging/libarch.a(sam_start.o): In function `sam_fpuconfig':
/fullpath/nuttx/arch/arm/src/chip/sam_start.c:159: undefined reference to `getcontrol`
/fullpath/nuttx/arch/arm/src/chip/sam_start.c:161: undefined reference to `setcontrol`

使用OpenOCD调试

编译OpenOCD

1
2
3
4
~$ git clone http://repo.or.cz/r/openocd.git
~$ cd openocd && mkdir build-linux && cd build-linux
~$ ../configure --enable-ftdi --enable-stlink --enable-ti-icdi --enable-ulink --enable-usb-blaster-2 --enable-ft232r --enable-xds110 --enable-usbprog --enable-armjtagew --enable-cmsis-dap --enable-usb-blaster --enable-openjtag --enable-jlink --enable-bcm2835gpio --enable-imx_gpio --enable-oocd_trace --enable-buspirate --enable-sysfsgpio
~$ make && make install
  • 根据Nuttx官方的Debugging Nuttx提示,基于某些特性调试,可能需要修改相应的openocd/src/rtos/nuttx_header.h内的宏定义如:CONFIG_DISABLE_MQUEUE=y.

  • 运行OpenOCD服务,通过PC端的USB连接到Atmel-SAM4S_Xpained-Pro上写有DEBUG USB的接口上,注意,该USB接口是板上调试器(EDBG)的组合接口,它包含三个接口功能:DEBUG,Virtual COM Port, Data Gateway Interface(DGI).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# 这里如果定义板级配置也可直接: openocd -f board/atmel_sam4s_xplained_pro.cfg -c init -c "reset halt"
~$ openocd -f interface/cmsis-dap.cfg -f target/at91sam4sd32x.cfg -c init -c "reset halt"
Open On-Chip Debugger 0.10.0+dev-01408-g762ddcb74-dirty (2020-09-25-00:32)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: JTAG Supported
Info : CMSIS-DAP: FW Version = 1.0
Info : CMSIS-DAP: Serial# = ATML1803040200001055
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 500 kHz
Info : SWD DPIDR 0x2ba01477
Info : sam4.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for sam4.cpu on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00400554 msp: 0x200034d0
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : accepting 'telnet' connection on tcp/4444
Info : dropped 'telnet' connection
Info : accepting 'telnet' connection on tcp/4444
Info : dropped 'telnet' connection
Info : accepting 'gdb' connection on tcp/3333
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00400554 msp: 0x200034d0

  • 使用GDB桥接到OpenOCD服务上去调试.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
~$ arm-nuttx-eabi-gdb nuttx
GNU gdb (GDB) 8.0.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-pc-elf --target=arm-nuttx-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from nuttx...done.
(gdb) target extended-remote :3333
0x00400554 in arm_earlyserialinit () at chip/sam_serial.c:1345
1345 up_disableallints(TTYS1_DEV.priv, NULL);
(gdb) load # 加载到板子上去,也就烧写入板子.
# OpenOCD的终端上也有相应的信息输出.
Loading section .text, size 0x19003 lma 0x400000
Loading section .ARM.extab, size 0x30 lma 0x419004
Loading section .ARM.exidx, size 0xd0 lma 0x419034
Loading section .data, size 0x220 lma 0x419104
Start address 0x4000cc, load size 103203
Transfer rate: 18 KB/sec, 10320 bytes/write.
(gdb) cont #继续运行,这里出现异常了,这人错误的示例,是因为工具链选择了`BR2_GCC_CORTEX_M4F_SP=y`,与目标板子不匹配,SAM4S-XPRO它是Cortex-m4但是它没有FPU.
Continuing.
sam4.cpu -- clearing lockup after double fault

Program received signal SIGINT, Interrupt.
exception_common () at armv7-m/gnu/arm_exception.S:176
176 vstmdb sp!, {s16-s31} /* Save the non-volatile FP context */
(gdb) i r # 详细GDB的指令,参考该版本的说明文档,最权威,最详细.
r0 0x3 3
r1 0x1 1
r2 0x20001e78 536878712
[....]

  • 也可以把几个参数合在一行命令下提交,如arm-nuttx-eabi-gdb -ex "target remote :3333" -ex "mon reset halt" nuttx

  • 关于类似ATSAM4SD32C.cpu -- clearing lockup after double fault,参考了stackexchange处理.

  • 查看目标文件的内容.

1
2
3
4
5
6
~$ file nuttx
nuttx: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped
~$ file nuttx.bin
nuttx.bin: data
~$ file nuttx.hex
nuttx.hex: ASCII text, with CRLF line terminators

GDB调试

OpenOCD服务

1
2
3
# ~$ openocd -f board/atmel_sam4s_xplained_pro.cfg -c init -c 'reset halt' -c '$_TARGETNAME configure -rtos nuttx'
~$ openocd -f board/atmel_sam4s_xplained_pro.cfg -c '$_TARGETNAME configure -rtos nuttx'

GDB连接

  • nuttx的目录下运行,为了加载nuttx文件.
1
~ nuttx$ arm-none-eabi-gdb -ex "target remote :3333" -ex "mon reset halt"  nuttx
  • 定义一些gdb hook函数,只是为了方便一些调试,最好的方式是把这些define放在~/.gdbinit内, 但是要注意,你如果在用系统gdb去调非nuttx的程序时,
    记得要删了~/.gdbinit.
1
2
3
4
5
6
7
8
9
(gdb) define hookpost-file
Type commands for definition of "hookpost-file".
End with a line saying just "end".
> eval "monitor nuttx.pid_offset %d", &((struct tcb_s *)(0))->pid
> eval "monitor nuttx.xcpreg_offset %d", &((struct tcb_s *)(0))->xcp.regs
> eval "monitor nuttx.state_offset %d", &((struct tcb_s *)(0))->task_state
> eval "monitor nuttx.name_offset %d", &((struct tcb_s *)(0))->name
> eval "monitor nuttx.name_size %d", sizeof(((struct tcb_s *)(0))->name)
>end
  • 连接远程openocd的端口
1
2
3
4
5
6
(gdb) target extended-remote :3333
Remote debugging using :3333
__start () at chip/sam_start.c:269
269 {
(gdb) file nuttx

  • 上线的file nuttx是加载文件的symbols,因为定义了hook-file,所以会在openocd内显示,如:
1
2
3
4
5
6
7
Error: No symbols for NuttX  # 有可能会显示,如果每次都显示,是因为没有打开`CONFIG_DEBUG_SYMBOLS`
Info : pid_offset: 12
Info : xcpreg_offset: 132
Info : state_offset: 26
Info : name_offset: 208
Info : name_size: 16

  • 查看调试线程信息.
1
2
3
4
(gdb) info threads
warning: while parsing threads: not well-formed (invalid token)
Id Target Id Frame
* 1 Remote target __start () at chip/sam_start.c:269
  • 查看寄存器的信息
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(gdb) info registers
r0 0x0 0
r1 0x20004360 536888160
r2 0x20004360 536888160
r3 0x1 1
r4 0xc 12
r5 0x200010cc 536875212
r6 0x200010cc 536875212
r7 0x3 3
r8 0x0 0
r9 0x0 0
r10 0x0 0
r11 0x0 0
r12 0x20004290 536887952
sp 0x20004340 0x20004340
lr 0x8012621 134293025
pc 0x8003b4c 0x8003b4c <memcpy+20>
xPSR 0x61000000 1627389952

设置断点

  • Breakpoints

  • 下面设置的断点是在文件的某行上面,为防止调试时程序跑飞,硬件重启后又需要重新设置断点,这里保存断点到bp.txt文件上,下次可以使用source bp.txt加载.

1
2
3
4
5
6
7
8
9
10
11
12
(gdb) b chip/sam_hsmci.c:757
Breakpoint 1 at 0x417cf8: file chip/sam_hsmci.c, line 757.
(gdb) b mmcsd/mmcsd_sdio.c:2780
Breakpoint 2 at 0x415fc4: file mmcsd/mmcsd_sdio.c, line 2780.
(gdb) save breakpoints bp.txt
Saved to file 'bp.txt'.
(gdb) rbreak bp.txt
(gdb) info b
Num Type Disp Enb Address What
1 breakpoint keep y 0x00417cf8 in sam_clock at chip/sam_hsmci.c:757
2 breakpoint keep y 0x00415fc4 in mmcsd_probe at mmcsd/mmcsd_sdio.c:2780

  • 查看调用栈,有时调试板子,在板子初始硬件时,串口打印还没有就绪时,此时用backtrace查看调用栈很有用,比如:晶振不起振.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(gdb) backtrace
#0 sam_clock (dev=0x2000016c <g_sdiodev>, rate=CLOCK_SD_TRANSFER_1BIT)
at chip/sam_hsmci.c:1580
#1 0x00415e56 in mmcsd_sdinitialize (priv=0x200043b0) at mmcsd/mmcsd_sdio.c:3023
#2 mmcsd_probe (priv=priv@entry=0x200043b0) at mmcsd/mmcsd_sdio.c:3465
#3 0x004162d2 in mmcsd_mediachange (arg=0x200043b0) at mmcsd/mmcsd_sdio.c:2545
#4 0x004185f2 in sdio_mediachange (dev=0x2000016c <g_sdiodev>, cardinslot=<optimized out>)
at chip/sam_hsmci.c:2799
#5 0x004148e4 in sam_hsmci_initialize () at sam_hsmci.c:180
#6 0x0041478a in board_app_initialize (arg=arg@entry=0) at sam_appinit.c:129
#7 0x004120fa in boardctl (cmd=cmd@entry=65281, arg=arg@entry=0) at boardctl.c:326
#8 0x00405cfa in nsh_initialize () at nsh_init.c:103
#9 0x00405ccc in nsh_main (argc=1, argv=0x200059c8) at nsh_main.c:143
#10 0x00403858 in nxtask_startup (entrypt=0x405ca9 <nsh_main>, argc=1, argv=0x200059c8)
at sched/task_startup.c:165
#11 0x00401320 in nxtask_start () at task/task_start.c:144
#12 0x00000000 in ?? ()

  • 单步(s = Step into, n = Step over),单步步入(Step Into)有时会进入很深的调用栈,如果要退回可以使用finish指令跳出.
1
2
3
4
5
6
7
(gdb) step
100 ret = nxsig_nanosleep(&rqtp, &rmtp);
(gdb) stepi
nxsig_nanosleep (rqtp=rqtp@entry=0x20004330, rmtp=rmtp@entry=0x20004338) at signal/sig_nanosleep.c:108
108 {
(gdb) n
116 if (rqtp == NULL || rqtp->tv_nsec < 0 || rqtp->tv_nsec >= 1000000000)
  • 查看变量
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
btle_main (argc=<error reading variable: value has been optimized out>, argv=<error reading variable: value has been optimized out>) at nrf24l01_btle.c:372
372 memcpy(chunk(buffer,pls)->data,&hum,2);
(gdb) p hum
$5 = 1844
(gdb) p temp
$6 = 3139
(gdb) p buffer.playload
There is no member named playload.
(gdb) x buffer.payload
0x200010d4 <buffer+8>: 0x06000102
(gdb) x/32b buffer.payload
0x200010d4 <buffer+8>: 2 1 0 6 9 0 0 0
0x200010dc <buffer+16>: 0 0 7 22 0 0 0 0
0x200010e4 <buffer+24>: 0 0 40 7 -56 0 0 0
0x200010ec <current>: 0 0 0 0 0 0 0 0
(gdb) x/32x buffer.payload # hex格式数组.
0x200010d4 <buffer+8>: 0x02 0x01 0x00 0x06 0x09 0x00 0x00 0x00
0x200010dc <buffer+16>: 0x00 0x00 0x07 0x16 0x00 0x00 0x00 0x00
0x200010e4 <buffer+24>: 0x00 0x00 0x28 0x07 0xc8 0x00 0x00 0x00
0x200010ec <current>: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
(gdb) print /x buffer.payload # 使用打印查看数组.
$2 = {0x2, 0x1, 0x0, 0x6, 0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x16, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x28, 0x7, 0xc8, 0x0, 0x0, 0x0}
  • hexdump 查看地址,数组
1
2
3
4
5
6
(gdb) x /32bx data
0x20004374: 0x44 0x12 0x00 0x20 0x20 0x00 0x00 0x00
0x2000437c: 0x95 0x3a 0x01 0x08 0x44 0x12 0x00 0x20
0x20004384: 0x03 0x00 0x00 0x00 0x04 0x00 0x00 0x00
0x2000438c: 0x07 0x5d 0x01 0x08 0x10 0x00 0x00 0x00

  • 查看结构体的内容
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
(gdb) set print pretty on
(gdb) p dev
$4 = (struct nrf24l01_dev_s *) 0x20003370
(gdb) p *dev
$5 = {
spi = 0x20000174 <g_spi2dev>,
config = 0x20000140 <nrf_cfg>,
state = ST_STANDBY,
tx_payload_noack = 0 '\000',
en_aa = 63 '?',
en_pipes = 1 '\001',
ce_enabled = 0 '\000',
lastxmitcount = 0 '\000',
addrlen = 5 '\005',
pipedatalen = "!\000\000\000\000",
pipe0addr = "\001\312\376\022\064",
last_recvpipeno = 0 '\000',
sem_tx = {
semcount = 0
},
tx_pending = 1 '\001',
rx_fifo = 0x200033d0 "h\020",
fifo_len = 0,
nxt_read = 0,
nxt_write = 0,
[.....]

烧写固件

  • 烧写flash0,地址0x00400000在链接脚本文件boards/arm/sam34/sam4s-xplained-pro/scripts/sam4s-xplained-pro.ld里有定义.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
~$ openocd -f board/atmel_sam4s_xplained_pro.cfg -c init -c "reset halt" -c "flash write_image erase nuttx.bin 0x00400000" -c "reset"
Open On-Chip Debugger 0.10.0+dev-01408-g762ddcb74-dirty (2020-09-25-00:32)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: JTAG Supported
Info : CMSIS-DAP: FW Version = 1.0
Info : CMSIS-DAP: Serial# = ATML1803040200001055
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 500 kHz
Info : SWD DPIDR 0x2ba01477
Info : ATSAM4SD32C.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for ATSAM4SD32C.cpu on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x004000cc msp: 0x20001ee4
Info : sam4 does not auto-erase while programming (Erasing relevant sectors)
Info : sam4 First: 0x00000000 Last: 0x0000000c
Info : Erasing sector: 0x00000000
Info : Erasing sector: 0x00000001
Info : Erasing sector: 0x00000002
Info : Erasing sector: 0x00000003
Info : Erasing sector: 0x00000004
Info : Erasing sector: 0x00000005
Info : Erasing sector: 0x00000006
Info : Erasing sector: 0x00000007
Info : Erasing sector: 0x00000008
Info : Erasing sector: 0x00000009
Info : Erasing sector: 0x0000000a
Info : Erasing sector: 0x0000000b
Info : Erasing sector: 0x0000000c
auto erase enabled
wrote 106496 bytes from file nuttx.bin in 5.418800s (19.192 KiB/s)

  • 连接到它的UART接口,进入系统.
1
2
3
~$ sudo minicom -o -b 115200 -D /dev/ttyACM0
NuttShell (NSH) NuttX-9.1.0
nsh> mm #测试一下内存.

NAND 移植

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
sam_nand_initialize: CS0
nand_initialize: cmdaddr=0x60400000 addraddr=0x60200000 dataaddr=0x60000000
onfi_ebidetect: cmdaddr=60400000 addraddr=60200000 dataaddr=60000000
onfi_read: cmdaddr=60400000 addraddr=60200000 dataaddr=60000000
onfi_read: Returning:
onfi_read: manufacturer: 0x2c
onfi_read: buswidth: 0
onfi_read: luns: 1
onfi_read: eccsize: 4
onfi_read: model: 0x @
onfi_read: sparesize: 64
onfi_read: pagesperblock: 64
onfi_read: blocksperlun: 2048
onfi_read: pagesize: 2048
nand_initialize: Found ONFI compliant NAND FLASH
nand_devscan: Retrieving bad block information. nblocks=2048
  • 读/写页(page),擦除块(block).在概念上,由大到小来说,就是:
1
Nand Flash ⇒ Chip ⇒ Plane ⇒ Block ⇒ Page ⇒ oob
1
2
3
4
5
6
7
8
9
10
 hexdump /dev/mtdblock0 count=128
/dev/mtdblock0 at 00000000:
0000: eb 3c 90 4e 55 54 54 58 20 20 20 00 08 20 01 00 .<.NUTTX .. ..
0010: 02 00 02 00 00 f8 05 00 3f 00 ff 00 00 00 00 00 ........?.......
0020: 00 00 02 00 00 00 29 00 00 00 00 20 20 20 20 20 ......)....
0030: 20 20 20 20 20 20 46 41 54 31 36 20 20 20 0e 1f FAT16 ..
0040: be 5b 7c ac 22 c0 74 0b 56 b4 0e bb 07 00 cd 10 .[|.\".t.V.......
0050: 5e eb f0 32 e4 cd 16 cd 19 eb fe 54 68 69 73 20 ^..2.......This
0060: 69 73 20 6e 6f 74 20 61 20 62 6f 6f 74 61 62 6c is not a bootabl
0070: 65 20 64 69 73 6b 2e 20 20 50 6c 65 61 73 65 20 e disk. Please
  • 格式化nuttx代码
    1
    git status | grep "modified:" | awk '{print $2}' | xargs tools/checkpatch.sh -f
  • 内存分布SAMA5D3 Series是参照Datasheet第5章Memories. SAM4S是SAM4S Datasheet Chapter 6 . Product Mapping

Arduino Due

  • Arduino Due
  • Hacking with the Arduino Due
  • SAM3X-Arduino Pin Mapping
  • The Arduino Due is a microcontroller board based on the Atmel SAM3X8E ARM Cortex-M3 CPU. It is the first Arduino board based on a 32-bit ARM core microcontroller. It has 54 digital input/output pins (of which 12 can be used as PWM outputs), 12 analog inputs, 4 UARTs (hardware serial ports), a 84 MHz clock, an USB OTG capable connection, 2 DAC (digital to analog), 2 TWI, a power jack, an SPI header, a JTAG header, a reset button and an erase button.
  • 根据官方警示:Arduino Due的管脚只容3.3v,高于3.3v会损坏板子.

BOSSAC烧写

  • 这里将使用它官方的烧写工具BOSSAC,它一般位于用户目录下.如:~/.arduino15/packages/arduino/tools/bossac/1.7.0-arduino3/bossac.

检测目标板子信息

1
2
~$  bossac -p ttyACM0 -U false -i
No device found on ttyACM0
  • 需要设置正确的端口参数,如果再不行,按reset再重试,如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
~$ stty -F /dev/ttyACM0 speed 1200 cs8 -cstopb -parenb
115200
~ $ bossac -p ttyACM0 -U false -i
Atmel SMART device 0x285e0a60 found
Device : ATSAM3X8
Chip ID : 285e0a60
Version : v1.1 Dec 15 2010 19:25:04
Address : 524288
Pages : 2048
Page Size : 256 bytes
Total Size : 512KB
Planes : 2
Lock Regions : 32
Locked : none
Security : false
Boot Flash : false

烧入nuttx.bin

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ bossac -p ttyACM0 -U false -e -w -v -b nuttx.bin -R
Atmel SMART device 0x285e0a60 found
Erase flash
done in 0.041 seconds

Write 62368 bytes to flash (244 pages)
[==============================] 100% (244/244 pages)
done in 12.866 seconds

Verify 62368 bytes of flash
[==============================] 100% (244/244 pages)
Verify successful
done in 12.240 seconds
Set boot flash true
CPU reset.

使用SWD烧写

  • 除了使用BOSSAC,本来想使用SWD接口与OpenOCD来烧写调试.因为Due板有一个排4针的DEBUG接口,针脚是:1:RESET,2:SWDIO,3:SWCLK,4:GND.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    ~$ cat > ~/sam3x8e.cfg<<EOF
    source [find interface/stlink.cfg]

    set CPUTAPID 0x2ba01477

    source [find board/atmel_sam3x_ek.cfg]
    EOF

    ~$ openocd -f ~/sam3x8e.cfg -c init -c halt -c "flash write_image erase nuttx.bin 0x80000" -c "at91sam3 gpnvm set 1" -c "exit"

使用板载AT16u2烧写

  • at16u2_cmsis_dap

  • 在网上发现可以修改AT16u2的固件,使它成为CMSIS_DAP,从而可以支持openocd的烧写调试.

更新AT16u2的固件

  • Upgrading16U2Due

  • 烧写AVR芯片需要一个烧写器,如:avr JATG-ICE, AVR-ISP,Atmel-ICE,USBasp.也可以把一块arduino板子变成AVR-ISP.如:Arduino Uno. 但是这里有一块NUCLEO-L152RE它有兼容arduino的接口,可以使用stm32duino把它变成AVR-ISP烧写器,烧入官方的ArduinoISP进去.

  • 打开Arduino IDE --> File --> examples(Builtin-examples) --> 11.ArduinoISP --> ArduinoISP,烧写上传到NUCLEO-L152RE.

1
2
3
4
5
6
7
NUCLEO-L152RE        Arduino Due (ICSP)
D10 CS <------> Reset
D11 MOSI <------> MOSI
D12 MISO <------> MISO
D13 SCK <------> SCK
GND <------> GND
+5V <------> +5V

avrdude

  • 下载avrdude源码avrdude是一个开源的AVR烧写软件,它最新地板本是avrdude-6.3,通过源码可以查看它所支持的硬件详情.

  • 下面是使用NUCLEO-L152RE做为一个烧写器,按照上面接线,对Arduino Due板上的at16u2的固件进行更新.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    ~$ cd   ~/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/
    ~$ tree
    .
    ├── bin
    │   └── avrdude
    └── etc
    └── avrdude.conf

    ~$ avrdude -c arduino -P /dev/ttyACM0 -b 19200 -p atmega16u2 -vvv -U flash:w:at16u2_cmsis_dap/at16u2_cmsis_dap.elf.hex:i

    avrdude: Version 6.3-20171130
    Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
    Copyright (c) 2007-2014 Joerg Wunsch

    System wide configuration file is "/etc/avrdude.conf"
    User configuration file is "/home/michael/.avrduderc"
    User configuration file does not exist or is not a regular file, skipping

    Using Port : /dev/ttyACM0
    Using Programmer : arduino
    Overriding Baud Rate : 19200
    AVR Part : ATmega16U2
    Chip Erase delay : 9000 us
    PAGEL : PD7
    BS2 : PC6
    RESET disposition : possible i/o
    RETRY pulse : SCK
    serial program mode : yes
    parallel program mode : yes
    Timeout : 200
    StabDelay : 100
    CmdexeDelay : 25
    SyncLoops : 32
    ByteDelay : 0
    PollIndex : 3
    PollValue : 0x53
    Memory Detail :

    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
    eeprom 65 20 4 0 no 512 4 128 9000 9000 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
    flash 65 6 128 0 yes 16384 128 128 4500 4500 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
    lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
    hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
    efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
    lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
    calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
    signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

    Programmer Type : Arduino
    Description : Arduino
    Hardware Version: 2
    Firmware Version: 1.18
    Topcard : Unknown
    Vtarget : 0.0 V
    Varef : 0.0 V
    Oscillator : Off
    SCK period : 0.1 us

跳线

  • 因为Due板上的GND,RESET已经连接到AT16u2上了,这里Due板内只需两根跳线就够了.所以此时的at16u2就是一个CMSIS-DAP的设备了.
1
2
3
4
 ICSP            DEBUG(SWD)

SCK (3) <-----> SCK (2)
MOSI(4) <-----> SDO (3)
  • 使用OpenOCD烧写.
1
~$ openocd -f interface/cmsis-dap.cfg -f board/atmel_sam3x_ek.cfg  -c init -c halt -c "flash write_image erase nuttx.bin 0x80000" -c "at91sam3 gpnvm set 1" -c "exit"

使用UM232H(FTDI)做烧写器

  • 上面的做法是使用一块arduino板做为烧写器,这里是使用FT232H USB to SPI/I2C的小板来做为烧写器,连接板上的DEBUG(SWD).
1
2
3
4
5
6
7
8
9
10
# FT232HQ minimodule channel 0 (Channel A)
# Connector FTDI Arduino Due(SWD)
# Pin Name
# --------- ------ ------
# CN2-10 GND GND (pin1)
# CN2-13 ADBUS0 (TCK) SWCLK (pin2)
# CN2-14 ADBUS2 (TDI/TDO) SWDIO (pin3)
# CN2-15 ADBUS1 (TDO/TDI) SWDIO (pin3)
# CN2-17 ADBUS4 (GPIOL0) nTRST (pin4)

  • 也可以使用Due板上的标准的ARM-JTAG-10pin去调试,接线的方式如同上面,可以使用JTAG信号,也可以只接SWD信号.如果转接到一个20Pin的板上,就需要对接相应的信号线.

  • 使用OpenOCD烧写,如果板上原来是arduino镜像,需要按下reset后,马上运行下面命令.

1
~$ openocd -f interface/ftdi/ft232h-module-swd.cfg  -f board/atmel_sam3x_ek.cfg  -c init -c halt -c "flash write_image erase nuttx.bin 0x80000" -c "at91sam3 gpnvm set 1" -c "exit"

OpenOCD连接

其它

  • Write code to FLASH don’t change boot mode and don’t reset. This lets
    you examine the FLASH contents that you just loaded while the bootloader
    is still active.
1
2
3
4
5
6
~$ bossac.exe --port=COM26 --usb-port=false -e -w -v --boot=0 nuttx.bin
Write 64628 bytes to flash
[==============================] 100% (253/253 pages)
Verify 64628 bytes of flash
[==============================] 100% (253/253 pages)
Verify successful
  • Verify the FLASH contents (the bootloader must be running)
1
2
3
4
~$ bossac.exe --port=COM26 --usb-port=false -v nuttx.bin
Verify 64628 bytes of flash
[==============================] 100% (253/253 pages)
Verify successful
  • Read from FLASH to a file (the bootloader must be running):
1
2
3
~$ bossac.exe --port=COM26 --usb-port=false --read=4096 nuttx.dump
Read 4096 bytes from flash
[==============================] 100% (16/16 pages)
  • Change to boot from FLASH
1
2
~$ bossac.exe --port=COM26 --usb-port=false --boot=1
Set boot flash true

恢复AT16u2的固件

  • ArduinoCore-sam

  • 下面是把Arduino Due板上的AT16u2恢复它原来的固件功能,这里是使用FT232H连它的ICSP而不是用一个Arduino板来做烧写器.arduino它所有支持的固件都在它的安装包内,因为Arduino DueSAM3X8E的芯片,这里选择查看~/.arduino15/packages/arduino/hardware/sam/目录.如下.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
~$ tree ~/.arduino15/packages/arduino/hardware/sam/1.6.12/firmwares
.arduino15/packages/arduino/hardware/sam/1.6.12/firmwares
└── atmega16u2
├── Arduino-DUE-usbserial-prod-firmware-2012-11-05.hex
├── Arduino-DUE-usbserial-prod-firmware-2013-02-05.hex
└── arduino-usbserial
├── Arduino-usbserial.c
├── Arduino-usbserial.h
├── Board
│   └── LEDs.h
├── Descriptors.c
├── Descriptors.h
├── Lib
│   └── LightweightRingBuff.h
├── makefile
└── readme.txt

4 directories, 10 files

  • 关于如何接线的问题,可以查看/etc/avrdude.conf,根据里面的注释指导,结合自已板子接线.
1
2
3
4
5
6
7
8
9
10

FT232H Arduino Due (ICSP)

pin15 ADBUS2 <------> MISO pin1
+5V <------> +5V 2
pin13 ADBUS0 <------> SCK 3
pin14 ADBUS1 <------> MOSI 4
pin16 ADBUS3 <------> Reset 5
GND <------> GND 6

  • 烧写命令如下,如有问题可以,添加-vvv烧写查看.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
~$ avrdude -C /etc/avrdude.conf -c UM232H -P /dev/ttyUSB0 -b 19200 -p atmega16u2 -U flash:w:Arduino-DUE-usbserial-prod-firmware-2013-02-05.hex:i

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9489 (probably m16u2)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "Arduino-DUE-usbserial-prod-firmware-2013-02-05.hex"
avrdude: writing flash (4314 bytes):

Writing | ################################################## | 100% 7.56s

avrdude: 4314 bytes of flash written
avrdude: verifying flash memory against Arduino-DUE-usbserial-prod-firmware-2013-02-05.hex:
avrdude: load data flash data from input file Arduino-DUE-usbserial-prod-firmware-2013-02-05.hex:
avrdude: input file Arduino-DUE-usbserial-prod-firmware-2013-02-05.hex contains 4314 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 7.28s

avrdude: verifying ...
avrdude: 4314 bytes of flash verified

avrdude: safemode: Fuses OK (E:F4, H:D9, L:FF)

avrdude done. Thank you.

谢谢支持

  • 微信二维码: