Introduction to Embedded Linux Part 3 - Flash SD Card and Boot Process | Digi-Key Electronics

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ก.ย. 2021
  • Linux is a powerful operating system that can be compiled for a number of platforms and architectures. One of the biggest draws is its ability to be customized for an application. Tools like Buildroot, OpenWRT, and Yocto Project help us create custom Linux distributions for embedded systems.
    In this video series, we will explore Buildroot and the Yocto Project. We also demonstrate how you might develop applications for embedded Linux. We will not dive into the specifics of how each of these systems work but give you a good starting place so you can read or watch more advanced material about working with embedded Linux.
    See this written tutorial if you would like to review the commands issued in this tutorial for the Yocto Project: www.digikey.com/en/maker/proj...
    In the previous episode ( • Introduction to Embedd... ), we generated a custom Linux image using the Yocto Project for the STM32MP157D-DK1.
    In this episode, we look at how a boot chain works in order to begin running the Linux kernel. We then examine the output of the Yocto Project build process to find which image files are required to create a successful boot chain. For this project, we will use the TF-A trusted boot from Arm as the first stage bootloader, and we will use U-Boot as the second stage bootloader.
    The hardcoded ROM bootloader first executes the first stage bootloader (FSBL), which configures the clocks, DDR memory, and loads the second stage bootloader (SSBL). The second stage bootloader configures any necessary peripherals (e.g. networking, USB, display drivers) and begins execution of the kernel. The kernel mounts the root filesystem (rootfs) and executes the processes required to run Linux.
    You can read more about ST’s boot chain process in this presentation: www.st.com/content/ccc/resour...
    We format an SD card with the necessary partitions and flash the image files to those partitions. We then plug the SD card into our STM32MP157D-DK1 and boot into Linux.
    The ST tool for flashing SD cards (or other memory) with OS images is the STM32CubeProgrammer, which you can read about here: wiki.st.com/stm32mpu/wiki/STM...
    Product Links:
    www.digikey.com/en/products/d...
    Related Videos:
    • STM32MP1 workshop - 1 ...
    Related Project Links:
    www.digikey.com/en/maker/proj...
    Related Articles:
    forum.digikey.com/c/eewiki/li...
    Learn more:
    Maker.io - www.digikey.com/en/maker
    Digi-Key’s Blog - TheCircuit www.digikey.com/en/blog
    Connect with Digi-Key on Facebook / digikey.electronics
    And follow us on Twitter / digikey
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 40

  • @reptilicusrex4748
    @reptilicusrex4748 2 ปีที่แล้ว +19

    This series of videos is very informative and explained extremely well. Especially this one, in which you took the time to create the partitions and filesystems manually for instructional purposes. Thanks for the effort.

  • @tljstewart
    @tljstewart 2 ปีที่แล้ว +12

    Great videos! It’s difficult to find good content on these subjects.

  • @Telemanblues
    @Telemanblues ปีที่แล้ว

    Using the STM partition script worked like a charm. First pass of manual partitioning did not work for me for some reason. Awesome series. Thanks for all of you efforts.

  • @joshhaughton4547
    @joshhaughton4547 2 ปีที่แล้ว

    Awesome video! Thanks so much for making this. You do a great job of explaining everything!

  • @vonmakeheat
    @vonmakeheat 2 ปีที่แล้ว +1

    Ok . I swore off low level coding tutorials for a while u sir got me excited to try this stuff again . I mean the explanation of mounting the rootfs after the cook init layer is literally 🔥

  • @amrrasslan4329
    @amrrasslan4329 2 ปีที่แล้ว

    thx for sharing i hope we see more advanced topics like these hats off to you sir

  • @zzws524
    @zzws524 2 ปีที่แล้ว +1

    Really appreciate your effort. Very clear...

  • @nandospm
    @nandospm 2 ปีที่แล้ว +1

    Great tutorial. I tried some different packages and images after last episode and used the FlashLayout_sdcard_stm32mp157c-dk2-trusted.tsv file as an argument to the STM32_Programmer_CLI. I am going to try this process next

  • @hamedzaheri7050
    @hamedzaheri7050 2 ปีที่แล้ว +2

    Greate series. Thanks

  • @sagarshubham8660
    @sagarshubham8660 2 ปีที่แล้ว +1

    Hey Shawn and Digikey! Thanks for another great video. Did you get to try genimage for an sdcard image creation? That's how build root does it, for most hardware it has this option anyway, and you can use it with your Yocto build too :) Hope this helps.

    • @ShawnHymel
      @ShawnHymel 2 ปีที่แล้ว

      I didn't know about genimage, thanks for the tip!

  • @byteslee1729
    @byteslee1729 2 ปีที่แล้ว

    Free knowledge. Wow!
    I wish all universities taught students like that 😁🤣😂

  • @adoormanusoman
    @adoormanusoman 2 ปีที่แล้ว +1

    Hi, please add tutorial on how to add packages to custom Linux using yocto

  • @subhamdas2491
    @subhamdas2491 ปีที่แล้ว +1

    Can we make iot project with this ...like getting digital, analog sensor value & process them in the cloud

  • @alexscarbro796
    @alexscarbro796 2 ปีที่แล้ว

    I guess the “Disco” layer is more likely to generate an SD card image since it’s targeted at a specific dev board, whereas this build was for a generic MP1 application?

  • @anime-id9716
    @anime-id9716 4 หลายเดือนก่อน

    Instant subscribe
    You teach me how to using dd and how to make partition via cli which very clear explanation

  • @ugurcanusta7005
    @ugurcanusta7005 2 ปีที่แล้ว

    Thanks for this video serie, you are being very helpful. Could you do some Qt applications by using this board, it would be great!!!

  • @Mr_Gaurav
    @Mr_Gaurav 2 ปีที่แล้ว

    hi i have a microchip sama5d3 xplaned board. I followed the same steps but I am unable to boot through SD card. I have spent two days in trouble shooting but didn't get any luck. can you please help?

  • @illie8066
    @illie8066 6 หลายเดือนก่อน +1

    This is a very good series, simple and clear. however, I had a problem booting up the discovery kit and got 2 lines that stopped the boot sequence:
    [ 33.762475] vref: disabling
    [ 33.765065] vdda: disabling
    The whole process wad good, but after connecting the SD-card and starting the board, I got that.

    • @dnyaneshvarsalve
      @dnyaneshvarsalve 6 หลายเดือนก่อน

      @illie8066 I got the same problem, have you found the solution?

    • @dnyaneshvarsalve2984
      @dnyaneshvarsalve2984 6 หลายเดือนก่อน +1

      Hi, my problem is solved, edit the file to find rootfs with /dev/mmcblk0p5 instead of /dev/sdc5 (/dev/sdc5 in my case)

    • @illie8066
      @illie8066 6 หลายเดือนก่อน

      Sorry for the late response, I had to put it on hold,
      So, thank you, @dnyaneshvarsalve2984, it worked for me too!!
      In my case, the location is: /media/illi/bootfs/mmc0_extlinux/extlinux.conf
      Naturally, I changed to: APPEND root=/dev/sdb5....... because in my case the partitions are sdb1..5.
      changed to mmcblk0p5 and it worked and I succeeded in logging the system.
      Thank you!!

  • @AndersJackson
    @AndersJackson 2 ปีที่แล้ว

    There are a command, which I don't remember the name of, that expands ext3 and ext4 file systems. It is easy to run that, especially from Raspberry Pi or any other Linux system.
    "man -k ext4" should give you some clues where to find it.

    • @Shamino0
      @Shamino0 ปีที่แล้ว

      You're probably thinking of the "resize2fs" command. When run without any parameters other than the device, it will resize the file system to match the partition size.
      On Debian and related systems, it is part of the "e2fsprogs" package. This is the package that includes pretty low-level ext file utilities like fsck (e2fsck), so I would expect it to be in this minimal Linux build. But maybe the build is extremely minimal and therefore omitted this tool.
      Of course, it only needs to be on the device if you want to resize the file system from the STM32. You could also do that from the host PC after writing the file system to the SD card.

  • @joanelietheiligerruiz3144
    @joanelietheiligerruiz3144 2 ปีที่แล้ว

    El Mejor!!!

  • @user-ww2lc1yo9c
    @user-ww2lc1yo9c ปีที่แล้ว

    Can Cygwin be used to do all this stuff?

  • @Hacker-at-Large
    @Hacker-at-Large 2 ปีที่แล้ว +4

    Couldn’t you hear me screaming about expanding rootfs on the development system?

    • @ShawnHymel
      @ShawnHymel 2 ปีที่แล้ว +1

      Don't worry...that's something I tackle in the next episode ;)

    • @Shamino0
      @Shamino0 ปีที่แล้ว

      @@ShawnHymel But you don't really want to hard-code any size for that file system. You always want it to fill all remaining space.
      My recommendation is to set the file system size to the minimum needed for a running system, and then expand that file system to fill its partition after writing it to the SD card.
      If you do it from the host, there are many tools. I like the graphical "gparted". Or you could use the "resize2fs" command.
      Or you could do it on the STM device, if your minimal installation has "resize2fs". It might, because that command is typically part of other low-level ext utilities like fsck, which really need to exist for a functioning system.
      One approach might be to add a script (maybe via systemd) that runs only on the first boot, which resizes the file system to fill the partition. Then (if you want to be really slick), the script can disable itself, so it won't try to run the next time you boot.

  • @nilutpolkashyap
    @nilutpolkashyap 2 ปีที่แล้ว +1

    Can the same tutorial be tried with a Raspberry Pi?

    • @ShawnHymel
      @ShawnHymel 2 ปีที่แล้ว +2

      Do you mean using the Raspberry Pi as the host machine or creating an image for the Raspberry Pi? If using as the host machine, then it should work, but it will take much longer (as the Pi is slower than most modern PCs). If you mean creating an image for the Pi, then that's also possible. I recommend checking out this tutorial: jumpnowtek.com/rpi/Raspberry-Pi-Systems-with-Yocto.html

    • @nilutpolkashyap
      @nilutpolkashyap 2 ปีที่แล้ว +1

      @@ShawnHymel Thanks a lot. I meant creating an image for the Raspberry Pi. I will surely try it out.

  • @dnyaneshvarsalve
    @dnyaneshvarsalve 6 หลายเดือนก่อน

    after vref disabling and vdda disabling lines printed on terminal, I can't see any login prompt.
    any idea ?

  • @fayask9904
    @fayask9904 ปีที่แล้ว

    Raspberry Pi/beagle bone black /STM32MP157F-DK2 which one is better ??

    • @batkonashbandera5165
      @batkonashbandera5165 ปีที่แล้ว

      it depends what you need it for. if you need microcontroler for robotics or adc for sensors. BBB is better. If you just need server with some io, raspberry pi will do just fine. Don't do DK2, its crap.

  • @user-ww2lc1yo9c
    @user-ww2lc1yo9c ปีที่แล้ว

    A course like this could easily cost thousands of £

  • @andrsam3682
    @andrsam3682 2 ปีที่แล้ว

    чертов гений

  • @markmanning2921
    @markmanning2921 4 หลายเดือนก่อน

    not "in root file system", this is horrendously bad English:
    Correction: "in ***THE*** root file system"
    yes it matters.