How Microcontroller Memory Works | Embedded System Project Series #16

Поделиться
HTML-код
  • Опубликовано: 20 сен 2024

Комментарии • 68

  • @isakneuman9995
    @isakneuman9995 Год назад +16

    Thanks for the probability that I decided to go to RUclips 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 9 месяцев назад +3

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

  • @code4th
    @code4th Год назад +1

    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 😉😉

  • @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!

  • @fifaham
    @fifaham 4 месяца назад

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

  • @abdelrahmanyasser5720
    @abdelrahmanyasser5720 9 месяцев назад +1

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

  • @Jindraxx20
    @Jindraxx20 3 месяца назад

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

  • @Illayarajamuruga
    @Illayarajamuruga 5 месяцев назад

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

  • @L2.Lagrange
    @L2.Lagrange 5 месяцев назад +4

    Commenting as a bookmark to watch this a few times lol

  • @alexgillespie1098
    @alexgillespie1098 Год назад

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

  • @JoeBob189
    @JoeBob189 4 месяца назад

    beautifully explained, thank you!

  • @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 "ruclips.net/video/HCfq44NNBaU/видео.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 😇

  • @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.

  • @pieterboning
    @pieterboning 11 месяцев назад

    VERY useful, thank you for your videos!

  • @juanrodrigoguerrerozarate2602
    @juanrodrigoguerrerozarate2602 Год назад

    This video is awesome ! Thanks for the information

  • @vaishalibiswas5674
    @vaishalibiswas5674 Год назад

    Best..all in one video🙏

  • @prasenjit134
    @prasenjit134 Месяц назад

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

  • @0xbitbybit
    @0xbitbybit 8 месяцев назад

    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  8 месяцев назад

      That would be "Iosevka Nerd Font Mono".

  • @RavinderSingh-cd5ei
    @RavinderSingh-cd5ei 5 месяцев назад

    awesome explanation 👏

  • @olivialinden8699
    @olivialinden8699 Год назад

    educative and informative 👍

  • @mursalaboobacker3593
    @mursalaboobacker3593 3 месяца назад

    nice videos and good explanation.

  • @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  Год назад +1

      embeddedartistry.com is a good resource for embedded programming. I like Robert Feranec and Phil's lab for RUclips 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!

  • @cantaff0rd2
    @cantaff0rd2 9 дней назад

    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  8 дней назад

      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.

  • @jiefang11
    @jiefang11 7 месяцев назад

    Thanks a lot 🎉

  • @alirezasalehi9149
    @alirezasalehi9149 2 месяца назад

    great. thx🤗

  • @isakneuman9995
    @isakneuman9995 Год назад

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

    • @artfulbytes
      @artfulbytes  Год назад +2

      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.

  • @tannguyentrong1142
    @tannguyentrong1142 2 месяца назад

    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 ?

  • @walidoulondon8107
    @walidoulondon8107 Год назад

    Awesome explanation which IDE are you using bro?

  • @rafassm
    @rafassm 4 месяца назад

    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  4 месяца назад +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).

  • @embeddedroom
    @embeddedroom Год назад

    nice job!

  • @majideidy6513
    @majideidy6513 5 месяцев назад

    Good

  • @Eto-xg7rr
    @Eto-xg7rr Год назад

    damn you so good at it

  • @cihan1995
    @cihan1995 11 месяцев назад

    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  11 месяцев назад

      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 11 месяцев назад

      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  11 месяцев назад +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.

  • @dragoniscoming
    @dragoniscoming 7 месяцев назад

    subscribed to the shrug

  • @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 10 месяцев назад

      Stack or heap

    • @ALIENdrifter66
      @ALIENdrifter66 8 месяцев назад

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

  • @mhmodsadek7902
    @mhmodsadek7902 8 месяцев назад

    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  8 месяцев назад

      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 2 месяца назад

      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.

  • @bhojasd
    @bhojasd 2 месяца назад

    Pls make video in slow motion

  • @JeanDAVID
    @JeanDAVID 11 месяцев назад

    Do you use visual studio code as IDE ?

    • @artfulbytes
      @artfulbytes  11 месяцев назад

      Sometimes, but not in this video series.

  • @MrDajiangyoude
    @MrDajiangyoude 7 месяцев назад

    why are flash and RAM on the same media?

    • @artfulbytes
      @artfulbytes  7 месяцев назад

      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).

  • @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.

  • @b17_igedeparadiptadharmasa7
    @b17_igedeparadiptadharmasa7 5 месяцев назад

    what kind IDE u use in this video?

    • @artfulbytes
      @artfulbytes  4 месяца назад

      Code Composer Studio (CCSTUDIO IDE) from TI

  • @DrGeta666
    @DrGeta666 Месяц назад +1

    man that is a lot of talking about screenshots