ARM 的封存

Announce U-Boot for Kontron SAMX6I

Posted in ARM, uboot with tags , , , , on 2016 年 07 月 07 日 by Kun-Yi

bToday I have push an u-boot for support Kontron sAMX6i  iMX6Q

The version just verify on IMX6Q with 1GB configuration for booting success original Linux system

you can following the  below instructions to build up your binary to replace default bootloader

git clone https://github.com/KunYi/uboot-samx6i
cd uboot-samx6i
# setup cross compiler environments, use Yocto toolchains
source ~/yocto/toolchain/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
make distclean
make samx6i_defconfig
make -j8

Okay,  you can get u-boot.imx now, I use the below method to replace original bootloader

  1. connect UART1 to host computer and run minicom for operation u-boot commands
  2. format Micro SD for FAT, the put u-boot.imx file on the micro sdcard
  3. plug the Micro SD into slot of carrier board
  4. power on system and press any key on host to interrupt booting
  5. run the below commands for upgrade bootloader
  • mmc dev 1
  • fatload mmc 1:0 0x10800000 u-boot.imx
  • sf probe
  • sf erase 0 0xc0000
  • sf write 0x10800000 0x400 $filesize
  • reset

all complete, should be reboot from new bootloader now

廣告

Note: U-Boot update read from SD card then write into SPI Flash

Posted in ARM, uboot, 未分類 with tags , on 2015 年 11 月 30 日 by Kun-Yi

這兩天拿到一張 IMX 的 SMARC 版子,想要弄Android 但是只有Freescale 的codebase ,所以從u-boot 開始搞起。

接上 console 後,測試版上的u-boot 發現需要更新到新版本,研究一下u-boot 現在可以自我更新,嘗試了一下發現按照下面的command 順序即可

  1. mmc dev 1  # 切換mmc 到那一個slot
  2. mmcinfo   # 可以確認是否有認到sdcard
  3. fatload mmc 1 0x10800400 u-boot.bin # 讀SD card 上的u-boot.bin 到DRAM中, 讀完會有檔案大小
  4. sf probe
  5. sf erase 0 0x200000 # erase all
  6. sf write 0x10800000  0 0x58000 # 0x58000 是檔案大小 + 1024(0x400), 注意第三步已經偏移了 0x400, 這是IMX6的需求
  7. reset

Note: Test mbed OS beta on FRDM-K64F

Posted in ARM, mbed with tags , on 2015 年 09 月 12 日 by Kun-Yi

Host : Ubuntu 12.04 LTS
tools: yotta: 0.7.0/git:2.5.2/ cmake:3.3.1/ninja:1.6.0
build toolchain: gcc-arm-none-eabi-4_9-2015q1-20150306
target board: Freescale FRDM-K64F

步驟就事先安裝 yotta, 這是個 python 寫的工具軟體, 可以透過 pip 安裝, 個人用
sudo pip install -U yotta 安裝所需的packages, 另外為了解決 urllib3 的 security warring 又裝了 pyOpenSSL, 這個要裝 0.13.0 以上的版本

準備工作是 裝好 yotta, 把 build toolchain 的bin路徑加進 $PATH 然後按下面步驟測試
另外 yotta 的別名(alias)是 yt, 所以可以直接打 yt 執行

yt search -l 50 target  # 這個命令會列出目前支援的 target 有哪些 下面就是目前執行的結果

