New firmware release 1.2.0.b1
-
Hello everyone,
Firmware 1.2.0.b1 has just been released. These are the notes from the change log:
- Add the Timer class and the new interrupt mechanism.
- Use the correct functions to enter and exit critical sections in LoRa Timers. This fixes the crash on raw LoRa that was introduced in version 1.1.1.b1
- Add the SD class docs for the ESP32.
- Integrate the SDMMC drivers with FatFS.
- Increase the max Rx packet size of the certification script.
- Use a global variable for the rx_data struct used inside ISRs/Callbacks.
- Create custom channel add/remove functions for manual requests.
- Update the LoRaWAN stack to Semtech's version 4.3.0
- Change the LoRa timebase from 1000us to 1ms.
- Properly exit compliance test mode when disabling it via the API.
The main highlights of these release are:
- The new SD card class: https://docs.pycom.io/pycom_esp32/library/machine.SD.html
- The updated LoRa stack which is now on the lab for LoRaWAN certification.
- The new Timer class: https://docs.pycom.io/pycom_esp32/library/machine.Timer.html
- A whole new interrupt system mechanism: https://docs.pycom.io/pycom_esp32/pycom_esp32/general.html#interrupt-handling
Right now this interrupt mechanism is being used by:
-
The Pin class:
https://docs.pycom.io/pycom_esp32/library/machine.Pin.html?highlight=pin#machine.Pin.callback -
And the newly added Timers: https://docs.pycom.io/pycom_esp32/library/machine.Timer.html#machine.alarm.callback
Known issues:
- Using SSL/TLS sockets with client and server side certificates doesn't work and an unknown exception is thrown. This prevents connecting to AWS.
This will be addressed in the next release as it is on the top of our list now.
If you still don't have the latest updater tool (v 1.0.0.b1), please get it from: https://www.pycom.io/support/supportdownloads/ and update your boards. It should fetch this new firmware automatically.
Cheers,
Daniel -
@daniel Hi, good stuff. The link does not seem to work yet though ? It is directing me to 1.0.0.b1 software (windows link).
-
Hi @Wembly, a few releases ago (1.0.0.b1) we improved the updater tool so you don't need to reinstall it every time we release a new firmware. It will fetch the new firmware releases by itself.
The number 1.0.0.b1 you see corresponds to the installer version and not to the firmware.
Hope it helps,
-
Ahh, excellent !
-
Thank you for your new release.
I tested the timer.alarm and I just get a reset.
Guru Meditation Error of type InstrFetchProhibited occurred on core 0. Exception was unhandled.
Register dump:
PC : 0x02625a00 PS : 0x00060a30 A0 : 0x800e823c A1 : 0x3ffc1ab0
A2 : 0x3ffc3470 A3 : 0x00000001 A4 : 0x00000000 A5 : 0x3ffc1ad0
A6 : 0x400de118 A7 : 0x3ffc46b0 A8 : 0x800e81f8 A9 : 0x3ffc1a90
A10 : 0x3ffc3470 A11 : 0x00000001 A12 : 0x00000000 A13 : 0x3ffc1ad0
A14 : 0xb33fffff A15 : 0x00060023 SAR : 0x00000014 EXCCAUSE: 0x00000014
EXCVADDR: 0x02625a00 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffffBacktrace: 0x02625a00:0x3ffc1ab0 0x400e823c:0x3ffc1ad0 0x400de127:0x3ffc1b00 0x400df7a6:0x3ffc1b20 0x400d7d6c:0x3ffc1ba0
Rebooting...
-
I don't seem to get the interrupts working either...
-
@Wembly I tested because I desperate need them. It looks like working. I tested on WiPy 2
-
@constantinos can you show how did you get to that Guru Meditation Error ?
-
@Wembly are you trying any of the examples from the docs or something else? Could you share your code?
-
@daniel I have a project with three buttons, which I debounce and use them to activate some relays. I tried to simplify my code using the pin.callback, but every time I push the button, the handler gets called several times because of the noise. How could I solve this?
The code I'm using is:
button1 = Pin("G8", mode=Pin.IN, pull=Pin.PULL_UP)
button2 = Pin("G9", mode=Pin.IN, pull=Pin.PULL_UP)
button3 = Pin("G10", mode=Pin.IN, pull=Pin.PULL_UP)
button1.callback(handler=pin_handler, trigger=Pin.IRQ_LOW_LEVEL and Pin.IRQ_FALLING)
button2.callback(handler=pin_handler, trigger=Pin.IRQ_LOW_LEVEL and Pin.IRQ_FALLING)
button3.callback(handler=pin_handler, trigger=Pin.IRQ_LOW_LEVEL and Pin.IRQ_FALLING)The code I previously used and works fine is:
while True:
reading1 = button1()
reading2 = button2()
reading3 = button3()
if(reading1 != lastButton1State):
lastDebounceTime = current_milli_time()
if(reading2 != lastButton2State):
lastDebounceTime = current_milli_time()
if(reading3 != lastButton3State):
lastDebounceTime = current_milli_time()if((current_milli_time() - lastDebounceTime) > debounceDelay): if(reading1 != button1State): button1State = reading1 if(button1State == True): relay1State = not relay1State print("button pushed") if(reading2 != button2State): button2State = reading2 if(button2State == True): relay2State = not relay2State print("button pushed") if(reading3 != button3State): button3State = reading3 if(button3State == True): relay3State = not relay3State print("button pushed") relay1.value(relay1State) relay2.value(relay2State) relay3.value(relay3State) lastButton1State = reading1 lastButton2State = reading2 lastButton3State = reading3 -
@daniel just a gc.collect() before the instance of Clock()
import micropython from machine import Timer import gc micropython.alloc_emergency_exception_buf(100) SECONDS = 0 class Clock: def __init__(self): self.__alarm = Timer.Alarm(self._seconds_handler, 1, periodic=True) def _seconds_handler(self, alarm): global SECONDS SECONDS += 1 #print("%02d seconds have passed" % nemet_global.SECONDS) gc.enable() gc.collect() clock = Clock() -
@toribios_people debouncing by measuring time like you show on your code should work. Could you share with us the complete pin handler so that I can test it? Other than that, instead of:
button1.callback(handler=pin_handler, trigger=Pin.IRQ_LOW_LEVEL and Pin.IRQ_FALLING)you should write it like this:
button1.callback(handler=pin_handler, trigger=Pin.IRQ_FALLING)Doing that AND operation on the trigger doesn't have the effect that you expect as this are just bit flags that are passed to the internal interrupt registers. Besides that, if you want to detect the button push, the falling edge is enough (plus some of that debounce code).
Cheers,
Daniel -
@constantinos I just tested your example, and I even enabled the print statement, but I can't reproduce the crash... (still running for ~10 minutes)
EDIT: OK got the guru meditation error now getting closer to the 11 minutes. We'll investigate. Thanks for the report.
Cheers,
Daniel -
@daniel Thanks for reply, nevermind my comment. It was my bad. Interrupts works !
Edit: however, interrupts will not work if waiting for socket operation (which was the only reason to why I needed them to work). I have added an issue here:
https://github.com/pycom/pycom-micropython/issues/57 -
@constantinos, thanks again for your report. We found the cause of the issue inside the garbage collector code. We're fixing it right now. It should be fixed for the next firmware release.
-
@Wembly, thanks for reporting the issue with the sockets, we've tracked it to the GIL (global interpreter lock) not being taken care of inside the sockets code. I've already tested a fix, so it should be included for the next firmware release.
-
@abilio I appreciate your effort and your response. I started one week ago having no experience in python but having a lot in Enterprise Infrastructure & Software (Banking & Finance) and offcourse made plenty projects with atmega and ESP8266. Check my pyCom coda library in github
-
@daniel Can you also give us access to older firmware updates? Sometimes I need that because of breaking updates.
-
@gertjanvanhethof yes of course. I'll publish links to access the old updates tomorrow. Sorry for the delay.
-
@daniel
can you confirm this on WiPy2?when i do:
ir = Pin('P13', mode=Pin.IN, pull=None)
or
ir = Pin('P14', mode=Pin.IN, pull=None)then this is connected to same pin?
P15 is ok
but P13 is same as P14it looks to me as firmware error
pin P13 not work at all (first on the right bottom) only second one and P13 and P14 are connected to it
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