This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/PROCESSOR-SDK-AM335X: eMMC boot on Beaglebone Black

Part Number: PROCESSOR-SDK-AM335X

Tool/software: TI-RTOS

Hello,

I am trying to boot a SYS Bios application without holding the S2 button on my beaglebone black. I am already able to create a bootable SD card for my beaglebone black to execute sys bios applications with my script (you can see below) for creating the "App" file and the "MLO" file from path "C:\ti\processor_sdk_rtos_am335x_4_02_00_09\prebuilt-sdcards\evmAM335x\sd_card_files\MLO", but the beaglebone always wants to boot from emmc first because of the hardware design. Many forums describe something with uboot but I don't know what I need to change. Another suggestion which I tried was to delete the emmc. I did that by connecting the beaglebone via usb, logging in via ssh and executing "dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=1". The outcome was, that I still had to hold the user button because when I don't do that now, the beaglebone is doing nothing except of permnanently illuminating user led0 and user led1 because it is not able to boot into linux anymore I think. Do you have any ideas except of changing the hardware to hold the S2 button permanently to high? I really don't need to have linux at all anywhere on the flash. I just want to always boot my sys bios application on startup. If you do have a solution by flashing it directly to emmc via JTAG, that would be ok as well.

script:

set PDK_PATH=C:/ti/pdk_am335x_1_0_9/packages
set CG_TOOL_PATH=C:/ti/gcc-arm-none-eabi-6-2017-q1-update
set APP_NAME=AppName

%CG_TOOL_PATH%/bin/arm-none-eabi-objcopy -O binary %APP_NAME%.out %APP_NAME%.bin
    %PDK_PATH%/ti/starterware/tools/ti_image/tiimage.exe 0x80000000 NONE %APP_NAME%.bin app

beaglebone hardware design (without holding s2 user button MMC1 is booted first, which should be emmc/linux):

regards,

David

  • The RTOS team have been notified. They will respond here.
  • David,

    It appears that your beaglebone black has a uboot/Linux boot pre-programmed in the EMMC flash which is preventing you from booting from the SD card. There are numerous community users who have run into this issue and posted there solutions:
    www.erdahl.io/.../beaglebone-black-booting-from-sd-by.html
    groups.google.com/.../
    e2e.ti.com/.../275997

    Regards,
    Rahul
  • Hello Rahul,

    I did of course find that link when I tried to fix the problem before opening this thread and I did the steps described there but I still can't boot the system after deleting the EMMC flash.

    Regards,
    David
  • David,

    Did you get any further answers on this?  It is typical that they drop the ball on questions.

    I want to do something similar to what you are doing. I want to load my app into the eMMC so it runs from there all the time, without having the mechanical SD card plugged it.

    I also erased my eMMC memory.  But that may be a mistake. I think the solution is to leave the MLO file in the eMMC, then somehow put your app into it, just like doing an SD card. I am going to download a new Linux image and re-flash it, to get the MLO file back.

    Then, perhaps, get a Linux image that runs from the SD card, put my "app" somewhere on the SD filesystem using my PC, and use Linux commands to push the "app" into the eMMC.  Kind of tedious when you think about it...

    As for booting from an SD card, since this is just testing at this stage, I just wired a jumper from the GPIO pin (which is also the boot switch) to ground.

    To do this on a more permanent design, you should have some logic, maybe just a FET, pulling the pin to ground at startup, then use a different GPIO pin to disconnect this pin so it's floating again.  That way you can use the pin for other things.

    Please let me know if and how you solved it...?

  • Christopher, David,

    I received an BEagle bone black platform with UBoot flashed on the EMMC and was sucessfully able to erase the eMMC and boot from SD card using the following instructions.

    When uboot is flashed on the eMMC when you power on reset the board the uboot starts, if you halt the autoboot then uboot command prompt will appear. On the command prompt, I am able to type the following commands to erase 4096 bytes on the EMMC in blk#0. To do this, I typed in the following command on uboot:

    >mmc list
    >mmc dev 1
    >mmc erase 0 1000

    "mmc list" will show the number of SD/MMC interfaces mounted. From bootargs, I noticed that uboot mounts eMMC on device#1 and SD card on device#0. "mmc dev 1" configured the MMC command interface to act on dev1 (eMMC). Then "mmc erase 0 1000 " erased the contents of the on-board eMMC which allows booting for SD card. Next time, I booted the board booted from SD card. as there is no MLO image on the eMMC due to erase operation.

    Regards,
    Rahul
  • Rahul, David,

    Thanks.  I actually erased my eMMC, and now the BBB doesn't boot when I just "power it up".  From what I've learned, if it can't find an image to boot from, it will timeout and start again.  Also my experience is that it will NOT boot from the SD card unless you are holding down the "boot" button on power up.

    So the advantage to erasing the eMMC is that, even though the board is timing out and resetting, I can still JTAG into the board and load development code to test.  When Linux is on the eMMC and it boots up, the JTAG will not connect once Linux has started.  A very annoying trait that Linux is doing.

    If you still ever need to boot it up in Linux, you can load an image of Linux onto the SD card, and run from the SD card.  That way you can read and write to the eMMC. This link tells how to load the Linux image to an SD card.  And how to "comment out" the step in autorun.sh that will re-flash the image in the eMMC, so you end up with just a Linux prompt and you can use "dd" tools to read or write to the eMMC.

    beagleboard.org/getting-started

    I did notice that the memory it booted from was always mmcblk0, regardless of whether is was SD or eMMC, and the "other" memory was mmcblk1.  So which device the eMMC is depends on how you booted (from eMMC or from SD).  In other words do not assume the eMMC is always mmcblk0.

    As for booting bare metal programs directly from the SD card, there are these instructions:

    processors.wiki.ti.com/.../Processor_SDK_RTOS_Creating_a_SD_Card_with_Windows

    NOTE:  The "Image" that you are told to use is essentially a regular floppy image, not a hard drive image with a Master Boor Record (MBR). The AM335x ROM boot does know how to read it.  But windows freaks out. The result is you will corrupt the SD card making it difficult to ever use it for anything else. In Windows, it is necessary to use "diskpart" to rebuild it.   There is supposed to be a way to take a regular SD card with an MBR and put the files on it, without flashing the "floppy" image...  But it wasn't working. So I did some digging...

    I have discovered that a conventional FAT32 SD Card made in Win7 or similar has Windows specific stuff (AKA Microsoft garbage) in the MBR before the partition table, and the ROM boot process in the AM335x fails because it expects that region to be all zeros. So, you cannot use Windows to create an SD card, put MLO and the app on it, and expect it to work.  But you can create it another way...

    Using a regular Linux machine I was able to fidsk, erase, reformat, mark bootable, and copy in the MLO and app.  The the MBR doesn't have extra Microsoft nonsense it in.  At that point, the BBB boots from the SD card when the boot button is pushed, or the GPIO line is tied low as my previous post indicates.  Essentially the steps are:

    1. fdisk /dev/sdb  (or whatever the SD card is)
    2. Delete all partitions
    3. Create one full size partition
    4. Mark it bootable
    5. Change the type to FAT32  (partition type "c")
    6. Write the updates and exit
    7. Format with "mkfs -t msdos /dev/sdb1"   (or whichever dev your SD card first partition is)
    8. Copy the files MLO and app onto the SD card
    9. Plug in and enjoy!

    Next question, is there a MLO file which can be loaded into the eMMC which would then read an "app" that is in the eMMC?  Because I assume (but haven't yet checked) that the MLO is intended to read from SD cards only.

    Also, I was thinking that oddly enough, the MLO program is the bootstrap... So logically if I were to change the linker script to my app so that it runs in the bootstrap space instead of 0x80000000, add the header to it, and rename it to "MLO", then the AM335x device would load and run my program, just like the MLO bootstrap.  My program would just have to be small enough to fit in the designated space  (< 109K).  Why would I want to do that?  Just because I can  :-)

  • Hi Christopher,

    I also already considered in my own custom beaglebone cape design to connect the pin to ground permanently to workaround that problem.

    regards,

    David
  • Hi Rahul,

    at the moment I don't have time to test your solution. But as soon as I have time I verify your solution. Thank you very much.

    Regards,
    David