test-target-dep 0.0.2: Test Target Test Dependencies
frdm-k64f-gcc 0.0.24: Official mbed build target for the mbed frdm-k64f development board.
frdm-k64f-armcc 0.0.16: Official mbed build target for the mbed frdm-k64f development board, using the armcc toolchain.
bbc-microbit-classic-gcc 0.1.3: Official mbed build target for the mbed nrf51822 development board, using the armgcc toolchain.
st-nucleo-f401re-gcc 0.1.0: Official mbed build target for the mbed st-nucleo-f401re development board.
bbc-microbit-classic-armcc 0.1.0: Official mbed build target for the microbit, using the armcc toolchain.
stm32f429i-disco-gcc 0.0.5: Official mbed build target for the mbed st-nucleo-f429zi development board.
nordic-nrf51822-16k-gcc 0.0.9: Official mbed build target for the mbed nrf51822 development board, using the armgcc toolchain.
nordic-nrf51822-32k-gcc 0.0.6: Official mbed build target for the nrf51822 32KB chip.
st-stm32f439zi-gcc 0.0.3: Official mbed build target for the st stm32f439zi microcontroller.
nordic-nrf51822-16k-armcc 0.0.8: Official mbed build target for the mbed nrf51822 development board, using the armcc toolchain.
bbc-microbit-classic-gcc-nosd 0.1.2: Official mbed build target for the BBC micro:bit, using the armgcc toolchain, without Softdevice.
stm32f411re-nucleo-gcc 0.0.1: Official mbed build target for the mbed st-nucleo-f411re development board.
nordic-nrf51822-32k-armcc 0.0.8: Official mbed build target for the mbed nrf51822 development board, using the armcc toolchain.
bbc-microbit-classic-armcc-nosd 0.1.0: Official mbed build target for the microbit, using the armcc toolchain, without soft device.
x86-linux-native 0.0.6: Build target for programs compiled natively for Linux
x86-osx-native 0.0.7: Build target for programs compiled natively for OS X
mbed-gcc 0.0.14: base mbed build target for gcc toolchain
mbed-armcc 0.0.16: Official mbed base target description for compiling with the ARMCC compiler
libc 0.0.3: libc shim module: pulls in the platform libc when compiling for nostdlib targets
ublox-odin-w2-gcc 0.0.3: Official mbed build target for the ublox odin-w2 module.
ublox-odin-w2-evk-gcc 0.0.0: Official mbed build target for the mbed ublox c029 evkelopment board.
seeedtinyble-gcc 0.0.2: Official mbed build target for the nrf51822 16KB chip.
mkit-gcc 0.0.1: Official mbed build target for the nrf51822 16KB chip.
ublox-c029-gcc 0.0.0: Official mbed build target for the mbed ublox c029 development board.
mkit-classic-armcc 0.0.1: mbed classic build target for nrf51822 mkit.
lex-test-gcc 0.0.1: lex’s first target to test

配合實際的狀況所以選 frdm-k64f-gcc (FRDM-K64F+ GCC Embedded for ARM), 這時下 yt target frdm-k64f-gcc
這時目錄中會出現 .yotta.json內容如下

{
“build": {
“target": “frdm-k64f-gcc,*"
}
}

接著準備進行實際測試專案, 我這採用mbed 本身提供的範例
可以用 yt search -l 100 examples

example-mbedos-blinky 0.0.0: simple example program to blink an LED on an mbed board with mbed OS
mbed-client-examples 0.2.2: mbed Client Example for mbed
mbed-client-example-6lowpan 0.0.2: 6LoWPAN networking example
mbed-example-network 0.1.8: Asynch Network Examples
example-asynch-serial 0.2.1: Asynch Serial example
example-asynch-spi 0.2.1: Asynch SPI example
example-asynch-i2c 0.2.1: Asynch I2C example
uvisor-helloworld 0.5.9: Hello world example with uVisor enabled

可以觀察到 example-mbedos-blinky, 實際上他就是 mbed 提供的 Getting Started 的專案檔案
可以透過 yt install example-mbedos-blinky 下載檔案, 下載過程如下

info: get versions for example-mbedos-blinky
info: download example-mbedos-blinky@0.0.0 from https://registry.yottabuild.org
info: get versions for frdm-k64f-gcc
info: download frdm-k64f-gcc@0.0.24 from https://registry.yottabuild.org
info: get versions for mbed-gcc
info: download mbed-gcc@0.0.14 from https://registry.yottabuild.org
info: get versions for mbed-drivers
info: download mbed-drivers@0.6.9 from https://registry.yottabuild.org
info: get versions for uvisor-lib
info: download uvisor-lib@0.7.23 from https://registry.yottabuild.org
info: get versions for mbed-hal
info: download mbed-hal@0.6.4 from https://registry.yottabuild.org
info: get versions for cmsis-core
info: download cmsis-core@0.2.6 from https://registry.yottabuild.org
info: get versions for ualloc
info: download ualloc@0.0.10 from https://registry.yottabuild.org
info: get versions for minar
info: download minar@0.6.7 from https://registry.yottabuild.org
info: get versions for core-util
info: download core-util@0.0.16 from https://registry.yottabuild.org
info: get versions for mbed-hal-freescale
info: download mbed-hal-freescale@0.5.2 from https://registry.yottabuild.org
info: get versions for mbed-hal-ksdk-mcu
info: download mbed-hal-ksdk-mcu@0.5.4 from https://registry.yottabuild.org
info: get versions for mbed-hal-k64f
info: download mbed-hal-k64f@0.3.5 from https://registry.yottabuild.org
info: get versions for mbed-hal-frdm-k64f
info: download mbed-hal-frdm-k64f@0.4.4 from https://registry.yottabuild.org
info: get versions for cmsis-core-freescale
info: download cmsis-core-freescale@0.1.4 from https://registry.yottabuild.org
info: get versions for cmsis-core-k64f
info: download cmsis-core-k64f@0.1.5 from https://registry.yottabuild.org
info: get versions for dlmalloc
info: download dlmalloc@0.0.6 from https://registry.yottabuild.org
info: get versions for compiler-polyfill
info: download compiler-polyfill@1.0.4 from https://registry.yottabuild.org
info: get versions for minar-platform
info: download minar-platform@0.3.4 from https://registry.yottabuild.org
info: get versions for minar-platform-mbed
info: download minar-platform-mbed@0.1.5 from https://registry.yottabuild.org
error: mbed-drivers does not meet specification ~0.7.0 required by minar

目前會發生 mbed-drivers 這個版本不對的情形, 但是目前不用管他!
會發現多了一個目錄 “example-mbedos-blinky" 上面下載的module 都會在此目錄下
然後 cd example-mbedos-blinky
並透過 yt target frdm-k64f-gcc 再設定一次 target
此時就剩下執行 “yt build"這個步驟了

error: mbed-drivers does not meet specification ~0.7.0 required by minar
info: generate for target: frdm-k64f-gcc 0.0.24 at /home/kunyi/mbed-test/example-mbedos-blinky/yotta_targets/frdm-k64f-gcc
GCC version is: 4.9.3
— The ASM compiler identification is GNU
— Found assembler: /home/kunyi/emgcc/gcc-arm-none-eabi-4_9-2015q1/bin/arm-none-eabi-gcc
— Configuring done
— Generating done
— Build files have been written to: /home/kunyi/mbed-test/example-mbedos-blinky/build/frdm-k64f-gcc
[130/130] Linking CXX executable source/example-mbedos-blinky

順利的話, 可以在 example-mbedos-blinky/build/frdm-k64f-gcc/source 發現 “example-mbedos-blinky.bin" 這個下載用的檔案!

P.S.
也可以手動解決 mbed-drivers 版本不對的問題, 當透過yt install example-mbedos-blinky 抓下所有檔案後, 執行下面步驟

 cd example-mbedos-blinky  # 切換目錄
vim module.json  #去更改 “mbed-drivers" 的版本 為 ~0.7.0, 退出VIM
yt update # 更新檔案

就會出現下面訊息
info: get versions for frdm-k64f-gcc
info: get versions for mbed-gcc
info: get versions for mbed-drivers
info: download mbed-drivers@0.7.0 from https://registry.yottabuild.org
info: get versions for uvisor-lib
info: get versions for mbed-hal
info: get versions for cmsis-core
info: get versions for ualloc
info: get versions for minar
info: get versions for core-util
info: get versions for compiler-polyfill
info: get versions for mbed-hal-freescale
info: get versions for mbed-hal-ksdk-mcu
info: get versions for mbed-hal-k64f
info: get versions for mbed-hal-frdm-k64f
info: get versions for cmsis-core-freescale
info: get versions for cmsis-core-k64f
info: get versions for dlmalloc
info: get versions for minar-platform
info: get versions for minar-platform-mbed

