How Microcontroller Memory Works | Embedded System Project Series #16

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ธ.ค. 2024

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

  • @isakneuman9995
    @isakneuman9995 ปีที่แล้ว +22

    Thanks for the probability that I decided to go to TH-cam at 2 o'clock in the morning. You have such a storehouse on the channel. I will definitely watch every video and I am 10,000% sure that every video will be super useful.

  • @SurvivalSquirrel
    @SurvivalSquirrel ปีที่แล้ว +6

    I find the first 15 minutes to have 80% of the value of this whole video. Thanks a lot!

  • @code4th
    @code4th ปีที่แล้ว +3

    I like this kind of detailed low-level explanation. I port a ton of code from c/c++ into forth and basically have to know this stuff at a deep level. Thank you

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

      Turn back, you are going the wrong way 😉😉

  • @elakstein
    @elakstein 2 หลายเดือนก่อน +2

    Please TH-cam recommend me again, i will watch it in the future, very tired right now

  • @fifaham
    @fifaham 7 หลายเดือนก่อน +1

    One of the best videos detailing the memory work, job well done - thank you.

  • @SiamMiah-v8f
    @SiamMiah-v8f ปีที่แล้ว +2

    Thanks, you put all the information I wanted into one video. The way a program is stored into the physical memory of a computer which runs a OS and has a MMU is very different to how a program is allocated to the microcontrollers memory. It was confusing to read and make sense of on my own! Thanks for uploading!

  • @L2.Lagrange
    @L2.Lagrange 8 หลายเดือนก่อน +8

    Commenting as a bookmark to watch this a few times lol

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

    Best video ever in this topic, it gather more than what I've expected together. Thank you very much bruuuuuh

  • @Illayarajamuruga
    @Illayarajamuruga 8 หลายเดือนก่อน +1

    One of the best explanations I have ever heard before. Thanks a Lot ..👏

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

    simply wow

  • @Jindraxx20
    @Jindraxx20 7 หลายเดือนก่อน

    Thank you for this great content. This explains very well how the memory is allocated !

  • @jdaniel0491
    @jdaniel0491 2 หลายเดือนก่อน +1

    How can I learn the details of all of this information? Do you recommend a book or set of books/lectures?

  • @AkashModi-l1h
    @AkashModi-l1h หลายเดือนก่อน

    Amazing Video. Thank you for creating this.

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

    Hi, thank you for your contributions your videos are really helpful. Would you consider to make a video or video series maybe on how to use unit testing on embedded systems? Thanks in advance.

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

      I won't be doing it for this video series since I'm not writing any unit tests in this project, but it is a topic I would like to cover in the future.

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

    Please record a video explaining how to flash a microcontroller without any IDE. No one pays attention to this topic, but I think this will allow you to understand more deeply how the linker and the compiler in general work. That is, it will open up opportunities to flash not only microcontrollers of the same type, but almost all possible ones. After all, the base is that one.

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

      I mention it in this video "th-cam.com/video/HCfq44NNBaU/w-d-xo.html" and also add a make rule for it. The specific command/tool will vary depending on the microcontroller and debugger.

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

      @@artfulbytes Do u understand that u brilliant?

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

      @@isakneuman9995 😇

  • @0xbitbybit
    @0xbitbybit 11 หลายเดือนก่อน

    Great stuff mate! Just got myself an MSP430 to follow along with some courses and learn about all this stuff, super excited. Just a side question, what font are you using in your terminal, when you were editing your make file? Looks great! Thanks!

    • @artfulbytes
      @artfulbytes  11 หลายเดือนก่อน

      That would be "Iosevka Nerd Font Mono".

  • @prasenjit134
    @prasenjit134 5 หลายเดือนก่อน

    Memory layout so well explained. What is the IDE you use?

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

    I got interviews coming up and this video is super helpful, thx.

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

      Good luck on your interviews!

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

    Incredible video❤️ very helpful! Thanks : )

  • @cantaff0rd2
    @cantaff0rd2 3 หลายเดือนก่อน

    Nice tutorial. But why is this int a[5] = { 0xAAAA, 0xBBBB, 0xCCCC }; placed in .const and .data instead of only in .data? Is this not a variable which can be modified at runtime? As far as I know arrays are not constants like strings?
    Also why is the global int c[5] 'only part of the ram'? Isn't it both in .bss in flash and then in .bss in RAM after the startup code initializes the RAM?

    • @artfulbytes
      @artfulbytes  3 หลายเดือนก่อน

      RAM contains garbage after power reset. So before we get to main(), the RAM variables (variables that can be modified at runtime) must be initialized. But to do this we must know what the the initialization values should be, and that information we are store in flash. In other words, a[5] first contains garbage, but is then overwritten with the initialization values from flash (.const).
      c[5] is also stored in RAM, but it's zero-initialized, and for space-efficiency (bss sometimes called "better save space") we don't store that information in flash. Instead the zero-initialized RAM variables are simply initialized to 0.

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

    Thanks a lot. Could you please explain boot process ?
    I also wonder, is start up code is the equivalent of boot manager and flash loader?

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

      Yes this is something I could see myself doing a video about in the future. Until then, I can recommend this blog post series interrupt.memfault.com/tag/zero-to-main/. No they are not equivalent.

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

      thank you, can you please also let me know the tools you used in this video ? I would like to repeat steps learned here on my own@@artfulbytes

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

      @@cihan1995 The IDE is CCSTUDIO from TI with MSP430 microcontroller. Though you could repeat this with other IDEs and MCUs as well. At the end I just use the bare-bone toolchain, GCC in this case, and Make.

  • @JoeBob189
    @JoeBob189 7 หลายเดือนก่อน

    beautifully explained, thank you!

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

    Best..all in one video🙏

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

    This video is awesome ! Thanks for the information

  • @tannguyentrong1142
    @tannguyentrong1142 5 หลายเดือนก่อน

    i have a question, normally, text section will lowest in flash memory , follow it is another section like data, bss,... why in your video. text section have higher address than data and bss section ?

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

    VERY useful, thank you for your videos!

  • @rafassm
    @rafassm 7 หลายเดือนก่อน

    Great video! but I have a question, in arduino when you want to burn a bootlader into a custom board (not uploading the code, just programming it) what you are doing in reality is uploading the ELF and linker script files to the MCU? I am not sure if I am misunderstanding the concepts of bootlader and those files.

    • @artfulbytes
      @artfulbytes  7 หลายเดือนก่อน +2

      ELF and linker scripts are not what you flash/upload, they are just intermediate files used during the compilation process that outputs the final machine code (typically a hex file). It's the final machine code (hex file) that is flashed/uploaded to the MCU with a dedicated programmer (e.g. segger-jlink, stlink). A bootloader is a small program that provides a convenient alternative interface (e.g. usb, uart, i2c , wifi, bt...) for uploading your normal application code (typically hex) without the need for a dedicated programmer. The bootloader has the same compilation process as described above and must be flashed with a dedicated programmer (technically not always true, e.g. multi-stage/self-updating bootloader).

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

    nice videos and good explanation.

  • @mhmodsadek7902
    @mhmodsadek7902 11 หลายเดือนก่อน

    why "int d[5]" which is the first thing in main () is not the first address of .text section ? why it is exists in the first address in . const section?

    • @artfulbytes
      @artfulbytes  11 หลายเดือนก่อน

      int d[5] is not constant, it's a variable allocated on the stack. The data it's initialized with is constant, and because of that it's stored in the .const section. The .text section holds the program code so it will have the instructions that copies the const data from .const section to the stack.

    • @gopaltiwari9402
      @gopaltiwari9402 5 หลายเดือนก่อน

      Although the values you are using for initialization are constants, they are not stored in a separate constant section when used in this context. Instead, they are part of the initialization process and directly copied into the memory allocated for the array on the stack.

  • @pyrhockz
    @pyrhockz 3 หลายเดือนก่อน

    Great stuff.

  • @RavinderSingh-cd5ei
    @RavinderSingh-cd5ei 8 หลายเดือนก่อน

    awesome explanation 👏

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

    The variable 'i' cannot be stored in flash because flash memory does not have the ability to write values during runtime.

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

      Yes you are right, I should have been more clear there. The loop code is in flash, but the variable is in ram.

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

      Stack or heap

    • @ALIENdrifter66
      @ALIENdrifter66 11 หลายเดือนก่อน

      On some microcontrollers it can, but it's not used for those situations

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

    educative and informative 👍

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

    Thanks for such detailed video, it's nice how you explaining things on such low level.
    I'm working as embedded linux engineer but I'd like to learn more low level "embedded" and want to have a good base.
    Can you recommend your favourite resources for learning?
    Also do you have any recommendation on learning electronics/circuit therory/pcb? :)

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

      embeddedartistry.com is a good resource for embedded programming. I like Robert Feranec and Phil's lab for TH-cam tutorials on electronics/PCB design. Best way to learn in my opinion is to work on a project, start with a simple one, and let that guide your learning.

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

      @@artfulbytes thanks for the recommendation!

    • @knowledgesharing5483
      @knowledgesharing5483 2 หลายเดือนก่อน +1

      CFBR ​@@artfulbytes

  • @mazharkhaliq1971
    @mazharkhaliq1971 2 หลายเดือนก่อน

    Nice 👍

  • @MouhcineAnter
    @MouhcineAnter 3 หลายเดือนก่อน +1

    noob quation : where can i find that page you are working on

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

    how about struct union and pointers?

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

      In terms of where they are allocated is the same as other data variables, but yes could have been good to include them as examples too.

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

    Awesome explanation which IDE are you using bro?

  • @b17_igedeparadiptadharmasa7
    @b17_igedeparadiptadharmasa7 8 หลายเดือนก่อน

    what kind IDE u use in this video?

    • @artfulbytes
      @artfulbytes  7 หลายเดือนก่อน

      Code Composer Studio (CCSTUDIO IDE) from TI

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

    Do you use visual studio code as IDE ?

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

      Sometimes, but not in this video series.

  • @MrDajiangyoude
    @MrDajiangyoude 10 หลายเดือนก่อน

    why are flash and RAM on the same media?

    • @artfulbytes
      @artfulbytes  10 หลายเดือนก่อน

      Flash and RAM are separate, but both are ntegrated into the microcontroller for benefits of space, cost, latency, design simplicity, and so on. Memory mapping allows us to programmatically access them in a similar manner, but they are still physically separated and behaves differently (e.g. Flash retains data on reset while RAM does not).

  • @jiefang11
    @jiefang11 11 หลายเดือนก่อน

    Thanks a lot 🎉

  • @alirezasalehi9149
    @alirezasalehi9149 5 หลายเดือนก่อน

    great. thx🤗

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

    nice job!

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

    This is brilliant content.
    Жаль что embedded вообще не популярный и умирает. Не подскажете, вы работаете и как обстоит рынок в сфере embedded? Я бы очень хотел в эту сферу, но в связи низким спросом я сейчас учу backend чтобы выжить и прокормить себя.

    • @artfulbytes
      @artfulbytes  ปีที่แล้ว +3

      I'm not Russian, but I translated. The embedded field is indeed less popular and harder to break into than other fields of programming, but it is by no means a dying field. It's not like we are getting fewer embedded systems around us :) But it is an evolving field, and we are slowly moving up the stack (e.g. less bare-metal, more OS-based systems). Yes, I work as an embedded systems engineer, and the market for embedded programming is good. If you know your way around C/C++ there is no shortage of jobs. Of course, the situation may vary depending on where you are located.

  • @Eto-xg7rr
    @Eto-xg7rr ปีที่แล้ว

    damn you so good at it

  • @majideidy6513
    @majideidy6513 8 หลายเดือนก่อน

    Good

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

    Pls make video in slow motion

  • @dragoniscoming
    @dragoniscoming 10 หลายเดือนก่อน

    subscribed to the shrug

  • @DrGeta666
    @DrGeta666 4 หลายเดือนก่อน +1

    man that is a lot of talking about screenshots