STM32F429 Testing

參考 Jserv 提供的 https://stm32f429.hackpad.com/NOTE-WbiooOfkaoR 步驟

我更改了 Toolchain 安裝的方法, 直接從下面網址 下載 Prebuilt package  然後解壓縮放到自己習慣的目錄下

GCC 4.8.2 for ARM Embedded Toolchain

https://launchpad.net/gcc-arm-embedded

後面寫了一個 envsetup.sh  bash script

#!/bin/bash

echo “setting build environment for STM32F4″

# copy from AOSP
function cgrep()
{
find . -name .repo -prune -o -name .git -prune -o -type f \( -name ‘*.c’ -o -name ‘*.cc’ -o -name ‘*.cpp’ -o -name ‘*.h’ \) -print0 | xargs -0 grep –color -n “$@"
}
export STM32F4_PATH=~/STM32F4
export PATH=$STM32F4_PATH/toolchain/gcc-arm-none-eabi-4_8-2013q4/bin/:$STM32F4_PATH/toolkits/bin:$PATH

然後 make 後就可以透過 st-link tools 直接刷, st-link 擺在 tookits/bin 內

st-flash write r3d.bin 0x08000000
2014-02-05T10:55:15 INFO src/stlink-usb.c: — exit_dfu_mode
2014-02-05T10:55:15 INFO src/stlink-common.c: Loading device parameters….
2014-02-05T10:55:15 INFO src/stlink-common.c: Device connected is: F42x and F43x device, id 0x10036419
2014-02-05T10:55:15 INFO src/stlink-common.c: SRAM size: 0x30000 bytes (192 KiB), Flash: 0x200000 bytes (2048 KiB) in pages of 16384 bytes
2014-02-05T10:55:15 INFO src/stlink-common.c: Attempting to write 440304 (0x6b7f0) bytes to stm32 address: 134217728 (0x8000000)
EraseFlash – Sector:0x0 Size:0x4000
Flash page at addr: 0x08000000 erasedEraseFlash – Sector:0x1 Size:0x4000
Flash page at addr: 0x08004000 erasedEraseFlash – Sector:0x2 Size:0x4000
Flash page at addr: 0x08008000 erasedEraseFlash – Sector:0x3 Size:0x4000
Flash page at addr: 0x0800c000 erasedEraseFlash – Sector:0x4 Size:0x10000
Flash page at addr: 0x08010000 erasedEraseFlash – Sector:0x5 Size:0x20000
Flash page at addr: 0x08020000 erasedEraseFlash – Sector:0x6 Size:0x20000
Flash page at addr: 0x08040000 erasedEraseFlash – Sector:0x7 Size:0x20000
Flash page at addr: 0x08060000 erased
2014-02-05T10:55:23 INFO src/stlink-common.c: Finished erasing 8 pages of 131072 (0x20000) bytes
2014-02-05T10:55:23 INFO src/stlink-common.c: Starting Flash write for F2/F4
2014-02-05T10:55:23 INFO src/stlink-common.c: Successfully loaded flash loader in sram
size: 32768
size: 32768
size: 32768
size: 32768
size: 32768
size: 32768
size: 32768
size: 32768
size: 32768
size: 32768
size: 32768
size: 32768
size: 32768
size: 14320
2014-02-05T10:55:36 INFO src/stlink-common.c: Starting verification of write complete
2014-02-05T10:55:45 INFO src/stlink-common.c: Flash written and verified! jolly good!

result

Image

update:

在 Ubuntu 下用 st-link 記得要把 49-stlinkv2.rules 丟到 /etc/udev/rules.d/ 下面

我自己是有稍微修改內容成為下面樣式

SUBSYSTEM=="usb", ATTR{idVendor}=="0483″, ATTR{idProduct}=="3748″, \
MODE="0666″, OWNER="kunyi", GROUP="plugdev", \
SYMLINK+="stlinkv2_%n"

廣告

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

您的留言將使用 WordPress.com 帳號。 登出 / 變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 / 變更 )

Facebook照片

您的留言將使用 Facebook 帳號。 登出 / 變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 / 變更 )

連結到 %s

%d 位部落客按了讚: