From: dan <[email protected]> Reply-To: <[email protected]> Date: Saturday, April 12, 2014 at 7:07 PM To: <[email protected]> Subject: Re: [beagleboard] undo boot from sdcard? need to boot from emmc while an sdcard is inserted
> also, I dont have this: ³setenv mmcdev 0" > > > On Sat, Apr 12, 2014 at 3:50 PM, dan <[email protected]> wrote: >> >> On Fri, Apr 11, 2014 at 11:23 AM, John Syn <[email protected]> wrote: >>> Just remove the part that does ³setenv mmcdev 0" >> >> If I do this, can I still boot from sdcard by holding the user boot button? The boot button controls the SYS_BOOT2 pin on the processor which is normally high (boot button not pressed) and loads u-boot from the eMMC. Then, u-boot runs the scripts defined in it¹s environment. Use printenv to see the env settings. If you are using minicom, for your console, press ctrl a w to enable line wrap (or the equivalent command for putty, etc). enter the printenv command and then scroll up to see the bootcmd which should look something like this: bootcmd=gpio set 53; i2c mw 0x24 1 0x3e; run findfdt; mmc dev 0; if mmc rescan ; then echo micro SD card found;setenv mmcdev 0;else echo No micro SD card found, setting mmcdev to 1;setenv mmcdev 1;fi;setenv bootpart ${mmcdev}:2;mmc dev ${mmcdev}; if mmc rescan; then gpio set 54; echo SD/MMC found on device ${mmcdev};if run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;gpio set 55; if run loaduimage; then gpio set 56; run loadfdt;run mmcboot;fi;fi; While this looks complicated, it really isn¹t. It starts of by turning on an LED, runs a command findfdt which is defined as: findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi; if test $board_name = A335BNLT; then setenv fdtfile am335x-boneblack.dtb; fi; if test $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $board_name = A335X_SK; then setenv fdtfile am335x-evmsk.dtb; fi Which just sets a variable ³fdtfile² to " am335x-boneblack.dtb² To prove this, enter these commands in u-boot: run findfdt echo $findfdt Continuing with bootcmd, it test to see if the SDCard is installed (if mmc rescan) and if it is, ³mmcdev² is set to ³0² (BTW, eMMC is mmcdev 1). Reading further, the script then runs loadbootenv, which loads the uEnv.txt, which it loads from SDCard if one is installed ($mmcdev = 0) or it loads from eMMC if no SDCard is installed ($mmcdev = 1). I¹ll leave your to read the remainder of the bootcmd script. BTW, I believe this behavior is baked into u-boot and you have to change u-boot source code to change this behavior. You can only modify u-boot behavior after uEnv.txt is loaded. Also, when you press the load button, u-boot is read from the SDCard. When the load button isn¹t pressed, u-boot is read from the eMMC. So, to answer your question, if you press the boot button, it will always boot from the SDCard. Regards, John > > > -- > For more options, visit http://beagleboard.org/discuss > --- > You received this message because you are subscribed to the Google Groups > "BeagleBoard" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