此時在執行 yt build 即可

Note: MBED support STM32F429 Discovery board

Posted in ARM with tags , , on 2015 年 05 月 05 日 by Kun-Yi

基本上使用方法如前
build MBED SDK
python ./workspace_tools/build.py -m DISCO_F429ZI -t GCC_ARM -j8 -r -d -F

測試
python ./workspace_tools/make.py -m DISCO_F428ZI -t GCC_ARM -j8 -p 47 # HELLO

然後切換目錄到
./build/test/DISCO_F429ZI/GCC_ARM/MBED_10
找到hello.bin 後, 可以用
st-flash write hello.bin 0x8000000 寫到版上測試

需注意 STDIO 是轉向 USART1 (PA9 & PA10)

下面是改 STDIO 的 serial port 的 baud rate
diff –git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32F4/serial_api.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32F4/serial_api.c
index c89d1e5..7a42d9c 100644
— a/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32F4/serial_api.c
+++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_STM32F4/serial_api.c
@@ -136,7 +136,7 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
}

// Configure UART
– obj->baudrate = 9600;
+ obj->baudrate = 115200;
obj->databits = UART_WORDLENGTH_8B;
obj->stopbits = UART_STOPBITS_1;
obj->parity = UART_PARITY_NONE;
ref.

 

Note: MBED_A3 for C++ STL testing

Posted in ARM with tags , on 2015 年 05 月 04 日 by Kun-Yi

測半天在 minicom 看不到結果, 結果是serial configuration是 “9600,N,8,1″ 個人習慣用 “115200,N,8,1″

這時改 MBED_A3/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/serial_api.cpp 這個檔案找到
UART_HAL_SetBaudRate(uart_addrs[obj->index], uartSourceClock, 9600);
改成
UART_HAL_SetBaudRate(uart_addrs[obj->index], uartSourceClock, 115200);

即可!
測試結果如下

MBED_A3

update:
just for K64F-FRDM board
如果像我一樣習慣某個baud設定的 可以pull source code 改下面檔案, 這樣就不用每個 test project export 在改了!
diff –git a/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/serial_api.c b/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/serial_api.c
index 68e3105..ad65f4a 100644
— a/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/serial_api.c
+++ b/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/serial_api.c
@@ -56,7 +56,7 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
CLOCK_SYS_EnableUartClock(obj->index);
uint32_t uart_addrs[] = UART_BASE_ADDRS;
UART_HAL_Init(uart_addrs[obj->index]);
– UART_HAL_SetBaudRate(uart_addrs[obj->index], uartSourceClock, 9600);
+ UART_HAL_SetBaudRate(uart_addrs[obj->index], uartSourceClock, 115200);
UART_HAL_SetParityMode(uart_addrs[obj->index], kUartParityDisabled);
#if FSL_FEATURE_UART_HAS_STOP_BIT_CONFIG_SUPPORT
UART_HAL_SetStopBitCount(uart_addrs[obj->index], kUartOneStopBit);

Note: build test program for mBed

Posted in ARM with tags , on 2015 年 05 月 03 日 by Kun-Yi

python workspace_tools/make.py -m K64F -t GCC_ARM -p 47
Building project HELLO (K64F, GCC_ARM)
Compile: main.cpp
Compile: test_env.cpp
Link: hello
Elf2Bin: hello
Image: ${your mbed}/test/K64F/GCC_ARM/MBED_10/hello.bin

if you just run ‘python workspace_tools/make.py’, the script will show the below message
total provide125 items now (May 3, 2015)

