bootcmd env changed after a successful boot of JB4.3 demo binary w/ iMX6Q-SD board

cancel
Showing results for 
Search instead for 
Did you mean: 

bootcmd env changed after a successful boot of JB4.3 demo binary w/ iMX6Q-SD board

2,285 Views
yanfengliu
Contributor III

By using "setenv bootcmd booti mmc2" followed by a successful "saveenv", we can boot the droid JB demo binary successful w/ the iMX6Q-SD board.

However, after doing "reset" or power on again, we found that the env variable "bootcmd" has been changed to some other value and device can't boot.

Here is the successful boot case:

Hit any key to stop autoboot:  0

MX6Q SABRESD U-Boot > setenv bootcmd booti mmc2

MX6Q SABRESD U-Boot > saveenv

Saving Environment to MMC...

Writing to MMC(2)... done

MX6Q SABRESD U-Boot > boot

kernel   @ 10808000 (4724232)

Here is the env after "reset" or reboot, the boot will fail (w/ a droid icon with a  !! mark shown on the screen):


MX6Q SABRESD U-Boot > printenv

...

bootcmd=run bootcmd_android_recovery

bootcmd_android_recovery=booti mmc2 recovery


It seems that the successful boot was from boot partition of mmc2 (SD3 on the board), but the changed value is from recovery partition.


Hope someone can give some pointers here about how to fix it.


I am using the following commands to prepare the 8GB SD card:


dd if=u-boot-6q.bin of=/dev/sdb bs=1K skip=1 seek=1

dd if=SD/boot.img of=/dev/sdb1;

dd if=SD/system.img of=/dev/sdb5;

dd if=SD/recovery.img of=/dev/sdb2;


The image I am using is "android_jb4.3_1.1.0-ga_image_6qsabresd.tgz"


Regards,

yanfeng

Labels (1)
0 Kudos
24 Replies

556 Views
b45499
NXP TechSupport
NXP TechSupport

Hi Feng,

Can you attach your whole uboot environment? And how do you create your SD card partitions?

Best Regards

Dan

0 Kudos

556 Views
yanfengliu
Contributor III

Dan,

Here are the "printenv" dump, the boot log is also attached.

MX6Q SABRESD U-Boot > printenv

bootdelay=3

baudrate=115200

ipaddr=192.168.1.103

serverip=192.168.1.101

netmask=255.255.255.0

loadaddr=0x10800000

rd_loadaddr=0x11000000

netdev=eth0

ethprime=FEC0

splashimage=0x30000000

splashpos=m,m

lvds_num=1

bootcmd_android_recovery=booti mmc2 recovery

ethact=FEC0

fastboot_dev=mmc2

bootargs=console=ttymxc0,115200 init=/init video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32 video=mxcfb1:off video=mxcfb2:off fbmem=28M androidboot.hardware=freescale androidboot.console=ttymxc0 vmalloc=400M no_console_suspend=1

stdin=serial

stdout=serial

stderr=serial

bootcmd=run bootcmd_android_recovery

As for the SD card partition, I did it using the "mksdcard-android.sh" tool within the MGFtools tarball got from freescale site.

Regards,

Yanfeng

0 Kudos

556 Views
b45499
NXP TechSupport
NXP TechSupport

Hi Feng,

When you power on the board ,set the uboot environment  the bootcmd should be set ''setenv bootcmd booti mmc2'. You can have a try~~

Best Regards

Dan

0 Kudos

556 Views
yanfengliu
Contributor III

Dan,

Yes I know that setenv thing, but my question was after using the "setenv bootargs ..." and "saveenv", the device can boot successfully once, then upon another reboot, the param changed back to the recovery I shared with you.

Do you have any hints about why the param changed to recovery mode?

Regards,

Yanfeng

0 Kudos

556 Views
b45499
NXP TechSupport
NXP TechSupport

Hi Feng,

I have tested on my board with the same environment with you, It works OK. But I download the image to board by MFGTool  not dd commends. I think the problem happened when you downloaded image to your board. When you download by dd commends, you missed sync. Maybe you can try the following to download again.

dd if=u-boot-6q.bin of=/dev/sdb bs=1K skip=1 seek=1; sync

dd if=SD/boot.img of=/dev/sdb1;sync

dd if=SD/system.img of=/dev/sdb5; sync

       dd if=SD/recovery.img of=/dev/sdb2;sync
By the way, I recommend you to use the MFGTool to download, I think it's more convenient. Which you can download from freescale for free, the link is SABRE Platform for Smart Devices Based on the i.MX 6 Series and it's under Programmers, the name is IMX_6DQ_MFG_TOOL.

Hope this can help you. If any question contact us~~

Best Regards

Dan

0 Kudos

556 Views
yanfengliu
Contributor III

Dan,

Thank you. I did use "sync" after each dd command but I didn’t put it on the ticket for simplicity.

I will retry later.

Regards,

Yanfeng

0 Kudos

556 Views
b45499
NXP TechSupport
NXP TechSupport

Hi Feng,

Have you solved your problem?

Best Regards

Dan

0 Kudos

556 Views
yanfengliu
Contributor III

Dan,

I found in my log that:

i2c: I2C3 SDA is low, start i2c recovery...

I2C3 Recovery success

Found PFUZE100! deviceid=10,revid=11

Recovery key pressed

Recovery command file founded!

recovery on bootdev: 6

setup env for recovery..

This probably tells that the boot loader detects that "recovery key pressed" thus it enters recovery mode. Maybe your device doesn’t have this behavior.

Regards,

Yanfeng

0 Kudos

556 Views
b45499
NXP TechSupport
NXP TechSupport

Hi Feng,

Which board are you using? You designed?

Best Regards

Dan

0 Kudos

556 Views
yanfengliu
Contributor III

Dan,

The model is "MCIMX6Q-SDB", looks like a standard one from freescale. It has an on-board built-in SanDisk 8GB storage as mmc:0 but I am using a SD card which is mmc:2.

The boot DIP is set as 01000010 which means to boot from the SD.

I tried again with a newly prepared SD card, the situation is still the same. I guess somehow my card is entering "recovery" mode.

Regards,

Yanfeng

0 Kudos

556 Views
b45499
NXP TechSupport
NXP TechSupport

Hi Feng,

It's strange, I can see that your setting is correct. Have you tried to download the android demo image to your board by MFGTool ?

Best Regards

Dan

0 Kudos

556 Views
yanfengliu
Contributor III

Dan,

Not yet. I though "dd" is direct and simple than such tools so I didn’t try it.

Is that MFGtool trying to download image files to the internal eMMC, or the SD card?

Should I adjust the boot DIP to something else?

Regards,

Yanfeng

0 Kudos

556 Views
b45499
NXP TechSupport
NXP TechSupport

Hi Feng,

Have you solved your problem now ?

Best Regards

Dan

0 Kudos

555 Views
yanfengliu
Contributor III

Dan

Unfortunately no.

We've given up this since it is only for a POC project.

Regards,

Yanfeng

0 Kudos

555 Views
b45499
NXP TechSupport
NXP TechSupport

Hi Feng,

So sorry to heard that, It's strange. But I think you can try again once you are not busy. Anyway, contact us when you meet problems.

By the way, If you have no other problem, would you please help helpful answer or correct answer for us? Thanks~~

Best Regards

Dan

0 Kudos

555 Views
yanfengliu
Contributor III

Dan,

Thank you for the effort.

I am guess that MCIMX6Q-SDB device we are using is having some issue with the demo binaries downloaded from freescale.com. This mismatching always causes the boot loader thinks that "recovery key is pressed" thus enters the recovery mode. You can check the console log I shared to verify this point.

Maybe this won’t happen with another FSL device with a different model but we don’t have any such devices to try.

The device we have has tags stickers like "SCH-27516 Rev C1" and "700-27516 Rev A" on it, not sure if you have the same device model or not.

Thank you anyway.

Regards,

Yanfeng

0 Kudos

555 Views
b45499
NXP TechSupport
NXP TechSupport

Hi Feng,

The board I using is MCIMX6Q-SDB which the tags stickers are ''SCH-27516 Rev B5'' and "700-27516 Rev X5".  It works OK.

By the way, you can try the image build yourself on your board.

Best Regards

Dan

0 Kudos

555 Views
yanfengliu
Contributor III

Dan,

The saveenv issue was finally solved by removing an extra sister board attached to the device. I guess somehow that sister board overwrites the saveenv operation.... anyway, it was gone and thank you for all the help.

Just wondering if you can give a look at this question: https://community.freescale.com/message/431454

Regards,

yanfeng

0 Kudos

556 Views
b45499
NXP TechSupport
NXP TechSupport

Hi Feng,

You can download image to both eMMC and SD card. It depends on your setting. It's easy and exact clearly to watch the download process.

When you want to download, you should change the SW6 to00001100 (from 1-8 bit) download mode. And when you want to boot, you have to change it to boot mode.

You can refer to the file I attached you.

Best Regards

Dan

0 Kudos

556 Views
martinhowell
Contributor III

If you are using the uboot that comes with the JB 4.2 you will find that it always overwrites the bootcmd  with the string booti mmc3. I had to change uboot to stop this behavior. I dont know if this is the same in JB 4.3 or if there is a similar thing when booting in recovery mode.

Look in the file /bootable/bootloader/uboot-imx/board/freescale/mx6q_sabresd/mx6q_sabresd.c around line 1900, you can see it forces the env variable every board init.

int board_late_init(void)

{

  int ret = 0;

#ifdef MX6Q_SABRESD_ANDROID_H

  switch (get_boot_device()) {

  case SD_BOOT:

  setenv("fastboot_dev", "mmc2");

  setenv("bootcmd", "booti mmc2");

  break;

  case MMC_BOOT:

  setenv("fastboot_dev", "mmc3");

  setenv("bootcmd", "booti mmc3");

  break;

  default:

  printf("unsupported boot devices\n");

  break;

  }

#endif

#ifdef CONFIG_I2C_MXC

  setup_i2c(CONFIG_SYS_I2C_PORT);

  i2c_bus_recovery();

  ret = setup_pmic_voltages();

  if (ret)

  return -1;

#endif

  return 0;

}

0 Kudos