2

I have a BeagleBone Black, with Debian 8.3, Linux 4.1.15-ti-rt-r43.

EDIT: The system is installed on the internal flash.

I modified the /boot/uEnv.txt to load a different dtb file, apparently with wrong file name, so it doesn't boot into Linux.

So I connected via J1 pins / UART0 -> terminal program on my PC. I see that U-Boot complains about a file not being found, so it won't start Linux, and gives me the U-Boot commands. What was listed after entering "help" didn't look very useful.

Is it possible, and feasible, to repair the uEnv.txt from my serial console with U-Boot commands - which would work... how? Or, what else would the best approach be?


EDIT#2: Finding some useful scraps on this site, which did not exactly tell, but lead in a useful direction: https://www.compulab.co.il/utilite-computer/wiki/index.php/Utilite_U-Boot_User_How-To%27s I found I can actually see uEnv.txt typing in the U-Boot console: "ls mmc 1 boot", the ls command in U-Boot needs the device name + num, and apparently my SDcard is mmc0, the internal flash mmc1, funny order. Alas, U-Boot has no "cat", let alone an editor apparently. Like a kid with a remote controlled arm trying to grab a plush animal for some coins, can't quite grasp my file, and it's so close, argh!


EDIT#3: I saw that I have an old backup file of uEnv.txt on mmc1. There is the U-Boot command "load", to load a file into memory, and "save", to save a file. You have to specify address and size. File size you see from "ls mmc 1 boot" command. Looking at the memory map on page 35 of this slide: https://www.slideshare.net/chrissimmonds/embedded-linux-quick-start-guide, the RAM starts at 0x80000000. Guessing that if only U-Boot is in RAM, where will hopefully be nothing at, say, 384 Mbytes, I tried to load file to 98000000, and save from there, but save returned "unable to write file". Too bad.

  • Do you have the OS on SDCard? If yes, you can edit this uEnv.txt file on other computer using card reader. – mariaczi Jun 13 '18 at 12:45
  • Unfortunately, not. It's all on the internal flash on the BeagleBone Black. I guess I could try to boot from SDcard, I don't know whether the available images would then actually mount the internal flash for me to repair the txt file. What I absolutely want to avoid is erasing the system on the internal flash. There's unfinished business and it would mean loss of lots of work. (yeah, I was just about to make an image of the whole thing...) – sktpin Jun 13 '18 at 13:13
  • 1
    You can start another linux with tftp or from USB stick and fix the broken file. – Arkadiusz Drabczyk Jun 14 '18 at 9:33
  • TFTP, that sounds interesting. It worked via SDcard boot (see answer), but TFTP sounds optentially useful, for other scenarios also, will keep it in mind. – sktpin Jun 14 '18 at 12:20
0

Ok, I gave up the U-Boot route, although it would have been cool, had that worked.

I grabbed the IoT variant (console only, no GUI, downloads quicker) of the BeagleBone Debian image, e.g. "Stretch IoT (without graphical desktop)": https://beagleboard.org/latest-images

and followed the steps here: http://beagleboard.org/getting-started

There is a link of how to flash it, i.e. extra steps are needed for that - good, I remembered that wrong. Was afraid that the sdcard boot would flash the internal emmc, which I don't want.

As mentioned earlier, when a SDcard is inserted, the sdcard mmc device will be number 0, and internal flash (emmc) will be 1. Also, the file system on the emmc is apparently ext4. So you need to mount that:

debian@beaglebone:~$ sudo mkdir /mnt/emmc
debian@beaglebone:~$ sudo mount -t ext4 /dev/mmcblk1p1 /mnt/emmc

Then you can just go to the boot folder on the mounted emmc:

debian@beaglebone:/$ cd /mnt/emmc/boot/

and fix the uEnv.txt lying there with an editor or the backup you certainly made beforehand ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.