New release New firmware release 1.2.2.b1
-
Hello everyone,
Here we are with an early week release that improves the interrupt functionality and fixes some bugs that were present in the previous release. These are the release notes:
-
When a thread dies remove it from the linked list. Also release the memory it had allocated. Fixes #39 (https://github.com/pycom/pycom-micropython/issues/39)
-
Kill the interrupts tasks during a soft reset.
-
Enable the finalizer for Alarms.
-
Release the GIL before blocking
-
Test for possible handler=None in queued callbacks.
-
Move functions called by ISRs to RAM to fix gurus on Alarms and Pins.
-
Pass the correct stack size when creating threads.
-
Correct pins P13 and P14 that were inverted.
As usual, the new firmware can be flashed using the updater tool found in: https://www.pycom.io/support/supportdownloads/
Cheers,
Daniel -
-
Oh this is a very welcome early bug fix release.
I was trying some periodic Alarm code which was crashing with a Guru Meditation error at about every 142 events on the previous beta. Happy to report that's now running well into the thousands and still ticking away nicely.
This even before I even had a proper chance to report it! Amazing :-)
-
How much free RAM is available?
-
>>> import gc >>> gc.mem_free() 42464 -
@jmarcelino said in New release New firmware release 1.2.2.b1:
>>> import gc >>> gc.mem_free() 42464Thanks, getting better.
-
As a hint for everyone who is building the image her- or himself:
Please update the pycom-esp-idf too. Otherwise the build will not run. -
OK first let me say the new release is a massive improvement, before this same code would crash after only 140 or so Alarm events. However it's still crashing without fail in the 2500-3000 range.
Note I may well be doing something wrong as I just started with MicroPython this Xmas!
First the crash:
[...some output here] Elapsed 2690 s Hourly average 22.84 mAh Consumed 17.07 Elapsed 2691 s Hourly average 22.83 mAh Consumed 17.07 Elapsed 2692 s Hourly average 22.82 mAh Guru Meditation Error of type InstrFetchProhibited occurred on core 0. Exception was unhandled. Register dump: PC : 0x00692cc0 PS : 0x00060430 A0 : 0x800ecdd4 A1 : 0x3ffc4bb0 A2 : 0x3ffc5490 A3 : 0x00000001 A4 : 0x00000000 A5 : 0x3ffc4bd0 A6 : 0x400dc2cc A7 : 0x3ffc1340 A8 : 0x800ecd90 A9 : 0x3ffc4b90 A10 : 0x3ffc5490 A11 : 0x00000001 A12 : 0x00000000 A13 : 0x3ffc4bd0 A14 : 0xb33fffff A15 : 0x3ffc4b70 SAR : 0x0000001c EXCCAUSE: 0x00000014 EXCVADDR: 0x00692cc0 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff Backtrace: 0x00692cc0:0x3ffc4bb0 0x400ecdd4:0x3ffc4bd0 0x400dc2dc:0x3ffc4c00 0x400e0e3e:0x3ffc4c20 0x400d81d8:0x3ffc4ca0 Rebooting...and my code (shortened version I'm using for testing)
from machine import Pin from machine import Timer import micropython micropython.alloc_emergency_exception_buf(100) class LTC4150(object): ah_quanta = 0.17067759 def __init__(self): self.p_in = Pin('P15', mode=Pin.IN, pull=None) self.p_in.callback(Pin.IRQ_FALLING, self.__pin_handler) self.chrono = Timer.Chrono() self.chrono.start() self.count = 0 self.time = 0 self.lastTime = 0 def __pin_handler(self, arg): self.count = self.count + 1 def periodic_handler(alarm): mA = cc.count* cc.ah_quanta seconds = cc.chrono.read() print("Consumed %.2f" % mA ) print ("Elapsed %d s " % seconds) print("Hourly average %.2f mAh" % ((3600*mA)/seconds)) cc = LTC4150() alarm = Timer.Alarm(periodic_handler, 1, periodic=True)If I increase the period say to 10s it still crashes just takes 10x as long, so I think it's more to do with the number of events
Thanks for the help
-
@jmarcelino thanks for the report, we are investigating why those crashes are occurring. We'll let you know once we discover the root cause.
Cheers,
Daniel -
Do we have to call the finalizer explicitly, or is it automatic?
-
Wonderful update I gotta admit. Fixed a lot of memory problems! One problem that has been fixed and I haven't see anybody reporting was that you could run your code 2 times and then it would crash on the 3rd try. It is now fixed and I can upload my code as many time as I want to! Fantastic.
Cheers,
M. -
@mohpor cool :-) thanks for the feedback!
Cheers,
Daniel -
@pdp8user it's automatic.
-
@daniel Thanks for that and the prompt reply.
Keep up the good work! The memory issues have been frustrating, because as @mohpor says, something would work some times and not others.
I'm still having some issues in that respect, which is why the question about the finalizer. I've still to clarify the details, then I'll report it to you.
Cheers,
Brian -
@pdp8user thanks. Yes, please let us know the details about the issues that you are experiencing so that we can analyze the problem.
-
On the download page current firmware version is 1.2.0.b1 see
-
@bmarkus
this is only not updated web page label
updater tool update to version expected 1.2.2.b1 -
@daniel
Hi again,
Are we still up for today's update? (despite of the early 1.2.2.b1 update) -
@mohpor the release is going to be out tomorrow (Friday 13), we still need one more day to complete all the features that we are targeting for this next release. Apologies for the delay...
Cheers,
Daniel -
@daniel
sorry for spam but good date "Friday 13" :) -
@livius haha :-)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login