www.8devices.com
View unanswered posts | View active topics It is currently 01 Nov 2014, 05:09



Reply to topic  [ 11 posts ]  Go to page 1, 2  Next
 Another way to brick Carambola2 
Author Message
User avatar

Joined: 11 Jun 2013, 11:34
Posts: 38
Hello community
While tying to fix this strange thing with u-boot
I bricked carambola2 to un-ubootable state. I'll describe all steps below, maybe someone point to what was done wrong
So, I built u-boot, pulled from carambola2 git and enabled via menuconfig
Code:
# make menuconfig
    Boot Loaders  --->
        [*] uboot-ar71xx-nbg460n_550n_550nh


As a result I got bin/ar71xx/openwrt-ar71xx-generic-nbg460n_550n_550nh-u-boot.bin

To get rw access to the u-boot section I also built kernel with mtd partitions unlocked.

On carambola2 side I first flashed new firmware, then booted with new kernel.
Last step - I flashed the image to u-boot partition with mtd utility
Code:
root@OpenWrt:/tmp# mtd write openwrt-ar71xx-generic-nbg460n_550n_550nh-u-boot.bin u-boot
Unlocking u-boot ...

Writing from openwrt-ar71xx-generic-nbg460n_550n_550nh-u-boot.bin to u-boot ...
root@OpenWrt:/tmp#
root@OpenWrt:/tmp# reboot


I would appreciate if someone points me to a doc describing how to unbrick C2 with JTAG, if this ever possible.


01 Feb 2014, 15:38
Profile

Joined: 11 Mar 2012, 18:42
Posts: 18
hutorny wrote:
So, I built u-boot, pulled from carambola2 git and enabled via menuconfig [...]

Why did you think that "uboot-ar71xx-nbg460n_550n_550nh" will work on Carambola 2? It's even not for AR9331 SoC!

hutorny wrote:
I would appreciate if someone points me to a doc describing how to unbrick C2 with JTAG, if this ever possible.

Desolder FLASH chip and reprogram it using Raspberry Pi: http://flashrom.org/RaspberryPi

PS. Maybe you will be interested in my modified version of U-Boot for Carambola 2: https://github.com/pepe2k/u-boot_mod


13 Feb 2014, 20:49
Profile

Joined: 21 Aug 2013, 21:21
Posts: 88
or if You have an older machine with LPT port, then You can reprogram it with only 4 resistors:
http://rayer.g6.cz/programm/programe.htm
(see SPIPGM section)

but before reprogramming, You should save the last 64KB called "ART" partition! in case of lost, You can use image from any other similar system but wifi performance will be degraded a bit!


13 Feb 2014, 21:30
Profile
User avatar

Joined: 11 Jun 2013, 11:34
Posts: 38
Hi all,

@pepe2k @FPeter - thanks for your responses!

pepe2k wrote:
hutorny wrote:
So, I built u-boot, pulled from carambola2 git and enabled via menuconfig [...]

Why did you think that "uboot-ar71xx-nbg460n_550n_550nh" will work on Carambola 2? It's even not for AR9331 SoC!


Well, it was a wild guess - first of all it is the only U-Boot image available in the configuration.
Second - some of the Atheros drivers in Carambola2 image are reused from ar71xx.

pepe2k wrote:
hutorny wrote:
I would appreciate if someone points me to a doc describing how to unbrick C2 with JTAG, if this ever possible.

Desolder FLASH chip and reprogram it using Raspberry Pi: http://flashrom.org/RaspberryPi


Thanks, I found this very useful.

pepe2k wrote:
PS. Maybe you will be interested in my modified version of U-Boot for Carambola 2: https://github.com/pepe2k/u-boot_mod


It looks interesting. What are the differences comparing to the stock U-Boot?

FPeter wrote:
or if You have an older machine with LPT port, then You can reprogram it with only 4 resistors:
http://rayer.g6.cz/programm/programe.htm
(see SPIPGM section)

but before reprogramming, You should save the last 64KB called "ART" partition! in case of lost, You can use image from any other similar system but wifi performance will be degraded a bit!


Unluckily, the oldest PC I can boot has no LPT.


14 Feb 2014, 09:32
Profile

