#222

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 พ.ค. 2024
  • Sometimes we need more memory for our sketches. In this quickie, I show you how you get it without heating up your soldering iron.
    Most of the ESP32 modules have 4Mbyte flash memory chips. But if you look at the usable memory size, you only get 1310720 bytes, which is roughly one-quarter of your flash memory. With a blink sketch, this is no problem. It only uses 13% of the available space. But if you use the simple BLE_server example, which is just a few lines long, it occupies already 85% of your flash memory. If you add some other libraries, you quickly get an “out of memory” error.
    Partitioning and ESP32 partition tables provide the solution.
    Links:
    ESP32 boards: s.click.aliexpress.com/e/7xUZti0
    Supporting Material and Blog Page: www.sensorsiot.org
    Github: www.github.com/sensorsiot
    My Patreon Page: / andreasspiess
    My Bitcoin address: 19FSmqbBzb5zsYB1d8Bq4KbxVmezToDNTV
    If you want to support the channel, please use the links below to start your shopping. No additional charges for you, but I get a commission (of your purchases the next 24 hours) to buy new stuff for the channel
    For Banggood bit.ly/2jAQEf4
    For AliExpress: bit.ly/2B0yTLL
    For ebay.com: ebay.to/2DuYXBp
    profile.php?...
    / spiessa
    www.instructables.com/member/...
    Please do not try to Email me or invite me on LinkedIn. These communication channels are reserved for my primary job
    Equipment in my lab: www.sensorsiot.org/my-lab/
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @robfenwitch7403
    @robfenwitch7403 5 ปีที่แล้ว +9

    Cool - I'm using the Adafruit HUZZAH32 and the Partition Scheme menu item doesn't exist but a quick edit of boards.txt put that right and I'm now using Minimal SPIFFS with no problems :) Thank you.

    • @rpmuir1102
      @rpmuir1102 5 ปีที่แล้ว

      Really neat! Thank you

    • @dhaniyanuar5024
      @dhaniyanuar5024 4 ปีที่แล้ว

      hello, what kind of edit you do in boards.txt?

    • @robfenwitch7403
      @robfenwitch7403 4 ปีที่แล้ว

      @@dhaniyanuar5024 I've just checked the ESP32 Arduino github and it seems that the partition lines are now in boards.txt, as installed.

  • @marratia
    @marratia 12 วันที่ผ่านมา

    I've spend probably 4+ hours researching the web, trying to find a simple explanation and resolution to the 1.3MB limit, and your video is exactly what I needed, Thanks!!!😎👍

  • @reanimationxp
    @reanimationxp 5 ปีที่แล้ว +4

    Great topic! I was having to fiddle with this a while back too.

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

      I thought it can be useful because I had a few questions about it...

  • @deangreenhough3479
    @deangreenhough3479 5 ปีที่แล้ว

    I’m so happy😀😀😀 all my prays answered. Thank you Andreas👍🏴󠁧󠁢󠁥󠁮󠁧󠁿

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

      You are welcome. If it always were so easy ;-)

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

    Awesome information Andreas, very useful indeed!

  • @Ed17151
    @Ed17151 5 ปีที่แล้ว +5

    OMG, this info just saved my life!

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

    Very useful. I was searching for it everywhere. Thank you.

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

      Glad it was helpful!

  • @frankalvarez7387
    @frankalvarez7387 5 ปีที่แล้ว

    Thanks this might come in handy for my home automation project :)

  • @vidanatural_oficial
    @vidanatural_oficial 5 ปีที่แล้ว +14

    very usefull, thank you Andreas..

  • @deangreenhough3479
    @deangreenhough3479 5 ปีที่แล้ว

    Back again and about to test this out😀🏴󠁧󠁢󠁥󠁮󠁧󠁿👍

  • @freedom2000
    @freedom2000 5 ปีที่แล้ว

    Excellent Andreas, as usual.

  • @markferrick10
    @markferrick10 5 ปีที่แล้ว

    Great info Andreas. Thanks for the video(s)

  • @MrBrian9107
    @MrBrian9107 5 ปีที่แล้ว

    you are the best, in this moment i have this problem thakss!!!!

  • @FantaBH
    @FantaBH 5 ปีที่แล้ว

    Interesting and educative video, thanks for sharing.

  • @science4allworld587
    @science4allworld587 5 ปีที่แล้ว

    Great quickie thanks.

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

    Thank you! This is still relevant.

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

    THANK YOU, YOUR VIDEO WAS VERY HELPFUL. 🤯

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

    Thank you very much! Today you saved my life!! 👊🏻

  • @malleusmaleficarum9248
    @malleusmaleficarum9248 5 ปีที่แล้ว +11

    Hello Andreas.
    Thank you for another great video.
    Why there is no possibility to use No OTA AND minimum SPIFFS at the same time?

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

      exactly - that sounds like a very useful default. It's be good to have someone built and test one and share it ? personally I never use OTA or SPIFFs, but I use multiple libraries in some projects and having most of that 4mb would to use in sketches would be my default for most of the time. weird that whomever made those defaults didn't put that obvious one in, unless it isn't supported for some reason.

    • @tobi_n
      @tobi_n 5 ปีที่แล้ว +4

      If I understand it right, you might try to provide your own partition CSV with no app1 and a minimal SPIFF section. I.e. combine the best parts of no_ota.csv and min_spiffs.csv. (Edit: typo)

    • @GamerCNDG
      @GamerCNDG 5 ปีที่แล้ว +10

      There are example partition CSVs at github.com/espressif/arduino-esp32/issues/1476 which answer exactly that. Last one allocates ~3.5MB for a single APP

  • @CrazyCoupleDIY
    @CrazyCoupleDIY 5 ปีที่แล้ว

    Thanks that was very helpful

  • @picontrol3482
    @picontrol3482 5 ปีที่แล้ว

    Thanks a lot for this video!

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

    Hey Andreas, can you do a video over Esp32 Cam and/or m5stack?
    Thank you

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

    I actually stumbled into this one by accident and have been using the minimal SPIFFS configuration as it made more logical sense to me.
    Again a great quick video to get this done.

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      This info was somehow hidden. So I thought I bring it to the attention of everybody.

  • @Giblet535
    @Giblet535 5 ปีที่แล้ว

    Very useful information, especially since some of the Wemos D1 boards have 16MB of flash (that is difficult to use). On ESP32, RAM is the barrier I most frequently run into, dreams-first. It encourages creativity.

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

      I think the ESP8266 does not use the same method.

    • @Giblet535
      @Giblet535 5 ปีที่แล้ว

      Internally, it's slightly different, but from the IDE the ESP8266 uses a similar process to set target flash partitioning. It can only be set from the Arduino IDE if valid partitioning has been defined in your boards.txt for the currently selected board.
      Example linker command line: -Tesp8266.flash.4m1m.ld which yields 3MB program, 1MB SPIFFS.
      But from within the Arduino IDE using a Wemos D1 Pro Mini, you'd simply select "3MB Program, 1MB SPIFFS" from the Arduino Tools menu.
      You can define custom partitioning, too, but you need to understand the board and linker limitations.

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

    Thanks for sharing 👍😀

  • @christopherguy1217
    @christopherguy1217 5 ปีที่แล้ว

    Thank you Andreas, that was very informative I had no idea. Can I assume that the RTOS is responsible for the 13% in the blink sketch? If you added external SD flash memory could that be used for OTA?

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      OTA is a function programmed by espressif. If you want to use another flash, you probably have to adapt this code.

  • @pedramgolkar
    @pedramgolkar 4 ปีที่แล้ว

    Many Thanks, that helped me too much

  • @karnasiwantarasuara9418
    @karnasiwantarasuara9418 4 ปีที่แล้ว

    thank you.. as always helpfull

  • @ahmedal-musharraf9242
    @ahmedal-musharraf9242 5 ปีที่แล้ว +3

    greetings from sudan! :)

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      Never had a comment from you country!

  • @LuisLlerena
    @LuisLlerena 5 ปีที่แล้ว

    Thanks, very useful !

  • @electronic7979
    @electronic7979 5 ปีที่แล้ว

    Useful video

  • @VilenPro
    @VilenPro 5 ปีที่แล้ว

    Thank you!

  • @AJB2K3
    @AJB2K3 5 ปีที่แล้ว

    Thanks, i wondered was those ota spiffs options were about

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

      Now you know ;-)

    • @AJB2K3
      @AJB2K3 5 ปีที่แล้ว

      Thank you, it is nice to learn something new every day.

  • @PhG1961
    @PhG1961 5 ปีที่แล้ว

    Interesting ! As usual.

  • @Electronieks
    @Electronieks 5 ปีที่แล้ว

    I love quicky

  • @anvz6
    @anvz6 5 ปีที่แล้ว

    Great! Very useful.

  • @george12121979
    @george12121979 5 ปีที่แล้ว

    usefull info thanks for this

  • @leonardopierangelini3097
    @leonardopierangelini3097 4 ปีที่แล้ว

    Hey man, you saved us!!!!!!!!!!!

  • @bwatspro
    @bwatspro 5 ปีที่แล้ว

    Brilliant!

  • @korishan
    @korishan 5 ปีที่แล้ว

    Wow!! That's really neat! I never knew you could change the partition of the memory spaces in these mcu's. I'll have to remember this when I'm working with my custom bms. Can the STM32 also be done this way?

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      I do not know STM32.

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

      Technically the flash chip is on the WROOM/WROVER module, not on the ESP32. The STM32 seems to have some memory within it at first glance, but I'm not positive. It's formatting would be up to the developers who created the IDE and libraries.

  • @alimahidi8683
    @alimahidi8683 5 ปีที่แล้ว

    Thanks a lot .
    Good information .
    Iraq .

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      You are welcome. Nice to have viewers in your country!

  • @rolandstiebel1966
    @rolandstiebel1966 5 ปีที่แล้ว

    Great video again, Thanks!
    I never used OTA and my first thought was to remove app1 and minimize SPIFFS like in the other comments, but then I thought, why not using ota?
    I scanned your videos and did not find an esp arduino ota tutorial.
    I am sure not only I would be glad if you made one!
    Would you be so kind?
    Or is it the same as with the ESP8266?
    Greetings, Roland (the one with the shortest ESP-video ever ;-) )

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      There is an example file in the ESP section (ArduinoOTA). I never tried it so far.

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

    I will have to check this next time I'm connected to a board. I have over 500 lines of code with 6-7 libraries loaded and it tells me about 50% used. Maybe I found this setting months ago and just didn't know? I'll edit this comment when I know more.

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

    Technically, OTA doesn't need two equal sized partitions. You could copy the program directly over the original program as it's already loaded on RAM. The reason why there are two partitions is safety. If there's a problem when downloading and the program file is corrupted, a Serial reflash would be needed (which would be difficult and expensive to do in a consumer electronic product). And also, don't forget Secure Boot, used for anti-hacking, important in IoT products so that someone can't upload a malicious code exploiting the OTA update. If an error in the signature is found and the program is on the original partition, it would refuse to boot and, again, a Serial reflash would be needed. And if flash encryption is enabled, it's even more difficult to reflash via Serial. It might even be impossible depending on how you set it up, forcing you to replace the ESP32 chip (even more difficult and expensive). That means an attacker could disable an IoT alarm, for example, by simply uploading an arbitrary, not signed, program! And it would take hours to fix in a best case scenario (the victim has an electronics lab with ESP32s) to days in a worst case scenario (the product has to be sent to a technician and back to the victim)

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

      I think your comment describes why espressif chose to do what they do. And still, it is very easy to brick you ESP yourself with a bad sketch (re.g. blocking loop). Then, OTA does not work and you need to reflash the board :-(

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

      Ture, but at least you can test if it works before releasing the update if you have a consumer electronic product. The other scenarios are more likely to happen.

  • @piero957
    @piero957 5 ปีที่แล้ว

    Great, thanks.

  • @nidalhaddad8652
    @nidalhaddad8652 5 ปีที่แล้ว

    hi andreas, great video as always, can we have the same results on the esp8266 ?
    thank you

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

      I do not know if or how this works on the ESP8266

    • @duncanx99
      @duncanx99 5 ปีที่แล้ว

      Does anybody out there know?
      It would be really handy if it did. Zero or almost zero Spifs could make OTA viable on an ESP-01, and we've probably all got a draw full of those...

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

      Do not have time to read it right now but this article may have the answer regarding the 8266
      tinkerman.cat/eeprom-rotation-for-esp8266-and-esp32/

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

      You are right. At the bottom of the article.

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

    used custom partiton table in platformIO and can confirm that you can make your main partition 3Mb
    add *board_build.partitions = partitions_custom.csv* to your *platformio.ini* and your partitions_custom.csv file to the root of the project.

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

    thank you

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

    very interesting subject. thanks for sharing your knowledge. would be possible to do the same using micropython instead of Arduino IDE?

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

      I do not know how microPython uses the memory. But I think they already use it completely.

  • @Mikesukes
    @Mikesukes 5 ปีที่แล้ว

    This is kind of off the topic for memory but i am having a hard time trying to set a static IP for my ESP32's. have you been able to get this to work?

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      No. I always use dynamic IP.

  • @jeffmcclain
    @jeffmcclain 3 ปีที่แล้ว

    This didn't really show the functions to fetch the partition sizes...is that available? I'm curious, because I have a v2 Heltec Lora, which has 8MB QSPI flash and I wanted to just check the allocations. I would love to find this function. Also, I might mention I'm running in VSC with platformIO and not sure if you can set those default partitions there or how. As usual, you, sir, are a master and make very excellent/quick videos that answer some very complex questions! Thank you!

    • @jeffmcclain
      @jeffmcclain 3 ปีที่แล้ว

      ...and a little poking around on espressif's site: docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/storage/spi_flash.html#partition-table-api

    • @AndreasSpiess
      @AndreasSpiess  3 ปีที่แล้ว

      Usually you define the partition scheme in the IDE before you compile. So I do not see a big need to do that after deployment. You find the partition schemes if you chose the ESP32dev board. You should also find these constants in PIO, but you have to google.

  • @sorin.n
    @sorin.n 5 ปีที่แล้ว +1

    Everybody loves a quickie from time to time. Is OTA standardized somehow for ESP32? Or do I need to write my own code to be able to use it? Thank you!

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

      I think it is part of the IDE. Only a few lines of code.

    • @sorin.n
      @sorin.n 5 ปีที่แล้ว +1

      @@AndreasSpiess thank you! I'll give it a try!

    • @sorin.n
      @sorin.n 5 ปีที่แล้ว +1

      Or... do you think that OTA would fit one of your future viseos?

  • @VikiLab
    @VikiLab 3 ปีที่แล้ว

    Is it possible to allocate the total available SPIFFS for the sketch only, I don’t require the OTA or the capability to store other files I want all the memory available for the sketch only. Please help.

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

      Usually you can choose the chose the partitioning in the Arduino IDE (Tools-->partition scheme)

    • @VikiLab
      @VikiLab 3 ปีที่แล้ว

      @@AndreasSpiess i know but, i want to allocate all the memory for the sketch only with no SPIFFS or no OTA,default options has either combinations. Please help me i have been searching for a long time but didn’t manage to find a reasonable answer.

  • @ikstinknaarkip
    @ikstinknaarkip 5 ปีที่แล้ว

    Very useful to know, yet I haven't encountered this problem yet.

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      You never know when you will encounter it ;-)

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

    Can you explain how to make a memory map of current allocations and usage? thanks!

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

      I do not know how to do that. I only know how to create a new one.

  • @3dgussner958
    @3dgussner958 5 ปีที่แล้ว

    Great tip, aren't there esp32s with 16mb available?

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      Maybe. I never had the need so far.

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

      sort of. analoglamb sells some custom ESP32's with more storage.

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

    nice video! Can you give advice using ESP32 in sleep mode? Battery keeps dying..

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      I did it once for my board tests. I only used the example file. But I did not try if something is broken now. That would be an issue for Github...

    • @reanimationxp
      @reanimationxp 5 ปีที่แล้ว

      There are a number of Deep Sleep examples built into the esp32 library.

    • @ThomasHaberkorn
      @ThomasHaberkorn 5 ปีที่แล้ว

      I see that using the esp_sleep_enable_ext0_wakeup() method is the way to go. Is there a possibility to use as a wake-up event an incoming I2C message?

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      I do not think so. I2C needs a running processor.

    • @reanimationxp
      @reanimationxp 5 ปีที่แล้ว

      I would concur. Proper method would likely be waking up periodically and polling for new data via i2c. Best method is to devote a pin to waking up via an interrupt, which is supported.

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

    this works on Esp8266 aswell right?..i need to upgrade to a Esp32

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

      I do not think so. At least, I do not know.

  • @deangreenhough3479
    @deangreenhough3479 5 ปีที่แล้ว

    Back again

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

    4:30 "if true" 😂 dude you are compiling LIFE

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      I do not understand...

    • @recomoto
      @recomoto 5 ปีที่แล้ว

      @@AndreasSpiess I thought that the only thing missing from the expression at 4:30 was a semicolon at the end :D You of course could have done this deliberately though. Have a good day sir. Guata Morga👍

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

      depends on the language you use ;-)

    • @recomoto
      @recomoto 5 ปีที่แล้ว

      @@AndreasSpiess indeed :D

  • @jimmysalgado7001
    @jimmysalgado7001 5 ปีที่แล้ว

    Hi Andreas, great video, I was wondering if you can assist me, I'm using doit esp32 dev kit v1, and I can't see the partition scheme option under tools... Is there somehitng else that I should be doing?

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

      Just use the "ESP32 DEV" module" board instead, or "transplant" the lines in boards.txt to your board (As shown in the video.

    • @oalfodr
      @oalfodr 5 ปีที่แล้ว

      Line transplantation worked for me flawlessly on that board.

  • @MPElectronique
    @MPElectronique 3 ปีที่แล้ว

    In Arduino IDe is it possible to display the size of SPIFFS ?
    Thanks :)
    Marc.

    • @AndreasSpiess
      @AndreasSpiess  3 ปีที่แล้ว

      Usually you can display the partition scheme where you define the SPIFFS size

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

      There are API functions that will return used and available bytes. Check out the SPIFF library, SPIFFS.h file for the declaration.

  • @matthewnazmi9126
    @matthewnazmi9126 3 ปีที่แล้ว

    Hi. I was trying to get the partition plugin for arduinoIDE (francis94c/ESP32Partitions) working but did not succeed. I noticed your conversation with this plugin writer and is seems as if you got it to work. I wonder if you would consider making a video as how you manged to install it and getting it to work. thanks....

    • @AndreasSpiess
      @AndreasSpiess  3 ปีที่แล้ว

      I use the ESP32DEVboard in the Arduino IDE where I can chose the partition i need.

  • @axa.axa.
    @axa.axa. 4 ปีที่แล้ว

    It's this still true in later versions of the ide? I cannot find that partition menu option. At least not in versions 1.8.8 and later

    • @AndreasSpiess
      @AndreasSpiess  4 ปีที่แล้ว

      It is still here on my 1.8.9 version. But only with ESP32 boards. Try once "ESP32 dev module" board

    • @axa.axa.
      @axa.axa. 4 ปีที่แล้ว

      @@AndreasSpiess appreciate the reply. Sure enough changing the board to ESP dev module had updated the menu and i see the function. thanks!

  • @morpheuz2006
    @morpheuz2006 5 ปีที่แล้ว

    very interesting :D

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

    Oh my god, thank you so much ! You are a very-pretty-you-tuber yourself
    I was wondering where are my lost 3 MB for a very long time and always felt a bit ... cheated
    Until you came along :) so easy, and so many new exciting possibilities

  • @geekrulz1
    @geekrulz1 5 ปีที่แล้ว

    Don't forget that the esp32 runs an rtos in the background so that will also take up a lot of memory.

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

      But it also has a lot of memory ;-)

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

    Please explain how to setup the partition tables for aerduino IDE 2

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

      I do not understand "aerduino IDE 2"

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

      @@AndreasSpiess sorry my spelling. I ment the new Arduino 2 IDE. I was asking how to get the partions menu setup under tools menu.

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

      @@royhopkins974 It is at the same place as in the old IDE. But you have to select ESP32 DEV module. Otherwise, it might not be displayed.

  • @JohnEdwa
    @JohnEdwa 5 ปีที่แล้ว

    So could you do a "Min SPIFF No OTA" custom partition scheme and get practically all of the memory available for one app?

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

      Yes: github.com/espressif/arduino-esp32/issues/1476

  • @jeanpierredaviau7478
    @jeanpierredaviau7478 3 ปีที่แล้ว

    Is it the same for the AIThinker esp-CAM?

  • @DocMicha
    @DocMicha 5 ปีที่แล้ว

    Hello, what if ... I do not know: What if you manage OTA over an additional sd-card memory. It must not be fast. Is this possible?

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      I do not know. The OTA code is maintained by espressif and I would not want to change it...

    • @DocMicha
      @DocMicha 5 ปีที่แล้ว

      Oh, I thought the code is a library, easy to change so that was the missing info I had.

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      Maybe technically it is in a library. I am not sure. But it is done by espressif

    • @DocMicha
      @DocMicha 5 ปีที่แล้ว

      ok. Good Night. Its late in Europe!

  • @userou-ig1ze
    @userou-ig1ze 2 ปีที่แล้ว

    is it possible (and/or advisable) to get rid of spiffs entirely? Directly flash?

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

      It depends on your needs. You can put the variables in your sketch (flash memory), use EEPROM (also if flash memory), or SPIFFS (also in flash memory). All with advantages and disadvantages.

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

      Yes, just make do not include a spiffs partition in your partitions.csv file. Your program goes in the "factory" partiition. "NVS" can be used by you to store variables, structs etc but is also used by the system so keep that in there.

  • @dhaniyanuar5024
    @dhaniyanuar5024 4 ปีที่แล้ว

    I can't find a partition scheme in the tools bar, I am using Arduino IDE 1.8.12.
    is there any way to solve this?

    • @AndreasSpiess
      @AndreasSpiess  4 ปีที่แล้ว

      It depends on which board you selected. Not all show this option.

  • @pacsmile
    @pacsmile 5 ปีที่แล้ว

    This option only works with the "ESP32 dev module", currently i'm working with the "DOIT ESP32 DEVKIT V1", if i upload a sketch using the first board, do i keep the partition definition if i upload a second sketch but using my actual board?, if not, is there a way to add such optiion to any board model?.

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

      Yes, you have to copy the lines of the boards.txt file to your board definition. But you also can use the ESP32 dev module board. I always use that one.

    • @pacsmile
      @pacsmile 5 ปีที่แล้ว

      I see, thanks for the info!

  • @AbdulRehman-dx2lp
    @AbdulRehman-dx2lp 3 ปีที่แล้ว

    tussi great ho G !

  • @luissantiagoyaurikacyacuri4160
    @luissantiagoyaurikacyacuri4160 5 ปีที่แล้ว

    I didn´t understand what is OTA in ESP32. What is it useful for? Thanks

    • @AndreasSpiess
      @AndreasSpiess  4 ปีที่แล้ว

      You can update your firmware over WiFi. Very useful if you mounted your ESP in an inaccessible place.

  • @weinfin
    @weinfin 4 ปีที่แล้ว

    If some esp32 has 4mb ram, does it help?

    • @AndreasSpiess
      @AndreasSpiess  4 ปีที่แล้ว

      All ESP32 have at least 4MB flash

  • @deangreenhough3479
    @deangreenhough3479 5 ปีที่แล้ว

    I am not seeing Partition Scheme in the Tools menu of the IDE, tried on 1.8.5 and 1.8.6. Has anyone got any ideas please.. Thank you

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

      Not all boards definitions support partitioning. The ESP32 dev Module definition supports it.
      You can add these lines to your board:
      esp32.menu.PartitionScheme.default=Default
      esp32.menu.PartitionScheme.default.build.partitions=default
      esp32.menu.PartitionScheme.minimal=Minimal (2MB FLASH)
      esp32.menu.PartitionScheme.minimal.build.partitions=minimal
      esp32.menu.PartitionScheme.no_ota=No OTA (Large APP)
      esp32.menu.PartitionScheme.no_ota.build.partitions=no_ota
      esp32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
      esp32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA)
      esp32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
      esp32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
      in boards.txt
      please replace the esp32. with the text of your board.

    • @deangreenhough3479
      @deangreenhough3479 5 ปีที่แล้ว

      Andreas Spiess I worked on it last night and solved why it wasn’t working. I was working off the old esp32 core. Once I deleted it and added esp32 from within the Arduino IDE I had the options presented to me😀 many thanks for the code. I will store it somewhere safe. My BLE sketch has complied and uploaded into the new partition and all looking great 😀😀🏴󠁧󠁢󠁥󠁮󠁧󠁿

  • @17boxesofpasta29
    @17boxesofpasta29 5 ปีที่แล้ว

    Hi, just asking where we can get access to the Partition Scheme Tool. I don't seem to have access to all the tools :(

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      Maybe you chose a different board in the IDE definition. Not all boards have all definitions implemented. I select the "plain vanilla" dev board.

    • @17boxesofpasta29
      @17boxesofpasta29 5 ปีที่แล้ว

      @@AndreasSpiess Ah ok. I was using the 'DOIT ESP32 DEVKIT V1' board and thought you needed to download the tools from somewhere. Thanks for the help :)

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

    👍👏

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

    They also sell ESP32 with 8/16/32Mb flash size for like $1 or $2 more

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      Do you have a link?

    • @browaruspierogus2182
      @browaruspierogus2182 5 ปีที่แล้ว

      @@AndreasSpiess
      www.electrodragon.com/product/wroom-32/
      www.analoglamb.com/product/esp32-wrover/

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      Thanks! Were you able to use the flash in the Arduino IDE?

    • @browaruspierogus2182
      @browaruspierogus2182 5 ปีที่แล้ว

      Yes. They work out of the box

  • @bangonkali
    @bangonkali 5 ปีที่แล้ว

    I didn't need SPIFFS but still needed OTA , i tried this configuration and it works with HTTP OTA + BLE + MQTT. please do comment if you think there is an issue with this.
    # Name, Type, SubType, Offset, Size, Flags
    nvs, data, nvs, 0x9000, 0x5000,
    otadata, data, ota, 0xe000, 0x2000,
    app0, app, ota_0, , 0x1f7f00,
    app1, app, ota_1, , 0x1f7f00,
    eeprom, data, 0x99, , 0x200,
    spiffs, data, spiffs, , 0x0,

    • @bangonkali
      @bangonkali 5 ปีที่แล้ว

      i tried to maximize app0 and app1 for this one. also i left the offset blank because the esp_tool can handle offset alignment as per the document.

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      I cannot do remote debugging :-(

    • @bangonkali
      @bangonkali 5 ปีที่แล้ว

      @@AndreasSpiess this is interesting.
      btw, i updated mine to elimate eeprom and maximised app1, app0.
      # Name, Type, SubType, Offset, Size, Flags
      nvs, data, nvs, 0x9000, 0x5000,
      otadata, data, ota, 0xe000, 0x2000,
      app0, app, ota_0, 0x10000, 0x1f0000,
      app1, app, ota_1, 0x200000, 0x1f0000,
      eeprom, data, 0x99, 0x3f0000, 0x0,
      spiffs, data, spiffs, 0x3f0000, 0xf000,
      unfortunately my requirement includes support for Wifi OTA, WIFI Mqtt, and BLE Server for setting up node configuration via smart phone.
      I've been able to successfully merge all these 3 plus a variety of peripheral support on the device but somehow i needed to do a software restart every time the user needs to change mode (wifi mqtt as client -> ble server -> wifi ota as server) . it turned out, managing spiffs is easier than using eeprom with arduinojson.
      i never did remote debugging before and i don't think it will be needed in the product im involved with.
      this particular video explanation you posted has been instrumental in bootstrapping my knowledge in esp32 partitioning. thank you very much!

  • @deo-nis
    @deo-nis 5 ปีที่แล้ว

    this is strange. Micropython uses ~500 kb out of 4 MB. The only memory problem micropython gives is RAM memory shortage and only on esp8266. I am surprised that Arduino eats so much disk space.

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

      Micropython uses a different concept. It stores its "sketch" in RAM. This is why the ESP8266 is not used for big micropython projects and they use ESP32 with PSRAM

  • @iamnotgoodwithcomputer
    @iamnotgoodwithcomputer 5 ปีที่แล้ว

    i'm probably missing something here, but this caught my attention just now and it feels weird.
    the blink sketch uses a couple standard arduino library functions (3 or 5, depending on how you count setup() and loop()) and - compiled - is around 170 KiB.
    a hello world program in C on my computer (linux, gcc, amd64) compiles to a 7.8 KiB binary.
    what part am i missing here that explains why the microcontroller binary is a solid order of magnitude larger than the one on amd64? in particular, if you consider that the blink sketch essentially only sets a few registers. it just doesn't add up for me.

    • @GamerCNDG
      @GamerCNDG 5 ปีที่แล้ว +4

      Your C program will dynamically load the standard C library, which is big. Since it's dynamically loaded the file of the executable remains small.

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

      ah, thanks - yes, that was the part that i was missing in my brainfart. now it makes sense.
      cheers!

    • @trinidad17
      @trinidad17 5 ปีที่แล้ว

      Aside from the C library the Arduino library itself forces it to link to many stuff that you don't see or make use. Arduino inherits from it's Wiring past the fact that it is not well designed for speed or small footprint, but portability except in MCUs that have low storage space, obviously.
      For actual Arduino boards with AVR microcontrollers you can use Atmel Studio and don't use the Arduino library (or IDE) and that will give you a much smaller foot print, and also teach you more closely how your MCU works.

    • @iamnotgoodwithcomputer
      @iamnotgoodwithcomputer 5 ปีที่แล้ว

      thanks for the detail! i guess the the arduino ide does just fine for most purposes, but this is definitely something to keep in mind for that one occasion where you run of memory :)

  • @younespara1326
    @younespara1326 5 ปีที่แล้ว

    thank you so much from morocco

    • @AndreasSpiess
      @AndreasSpiess  5 ปีที่แล้ว

      You are welcome! Beautiful country. I was once on a desert race with my bike and once in Marrakesh.

    • @younespara1326
      @younespara1326 5 ปีที่แล้ว

      You are welcome

  • @hanpahomeautomation4101
    @hanpahomeautomation4101 5 ปีที่แล้ว

    I'm using PlatformIO, a much better IDE than Arduino IDE. Easy to change the partitioning both for ESP8266 and for ESP32. An example here for ESP8266 with almost 2MB for app0 and app1, github.com/espressif/arduino-esp32/issues/1476#issuecomment-395348594

  • @ifediora
    @ifediora 5 ปีที่แล้ว

    Hello Andreas,
    I admire your work and channel; and thanks for inspiring.
    I have a suggestion, I co-built an arduino plugin with a friend to automate memory partition for esp32
    See latest Esp32 Partition manager:
    github.com/francis94c/ESP32Partitions
    Other examples of usage is in:
    github.com/espressif/arduino-esp32/tree/master/libraries/EEPROM/examples/eeprom_class
    Best regards,
    Elochukwu Ifediora (fedy0)

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

      Interesting concept. However, it did not run for me. I added my point to the existing issue.

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

      I tried this tool too hoping it would solve all of my problems but no tool in the menu - tried various versions of the arduino IDE and still couldn’t get the gui tool to show 😢 thanks for your effort nonetheless 🙏

  • @Nabilphysics
    @Nabilphysics 5 ปีที่แล้ว

    great video. plz see "Electronics Plus" app. Where we added your video in learning section.

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

      Thank you. I hope you mentioned my channel ;-)

    • @Nabilphysics
      @Nabilphysics 5 ปีที่แล้ว

      @@AndreasSpiess yes. we directly give your channel. plz download the "Electronics Plus" app from play store

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

    Just because I can, FIRST!!!!!!

  • @mustafasaltuk7991
    @mustafasaltuk7991 5 ปีที่แล้ว

    Give me soildering iron please very need no money and studend

    • @reanimationxp
      @reanimationxp 5 ปีที่แล้ว

      Soldering irons can be found for $2-5 on eBay. Don't beg someone providing you with free information for hardware as well.