———————————————————————————————
[ 0] MBED_A1: Basic
[ 1] MBED_A2: Semihost file system
[ 2] MBED_A3: C++ STL
[ 3] MBED_A4: I2C TMP102
[ 4] MBED_A5: DigitalIn DigitalOut
[ 5] MBED_A6: DigitalInOut
[ 6] MBED_A7: InterruptIn
[ 7] MBED_A8: Analog
[ 8] MBED_A9: Serial Echo at 115200
[ 9] MBED_A10: PortOut PortIn
[ 10] MBED_A11: PortInOut
[ 11] MBED_A12: SD File System
[ 12] MBED_A13: I2C MMA7660 accelerometer
[ 13] MBED_A14: I2C Master
[ 14] MBED_A15: I2C Slave
[ 15] MBED_A16: SPI Master
[ 16] MBED_A17: SPI Slave
[ 17] MBED_A18: Interrupt vector relocation
[ 18] MBED_A19: I2C EEPROM read/write test
[ 19] MBED_A20: I2C master/slave test
[ 20] MBED_A21: Call function before main (mbed_main)
[ 21] MBED_A22: SPIFI for LPC4088 (test 1)
[ 22] MBED_A23: SPIFI for LPC4088 (test 2)
[ 23] MBED_A24: Serial echo with RTS/CTS flow control
[ 24] MBED_A25: I2C EEPROM line read/write test
[ 25] MBED_A26: AnalogIn potentiometer test
[ 26] MBED_A27: CAN loopback test
[ 27] MBED_BLINKY: Blinky
[ 28] MBED_BUS: Blinky BUS
[ 29] MBED_BUSOUT: BusOut
[ 30] BENCHMARK_1: Size (c environment)
[ 31] BENCHMARK_2: Size (float math)
[ 32] BENCHMARK_3: Size (printf)
[ 33] BENCHMARK_4: Size (mbed libs)
[ 34] BENCHMARK_5: Size (all)
[ 35] PERF_1: SD Stdio R/W Speed
[ 36] PERF_2: SD FileHandle R/W Speed
[ 37] PERF_3: SD FatFS R/W Speed
[ 38] MBED_1: I2C SRF08
[ 39] MBED_2: stdio
[ 40] MBED_3: PortOut
[ 41] MBED_4: Sleep
[ 42] MBED_5: PWM
[ 43] MBED_6: SW Reset
[ 44] MBED_7: stdio benchmark
[ 45] MBED_8: SPI
[ 46] MBED_9: Sleep Timeout
[ 47] MBED_10: Hello World
[ 48] MBED_11: Ticker Int
[ 49] MBED_12: C++
[ 50] MBED_13: Heap & Stack
[ 51] MBED_14: Serial Interrupt
[ 52] MBED_15: RPC
[ 53] MBED_16: RTC
[ 54] MBED_17: Serial Interrupt 2
[ 55] MBED_18: Local FS Directory
[ 56] MBED_19: SD FS Directory
[ 57] MBED_20: InterruptIn 2
[ 58] MBED_21: freopen Stream
[ 59] MBED_22: Semihost
[ 60] MBED_23: Ticker Int us
[ 61] MBED_24: Timeout Int us
[ 62] MBED_25: Time us
[ 63] MBED_26: Integer constant division
[ 64] MBED_27: SPI ADXL345
[ 65] MBED_28: Interrupt chaining (InterruptManager)
[ 66] MBED_29: CAN network test
[ 67] MBED_30: CAN network test using interrupts
[ 68] MBED_31: PWM LED test
[ 69] MBED_32: Pin toggling
[ 70] MBED_33: C string operations
[ 71] MBED_34: Ticker Two callbacks
[ 72] CMSIS_RTOS_1: Basic
[ 73] CMSIS_RTOS_2: Mutex
[ 74] CMSIS_RTOS_3: Semaphore
[ 75] CMSIS_RTOS_4: Signals
[ 76] CMSIS_RTOS_5: Queue
[ 77] CMSIS_RTOS_6: Mail
[ 78] CMSIS_RTOS_7: Timer
[ 79] CMSIS_RTOS_8: ISR
[ 80] RTOS_1: Basic thread
[ 81] RTOS_2: Mutex resource lock
[ 82] RTOS_3: Semaphore resource lock
[ 83] RTOS_4: Signals messaging
[ 84] RTOS_5: Queue messaging
[ 85] RTOS_6: Mail messaging
[ 86] RTOS_7: Timer
[ 87] RTOS_8: ISR (Queue)
[ 88] RTOS_9: SD File write-read
[ 89] NET_1: TCP client hello world
[ 90] NET_2: NIST Internet Time Service
[ 91] NET_3: TCP echo server
[ 92] NET_4: TCP echo client
[ 93] NET_5: UDP echo server
[ 94] NET_6: UDP echo client
[ 95] NET_7: HTTP client hello world
[ 96] NET_8: NTP client
[ 97] NET_9: Multicast Send
[ 98] NET_10: Multicast Receive
[ 99] NET_11: Broadcast Send
[100] NET_12: Broadcast Receive
[101] NET_13: TCP client echo loop
[102] NET_14: UDP PHY/Data link layer
[103] UB_1: u-blox USB modem: HTTP client
[104] UB_2: u-blox USB modem: SMS test
[105] USB_1: Mouse
[106] USB_2: Keyboard
[107] USB_3: Mouse_Keyboard
[108] USB_4: Serial Port
[109] USB_5: Generic HID
[110] USB_6: MIDI
[111] USB_7: AUDIO
[112] CMSIS_DSP_1: FIR
[113] DSP_1: FIR
[114] KL25Z_1: LPTMR
[115] KL25Z_2: PIT
[116] KL25Z_3: TSI Touch Sensor
[117] KL25Z_4: RTC
[118] KL25Z_5: MMA8451Q accelerometer
[119] EXAMPLE_1: /dev/null
[120] EXAMPLE_2: FS + RTOS
[121] UT_1: Basic
[122] UT_2: Semihost file system
[123] UT_3: General tests
[124] UT_BUSIO: BusIn BusOut
[125] DTCT_1: Simple detect test
Usage: make.py [options]

