Archive for the ARM Category

Note: XBL for Qualcomm

Posted in ARM, DragonBoard, Qualcomm with tags , on 2017 年 10 月 16 日 by Kun-Yi

Qualcomm 的平台從原本的 自家的SBL (Second Boot Loader) 改成走 UEFI 的 XBL (eXtensible Boot loader)

而且Toolchain 從以前的ARM DS-5 改成自家的Snapdragon LLVM, 最新的LLVM 是4.0.2(Oct. 2017), 但是平台上用的 XBL toolchain 可能是舊的

要看ReleaseNote 裡面用的版本, 因為他基於llvm.org 的版本不同, 跟改進的週期因素, 常常Compiler optional 關鍵字會起變化 需要特別的版本才能正確的re-build XBL (最近遇到必須是 SD LLVM 3.5.x, 但是官方支援管道, 極有可能會遇到不熟的跟你扯半天也沒正確結果)

今天找了一下 https://github.com/sudosurootdev/prebuilts_clang_linux-x86_host_msm-3.5/tree/pointers 這有一個 For Android NDK 用的版本 但是可以順利Rebuild XBL

 

 

廣告

Note: Kontron SMARC-sAMX6i

Posted in ARM, i.MX6 with tags on 2017 年 10 月 11 日 by Kun-Yi

from https://lists.yoctoproject.org/pipermail/meta-freescale/2014-December/011841.html download device tree files

The board always boot from ECSPI4, use W25Q16DW (16MBits/2MBytes)
ECSPI4 memory space layout

Partition 0, from 0 ~ 0xbffff (768KB), for bootloader
Partition 1, from 0xc0000 ~ 0xcffff (64KB), for U-Boot Environment use 32KB
Partition 2, others space, for user

LCD Brightness control through the below pins

MX6QDL_PAD_SD1_DAT0__GPIO1_IO16, Backlight Enabled
MX6QDL_PAD_SD1_DAT1__GPIO1_IO17, LCD Power Enabled
MX6QDL_PAD_SD1_CMD__PWM4_OUT, Brightness PWM ouput

I2C ports

I2C1, for SMARC General Purpose

MX6QDL_PAD_CSI0_DAT8__I2C1_SDA
MX6QDL_PAD_CSI0_DAT9__I2C1_SCL

I2C2, for HDMI

MX6QDL_PAD_KEY_COL3__I2C2_SCL
MX6QDL_PAD_KEY_ROW3__I2C2_SDA

I2C3, for Power Managmenet
I2C-GPIO0, for System management (PMIC:PFUZE100 on the bus)

MX6QDL_PAD_ENET_TXD0__GPIO1_IO30, SCL   MX6QDL_PAD_ENET_TX_EN__GPIO1_IO28, SDA

I2C-GPIO1, for SMARC CAMERA

MX6QDL_PAD_GPIO_6__GPIO1_IO06, SCL
MX6QDL_PAD_KEY_COL2__GPIO4_IO10, SDA

I2C-GPIO2, for SMARC LCD

MX6QDL_PAD_SD1_DAT2__GPIO1_IO19, SCL
MX6QDL_PAD_SD1_DAT3__GPIO1_IO21, SDA

 

 

Note: Firefly-RK3288 with Linux update

Posted in RK3288 with tags , , on 2017 年 08 月 24 日 by Kun-Yi

use linux tool (rkdeveloptool) to update image into EMMC, need remind device need force boot on maskrom mode

see here how to enforce into maskrom mode, it just break EMMC function, let bootrom stay in maskrom

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.