# FYI, Circuit Python versus Micro Python uf2 files

**URL:** <https://forums.pimoroni.com/t/fyi-circuit-python-versus-micro-python-uf2-files/19031>\
**Category:** Discussion\
**Created:** [March 5, 2022, 9:03pm UTC](https://forums.pimoroni.com/t/fyi-circuit-python-versus-micro-python-uf2-files/19031 "2022-03-05T21:03:56Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [March 5, 2022, 9:03pm UTC](https://forums.pimoroni.com/t/fyi-circuit-python-versus-micro-python-uf2-files/19031/1 "2022-03-05T21:03:56Z")

</div>

If you have a Pico LIPO, or Tiny 2040, and flash it with the Micro Python uf2 file, you will be limited to the Pi Pico default 2MB. To get the full use of all your memory you have to use the corresponding Adafruit Circuit Python uf2 file. As it stands now anyway. Or do up your own custom Micro Python uf2 file.

Also, keep track of which Tiny 2040 you have, as its not marked on it if its 2MB or 8MB. Not that I could see anyway? The Pico LIPO has a jumper on the back / bottom denoting which it is, 4MB or 16MB.

---

<div class="post-metadata">

**Author:** ![Tonygo2](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/tonygo2/32/7814_2.png) [@Tonygo2](https://forums.pimoroni.com/u/Tonygo2)\
**Post date:** [March 6, 2022, 11:19am UTC](https://forums.pimoroni.com/t/fyi-circuit-python-versus-micro-python-uf2-files/19031/2 "2022-03-06T11:19:57Z")

</div>

I prefer the graphics with Micropython so a fix would be useful.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [March 6, 2022, 11:55am UTC](https://forums.pimoroni.com/t/fyi-circuit-python-versus-micro-python-uf2-files/19031/3 "2022-03-06T11:55:48Z")

</div>

Ditto, I much prefer working in Micro Python. My Pico Lipo currently has the Pico Display Pack, 1.54 LCD breakout, LTR-559, VEML6075, RV3028, BME280 and a BME688 attached. Going to be a real PITA to start over and get that all working in Circuit Python.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [March 10, 2022, 8:00pm UTC](https://forums.pimoroni.com/t/fyi-circuit-python-versus-micro-python-uf2-files/19031/4 "2022-03-10T20:00:27Z")

</div>

Was directed here after posting on the Pi Foundation forum.  
[MicroPython - Python for microcontrollers](https://micropython.org/download/?vendor=Pimoroni)  
They will let you use the full amount of storage space. I’m thinking they don’t have all the custom files Pimoroni adds to their image though? I’ll be trying to confirm that at some point. Have to take a break from things for now though.

---

<div class="post-metadata">

**Author:** ![Tonygo2](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/tonygo2/32/7814_2.png) [@Tonygo2](https://forums.pimoroni.com/u/Tonygo2)\
**Post date:** [March 11, 2022, 8:37am UTC](https://forums.pimoroni.com/t/fyi-circuit-python-versus-micro-python-uf2-files/19031/5 "2022-03-11T08:37:38Z")

</div>

Thanks for the link… Updated both my Pico Lipo16 and Tiny2040.  
Both now report correctly.

Should now have plenty of room to store colour images for a photo display program.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [March 11, 2022, 9:36am UTC](https://forums.pimoroni.com/t/fyi-circuit-python-versus-micro-python-uf2-files/19031/6 "2022-03-11T09:36:04Z")

</div>

Phil Howard AKA Gadgetoid did up some custom Pimoroni versions and posted a link to them in a github post I made. I haven’t tested them myself just yet. Only just got up and turned on my PC. Its 5:30 AM here, need some java to get fully awake, lol.  
[CI: Build MicroPython for multiple boards · pimoroni/pimoroni-pico@eac8c68 (github.com)](https://github.com/pimoroni/pimoroni-pico/actions/runs/1966023834)

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [March 11, 2022, 11:19am UTC](https://forums.pimoroni.com/t/fyi-circuit-python-versus-micro-python-uf2-files/19031/7 "2022-03-11T11:19:16Z")

</div>

@Tonygo2 , Tony what are you using to check the “reported space”?  
Just flashed my Pico Lipo and Thonny shows it as  
MicroPython v1.18 on 2022-03-10; Pimoroni Pico LiPo 16MB with RP2040

---

<div class="post-metadata">

**Author:** ![Tonygo2](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/tonygo2/32/7814_2.png) [@Tonygo2](https://forums.pimoroni.com/u/Tonygo2)\
**Post date:** [March 11, 2022, 1:45pm UTC](https://forums.pimoroni.com/t/fyi-circuit-python-versus-micro-python-uf2-files/19031/8 "2022-03-11T13:45:04Z")

</div>

On my Tiny 2040 I used this:

```auto
# Board memory Test
# Tony Goodhew 11 March 2022
# Builds a very large text file - all junk!
import machine
import uos
print("Basic Memory Space Test \n")
with open("/test2.txt", "w") as f: # Write - new file
        f.write("First Message\r\n")
        
for u in range(10000):
    if int(u/500)*500 == u:
        print(u)
    with open("/test2.txt", "a") as f: # Append
        f.write("Tony Goodhew\r\n")
        f.write("Leicester City Cup Winners!\r\n")
        f.write("ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz,.?%$£*&\r\n")
        for i in range(10):
            f.write(str(i) + ", " + str(i*i*i) + ", " + str(i*i*i*i) + "\r\n")

print("Done")

```

> > > %Run -c $EDITOR\_CONTENT  
> > > Basic Memory Space Test

0  
500  
1000  
1500  
2000  
2500  
3000  
3500  
4000  
4500  
5000  
5500  
6000  
6500  
7000  
7500  
8000  
8500  
9000  
9500  
Done

> > >

If you look at the file with Thonny it reports 2360015 bytes!

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [March 11, 2022, 2:08pm UTC](https://forums.pimoroni.com/t/fyi-circuit-python-versus-micro-python-uf2-files/19031/9 "2022-03-11T14:08:30Z")

</div>

Ok, I just uploaded a big mp3 file, 5MB or so. The PICO Display Pack demo ran on my Pico Lipo after flashing it with the new Pimoroni file, so I’d say I’m good to go now.

---

<div class="post-metadata">

**Author:** ![hel](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/hel/32/6075_2.png) [@hel](https://forums.pimoroni.com/u/hel)\
**Post date:** [March 11, 2022, 3:07pm UTC](https://forums.pimoroni.com/t/fyi-circuit-python-versus-micro-python-uf2-files/19031/10 "2022-03-11T15:07:30Z")

</div>

You can also do something like this to report the available filesystem size:

```auto
import os

f_bsize, f_frsize, f_blocks, f_bfree, _, _, _, _, _, f_namemax = os.statvfs("/")
f_total_size = f_frsize * f_blocks
f_total_free = f_bsize * f_bfree

print(f"Total size: {f_total_size/1048576} MB")
print(f"Total free: {f_total_free/1048576} MB")

```

Have tested both flavours of Pico LiPo and Tiny 2040 with the new [pimoroni-pico board specific builds](https://github.com/pimoroni/pimoroni-pico/releases/tag/v1.18.4) and they both seem to be now reporting believable flash amounts and dealing with big files properly - hooray!

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [March 11, 2022, 7:14pm UTC](https://forums.pimoroni.com/t/fyi-circuit-python-versus-micro-python-uf2-files/19031/11 "2022-03-11T19:14:19Z")

</div>

Thankyou, I’ve been looking for code like that since this all started.  
This is what I’m getting with the 1.18.4 uf2 files flashed.

```auto
MicroPython v1.18 on 2022-03-11; Pimoroni Tiny 2040 with RP2040

Type "help()" for more information.
>>> %Run -c $EDITOR_CONTENT
Total size: 7.0 MB
Total free: 6.992188 MB
>>> 

```

```auto
MicroPython v1.18 on 2022-03-11; Pimoroni Pico LiPo 16MB with RP2040

Type "help()" for more information.
>>> %Run -c $EDITOR_CONTENT
Total size: 15.0 MB
Total free: 14.99219 MB
>>>

```