Options:
-h, –help show this help message and exit
-m MCU, –mcu=MCU build for the given MCU (APPNEARME_MICRONFCBOARD,
ARCH_BLE, ARCH_GPRS, ARCH_MAX, ARCH_PRO, ARM_MPS2,
ARM_MPS2_M0, ARM_MPS2_M0P, ARM_MPS2_M1, ARM_MPS2_M3,
ARM_MPS2_M4, ARM_MPS2_M7, DELTA_DFCM_NNN40,
DELTA_DFCM_NNN40_OTA, DISCO_F051R8, DISCO_F100RB,
DISCO_F303VC, DISCO_F334C8, DISCO_F401VC,
DISCO_F407VG, DISCO_F429ZI, DISCO_L053C8,
EFM32GG_STK3700, EFM32HG_STK3400, EFM32LG_STK3600,
EFM32WG_STK3800, EFM32ZG_STK3200, HRM1017, K20D50M,
K22F, K64F, KL05Z, KL25Z, KL43Z, KL46Z, LPC1114,
LPC11C24, LPC11U24, LPC11U24_301, LPC11U34_421,
LPC11U35_401, LPC11U35_501, LPC11U35_Y5_MBUG,
LPC11U37H_401, LPC11U37_501, LPC11U68, LPC1347,
LPC1549, LPC1768, LPC2368, LPC4088, LPC4088_DM,
LPC4330_M0, LPC4330_M4, LPC4337, LPC810, LPC812,
LPC824, LPCCAPPUCCINO, MAX32600MBED, MAXWSNENV,
MOTE_L152RC, MTS_DRAGONFLY_F411RE, MTS_GAMBIT,
MTS_MDOT_F405RG, MTS_MDOT_F411RE, NRF51822,
NRF51822_BOOT, NRF51822_OTA, NRF51822_Y5_MBUG,
NRF51_DK, NRF51_DK_BOOT, NRF51_DK_OTA, NRF51_DONGLE,
NUCLEO_F030R8, NUCLEO_F070RB, NUCLEO_F072RB,
NUCLEO_F091RC, NUCLEO_F103RB, NUCLEO_F302R8,
NUCLEO_F303RE, NUCLEO_F334R8, NUCLEO_F401RE,
NUCLEO_F411RE, NUCLEO_L053R8, NUCLEO_L073RZ,
NUCLEO_L152RE, OC_MBUINO, RBLAB_BLENANO,
RBLAB_NRF51822, RZ_A1H, SEEED_TINY_BLE,
SEEED_TINY_BLE_BOOT, SEEED_TINY_BLE_OTA, SSCI824,
STM32F3XX, STM32F407, TEENSY3_1, UBLOX_C027,
UBLOX_C029, WALLBOT_BLE, XADOW_M0, XBED_LPC1768)
-t TOOLCHAIN, –tool=TOOLCHAIN
build using the given TOOLCHAIN (ARM, GCC_ARM, GCC_CR,
GCC_CS, GCC_CW_EWL, GCC_CW_NEWLIB, IAR, uARM)
-c, –clean clean the build directory
-o OPTIONS, –options=OPTIONS
Add a build option (“save-asm": save the asm generated
by the compiler, “debug-info": generate debugging
information, “analyze": run Goanna static code
analyzer")
-p PROGRAM The index of the desired test program: [0-125]
-n PROGRAM_NAME The name of the desired test program
-j JOBS, –jobs=JOBS Number of concurrent jobs (default 1). Use 0 for auto
based on host machine’s number of CPUs
-v, –verbose Verbose diagnostic output
–silent Silent diagnostic output (no copy, compile
notification)
-D MACROS Add a macro definition
–automated Automated test
–host=HOST_TEST Host test
–extra=EXTRA Extra files
–peripherals=PERIPHERALS
Required peripherals
–dep=DEPENDENCIES Dependencies
–source=SOURCE_DIR The source (input) directory
–duration=DURATION Duration of the test
–build=BUILD_DIR The build (output) directory
-d DISK, –disk=DISK The mbed disk
-s SERIAL, –serial=SERIAL
The mbed serial port
-b BAUD, –baud=BAUD The mbed serial baud rate
-L, –list-tests List available tests in order and exit
–rtos Link with RTOS library
–eth Link with Ethernet library
–usb_host Link with USB Host library
–usb Link with USB Device library
–dsp Link with DSP library
–fat Link with FS ad SD card file system library
–ublox Link with U-Blox library
–testlib Link with mbed test library
-l LINKER_SCRIPT, –linker=LINKER_SCRIPT
use the specified linker script

Note: Build mBed SDK from github source with GCC ARM toolchain

Posted in ARM with tags , on 2015 年 05 月 03 日 by Kun-Yi
  1. pull source code from github
    git clone https://github.com/mbedmicro/mbed.git
  2. run install python package,
    cd mbed
    sudo python setup.py (on my ubuntu 12.04 LTS need use sudo command to install python package)
  3. create a private configuration files
    vim workspaces/private_setting.py
    place the below into file
    GCC_ARM_PATH = “${your toolchain}/gcc-arm-none-eabi-4_9-2014q4/bin"
  4.   build mbed nowrun “python workspace_tools/build.py -m K64F -t GCC_ARM -r -e -u -d -F -j 8″
    should would see the below message on screen
    ——————————————————————————————————–
    Building library CMSIS (K64F, GCC_ARM)
    Building library MBED (K64F, GCC_ARM)
    Building library RTX (K64F, GCC_ARM)
    Building library RTOS (K64F, GCC_ARM)
    Building library ETH (K64F, GCC_ARM)
    Building library USBDEVICE (K64F, GCC_ARM)
    Building library CMSIS_DSP (K64F, GCC_ARM)
    Building library DSP (K64F, GCC_ARM)
    Building library FAT (K64F, GCC_ARM)
    …….

    Completed in: (39.63)s

    Build successes:
    * GCC_ARM::K64F

    tip: sometime you need change build folder owner & group to use chown & chgrp command. if you get a build error with file permission