2MB flash on the wipy?

Questions and discussion about The WiPy 1.0 board and CC3200 boards.
Target audience: Users with a WiPy 1.0 or CC3200 board.
iandouglas
Posts: 6
Joined: Tue Nov 10, 2015 2:42 am

2MB flash on the wipy?

Post by iandouglas » Wed Nov 11, 2015 6:02 am

Hi folks,

The wipy is advertised as having 2MB of flash on board. How much of that is usable for our applications and libraries?

Reason I ask, I'm trying to FTP about 320kb worth of libraries (falcon) to my wipy and it keeps getting hung up on transferring all files like it's running out of space. I'm getting about 100kb worth of code on the device before it stops accepting new files.

Thanks,
Ian

User avatar
danicampora
Posts: 342
Joined: Tue Sep 30, 2014 7:20 am
Contact:

Re: 2MB flash on the wipy?

Post by danicampora » Wed Nov 11, 2015 6:26 am

Hi, 192 KB are available for the scripts. The rest is used internally.

iandouglas
Posts: 6
Joined: Tue Nov 10, 2015 2:42 am

Re: 2MB flash on the wipy?

Post by iandouglas » Wed Nov 11, 2015 6:53 am

Thanks.

Is that documented somewhere? I don't recall seeing that as a constraint on Kickstarter or any of the updates, and backed the WiPy (5 of them) with the belief I'd have 2MB of Flash at my disposal.

I understand that this is "micro" python, but having to constrain our code and 3rd party libraries to 192kb is a bit of a challenge for what I'd like to build with these devices without having to scale down 3rd party frameworks and dependencies etc. to fit on one tenth of the space I thought I'd have available to use.

To add expansion boards to all of my WiPy units at additional cost just to get SD card availability for more storage, I'd actually spend more than $50USD per unit plus the cost of an SD card.

I'm feeling quite disappointed. :(

User avatar
danicampora
Posts: 342
Joined: Tue Sep 30, 2014 7:20 am
Contact:

Re: 2MB flash on the wipy?

Post by danicampora » Wed Nov 11, 2015 7:06 am

I am sorry that you are feeling disappointed. Do you need the space for scripts or for data logging?

User avatar
dhylands
Posts: 3465
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: 2MB flash on the wipy?

Post by dhylands » Wed Nov 11, 2015 7:41 am

iandouglas wrote:Thanks.

Is that documented somewhere? I don't recall seeing that as a constraint on Kickstarter or any of the updates, and backed the WiPy (5 of them) with the belief I'd have 2MB of Flash at my disposal.
That's the total amount of flash on the chip. Obviously a portion of that gets used up for micropython, for the wifi drivers, etc.

You do have 2 Mb of flash, when there is NO firmware installed (but it isn't particularly useful without firmware).

You could add a serial EEPROM/flash chip and have a much larger filesystem there.

I don't know yet how the memory usage is broken down, and what the limitations of the firmware is, but I've worked with enough chips to know that just because there is 2Mb of flash doesn't mean you can do whatever you want with it. There are always limitations associated with its use.

User avatar
platforma
Posts: 258
Joined: Thu May 28, 2015 5:08 pm
Location: Japan

Re: 2MB flash on the wipy?

Post by platforma » Wed Nov 11, 2015 11:18 am

I am not entirely sure if micropython will run falcon, you might have to port it yourself, with that comes the size reduction as well. But yes, to agree with Dave, the advertised sizes of chips don't usually mean that you get it all for user storage. Alternatively, why not utilize your sd cards?

User avatar
pythoncoder
Posts: 4572
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: 2MB flash on the wipy?

Post by pythoncoder » Wed Nov 11, 2015 1:28 pm

@platforma a quick look at the falcon source suggests that porting it to MicroPython would be nontrivial. It uses various cPython standard libraries which haven't been ported, so the first task might be to assess the magnitude of that task. If I were attempting a port I'd also want to know how falcon achieves concurrency.

On the other hand it has a lot of comments and docstrings, so the code size could be reduced with minify.
Peter Hinch

User avatar
platforma
Posts: 258
Joined: Thu May 28, 2015 5:08 pm
Location: Japan

Re: 2MB flash on the wipy?

Post by platforma » Wed Nov 11, 2015 1:49 pm

@pythoncoder, that's what I thought at first glance but I didn't go as far as digging the code :) Doesn't look like something you can do in a day. Ian what was your application for falcon?

iandouglas
Posts: 6
Joined: Tue Nov 10, 2015 2:42 am

Re: 2MB flash on the wipy?

Post by iandouglas » Wed Nov 11, 2015 7:09 pm

Thanks for the replies, everyone. I'm already speaking with the team about getting a refund, but I appreciate hearing thoughts from others.

"There are always limitations associated with its use." -- I come from a background in embedded systems, so I'm well aware of that, but there was no mention that more than 90% of the 2MB of Flash storage was already used up anywhere in the kickstarter campaign, any of the updates, or any of the hundreds of comments at kickstarter, or in any post here on the forums. The only thing that came close was a single post here in the forums where a user asked about rolling their own firmware and being told it'd need to be 192kb at most.

So yeah, it's partly my own fault for not asking up front what the *usable* space on the flash storage was for our code and third party libraries, but it still feels misleading that there was no mention of this capacity issue until now.

As for background on my projects, we bought a new home this year so most of my ideas stem around tracking information about the home.

I was originally developing on a raspberry pi in Flask using SendGrid for email alerts, and InitialState for dashboard data and using Flask as a means for pulling data via json formatting to process on a home server, to see various sensor data around temperature (eg, which of our bedrooms are hottest/coolest versus weather outside), humidity (do we need to install a ceiling vent in our kid's bathroom when they shower), vibration (our washing machine bangs on the wall a lot, at what point will that be a problem for wall/floor structure), soil moisture sensors for controlling our sprinkler system (turn it off if it's raining, or going to rain) that sort of home automation stuff. The only reason I started looking at Falcon as an alternative to Flask was to learn something new and hadn't dug deep enough to see that it had clib dependencies.

I figured these wipy boards would be way more ideal from a power/footprint point of view, but when the third party libraries alone take up more than the usable space, I feel a little misled about how much storage we have on the device itself. And I don't really want to spend another $80 on more expansion boards or a nearly equal amount from sparkfun or some other source to buy SD card breakout boards (and having to write software to manage those new boards), or even have to reinvent all of this framework code that's already been well tested and secured and so on.

I'm not at all disappointed that I backed the project, I've had a deep love and appreciation for Python for several years and seeing a board like this got me pretty excited that rapid development with built-in networking with a tiny hardware footprint and power usage was going to be more commonplace. But for my project usage, the 192kb limitation means throwing out much of the code I've already been developing.

User avatar
dhylands
Posts: 3465
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: 2MB flash on the wipy?

Post by dhylands » Wed Nov 11, 2015 8:28 pm

It might not have been used up.

On the pyboard (I'm more familiar with the pyboard than the wipy), the filesystem is 112K even though there is 512K of free flash. But we can't really manipulate that flash because the block sizes are too big.

Using the flash as part of a file system requires having enough RAM to store the contents of the flash block in. On the pyboard, most of the chip is made up of 128K flash blocks, but we don't have 128K of free RAM, so we can't use those blocks as part of the file system.

That's what I meant by being "restricted".

Post Reply