Joined: 11 Mar 2012, 18:42
Posts: 18
hutorny wrote:
pepe2k wrote:
PS. Maybe you will be interested in my modified version of U-Boot for Carambola 2: https://github.com/pepe2k/u-boot_mod


It looks interesting. What are the differences comparing to the stock U-Boot?

There are a lot of differences and new/custom features.
I think that the most important are:
- firmware recovery/upgrade over www
- NetConsole
- overclocking/underclocking possibilities (with recovery mode):

Code:
*********************************************
*        U-Boot 1.1.4  (Feb 14 2014)        *
*********************************************

AP121 (AR9331) U-Boot for CARAMBOLA2 v1

DRAM:   64 MB DDR2 16-bit
FLASH:  Winbond W25Q128 (16 MB)
CLOCKS: 400/400/200/33 MHz (CPU/RAM/AHB/SPI)

LED on during eth initialization...

Hit any key to stop autobooting:  0

uboot> setcl

Current clocks (approximated):
- CPU: 400 MHz
- RAM: 400 MHz
- AHB: 200 MHz
- SPI:  33 MHz
- REF:  40 MHz

Available PLL and clocks configurations: 18

      | CPU | RAM | AHB | SPI | [ ]
  ---------------------------------
   1. | 200 | 200 | 100 |  25 | [ ]
   2. | 200 | 200 | 200 |  33 | [ ]
   3. | 250 | 250 | 125 |  31 | [ ]
   4. | 250 | 250 | 250 |  31 | [ ]
   5. | 300 | 300 | 150 |  25 | [ ]
   6. | 360 | 360 | 180 |  30 | [ ]
   7. | 380 | 380 | 190 |  32 | [ ]
   8. | 400 | 400 | 200 |  33 | [ ]
   9. | 420 | 420 | 210 |  35 | [ ]
  10. | 440 | 440 | 220 |  27 | [ ]
  11. | 460 | 460 | 230 |  29 | [ ]
  12. | 480 | 480 | 240 |  30 | [ ]
  13. | 500 | 500 | 250 |  31 | [ ]
  14. | 500 | 250 | 250 |  31 | [ ]
  15. | 520 | 520 | 260 |  32 | [ ]
  16. | 560 | 280 | 140 |  35 | [ ]
  17. | 580 | 290 | 145 |  36 | [ ]
  18. | 600 | 300 | 200 |  33 | [ ]

[*] = currently selected profile (stored in FLASH).
All clocks in MHz, run 'setclocks X' to choose one.

** Notice:
   you should always make a backup of your device
   entire FLASH content before making any changes

uboot>


Here you may find a compiled image (the latest version, don't use image from GitHub release, it's a little bit old) for Carambola 2 (with official development board only!):
http://www.tech-blog.pl/pliki/uboot_for ... 2-2014.zip

Put the image (256 KiB) at the beginning of the FLASH. Remember to erase corresponding space (4x 64 KiB block) before programming.
The above image was tested, 10 minutes ago :)


14 Feb 2014, 09:58
Profile

