Possible to flash bootloader from Linux on i.MX536?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Possible to flash bootloader from Linux on i.MX536?

962 Views
michaeljohn
Contributor IV

Hello,

I'm attempting to flash the bootloader to NAND from Linux Userspace. I can do this successfully if I'm running off MMC, but if I'm running off NAND I get errors. My NAND partitions are the following:

1 - Bootloader

2 - Kernel

3 - RootFS

Linux kernel 2.6.35 and u-boot 2009.08.

This is the error I get when attempting to flash while running from NAND:

# flash_erase /dev/mtd0 0 0
Erasing 128 Kibyte @ fe0000 -- 100 % complete
# kobs-ng init --chip_0_device_path=/dev/mtd0 ./u-boot.bin
UBIFS error (pid 856): ubifs_check_node: bad CRC: calculated 0x54b729d9, read 0x89df9781
UBIFS error (pid 856): ubifs_check_node: bad node at LEB 530:8016
UBIFS error (pid 856): ubifs_read_node: expected node type 1
UBIFS error (pid 856): do_readpage: cannot read page 3 of inode 6759, error -117
UBIFS error (pid 856): ubifs_check_node: bad CRC: calculated 0x54b729d9, read 0x89df9781
UBIFS error (pid 856): ubifs_check_node: bad node at LEB 530:8016
UBIFS error (pid 856): ubifs_read_node: expected node type 1
UBIFS error (pid 856): do_readpage: cannot read page 3 of inode 6759, error -117
zsh: bus error  kobs-ng init --chip_0_device_path=/dev/mtd0 ./u-boot.bin
# UBIFS error (pid 800): ubifs_check_node: bad CRC: calculated 0x175bdab8, read 0x283fd80a
UBIFS error (pid 800): ubifs_check_node: bad node at LEB 2785:5616
UBIFS error (pid 800): ubifs_read_node: expected node type 1
UBIFS error (pid 800): do_readpage: cannot read page 44 of inode 8679, error -117
UBIFS error (pid 800): ubifs_check_node: bad CRC: calculated 0x175bdab8, read 0x283fd80a
UBIFS error (pid 800): ubifs_check_node: bad node at LEB 2785:5616
UBIFS error (pid 800): ubifs_read_node: expected node type 1
UBIFS error (pid 800): do_readpage: cannot read page 44 of inode 8679, error -117
UBIFS error (pid 800): ubifs_check_node: bad CRC: calculated 0x175bdab8, read 0x283fd80a
UBIFS error (pid 800): ubifs_check_node: bad node at LEB 2785:5616
UBIFS error (pid 800): ubifs_read_node: expected node type 1

It continues to print UBIFS errors till a power cycle, at which point there is no bootloader.

Is it possible to write the bootloader to NAND from Linux userspace if you booted from NAND?

Thanks,

-Michael

Labels (2)
0 Kudos
3 Replies

700 Views
tobycollett
Contributor I

I have been investigating this with Michael, I can reproduce the issue by issuing

echo 1 > /sys/devices/platform/mxc_nandv2_flash.0/disable_bi_swap

and then accessing something on a filesystem on the NAND chip. This issue seems to be that kobs-ng modifies disable_bi_swap during the write process and does not restore it.

0 Kudos

700 Views
michaeljohn
Contributor IV

Sorry I wasn't clearer in my original post. The bootloader is on the first NAND partition (/dev/mtd0) and UBIFS is on the third NAND partition (/dev/mtd2). Would "flash_erase" still destroy NAND UBIFS structures in this case?

0 Kudos

700 Views
igorpadykov
NXP Employee
NXP Employee

Hi Michael

when running off NAND seems "flash_erase" destroys nand ubifs structures

so there are such errors. Note, nxp supports only nand programming using

mfg tools option, available on link

i.MX53 Quick Start Board|NXP 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos