Modifying BL2 Code
Normally you will not need to modify the BL2 code, but sometimes it can't be avoided. Our example here guides you through the case of disabling the factory default auto-reset feature.
Factory Reset - gpg16 / GPIO 46
The ARTIK 05x development board includes an "Arduino Reset" button connected to signal gpio pin 14, referenced as gpg16 / GPIO_46. When this line is held active during boot for more than ~10 seconds, the boot code will automatically erase the image to try to recover from a corrupt image load.
If you have reassigned this pin for other uses in your design, you may find this behavior quite annoying. The procedure below allows you to disable the function.
Preparation
On your Linux development system, follow these steps.
-
Install Crypto.
pip install pycrypto
-
Clone the U-Boot directory to a new directory under the root
mkdir ~/uboot
cd ~/uboot
git clone --depth=50 --branch=artik-05x https://github.com/SamsungARTIK/u-boot-artik.git
Procedure
-
Go into the cloned subdirectory and edit the noted header file.
cd ~/uboot/u-boot-artik
vi include/configs/artik05x.h
-
Search for
res_gpio
-
Delete the entire section, leaving you only with:
1 2
" mw.l 0x800400a8 0x13111111\n" \ " mw.l 0x800400a8 0x11111111\n" \
-
Compile.
make artik05x_defconfig
make CROSS_COMPILE=arm-none-eabi-
-
Attach header.
./tools/attachns2-s.py ./u-boot.bin ./u-boot.head.bin ./rsa_public.key
-
Sign the bootloader (modify path as needed).
~/ARTIK055s/TizenRT/build/configs/artik05x/tools/codesigner/artik05x_codesigner -sign u-boot.head.bin
-
Copy the file to your home directory and change to it (again, modify path as needed).
cp u-boot.head.bin-signed ~/ARTIK055s/TizenRT/build/configs/artik055s/bin/bl2.bin
cd ~/ARTIK055s/TizenRT/os
-
Flash the file to your board.
make download ALL
(or just bl2)