Joined: 18 Nov 2013, 18:44
Posts: 40
Looks like mine is also bricked :(

I built my own uboot image, and you can use it from here if you wish:
https://dl.dropboxusercontent.com/u/184 ... mbola2.bin
https://dl.dropboxusercontent.com/u/184 ... mbola2.md5

Here is the procedure I used to compile uboot from pepe2k git sources:

Code:
git clone https://github.com/pepe2k/u-boot_mod.git
cd u-boot_mod/
wget http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/OpenWrt-Toolchain-ar71xx-for-mips_r2-gcc-4.6-linaro_uClibc-0.9.33.2.tar.bz2
tar xvjf OpenWrt-Toolchain-ar71xx-for-mips_r2-gcc-4.6-linaro_uClibc-0.9.33.2.tar.bz2
mv OpenWrt-Toolchain-ar71xx-for-mips_r2-gcc-4.6-linaro_uClibc-0.9.33.2/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/ toolchain


then edited uboot Makefile per instructions:
Code:
nano Makefile

   export BUILD_TOPDIR=$(PWD)
   export STAGING_DIR=$(BUILD_TOPDIR)/tmp

   export MAKECMD=make --silent ARCH=mips CROSS_COMPILE=mips-openwrt-linux-uclibc-
   export PATH:=$(BUILD_TOPDIR)/toolchain/bin/:$(PATH)

   # boot delay (time to autostart boot command)
   export CONFIG_BOOTDELAY=1

   # uncomment following line, to disable output in U-Boot console
   export DISABLE_CONSOLE_OUTPUT=1


and then combiled uboot from this pepe2k sources:
Code:
make 8devices_carambola2


ls -al bin/
total 272
drwxr-xr-x 2 valent valent 4096 Lip 12 21:03 .
drwxr-xr-x 9 valent valent 4096 Lip 12 21:01 ..
-rw-r--r-- 1 valent valent 57 Lip 12 20:54 README
-rw-r--r-- 1 valent valent 262144 Lip 12 21:03 uboot_for_8devices_carambola2.bin
-rw-r--r-- 1 valent valent 68 Lip 12 21:03 uboot_for_8devices_carambola2.md5

and then put carambola to bootloaded mode and issued these commands:
Code:
setenv ipaddr 192.168.1.1
setenv serverip 192.168.1.2
tftpboot 0x80800000 uboot_for_8devices_carambola2.bin
erase 0x9F000000 +0x10000
cp.b 0x80800000 0x9F000000 0x10000
reset


Where did I go wrong?


12 Jun 2014, 19:52
Profile

Joined: 11 Mar 2012, 18:42
Posts: 18
valent wrote:
Where did I go wrong?

HERE:
Code:
[...]
erase 0x9F000000 +[b]0x10000[/b]
cp.b 0x80800000 0x9F000000 [b]0x10000[/b]
[...]

-rw-r--r-- 1 valent valent 262144 Lip 12 21:03 uboot_for_8devices_carambola2.bin

0x10000 == 64 KB, not 256 KB.

And yes, you broke it - now you need an external FLASH programmer.


12 Jun 2014, 19:59
Profile

Joined: 21 Aug 2013, 21:21
Posts: 88
hutorny wrote:
FPeter wrote:
or if You have an older machine with LPT port, then You can reprogram it with only 4 resistors:
http://rayer.g6.cz/programm/programe.htm
(see SPIPGM section)

but before reprogramming, You should save the last 64KB called "ART" partition! in case of lost, You can use image from any other similar system but wifi performance will be degraded a bit!


Unluckily, the oldest PC I can boot has no LPT.

another cheap alternative for external programming:
http://www.ebay.com/itm/EN25T80-Programmer-USB-Series-SPI-Flash-Bios-24CXX25XX-STC-AVR-Support-TTL-Hot-/191177338209?pt=AU_B_I_Electrical_Test_Equipment&hash=item2c830ead61

or if You have an another working device: remove both flash IC-s and wire them parallel, except the CS pin! First, connect the CS pin on working one to the modoule, terminate the boot process in uboot console, then disconnect first flash and connect CS pin of secondary and write it


16 Jun 2014, 08:20
Profile

Joined: 18 Nov 2013, 18:44
Posts: 40
pepe2k wrote:
valent wrote:
Where did I go wrong?

HERE:
Code:
[...]
erase 0x9F000000 +[b]0x10000[/b]
cp.b 0x80800000 0x9F000000 [b]0x10000[/b]
[...]

-rw-r--r-- 1 valent valent 262144 Lip 12 21:03 uboot_for_8devices_carambola2.bin

0x10000 == 64 KB, not 256 KB.

And yes, you broke it - now you need an external FLASH programmer.


Ok, got it. So I need to do this instead:

Code:
[...]
erase 0x9F000000 +0x40000
cp.b 0x80800000 0x9F000000 0x40000
[...]


Tested it on another Carambola 2 and success! Not bricked this time :)


Last edited by valent on 16 Jun 2014, 22:37, edited 1 time in total.



16 Jun 2014, 21:36
Profile

Joined: 11 Mar 2012, 18:42
Posts: 18
valent wrote:
Ok, got it. So I need to do this instead:

Code:
[...]
erase 0x9F000000 +0x40000
cp.b 0x80800000 0x9F000000 0x40000
[...]


Right?

Yes.


16 Jun 2014, 21:50
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 11 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Protected by Anti-Spam ACP Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.