Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

CPX Memory Allocation Issues
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

CPX Memory Allocation Issues

by htmagic on Sun Oct 18, 2020 1:43 am

OK, folks,
I have 2 Circuit Playground Express (CPX)/Crickit boards.
One works fine and the other gives me the following issue:
Traceback (most recent call last):
File "code.py", line 4, in <module>
MemoryError: memory allocation failed, allocating 448 bytes


I went through this forum looking for a similar issue and I deleted the adafruit_circuitplayground folder from the lib folder.
Strangely enough the other combo has the library and it still doesn't give issues.
What gives?

Thanks in advance for an answer.
MagicBill

htmagic
 
Posts: 46
Joined: Tue Dec 03, 2013 12:18 am

Re: CPX Memory Allocation Issues

by dastels on Sun Oct 18, 2020 10:50 am

What versions of CircuitPython are on the boards, and are both using the CPX+Crickit builds?

Dave

dastels
 
Posts: 3767
Joined: Tue Oct 20, 2015 3:22 pm

Re: CPX Memory Allocation Issues

by htmagic on Sun Oct 18, 2020 1:54 pm

Dave,

I believe both are running the same build:
adafruit-circuitpython-circuitplayground_express-en_US-5.3.1
Both have the CPX+Crickit boards.
I had a dilly of a time getting seesaw onto the Crickit board.
Once I plugged the cable into the Crickit board and got into boot, I dragged the seesaw-crickit.uf2 file over the boot disappeared the the Crickit board started flashing red.
I may swap boards and try to load my files onto a different board and see if that works.
That may take awhile. I shuttle back and forth to my apartment 2 hrs away from home and work the week as a geographic bachelor...

I finally got the radio control working on one board. Now for the other.
Eventually, I may migrate to a bluefruit CPB but that requires different drivers, etc.
One step to solve at a time...

Thanks in advance for your help.

MagicBill

htmagic
 
Posts: 46
Joined: Tue Dec 03, 2013 12:18 am

Re: CPX Memory Allocation Issues

by dastels on Sun Oct 18, 2020 2:37 pm

The USB connector on the cricket board is ONLY for reprogramming its firmware. You will likely never have to do that.

You won't have any memory issues on the CPB boards.

Dave

dastels
 
Posts: 3767
Joined: Tue Oct 20, 2015 3:22 pm

Re: CPX Memory Allocation Issues

by tannewt on Mon Oct 19, 2020 6:04 pm

Hi MagicBill, there is a CircuitPython build for CPX+Crickit specifically. It bakes some of the libraries into the flash to save RAM.

https://circuitpython.org/board/circuit ... s_crickit/

tannewt
 
Posts: 1837
Joined: Thu Oct 06, 2016 8:48 pm

Re: CPX Memory Allocation Issues

by htmagic on Mon Oct 19, 2020 6:43 pm

Tannewt,

Are you talking about CircuitPython 6.0.0-rc.0? I used the earlier version because it said it was the latest stable version.
But the funny thing is I have 2 boards that I built and only 1 is giving me memory issues.
I wonder if it's an earlier version board?

Davw said I didn't need to add seesaw on the Crickit board. But I believe I did for the other one.
This is all new to me and I used John Park's Scream tutorial as a guide. Once I had that working, I modified it for the project I'm working on.
I basically slowed down the 1st servo and added a second servo.
I also changed from the microphone input to the I/O pins.
I also changed the .wav file for a different one.

I finally got the radio control receiver and key fob to work to trigger the I/O pins. At least on the one setup without memory issues.
I would eventually like to migrate to a CPB board instead but there are different drivers and setup for the CPB board. I'm still learning.
Even though I have a CPB and bluefruit, I could still trigger the Crickit I/O pins with a radio control receiver, like the CPX board?
And then I could pull the RC receiver and just use Bluetooth from a phone? That would be ideal but I don't know how to do that (yet!).
I've learned quite a bit playing around with this setup. I love Adafruit and the support they've provided through this forum and the learning guides.
I think I've learned more from this site than I have in any college programming class I've taken in the past!
I've spent a lot of money on Adafruit products but I'll write that off as part of my 'educational expenses' (heh heh)!

Thanks in advance for your response and feedback.
May the FORCE be with you and have a magical day!

MagicBill

htmagic
 
Posts: 46
Joined: Tue Dec 03, 2013 12:18 am

Re: CPX Memory Allocation Issues

by tannewt on Mon Oct 19, 2020 9:03 pm

I was talking about the circuitplayground_express_crickit build versus the circuitplayground_express build. The first one should save memory when using the crickit with the CPX. The board version shouldn't matter.

The CircuitPlayground bluefruit should be an easy drop in for the CPX. The only major difference is the loss of IR capability in exchange for bluetooth.

tannewt
 
Posts: 1837
Joined: Thu Oct 06, 2016 8:48 pm

Re: CPX Memory Allocation Issues

by htmagic on Tue Oct 20, 2020 12:15 am

I need the Crickit because I'm running 2 servos, a speaker, and I'd like a 8 pixel neopixel strip.
The bluefruit drop in sounds intriguing.
I may have to set up a CPB/Crickit and try that.

BTW, here's a short video of what I'm working on.
https://youtu.be/yvU4_mIAh2Q
Thanks,

MagicBill

htmagic
 
Posts: 46
Joined: Tue Dec 03, 2013 12:18 am

Please be positive and constructive with your questions and comments.