#circuitpython-dev

1 messages Β· Page 194 of 1

manic glacierBOT
umbral dagger
#

I ordered an nRF52840-DK so I can play with the port of CP some.

manic glacierBOT
#

Finally some progress on this! I've got WizNet5500 support with LWIP for M4 and without LWIP for M0 and M4. LWIP is a bit of a resource hog so depending on what you're doing the non-LWIP version may work better for you.

Needs to be cleaned up and rebased before PR, but work in progress:
https://github.com/nickzoic/micropython/tree/circuitpython/nickzoic/703-wiznet-5500-samd

Support for WizNet5200 and ATWINC1500 to follow, I hope.

crude fossil
#

^ Yay!

raven canopy
#

@crude fossil nice!

raven canopy
#

[novel inbound!] @slender iron in sitting back down with the datasheet, and pondering reading COUNT vs CC[x], i don't think that will work. it would be limited to speed of the "control" (can't find a good name for it) timer and it's interrupt. the only way i can think of to reliably know if we've had a capture is to set EVACT = RETRIGGER, so that the COUNT starts over each time. i'll try and graph out what i suspect could happen:

Control Timer: TOP == 6535 (1ms, or 65535/1000), interrupt on OVF (^)

-----------^-----------^-----------^-----------^   

-----^-------^-----^-----^----------------^----------

Capture Timer: No interrupts, capture retriggers count to start over or OVF occurs (^).

Another option is available besides DMAing the capture events. ONESHOT. I debated in the beginning of using it on the call to get the value, but didn't want it to block out every read.

am i over thinking this (again...probably)?

manic glacierBOT
#

@arturo182:

Could you please rewrite this using pulseio/PWMOut.c or at least nRFx? Writing directly to registers is not very portable or future-proof :(

@hathach Is this same code, more or less, being used in the nrf52 Arduino library?

I agree in the long run it would be nice to be more portable, but if this code already works, we can use it for now, and open an issue to rewrite it later. I am mostly concerned that the PWM usage not mess up PWM usage in pulseio., but it appears the ...

manic glacierBOT
slender iron
#

@raven canopy its fine if its limited to the speed of the control timer. People can use PulseIn for low frequency measurements

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
umbral dagger
#

My nRF52840-DK arrived this morning. Digikey is amazing BTW πŸ˜ƒ

#

CircuitPython up & running with no problem.

manic glacierBOT
meager fog
#

@umbral dagger awesome, we just added neopixel

#

i will warn, the fs gets corrupted sometimes still

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
marble hornet
#

Thanks @slender iron ! it's awesome to see you reviving an older platform's compatibility . And also through python! I'd love it if we could chat later about the API you were mentioning! Always game to learn!

slender iron
manic glacierBOT
ruby lake
#

remove a resistor, add a resistor, and my 4-channel midi shield is safe for a metro m0/m4

tough flax
#

Hi folks - anyone know if CP can read input over USB? Ideally, I'd like to send serial commands to a CPX and have it change behavior. I would rather use MakeCode for this (it's an intro project), but I don't think it can read over USB.

arctic heron
#

CP on CPX does serial over USB nicely

tough flax
#

Excellent!

arctic heron
#

THough on close examination, it might depend on what sort of data. Most people use input(), which is blocking and waits for return

#

find for line oriented data, not so fine for 'streaming' data

#

oops

tough flax
#

I'm not picky

arctic heron
#

play around with input() then, it might get the job done

tough flax
#

input() will get me started - I can update when non-blocking read is implemented. @tulip sleet and @slender iron please add me to the folks looking forward to that πŸ˜ƒ

ruby lake
#

would would be the syntax to something like board.gatepin[i] instead of for example board.D4

#

trying to minimize the amount of repeated lengthy statements

#

gatepin = ('D4,'D5','D6','D7)

#

er 'D7'

raven canopy
#

@ruby lake i think you'd have to have a list containing the board.pin objects:

>>> gatepin = [board.D5, board.D6, board.SCL]
>>> for pin in gatepin:
...     type(pin)
...
<class 'Pin'>
<class 'Pin'>
<class 'Pin'>

unless, you're sub-classing the board module?

ruby lake
#

yeah I did that and it worked

#

I am setting up D2 through D10 all as outputs trying not to eat up memory space with nine individual config blocks

#

@raven canopy it is just I am OCD to the point I wanted to get the repeated 'board' strings out of the list πŸ˜‰

raven canopy
#

hehe. nothing OCD about that. you could do the whole from board import D1, D2.

#

though, that can get messy sometimes if the names are common...

ruby lake
#

yeah

tough flax
#

So... my code's working great when using the Mu console... or using Putty to connect to the serial port

#

However, when I try to write the information directly to the port using the Windows command line or PowerShell, it never returns from input()

#

Is this a newline issue? ASCII vs. UTF?

raven canopy
#

i was beginning to think that when i was plugging at it last week. (sorry...been working other things this week)

tough flax
#

So, I have changed my comparison to .startswith() instead of == and that lets it work from the command line

#

echo green >\.\COM30

#

sends green and it catches it

#

but the PowerShell doesn't

#

Makes me think it's sending some unicode "green"?

#

HAHAHAHA

#

It works

#

To send a "Unix-ish" carriage return/line feed, you need to do Write("yourtextrn")

#

that's "yourtext<BACKTICK.r<BACKTICK>n"

#

not backslash, BACKTICK

#

like escape character really needed to be redefined in PowerShell (dummies)

raven canopy
#

i think that is the only combo i didn't try. i tried all manner of '`n`lf', '`n`n', '`r', etc...

tough flax
#

No, just treat it like NORMAL strings with backslashes, but use backticks

raven canopy
#

the backslashes were just to escape the ` character here.. πŸ˜„

tough flax
#

function sendColor($colorName)
{
$portInfo = ( Get-WmiObject Win32_SerialPort | Where { $_.PNPDeviceID -like 'VID_239A' } | select -last 1 )
$port = new-Object System.IO.Ports.SerialPort $portInfo.DeviceID,9600,None,8,one
$port.open()
$text = $colorName + "rn"
$port.Write($text)
start-sleep -m 50
$port.ReadExisting()
$port.Close()
}

sendColor("red")

#

the line starting with $text = has two backticks before and after the r

raven canopy
#

if you put a \ before the ` it will print without markdowning it.

#

i still can't get it to respond to control characters... 😦 but, glad it is working for your case!

#

actually...control characters work! must've needed a reset.

# '^' = Ctrl
$port.Write("^{C}`r`n")
#

well, its definitely finnicky...

manic glacierBOT
tulip sleet
#

@tough flax sys.stdin.read(1) will read a single character. Or change the 1 to how many you want to read. It is blocking.

tough flax
#

Is there a version with a timeout? Or an β€œisAvailavle”? Otherwise the input is working

tulip sleet
#

unfortunately no not yet

#

UART has a timeout and we have a bugfix for zero-timeout. but you want from USB. you could use a separate USB-serial cable and use the TX/RX pins, but that's annoying

#

i have to sleep but take a look. as mentioned in that issue there's no simple native way in CPython.

manic glacierBOT
solar whale
#

@tulip sleet I see that there is now a build for the PCA10059 -- it builds -- I tried just loading it to the dongle (dfu-flash) but that did not appear to succeed. It loaded, but I was not able to communicate with it after that... Have you tried it? If so, How do you load/execute it? Sorry if I am jumping the gun on this. Just curious if it is usable. No problem if it is still a WIP.

indigo wedge
#

unsure if dfu-flash is the correct way to do it, might have to flash the CP bootloader over jlink

solar whale
#

@indigo wedge ah. I don’t see a bootloader for the pca10059. Yet...

indigo wedge
#

hmm, the pca10056 might work, the pinout will be wrong for the buttons but maybe that doesn't matter if you don't need to enter the bootloader, because it enters bootloader if there is no valid firmware on first boot

solar whale
#

Ok. I’ll solder a jlink connector on one and give it a try. Probably tomorrow. No rush on this. Couldn’t resist trying it!

#

BlTW when I loaded it via dfu-gen dfu -flash it seemed to load. No errors. I was encouraged πŸ€”

#

I the opened nrf-connect and updated the bootloader. Now back to where I started, I think. The jlink will be nice to have connected.

#

@indigo wedge on the PCA10056 -- the ble_scan is back to only showing one report. You fixed this once before, but I can't recall what you did. Do you remember this?

indigo wedge
#

hmm, i remember the issue but not the solution

#

need to finish my ble rewrite, then we won;t have that problem

solar whale
#

np - better to wait for the real fix.

indigo wedge
#

ah i think i remember, it was that the scan has to be restarted after each result comes

#

in the driver

solar whale
#

ok -- maybe thats a good project for me to dig into.

tulip sleet
#

@solar whale I only did the pin work. I didn’t try it yet. Building a UF2 bootloader for it is another as yet undone task, but that should be easy.

indigo wedge
#

yes, it should just be a matter of pins

solar whale
#

@tulip sleet np - I'll be patient.. at least I'll try πŸ˜‰

#

perhaps i can even try to add the bootloader

tulip sleet
#

@solar whale @indigo wedge Started to make a PCA10059 bootloader. One minor issue is that there's only one GPIO button (there's a dedicated reset button). Bootloader expects at least two GPIO buttons, so that you can switch between bootloader modes. Could just choose a pin you could ground as "button" 2. Otherwise it looks really straightforward. Very minor variation on PCA10056.

solar whale
#

@tulip sleet That sounds good to me. Thanks.

main meteor
#

It's cool when people refer to things like building a bootloader as "should be easy". That tells me the tool chain and existing software are pretty solid and the folks here are smart.

stuck elbow
#

nothing is ever easy when computers are involved

#

you might get lucky and it works at first try...

tulip sleet
#

easy means I can be constructively lazy - someone else did work I can use

tulip sleet
#

@gentle bronze are you there? Built a bootloader for pca10059 dongle but getting this for make BOARD=pca10059 SERIAL=/dev/ttyACM0 dfu-flash

...
Sending DFU start packet
Timed out waiting for acknowledgement from device.
Sending DFU init packet

is this going to work on linux?

#

port exists and LED is pulsing, showing inital bootloader is on-board

gentle bronze
#

did you flash the bootloader to the board yet

tulip sleet
#

this is a fresh board, no jlink, just trying DFU update of bootloader with our bootloader

gentle bronze
#

dfu-flash is for upgrading existing bootloader

#

you need to flash one first

tulip sleet
#

but there is a factory bootloader on-board, no?

#

does not it do DFU update?

gentle bronze
#

not ours

tulip sleet
#

oh, prob not unsigned, etc.

gentle bronze
#

I have no idea which bootloader they put on the board

tulip sleet
#

ok, I'll solder on an SWD connector. Was hoping to skip that initially

#

the dongle doc talks about using "nRF Connect for Desktops" and the DFU Trigger Library

#

page 9 in that doc

gentle bronze
#

the bootloader packet won't be the same, the bootloader address is different, ucir need to be cleared and rewritten using nvmc module. this is tricky.

manic glacierBOT
gentle bronze
#

I will check their bootloader code, there may be a chance we could produce "nrf to adafruit" packet things. But I am not sure, we need to update their bootloader. which may be fixed

tulip sleet
#

ok, jlink sounds much easier. Don't bother spending time on this now. I and the other people who want to try this can do jlink

gentle bronze
#

OK, it is one-time thing, you can solder only SWIO and SWCLK, I think they have a pad for that

#

but since you are doing it first, better to just solder the whole SWD header πŸ˜„

tulip sleet
#

thanks!

raven canopy
#

hehe. so its "easy+". πŸ˜†

tulip sleet
#

the code was easy πŸ˜ƒ

#

but everything in the compute universe takes two hours

raven canopy
#

touchΓ©

solar whale
#

@tulip sleet Sorry this has taken so much of your time --- I should be able to spend time on it tomorrow.

tulip sleet
#

no, not at all. I just got back from the YMCA. I spent about 15 mins rebuilding the bootloader. I want one too! I have two dongles.

raven canopy
#

@gentle bronze, or anyone nRF really, does nrfjprog truly need jflash 6.22, or can it use 6.30? i think having both installed is causing me some Atmel Studio programming woes...

#

mind you, i don't rule out the problem being with Atmel Studio itself.. πŸ˜„

gentle bronze
#

I have never got any isuse with jlink and nrfjprog so far.

#

I am on ubuntu, what is your OS ?

#

maybe it is platform specific thing

raven canopy
#

Win10. i haven't had issues with nrfjprog either. i might just try uninstalling jlink 6.22 and test nrfjprog with jlink 6.30, and see if that also fixes my AS7 issues.

gentle bronze
#

πŸ‘

tulip sleet
#
Adafruit CircuitPython 4.0.0-alpha-1056-g100603a60 on 2018-09-06; PCA10059 nRF52840 Dongle with nRF52840
>>> 
>>> 1+2
3
ruby lake
#

will 4 have timer interrupt callback? 😎

tulip sleet
#

The LEDS on the PCA boards are connected to VDD and need to be grounded to be lit. I used DriveMode.OPEN_DRAIN but the PCA10059 ones seem very faint still. Need to clean up GPIO open drain handling for nRF52 in CPy.

slender iron
#

@ruby lake no, you still want it for the adc multiplexing?

ruby lake
#

@slender iron it is a daydream I have. πŸ˜‰ I can get by without it.

#

micropython has one, and if I knew enough about writing external cp function calls I'd try to make it work

slender iron
#

I think its easier to write a C module for the complex functionality you want

ruby lake
#

@slender iron probably

indigo wedge
#

@gentle bronze I'm trying to make the MSC larger on my nRF52840 board and I noticed a strange thing, I made the FATFS 512KB so I changed #define CFG_TUD_MSC_BLOCK_NUM (512*1024)/512 and then when I connect the board to my PC I get [137545.843854] sd 4:0:0:0: [sdb] 1024 512-byte logical blocks: (524 kB/512 KiB) So it's 512 Kibibytes, so should I actually define BLOCK_NUM to (510*1024)/512 so it's 510 KiB = 512KB ? I'm just worried if the system thinks the drive is 524KB it might overwrite the flash past the FATFS region where the private data is supposed to be (I know we don't use that region yet but we might).

timber mango
#

is there something in CircuitPython that I can use to export data to an excel table?

#

I want to record this data into excel:

import time
import microcontroller
from adafruit_circuitplayground.express import cpx

while True:
    print("Ambient Room Temp:", cpx.temperature * 1.8 + 32)
    print("CPU Temp:", microcontroller.cpu.temperature * 1.8 +32)
    time.sleep(30)```
indigo wedge
#

you can write it to a csv file and load that in excel

timber mango
#

what do I use to do that?

indigo wedge
#

not sure if CP has any modules for csv, but you can just open a file and write directly

arctic heron
#

That data would be pretty easy to write out CSV, it has no funky quote/special character problems, etc

timber mango
#

I figured it was simple, I just dont know how to do it.

arctic heron
#

print("{},{}".format(cpx.temperature * 1.8 + 32, microcontroller.cpu.temperature * 1.8 +32)

#

or, same line, but instead of print write it to a file

#

import the result file into excel whcih will have not problems with it (espcially if it has the extension .csv)

#

Needs another ) on the end πŸ˜ƒ

#

you just want to write out your values with commas in between for each value, and a new line for each value set

timber mango
#

thanks @arctic heron

manic glacierBOT
slender iron
manic glacierBOT
umbral dagger
#

PyCon Canada is in Toronto, Nov 10 & 11. CFP closes in 5 days. A) is anyone else thinking of going and B) is anyone planning to do a talk on CP? I'm planning to go and I'd be happy to give a talk.

tawdry wyvern
#

Hello World! (First Post, please re-direct me if I'm in the wrong place.) I'm using an ItsyBitsy M0 Express to control a box that has a collection of lights, motors, sensors, etc. The box needs to be controlled by a PC running Matlab / Python. Is there a good way to set up a 'command manager' to watch the serial port for new instructions while still running lower-level operations in the background? Maybe something like the "second (raw) serial connection" mentioned in this post... https://github.com/adafruit/circuitpython/issues/231

manic glacierBOT
tawdry wyvern
manic glacierBOT
slender iron
#

@tawdry wyvern its a super common request and is why we have that issue. Please post a me too to that issue to vote it up. πŸ˜ƒ

manic glacierBOT
prime flower
#

@slender iron Thx for the ping, I don't usually lurk the CP forum.

tawdry wyvern
#

@slender iron Thanks for the info! Is "me too" a Discord thing? Or do you just mean commenting on the GitHub Issue #231 ? Also, at first glance it seems like it might be possible to implement a system with two separate boards : One to handle Communication over the Serial port and a second to handle box control with I2C, SPI, or UART comm between them. Does this sound reasonable, or like a rabbit trail?

slender iron
#

np

#

@tawdry wyvern comment on the issue. A second uart to usb can work for now

manic glacierBOT
#

Ditto to @protothesis comments above... and I was similarly directed by @tannewt from the Arduino Discord... My goal would be to have something similar to the Arduino CmdMessenger. Right now the best I can come up with is using two boards: 1 for communication via the Serial Console, and 1 for Device Control with a UART between them. If anybody has already been down that road, I'd love to hear about it...

https://playground.arduino.cc/Code/CmdMessenger

stoic marsh
indigo wedge
#

darn, still hitting that import bug from time to time and have no idea why :/

manic glacierBOT
tulip sleet
#

@indigo wedge you mean the long-lived UART bug? It was fixed in 3.x but not yet in master.

manic glacierBOT
indigo wedge
#

no, CP master fails to import a file from code.py

#
Traceback (most recent call last):
  File "code.py", line 6, in <module>
  File "HomeScreen.py", line 7, in <module>
  File "ui/gui/painting/Painter.py", line 3, in <module>
ImportError: cannot import name Rect
tulip sleet
#

@stoic marsh your external battery pack is not sharing a ground. Also on a full breadaboard there's a split in the middle of the power rails.

indigo wedge
tulip sleet
#

@indigo wedge I'd suspect something simple at first, like the file on CIRCUITPY is missing some pieces due to an incomplete write.

indigo wedge
#

but when I try to do it from REPL it works:

>>> from ui.core.tools.Rect import Rect
>>>
#

if it's corrupt then usually it's a syntax error not cannot import, i added a print in runtime.c and it's definietely that line

stoic marsh
#

Thank you @tulip sleet mine isn't exacctly like the image. I'm using a small breadboard that does not have the external rails. But I need to check if the ground is common.

indigo wedge
#

if i checkout a commit from before the Micropython merge then it works

tulip sleet
#

@stoic marsh also you have no resistor on the LED, not terrible, but you should have a current-limiting resistor

#

@indigo wedge if you could bisect that would be great

indigo wedge
#

yeah, problem is i have a custom change to make the MSC larger cause my code doesn't fit in 256KB so i would have to apply that every time i jump in the bisect

stoic marsh
#

@tulip sleet I was trying to get the idea across. I do have a resistor, and the sensor only has + - and output

indigo wedge
#

I'll try to make a minimal example and bisect with that

tulip sleet
#

@stoic marsh ok, so just make sure the grounds are connected together

indigo wedge
#

this is a total blocker for me right now, my code just fails to work :<

tulip sleet
#

gotta go cook

slender iron
#

bummer @indigo wedge !

manic glacierBOT
#

@nickzoic and I discussed this yesterday and came up with the following changes (from his email note about it):

  1. regularize both 'usocket.socket' and 'lwip.socket' into CPython-compatible 'socket.socket' and socket should become part of the shared-bindings / common-hal split.
  2. move 'network.WIZNET5K' off into 'wiznet.WIZNET5K'
  3. Merge 'WIZNET5K.active()' into the constructor and add a deinit() and exit method to make it context-managery.
  4. Make the SPI bus speed configurable
    ...
tulip sleet
#

@slender iron revised PR looks good! Just one outstanding q left for me about running through the groups backward when you display them. The group list runs from back (rearmost thing) to front, right? So if run through the list backwards and display them in that order, then won't the front objects get obscured by the back objects? I'm confused.

rotund basin
#

hey all, how does time.time() know what time it is?

tulip sleet
#

it doesn't

rotund basin
#

oh?

#

you set it with struct_time?

#

what does monotonic, values seem like? i.e. how much does it increase in 24 hrs ?

tulip sleet
#

monotonic() is in seconds But it can get somewhat behind due to interrupts, etc. If you really want to know what time it is, an off-board battery-backed clock is the best idea.

rotund basin
#

@tulip sleet my time resolution is in days , approx.

#

I can download the time from server, or get it from gps

tulip sleet
#

if you have a gps, that's by far the best

#

or from a server. is this on esp8266?

rotund basin
#

it's on my adalogger, which is connected to esp32

tulip sleet
#

i just fired up a board and it started at jan 1, 2000 as the default

rotund basin
#

nice, lol

tulip sleet
#

if you want an accurate timestamp, then asking for external time is best. If you don't want to ask externally, see products 2922, 3028 and 3013, and note their different accuracies.

rotund basin
#

@tulip sleet thanks, Dan!

tulip sleet
#

yw!

rotund basin
#

Sorry i haven't tested that build yet. I've been a bit busy

#

adding more sensors from adafruit to my robot πŸ˜ƒ

manic glacierBOT
ruby lake
#

hm, this actually works. Now I have a compact way to assign pins.

#

"""
pinNames = ['muxa','muxb','muxi','ldac','daccs']
pinList = [board.D2, board.D3, board.D8, board.D9, board.D10]
for pin in range(0, len(pinNames)):
globals()[pinNames[pin]] = DigitalInOut(pinList[pin])
globals()[pinNames[pin]].direction = Direction.OUTPUT
"""

#

er oops

manic glacierBOT
manic glacierBOT
manic glacierBOT
meager fog
#

@tacit glade @solar whale heya i modded the hc04 sonar library

#

it now works on non-pulseio boards like Raspberry pi

#

@prime flower ^

prime flower
#

Oh nice!!

#

thanks, looking at it rn

meager fog
prime flower
#

oh that's a neat trick for detecting pulseio

manic glacierBOT
#

@tannewt I just got tripped up about ISR support as well by the page below. Is this an old version of the documentation?

One advantage of ISR's over polling (I think) would be to enable sensor reading and peripheral control to happen during REPL or Serial Console sessions. Please correct me if I'm wrong.

https://adafruit-micropython.readthedocs.io/en/latest/docs/reference/isr_rules.html

meager fog
#

@prime flower yeah find something, they are all pretty similar

#

we can write one too if you want something with Adafruit_Sensor compatibility

#

which isnt a terrible idea

prime flower
#

adding an ultrasonic to adafruit_sensor would be great

gentle bronze
#

@indigo wedge hmm that is strange, on Linux it is spot on with 256KB., did you see the current 256 KB got reported larger as well. If you re too worrried, maybe insert a check to skip writing to the wrong address. That may be implemented already somewhere in the internal_flash

#

for the unused lines , I will remove them later with the qspi PR. Did littet many thing when doing the usb PR back then

ruby lake
#

hooray, the 4-voice midi key assigner works in cp

#

if the 8-channel hardware runs in a similar manner, timer callback becomes less of an issue πŸ˜‰

#

just in time to bring to knobcon

gentle bronze
#

@tulip sleet after a bit of thinking, I think we may be able to write an app that erase bootloader on pca10059 and write our own boot + update the ucir to the correct address. Similar to what you told me before (like openwrt/ddwrt to consumer router). Can you open an issue and assign it me, I will check it out later when having time.

manic glacierBOT
indigo wedge
#

@gentle bronze can't wait for the qspi change, my next board has qspi flash so it's perfect πŸ˜„

solar whale
#

yay! getting the JLink connected was a struggle ---- but finally ```
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha-1057-g23b23dd2b-dirty on 2018-09-06; PCA10059 nRF52840 Dongle with nRF52840

gentle bronze
#

@indigo wedge getting it done asap

manic glacierBOT
meager fog
#

@prime flower the ultrasonic supplies 'distance'

#

which all our distance measurement sensors should give ya - approx distance in cm

solar whale
#

@meager fog thanks for the hcsr04 update -- I'll dig one out and try it later today.

meager fog
#

@solar whale thanks! i dont have a PING sensor handy but i can get it working there too

solar whale
#

@meager fog hcsr04 works great on my RPi 3B+

slender iron
#

@tulip sleet I think you are confusing the mental model with the implementation for the display code.

#

The mental model is the painter's algorithm where every layer is painted and the last drawn pixel remains visible.

#

The implementation has the same effect by running backwards until it finds an opaque pixel and then it stops. It doesn't need to run through the rest of the list then.

solar whale
#

@tulip sleet Just curious if you have tried playing with the RGB LED2 on the nrf52 Dongle, On mine I can only get LED2_R to respond. Note, thay are Active Low - I can blink LED2_R, but LED2_B and LED2_G do not respond. I don't get any errors and I can set/retrieve the value setting, but no response at the LED. ```import board
import digitalio

led1 = digitalio.DigitalInOut(board.LED1)
led1.direction = digitalio.Direction.OUTPUT
led2_r = digitalio.DigitalInOut(board.LED2_R)
led2_r.direction = digitalio.Direction.OUTPUT
led2_g = digitalio.DigitalInOut(board.LED2_G)
led2_g.direction = digitalio.Direction.OUTPUT
led2_b = digitalio.DigitalInOut(board.LED2_B)
led2_b.direction = digitalio.Direction.OUTPUT

manic glacierBOT
#

@dhalbert I think you are confusing the mental model with the implementation for the display code.

The mental model is the painter's algorithm where every layer is painted and the last drawn pixel remains visible.

The implementation has the same effect by running backwards until it finds an opaque pixel and then it stops. It doesn't need to run through the rest of the list then and nothing is overwritten.

tulip sleet
#

@solar whale I had trouble with the RGB LED too, and they were all faint or even not visible. But I rewrote the DigitalInOut.c code yesterday to use the built-in open-drain capabilities of the nRF GPIO pins. We can have a true open-drain output instead of simulating it with an input. Haven't had time to test this yet.

manic glacierBOT
solar whale
#

@tulip sleet Thanks - glad it's not just me

#

Let me know if there is anything you want me to do to help with it.

tulip sleet
#

@solar whale "VDD nRF" on the schematic measures as 1.8V, which explains why the green and blue LEDs don't work. That's the voltage from the internal regulator, and it goes to the + ends of the LEDs. Reading more about it now.

#

and, in the current setup, HIGH on a GPIO pin is 1.8V, not 3.3V. We need to configure to voltage regulators differently to provide 3.3V outputs

solar whale
#

What document are you looking at?

tulip sleet
#

trying pca10056 pins now

#

pca10056 is 3.0v (not 3.3v, hmm)

solar whale
#

hmm -- these things are way too configurable.....

tulip sleet
#

yah, not sure if there are some nvm fuses that are different on the two boards, or what. no code that I know of that is different between the two

#

i need to spend some quality time with the datasheet

timber mango
#

msgfmt:
@tulip sleet

make: msgfmt: Command not found
 $ cd circuitpython
 $ pwd
/home/wa1tnr/blinka/Git/Adafruit/circuitpython
 $ make -C mpy-cross
make: Entering directory '/home/wa1tnr/blinka/Git/Adafruit/circuitpython/mpy-cross'
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
QSTR updated
python3 ../py/makeqstrdata.py build/genhdr/qstrdefs.preprocessed.h > build/genhdr/qstrdefs.enum.h
make: msgfmt: Command not found
../py/py.mk:301: recipe for target 'build/genhdr/en_US.mo' failed
make: *** [build/genhdr/en_US.mo] Error 127
make: Leaving directory '/home/wa1tnr/blinka/Git/Adafruit/circuitpython/mpy-cross'
 $ pwd
/home/wa1tnr/blinka/Git/Adafruit/circuitpython
manic glacierBOT
timber mango
#

Did the build environment change to require a new python .. module/whatnot?

solar whale
#

@timber mango I think you also need to install gettext if you don't have it.

tulip sleet
#

i never had to install gettext explicitly, but yes, that's the dependency

solar whale
#

I had to install it on my Mac, not Linux,

timber mango
#

I didn't have gettext:
Get:1 http://debian.cc.lehigh.edu/debian stretch/main amd64 gettext amd64 0.19.8.1-2 [1,495 kB]

#

Thanks!

solar whale
#

Hope that helps!

timber mango
#

Will report back in a few minutes. :)

#

That was definitely it. Thank you both!

   text    data     bss     dec     hex filename
 198006   20488     912  219406   3590e mpy-cross
make: Leaving directory '/home/nis/anthrope/Git/Adafruit/circuitpython/mpy-cross'
solar whale
#

@tulip sleet FYI - I manged to fry one of my Dongle boards. I think I accidentally shorted jumper SB1 - near the SWD header -- It says not to do that! May damage the SOC. Looks like it is true. I made a real mess of the header. Ended up just tacking wires on the 2nd one. Now I see taht SWDCLK and SWDIO ore on big castellated pads. May be a lot simple to use thme in the future.

tulip sleet
#

sorry to hear - I have succeeded on 2 out of 3 SWD header solderings, but it never works the first time. I tinned the pads and the leads, and I still have to go back and reheat them. I also destroyed the pads on an 832 feather trying to remove a bad header soldering job

timber mango
#
Adafruit CircuitPython 4.0.0-alpha-1057-g23b23dd2b on 2018-09-07; Adafruit Metro M4 Express with samd51j19
>>> 
#

Thanks again!

solar whale
#

@timber mango Congratulations! Glad to help!

timber mango
#

I use pogo pins inserted into dual female jumpers (One solid connector) and wedge that underneath the Feather mounted on standoffs bolted to perfboard -- makes a good solid SWD connection that way (I use the pointy ended pogos)

solar whale
#

I have not tried the pogo pins yet -- I have a few and they look like a good way to go.

timber mango
#

basically the 'elbow' in the jumper wires near the dupont plastic jumper shroud acts as another spring.

#

There's about almost 0.25 inch travel on the pogo springs.

#

Then just stabilize the dual jumper wire pair, mechanically.

#

Also: I use the extra long male headers to fix the perfboard to the breadboard. ;) Just bend them over 90 degrees (alternating). Really really strong mount. One row of 16 is plenty. ;)

solar whale
#

Sounds like a good setup!

timber mango
#

I also take a very sharp push-pin and make a high-reliefe 'dimple' in the SWD pads, to capture the pointy end of the pogo. ;)

solar whale
#

thanks - the pictures help me understand the setup better! Nice.

timber mango
#

It worked out and wasn't the first thing I tried. ;)

#

My Segger J-Link EDU won't talk (effectively) to Feather M4 Express; I read somewhere I may need a firmware update to the Segger to get it to go. Nevertheless there was enough positive response to know it was wired correctly (I believe). One of the LED's corresponded exactly with what was done through the user interface when talking to the Segger (Maybe in GDB?)

tawny creek
#

@timber mango if you do end up upgrading your jlink edu to work better with the m4 id like to know your findings

timber mango
#

@tawny creek will do! I may not remember who asked though. ;)

#

I really should get to it but it's not that important at the moment. My theory is that my flash was unlocked ('somehow') as the M4 target behaves as if it is alive, yet I cannot access the boot sequence.

#

(LED feedback is very consistent so I think the LED is still under program control)

#

I was running a bare metal atmel start 'forth' like program at the time and did nothing awful except read/wrote to the wrong memory map address (randomly).

#

No amount of shouting wake up poly! wake up, polly parrot at it does any good at all.

#

This is pretty new to have a problem:

$ JLinkExe 
SEGGER J-Link Commander V6.34b (Compiled Aug 13 2018 16:39:17)
DLL version V6.34b, compiled Aug 13 2018 16:38:47
raven canopy
#

i've been getting mixed results lately with Win10/Atmel Studio lately. i upgraded jlink to latest last night...didn't help.

timber mango
#

Oh that's software -- oops. Not firmware. ;)

#

Somersoft did they force .EXE or is this a Linux-capable upgrade method for the J-Link firmware.

raven canopy
#

new firmware...as of Aug 2018.

#

iirc

timber mango
#

The javascrap they run on their website makes it impossible to navigate

raven canopy
#

but, i didn't have jlink firmware issues prior to that. that i know of, at least. πŸ˜„

timber mango
#

;)

#

That's good because that implies this is a Hail Mary pass to try to win when it's not happenin'.

#

Section 17 suggests the Segger will update automagically on its own.

#

UM08001_JLink.pdf 17.5.1 Firmware Update

#

Yeah the comment I read may've been written (did not check!) prior to Segger deciding to do this for us automatically.

#

BUT there's a section on reset strategies I haven't looked at, in the user manual. And I don't recall establishing a ground reference to the Feather M4 -- just the two pads underneath.

#

My bad. I have six wires hooked up to the breakout. ;) They must do something!

#

Yeah there's RESET and all kinds of stuff.

timber mango
#

I seem to be good on the hardware side of my setup (using Feather M0 Express, instead, as it is working):

Reading symbols from build-feather_m0_express/firmware.elf...(no debugging symbols found)...done.
(gdb) target extended-remote :2331
Remote debugging using :2331
0x000002e8 in ?? ()
(gdb) load
Loading section .text, size 0x37560 lma 0x2000
Loading section .ARM.exidx, size 0x8 lma 0x39560
Loading section .data, size 0x400 lma 0x39568
Start address 0x2000, load size 227688
Transfer rate: 37058 KB/sec, 13393 bytes/write.
(gdb) 
#

Yeah I just ran CircuitPython by the Segger J-Link tether, so the hardware's definitely right. ;)

indigo wedge
#

@tulip sleet @slender iron Bisecting led me here:

498fec64e increase new dynamic stack size to a comfortable value for now // first bad
dfa2581ff Merge pull request #1057 from tannewt/flexible_heap
4b247eacd (tannewt/flexible_heap) Add todo for handling improper free.
5704bc8c9 Share memory.c and a bit of polish.
88ae7a9b2 Merge pull request #1082 from tannewt/no_pin_qstr // last good

For the 3 middle commits my code doesn't run, the board boots right after flash but when I copy the test code and reset, I get no REPL. I used same code to test all 5 commits so don't think it's the code's problem.

slender iron
#

@indigo wedge you have a summary issue for it? I don't have context

timber mango
#

./lib/mp-readline/readline.o
Scrollback in the circuitpython REPL From this?

#

(command line history)

indigo wedge
#

Scott, it's about the issue I mentioned yesterday, I have a code sample where a import statement fails for some reason

slender iron
#

can you file an issue for it?

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
#

The nRF52840 can be set to supply different voltages on its GPIO pins. If the chip is used in "high voltage" mode (so-called due to how the internal regulators are used and how the VDD and VDDH pins are connected), then the UICR->REGOUT0 register can be used to vary the voltage on the GPIO pins.

The PCA10059 dongle is set up to use "high voltage mode"

If you erase the NVM (say with some firmware erase command), then the UICR->REGOUT0 register is set to all 1's, and it uses the defau...

manic glacierBOT
manic glacierBOT
manic glacierBOT
solar whale
#

Connecting the JLink to the SWDCLK SWDIIO VDDOUT GND pads worked! No need for the header or tacking wires.

manic glacierBOT
#

@dhalbert FWYi after setting this register I now see that the JLink reports the target voltage as 3.29V rathere than 1.78V as it did before the change. I have my JLink connected to the VDDOut pad but from the Schematic, this should be the VDDnRF which is pin 1 on the SWD header.

before setting register

jerryneedell@Ubuntu-Macmini:~/projects/nrf52_dongle$ JLinkGDBServer -if SWD -device NRF52832_XXAA
SEGGER J-Link GDB Server V6.30h Command Line Version

JLinkARM.dll V6.30h (DLL com...
manic glacierBOT
#

hmm -- that was shortlived - I may have shorted something, but I appear to have fried another Dongle. I now see only .5V on VDDOut and the board is non functional. It's possible I shorted VDDOut to GND when connecting the JLink. Not sure if this would kill it. Just wanted to pass on a waring. Luckily theses boards are only $10. I have one more, but want to tread carefully before I kill another one! Should have a few more soon. Mouser is backorder, Symmetry claims to have them....

manic glacierBOT
#

Took a chance with my remaining dongle -- Flashed the bootloader and set the Register
for 3.3V GPIO then loaded CP 4.0 master.

All seems to be working well.
Noted that JLink now still sees the target voltage as 1.8V but measuring VDDOut shows 3.3V
Hopefully that makes sense...

jerryneedell@Ubuntu-Macmini:~/projects/adafruit_github/Adafruit_nRF52_Bootloader$ JLinkGDBServer -if SWD -device NRF52840_XXAA 
SEGGER J-Link GDB Server V6.30h Command Line Version

JLinkARM.dll V6.30h (...
#

and to confirm taht I am still confused, but it is still working -- now Jlink reports the 3.3V target

jerryneedell@Ubuntu-Macmini:~/projects/nrf52_dongle$ JLinkExe
SEGGER J-Link Commander V6.30h (Compiled Mar 16 2018 18:04:43)
DLL version V6.30h, compiled Mar 16 2018 18:04:35

Connecting to J-Link via USB...O.K.
Firmware: J-Link V10 compiled Mar  2 2018 17:07:17
Hardware version: V10.10
S/N: 260101649
License(s): FlashBP, GDB
OEM: SEGGER-EDU
VTref = 3.350V


Type "connect" ...
marble hornet
#

any thoughts on an fpga cp board?

raven canopy
#

@marble hornet FPGA has always interested me, but i haven't dug into them enough. are there C compilers for FPGA? i thought they were primarily Verilog...

manic glacierBOT
#

Like I mentioned on Discord, after updating my code from somewhere around July to current master, I ran into a problem where a import was failing with "ImportError: cannot import name Xyz". After a lot of bisecting I managed to identify that this problem started with #1057

While I didn't dive too deep into what exactly is happening, I managed to fix the issue by increasing the CIRCUITPY_DEFAULT_STACK_SIZE value from 4K to 8K.

manic glacierBOT
raven canopy
marble hornet
#

@slender iron @slender iron do you have a capacitor on the reset line?

prime flower
#

@marble hornet fpga cp board would be p sweet

#

just ordered a digilent nexys 4 ddr for a class I'm taking, their academic discount is pretty steep considering the Artix 7 is not inexpensive

marble hornet
#

@prime flower is that an fpga based board ?

prime flower
#

most universities use it/suggest it now

carmine basin
#

<code> "This is a test "</code>

#

[code] "This is a test" [/code]

manic glacierBOT
inland tusk
#

Noticed that you were considering a FPGA version of CP. How about a version that runs under RISC 5, that way you have a free ip for the FPGA being considered.

prime flower
#

@inland tusk idk, I haven;t done any work with RISCV, tho that'd fit CP's Open Source

pastel panther
#

@inland tusk where did you hear that?

#

<-- out of the loop

inland tusk
#

@pastel panther Somebody mention FPGA's earlier in this chat. thought that itt would be a good combonation..

pastel panther
#

ah; RISCV is a pretty good idea. I know Scott had previously made both a RISCV and ICE40 feather

tawdry wyvern
#

I'm pulling my hair out trying to get the hardware UART working on the ItsyBitsy M0 Express. The ASCII seems to get garbled in transmission. I'm using a ATEN USB to Serial Bridge on the PC side, and the pattern is below. #Character Sent --> Character Recieved:

01100001 a --> O --> 01001111

01100010 b --> '

01100011 c --> Γƒ (b'\xce') --> '11001110'

01100100 d -->  (b'\x13') --> ' 10011'

01100101 e --> Γƒ (b'\xcd')

01100110 f --> f

01100111 g --> L

01101000 h --> (b'\t')

#

Also, the ItsiBitsy won't start properly if the RX line of the hardware UART is connected to the host computer. Is there a workaround to this, or am I just not doing it right. Right now the only pins connected to anything on the ItsiBitsy are TX, RX, and GND.

solar whale
#

@tulip sleet I measured the VDD voltage on my fresh nrf52840 Dongle and "I think" it was 3.3V but it could have been 3.0 - I was just checking to make sure it was not 1.8.

tulip sleet
#

the dongle is 3.3v; the pca10056 is 3.0v

solar whale
#

OK - thanks for confirming.

tulip sleet
#

the dongle uses an internal regulator on the nrf52840 chip; the pca10056 uses an off-chip regulator

solar whale
#

ah -- do you know what the feather nrf52840 will use?

tulip sleet
#

hold on...

#

it uses an external regulator like all the other feathers

solar whale
#

so we can set it to 3.3 or 3.0

#

sorry -- external -- so 3.3

tulip sleet
#

right

#

I'm writing a PR that will set it to 3.3v if it's not already

solar whale
#

ok so 3.3 should be good for the Dongle

tawdry wyvern
#

@tulip sleet last week you mentioned a "long-lived UART bug"... Was that related to the hardware UART or the USBish Serial Console? Also: How do I know if the firmware that I'm currently running is subject to that bug?

tulip sleet
#

@tawdry wyvern the UART bug is hw UART and has to do with the buffer getting moved. Are you using 3.0.0 or 3.0.1? It's fixed in 3.0.1.

solar whale
#

I came up with a new way to do the JLink - much safer than alligator clips and easier than a header

tulip sleet
#

i bought those little things, I think, but haven't used them yet. I was going to solder headers on my other one. With the SWD on the back, it's not breadboardable, as you know 😦

solar whale
#

I've used the little gizmos with mixed success, but this time I soldered them in and they work fine. Then the 2 header pins fit nicely on VDDout and GND

#

I ordered more headers, but last time was pretty discouraging.

tulip sleet
#

you mean it was hard to solder them to the castellated indents?

solar whale
#

no, that was easy. the Header was hard.

tulip sleet
#

i mean soldering the header to the indents

tawdry wyvern
#

@tulip sleet Good question. I have 3.0.1 downloaded, but I'm not positive that the bootloader ran correctly. If I get to the ITSYBOOT file system, is there a way to tell?

tulip sleet
#

just look at the prompt message when you open the repl. it has the version

solar whale
#

the 2 header pins worked fine.. I was refering to my SWD header fiiasco

tulip sleet
#

or just copy 3.0.1 to ITSYBOOT and be done with it

#

@solar whale

#

oh yes, that was painful

#

i was going to solder a strip header to the castellated pins

solar whale
#

I did one on a feathrr52832 awhile ago and it went fine -- I was over confident this time!

tulip sleet
#

i wonder if hot air would be better

solar whale
#

probably, but I don't have it.

tawdry wyvern
#

Ahhhhhh Thanks @tulip sleet ! It's an old board running 2.2.3. I'll see if 3.0.1 makes it any better.

solar whale
#

ooh - I just checked and it looks like the SWDIO and SWDCLK are just offset by one breadboard row fro the rest of the pins

tulip sleet
#

@tawdry wyvern 2.2.3 should be OK for UART, but upgrade anyway for many other fixes

#

It looks like the Aten settings might be all wrong: almost looks like it's reversing the bits (!!), and make sure it's set to 8 bits no parity 1 stop bit (8N1), which is completely the standard these days

solar whale
#

on second look, not - I don't thon the 2 sides of the Dongle are breadboard spaced. 😦

tulip sleet
#

@solar whale as long as its 0.1" and not some random number

solar whale
#

each side look like 0.1 but the two sides don't seem to be able to span the breadboard gap properly

#

it's close may be ok

tulip sleet
#

it seems ok - setting up for soldering

solar whale
#

should work

tulip sleet
#

ok, soldered. I soldered from the top and then removed and reheated on the side to get the solder to flow all the way down the side

solar whale
#

Nice - great idea. When I get my next ones I'll do it this way!

tulip sleet
#

still blinks when I plug it in - stops holding breath

tawdry wyvern
#

@tulip sleet The bootloader appeared to run correctly (per the description at the page below). The end result was: 1: A blinking board (green and yellow) 2: A COM port in the Device Manager "Adafruit ItsyBitsy M0 Express CircuitPython (8012:00) (COM11) " 3: But no CIRCUITPY drive afterwards. 😦

#

I can still get to the bootloader with a doubleclick (and have tried repeating the process), but gotten the same result.

tulip sleet
#

Try putting 2.3.1 on the board instead, then copy off everything from CIRCUITPY. Then install 3.0.1, and in the REPL, do

import storage
storage.erase_filesystem()

Then put back what you saved

#

this is win7?

tawdry wyvern
#

Correct

tulip sleet
#

@solar whale I'll need a connection to the RESET pad too, right? I'm using the SWD breakout

solar whale
#

Hmm. To load bootloader I only needed SWDIO SWDCLK VDD GND

#

I have not tried using it to run code

tawdry wyvern
#

Oddness. πŸ˜• I can put adafruit-circuitpython-itsybitsy_m0-2.3.1.uf2 on this board, but neither adafruit-circuitpython-itsybitsy_m0_express-3.0.1.uf2 nor adafruit-circuitpython-itsybitsy_m0_express-3.0.0.uf2 appear to load successfully. If this board is from May 2018, have there been any hardware changes that might cause a problem?

tulip sleet
#

after you put 3.0.1 back and did the erase_filesystem(), CIRCUITPY should reappear

#

this is probably a software version issue, not hw

tawdry wyvern
#

After I try to put 3.0.1 back on, I don't get the CIRCUITPY filesystem at all. 😦

#

I only get a CIRCUITPY when I use the 2.3.1 UF2.

tulip sleet
#

no, but I want you to go into the REPL (via putty or tera term or mu) and type the two lines above

#

that will erase and re-create CIRCUITPY

tawdry wyvern
#

Sorry to be dense here. I did erase the filesystem using the two lines above, but I was only able to do that in 2.3.1. (Sorry if I mis-interpreted your instructions.)

tulip sleet
#

ok, so you're saying you couldn't get to the REPL when 3.0.1 was loaded?

#

just because there's no CIRCUITPY doesn't mean circuitpython isn't running.

tawdry wyvern
#

Whoops... I'm sorry for missing that. I hadn't considered the posability that REPL would work if I didn't have a CIRCUITPY. (stupid presumptions bite).

#

I've got a 3.0.1 REPL open and have run: <code>import storage storage.erase_filesystem()<\code>

#

The board ends up with a green blinky light, but no CIRCUITPY. Also, the COM port seems to be un-responsive until I reset the board.

tulip sleet
#

@tawdry wyvern sorry i was eating dinner

#

are you running AIDA64 or Kaspersky antivirus?

carmine basin
#

@prime flower Thank you for that.

#

this is a test

prime flower
#

ay! you got it working

tawdry wyvern
#

Hi Dan. Don't apologize, I appreciate the help. And yes, I'm running Kaspersky.

tulip sleet
#

try disabling kaspersky completely and unplugging and replugging the board with 3.0.1

carmine basin
#

@prime flower If i have a 4 lines of code do I first then copy and paste all (at one time) then and hit enter?

#

@prime flower the first step was to enter " " and the last step was to enter " " .

#

I have a python question. I'm practicing python... The attached program I wrote, displays the test vertically (text, next line, text next....). How do I get it to display the text horizontally (on one line)?

raven canopy
#

@carmine basin use three backticks:
```
code
```

code
carmine basin
#

@raven canopy Thank you .

tawdry wyvern
#

@tulip sleet Ok. I'll try that. I tested out my code in REPL in 3.0.1 and saw the same behavior so I don't think the UART bug is the problem right now.

#

And you're right, it seems like the bits are inverted. I've got it printing out characters [A-z] and the receiving terminal prints out some jibberish with a backwards alphabet in between e.g. [k%JI$HG#FE"C!B....].

tulip sleet
#

we've seen this "disappearing CIRCUITPY on upgrade to 3.x" before, but I usually it has come back after reformatting. I'll look up the kaspersky thing in the forusm

tawdry wyvern
#

Thanks for all the help!

tulip sleet
#

yes, that is really weird - the backwards part, so something odd about the USB-serial settings, I think.

#

yw!

tawdry wyvern
#

I've got some CP2104 's coming next week, maybe that will save some of the frustration.

raven canopy
#

@carmine basin to answer your question, for that particular case, you could do:

if print_vertical:
    for x in "Mississippi":
        print(x)
elif not print_vertical:
    print_string = ""
    for x in "Mississippi":
        print_string += x
    print(print_string)
#

although, you could drop the for... and just do print("Mississippi").

#

and obviously, you'll need to handle the conditional (print_vertical = True/False) somehow.

carmine basin
#

@pulsar ferry Ok. Thank you.

raven canopy
#

@carmine basin you're welcome. there are other ways to handle this, but can be application/purpose dependent.

carmine basin
#

@pulsar ferry ok. thanks for the info.

manic glacierBOT
arctic heron
#

What is the easiest way to recover a CPX when your code.py is running too hard to let even the drive mount work....

#

(and can't seem to get into REPL)

#

Ctrl-C isn't getting it done either

manic glacierBOT
arctic heron
#

Works!

exotic pumice
#

I'm interested in working on circuit playground support for rust, is this the closest channel to discuss that in?

exotic pumice
exotic pumice
#

oh, I see, It's hiding as MP_QSTR_SPEAKER_ENABLE

solar whale
#

@tulip sleet Did you find it necessary to connect RESET for the JLink to the Dongle? I hope not , since it does not appear to be avaialble on a pad...

solar whale
#

And I was able to issue a RESET to the board via my JLink without RESET connected - using Ozone to look at code execution - seems to work OK.

manic glacierBOT
#

C=>Python described. Nick Moore's presentation on the esp32 port includes a newbie's intro on how the C gets turned into Python. The slideset below seems to cover everything.
Slides: http://yowconference.com.au/slides/yowconnected2017/Moore-EasyIoTWithMicroPythonESPSoCs.pdf
Nick did a few presentations and didn't always go into the C=>Python process. This presentation includes that part of the process: https://www.youtube.com/watch?v=-MrqCmq3Z5k&feature=youtu.be&t=18m4s

tulip sleet
#

@solar whale i've had zero trouble without the reset line. I guess there are plenty of ways to reset via only SWD. I could imagine you'd want the reset line connected if you were debugging flaky hardware that tended to hang up even on SWD.

#

@exotic pumice we like rust but have no plans wrt circuitpython. What would you think of using rust for? As an alternative language for writing some of the firmware code? We use gcc, not clang/llvm to compile the firmware

exotic pumice
#

I'd like to work with the rust-embedded team to add support for some boards

#

so that they can be programmed in Rust, in addition to C, C++, Python, and whatever else (JS?)

#

I think it's a good intro to embedded for me

#

I wasn't thinking of adding rust to circuit python, if that's what you thought

#

that would probably just complicate the build process

#

sorry if this is the wrong channel, there's no circuitrust lol

tulip sleet
#

oh, i misread "circuit playground" as "circuit python". samd21 support would be very interesting. It's just another M0+ from the basic compiler point of view. The tricky stuff is library support for clock setup, peripherals, etc. #help-with-projects or #general-tech would be ok channels, but they are very full, and us embedded developers don't spend as much time in them

#

is chip-specific support the point of the wg project?

exotic pumice
#

the wg stands for working group, it's the committee of people working on embedded rust

tulip sleet
#

so does "embedded" in this case mean basic support for the different ARM variants (M0+, M4, etc.), or does it also mean chip-specific support?

exotic pumice
#

both

tulip sleet
#

is there m0+ support already?

exotic pumice
#

yes

#

samd21 I think too

tulip sleet
#

what is the model for chip support libraries? is there an attempt at a common API across different manufacturers? ... looking at that link, it looks like you're trying to create the equivalent of CMSIS support for the various chips (not higher-level libs yet?)

exotic pumice
#

I'm not sure what CMSIS means,

#

so far I've just defined the pins pretty much

#

but I'd like to do things like neopixel drivers too

tulip sleet
#

CMSIS is .h files that define all the periph register addresses, bitfields, etc. Basic named access to all the chip-specific stuff

exotic pumice
#

yeah, that's basically what I've got so far

tulip sleet
#

are there higher level libs like the arduino libs for I2C, SPI, UART, etc.?

#

but CMSIS is per-chip, not per board

exotic pumice
#

oh, that's probably the svd then

tulip sleet
#

yeah, exactly. I think the CMSIS files are (or could be generated) from svd

exotic pumice
#

yeah we have automatic svd generation

#

or, generation from svd, I mean

tulip sleet
#

are you thinking of supporting uf2 or arduino style bootloaders, or do you already?

exotic pumice
pastel panther
#

rust for m0/m4/etc would be awesome

exotic pumice
#

the readme suggests using some of the arduino toolchain to load your code onto the boards, not sure if that's what you mean

tulip sleet
#

yes

exotic pumice
#

it would be cool to get it integrated with cargo though

tulip sleet
#

also most of our cpy boards use the UF2 bootloader, which as you know presents as a USB drive, so no upload program is necessary. There's a conversion program from .bin to .uf2

exotic pumice
#

cool

tulip sleet
#

so whatever you come up with would be interesting, and of course tutorials and projects. our own emphasis is always on making things easier, but if rust coding is an improvement over the current C (and a little C++) toolchains and libraries, then the professional users woudl be interested too.

pastel panther
#

uf2 is pretty neet

#

I've been interested in rust for a while as an alternative to C but my concern has always been how quickly the community would be able to replicate the libraries already available in C

exotic pumice
#

there's lots of cool stuff out there, and where there isn't you can bind to C via FFI

pastel panther
#

though my understanding is that rust has a very enthusiastic community

exotic pumice
#

yep

arctic heron
#

On a CPX I've got a .mpy file that is zero length, but I can't get rid of it, even in safe mode. Thoughts?

pastel panther
#

There is a tool for nuking the storage of a CP device; let me see if I can find it

arctic heron
#

Ah, I just reformatted and copied everything back

#

a bit crude but it worked

pastel panther
#

does it load the code as expected?

arctic heron
#

It does now πŸ˜ƒ The .mpy file was working, but I was out of memory, I made it a frozen lib but then didn't delete the .mpy. Oops. Wend to delete the .mpy, and CP got pig-headed

pastel panther
#

yea, it can be like that at times

arctic heron
#

It looks like .mpy files seem to get kinda locked at boot sometimes? I had another one which I was using, couldn't even copy it off the device

#

that one works fine

#

worked fine anyway

#

I have a habit of writing a .py, then making it a .mpy 'cause I'm out of memory, then freezing it because I'm out of memory again, as I build this house of cards

#

and it can be hard to keep track of which one CP is actually using. It looks like it prefers the .py?

pastel panther
#

TBH I couldn't tell you without looking at the code; would you like me to?

tulip sleet
#

@arctic heron it does prefer the .py over the .mpy, so rename the .py or remove it

arctic heron
#

@tulip sleet Thanks! Do you happen to know how frozen modules fit in there? My guess is they are the lowest on the pole

tulip sleet
arctic heron
#

It looks like (casual observation) -- 4.0.1 at least -- that if an .mpy file doesn't fit CP just kinda locks up (no memory allocation error, you need to safe boot). Not a newbie user path, so not a big deal. Or I could be wrong.

#

@tulip sleet Oh, very clever, it fits in kinda proper like. Very nice

tulip sleet
#

i'd consider that a bug, especially if it's a regression from 3.x. Please file an issue.

arctic heron
#

Ok, I'll try to make something reproducible. I don't know if it is a regression from 3, I didn't use 3 much because I need a custom build so I just hopped on the tip πŸ˜ƒ At this rate, though, I'm gonna have to bit the shipping bullet and buy an itsy-bitsy M4 to develop this app on (which I'll probably freeze and put back into an M0 at the end); easier then fighting memory while in dev

#

Thanks for the help @pastel panther and @tulip sleet

pastel panther
#

np

#

glad to see another firmware dev in the channel

manic glacierBOT
rustic nymph
#

How do I know which version of Python the Trinket is running?

pastel panther
#

@rustic nymph there should be a boot_out.txt file on the CIRCUITPY drive when plugged into a USB port

#

if you open it in a text editor it will say which version of CPY is installed

rustic nymph
#

Its blank?

pastel panther
#

have you used the REPL yet?

rustic nymph
#

Ive done it before with this board but not this computer

pastel panther
#

when you open a REPL one of the first lines will tell you the version installed

rustic nymph
pastel panther
#

I believe so

rustic nymph
#

Thank you

pastel panther
#

I find it best to put the files in the CIRCUITPY drive, then open a REPL to test the code bits that I'll need to use the library. Once I have the basics figured out, I write a code.py with the stuff I learned/tested on the REPL

rustic nymph
#

When I try "import pulseio" I get "ImportError: no module named 'pulseio'"

#

and upgrading circuitpython fixed that

pastel panther
#

strange; normally an import error when you know the file is there is due to a path issue; glad you were able to fix it

rustic nymph
#

Ah python is a struggle

pastel panther
#

it can be, but it can also be pretty great at getting things done

#

the startup costs for any development environment can always be frustrating but I try to think of it as an investment in the future

manic glacierBOT
rustic nymph
#

Well I got it to write power in a text box when I hit the power button a remote so thats a start

pastel panther
#

nice

raven canopy
#

@rustic nymph if you're getting a pulseio import error on a Trinket, I imagine you're on an older 2.x version. pulseio was left out of the firmware on non-express boards due to storage size. the last 2.x version, and all 3.x versions should have pulseio on non-express builds.

fringe trench
#

@raven canopy is the machine code getting tighter? is that what's enabling the inclusions?

raven canopy
#

its a combination of things. memory [block] management was improved and qstr compression, are a couple of the larger improvements that i remember.

rustic nymph
#

Any idea why I get two pulses when pushing a button? [9005, 2217, 581]
[8996, 4426, 592, 525, 589, 529, 595, 522, 592, 1632, 596, 522, 592, 525, 600, 518, 596, 522, 592, 1632, 627, 1597, 620, 1604, 624, 493, 621, 1603, 595, 1629, 619, 1605, 624, 1603, 625, 492, 622, 1602, 626, 492, 621, 1603, 626, 1597, 620, 498, 627, 491, 623, 494, 620, 1604, 623, 495, 619, 1604, 624, 494, 620, 497, 628, 1596, 621, 1603, 626, 1600, 628]

raven canopy
rustic nymph
#

With maxlen at 0 I get [0]
[9023, 4395, 622, 495, 619, 498, 626, 491, 623, 1600, 627, 491, 623, 494, 620, 497, 627, 490, 623, 1600, 628, 1594, 623, 1600, 627, 490, 624, 1598, 619, 1604, 624, 1599, 598, 1628, 589, 1633, 595, 1628, 589, 528, 596, 1627, 591, 1632, 595, 522, 592, 525, 599, 518, 596, 521, 593, 524, 630, 1593, 594, 522, 592, 526, 598, 1624, 593, 1630, 598, 1627, 590]

meager fog
#

looks like maybe a repeat code

rustic nymph
#

maybe I need to try a different remote, this is with an old sparkfun one

#

even with a tv remote I get a group of 3 and then the big group

meager fog
#

yah the small group is a repeat code

#

ignore that

rustic nymph
#

Ah I see now, thank you

#

Any idea when the pIR key will be available?

meager fog
#

no ETA!

timber mango
#

we will serve no wine before its time -Paul Masson

manic glacierBOT
manic glacierBOT
manic glacierBOT
manic glacierBOT
rustic nymph
#

Any ideas?

meager fog
#

make sure you have the mpy installed, not the py

rustic nymph
#

Thank you!

#

All is working now

meager fog
#

awesome

#

yes it will use py (uncompressed) by default, so delete em!

rustic nymph
#

I actually had both in there but the mpy was for 2.0 and I still dont know what im doing with python

meager fog
#

all good, takes a little practice

#

but it gets easier

velvet yarrow
#

anyone able to help with some crude python?

pastel panther
#

I might be able to

velvet yarrow
#
            led.value = False
            print(FN)
            FN += 1
            print(FN)
            time.sleep(0.25)
            led.value = True
            TEST = FN + ".bmp"
            print(TEST)
            #condition: raise label()  # goto label```
#

so let me explain my mess

#

fn starts as 1

#

it increases if you hit the button

#

i then need to make "test" equal the new value of fn + .bmp

#

so hit the button and i want 2.bmp to be stored as TEST

pastel panther
#

(with some statements to verify for testing?)

velvet yarrow
#

sorry nont understanding what you mean

pastel panther
#

I'm assuming those print statements are for you to test/verify that it's working as you expect

velvet yarrow
#

ahh yes correct

#

but i keep getting errors

#

TypeError: unsupported types for add: 'int', 'str'

pastel panther
#

that's the TEST = FN + ".bmp" probably

exotic pumice
#

str(FN)

velvet yarrow
#

correct

#

@exotic pumice what do you mean?

exotic pumice
#

TEST = str(FN) + ".bmp"

pastel panther
#

you can cast the int to a string

exotic pumice
#

you have to cast

velvet yarrow
#

man, ty. i've been fighting that for an hour

exotic pumice
#

cheers

velvet yarrow
#

ok, now i have one more issue. i need a goto. i know python doesn't really do goto and they are really hated, but i just need to make a jump

exotic pumice
#

gotos can usually be replaced with while loops

pastel panther
#

what are you using it for? There is almost certainly a way to do what you want without it

velvet yarrow
#

for lack of elegance, i'm trying to cludge together a way to use the HalloWing Light Paintstick with more than one file name on the go

#

i need to jump after my crap code back to line 168 so the my new "filename" gets reloaded and everything continues

exotic pumice
#

I'd probably iterate over a list of file names if I were you

velvet yarrow
#

i guess let me explain the thoughts

#

i can't easily edit the code on the go. but i can make just put new files on the cpx

#

so let's say i have filenames 1-20 on the cpx

pastel panther
#

There is a fn that can read all the file names off the CPX

#

(pretty sure)

velvet yarrow
#

i've added the crap i've written at the bottom that increases the filenames

pastel panther
#

os.listdir

#

you can use that to get a list of files that you can then loop through

velvet yarrow
#

so everytime i hit A3 it will change the filename now to the next number 2.bmp, etc. but then i need to jump back to line 168 so it reloads, plus allows me to keep going up in filenames or change speed

pastel panther
#

you'll probably say something like os.listdir('image_files/')

velvet yarrow
#

that's over my head sorry. that would require alot more than my understanding

pastel panther
#

We'll help you figure it out. You're already pretty far along

velvet yarrow
#

if i can just go back to line 168 it will reload the new filename and then everything keeps running

pastel panther
#

Can you try something? Instead of changing the code in load_bmp, let's instead change the name of the file that it's loading

#

that way load_bmp can stay focused on doing its job of loading bmps

velvet yarrow
#

i'm game to try anything to make this work

exotic pumice
#

that's the spirit

pastel panther
#

start by commenting out your code and putting the following before the call to load_bmp, around line 168:

FILES= ['1.bmp']
CURRENT_FILENAME=FILES[0]
#

that should load your 1.bmp file

#

(we're going backwards to go forwards)

velvet yarrow
#

ok, and i'm adding before like 89 not 169,. i see it loads much earlier

exotic pumice
#

the code doesn't actually execute anything until line 170

pastel panther
#

?

velvet yarrow
#

i get outputs in the console corresponding with 89

#

'''Loading 1.bmp
File opened
WxH: (60,30)
Image format OK, reading data...
Loaded OK!
Mem free: 6368'''

manic glacierBOT
#

CPython returns the same object:

>>> class A:
...   def a(self):
...     pass
...   print(a)
...
<function A.a at 0xb6926108>
>>> A.a
<function A.a at 0xb6926108>
>>>

Do you know where MicroPython does this wrapping?

I have a solution for the bound method case, enabling MICROPY_PY_FUNCTION_ATTRS and 3 lines of code for __func__:

=== class A:
===     def a(self):
===         pass
===
>>> A.a
<function a at 0x2002d780>
>>> A().a.__func__
<functi...
pastel panther
#

there are some statements before the fn definitions

exotic pumice
#

oh my bad

#

it's mostly initialization though

pastel panther
#

np, it confused me as well

#

either way, @velvet yarrow did the code I mention work?

exotic pumice
#

it would help if there was a
if __name__ == "__main__": or w/e it is

pastel panther
#

true, but let's keep it simple for now

velvet yarrow
#

it still runs fine, it loads 1.bmp

pastel panther
#

ok, now change the FILENAMES definition to
FILES= ['1.bmp', '2.bmp, '3.bmp']

#

as a first step

velvet yarrow
#

SyntaxError: invalid syntax

pastel panther
#

sorry, it's missing a closing quote on the 2.bmp

velvet yarrow
#

fixed, loaded 1.bmp

pastel panther
#

do you understand what we've done so far?

velvet yarrow
#

i don't sorry

pastel panther
#

no worries, this is how we learn!

#

what we did is define an array called FILES that will hold all the file names that we will want to loop through

velvet yarrow
#

is this an array? we're telling it we are starting at 1.bmp and we will step through to 2.bmp and so on for a trigger?

#

aha, i was close πŸ˜ƒ

pastel panther
#

yes!

#

so now, instead of using FN directly, we're going to use it to choose which file in FILES to use

#

one small change we'll need to do is to have FN start at 0, because that's how arrays like to count; 0 is the first item, 1 is the second, etc.

velvet yarrow
#

k

#

so now we have to trigger it to step up in the array?

pastel panther
#

yup

velvet yarrow
#

well i mean define a trigger

pastel panther
#

yea; later in the file, around 188 we have a loop going where we can look for a button press like you were doing and increment FN

#

(as an aside, I would personally use a more descriptive filename than FN. Something like FILE_INDEX)

velvet yarrow
#

the block of code i wrote starts at 205

#

well i should explain

pastel panther
#

ah well line numbers are difficult when we're probaby not looking at the same thing

velvet yarrow
#

filename is what the prexisting code is looking for

pastel panther
#

ahhhhh.

#

we'll have to move COLUMNS = load_bmp(FILENAME) down into the loop so it can be re-evaluated

velvet yarrow
#

i defined FN=1 up above

pastel panther
#

same with FILENAME=FILE[FN] or whatever

velvet yarrow
#

so something like this?

#

ok so maybe first i change

#
CURRENT_FILENAME=FILES[0]```
#

to

#
CURRENT_FILENAME=FILENAME[0]```
#

to match all the existing code that is looking for "FILENAME" ??

exotic pumice
#

that won't work because it's expecting FILENAME to just be one value, not 3

velvet yarrow
#

ah so maybe FILES=FILENAME?

pastel panther
#

not quite

exotic pumice
#
FILES = ['1.bmp', '2.bmp', '3.bmp']
FILENAME = FILES[FN] 
velvet yarrow
#

ok, put that at line 35 and commented out all those names above

#

so now we just need a trigger to move the array up one and then to trigger the code to rerun the parts to load the new filename?

#
            led.value = False
            trigger array to move up one
            print(FILENAME)
            time.sleep(0.25)
            led.value = True
            run code to reload with new filename```
pastel panther
#

you're going to want to structure it (broadly) like so:

imports up here
constants and non-changing things here
functions here like load_bmp

while True:
    looping stuff here;
    we're never leaving this loop
    read a button to change the value of FN
    new_filename = files[FN]
   COLUMNS = load_bmp(new_filename)
   do stuff with columns
velvet yarrow
#

so i have to move it completely around?

pastel panther
#

you can have the constants and what not right above the while True, but I would have everything at that level together

#

it will make it easier to keep track of; you can even delimit the different sections of code with comments like
######## this section is all function definitions ########

functions here

constants and initializations here

#

it will work fine spread out but in the long term it might be more confusing

#

in the end it's up to you how you want to organize it, but having the different sections clear will help keep things organized

manic glacierBOT
velvet yarrow
#

so since the bmp loading is outside a loop i have to put it in a loop and have the existing loops further in so to speak?

#

this is getting over my head unfortuantely

pastel panther
#

yes! it's under your head! You just figured out yourself what I was just typeing up

#

there are a few key lines that are only evaluated once in the original version that you'll want to evaluate repeatedly in your version so that you can change how they evaluate

so instead of

#function definitions
COLUMNS = load_bmp(FILENAME)
 #more stuff
while True:
    #do stuff with columns

you'll want do something more like

#function definitions
 #more stuff
while True:
    if (button was pressed)
        file_index = file_index +=1
        CURRENT_FILENAME = FILES[file_index]
        COLUMNS = load_bmp(CURRENT_FILENAME)

    #do stuff with columns
#

that's a bit psudo-codey but I think you get it

exotic pumice
#

and don't forget

if (file_index >= len(FILES)):
file_index = 0

so you don't go past the boundary

pastel panther
#

yup

#

@velvet yarrow sorry I just re-read what you wrote earlier; You don't need to put the bmp loading in another outer loop, just in the main loop

velvet yarrow
#

so now i've really gotten it broken

#

so i'm working off of the original code, removed all my goofy variables

#

i've removed all the FILENAME= at the top (lines 17-34) and replaced them with

#
FILENAME = [FILES]```
#

but now it won't even load

pastel panther
#

that's not quite right

#

you can leave the FILES= but FILENAME will need to be defined/evaluated in the lower while True: loop

#

when you say FILENAME=[FILES] you're putting an array in a array

#

did you see my psudo-code above?

rustic nymph
#

whats a good way to learn python in general?

velvet yarrow
#

?? but it loads the first filename before the loop even starts?

#

i thought i had to define the array at the top

pastel panther
#

@rustic nymph I'm a fan of doing what @velvet yarrow is doing; finding code that works and then modifying it to do what you want to do

#

@velvet yarrow you should define FILES outside of the loop but define FILENAME inside the loop, depending on the value of a number you're incrementing

velvet yarrow
#

ok i got it to load. i made it

#
FILENAME=FILES[0]```
rustic nymph
#

ive tried codingame but its more about concepts like how a for loop works rather than syntax

#

ive got quite a bit of experience with vba, I just struggle with different syntax

pastel panther
#

that works; then within the loop, instead of FILES[0] you'll have a variable that you're updating when a button is pressed, then doing something like FILENAME=FILES[VARIABLE_INCREMENTED_WHEN_BUTTON_PRESSED]

#

@rustic nymph the various CP code examples are actually pretty good examples of basic python syntax

solar whale
#

@tulip sleet I built and loaded PR1177 to my Dongle -- anything special I should do to test it?

velvet yarrow
#

can't seem to get the array to advance

tulip sleet
#

I tested the RGB LED with DriveMode.OPEN_DRAIN and also measured voltage on a regular DigitalInOut pin as 3.3v. This PR will reset the GPIO voltage setting if it is wrong. You could try bitbang SPI on a DotStar strip - that would be a stressy test I haven't done yet. Thanks.

velvet yarrow
#

FILES = FILES +=1

pastel panther
#

@velvet yarrow do you mind if we switch to private messages to keep the main channel clear?

rustic nymph
#

Do feathers have a lot more memory than a trinket or itsy bitsy?

velvet yarrow
#

sure

solar whale
#

OK -- That will have to be tomorrow - happy to try it then -- I'll need to add more header pins.

pastel panther
#

@rustic nymph it depends of the feather but probably not, uless you're talking about m0 vs m4

rustic nymph
#

yeah m0 is what I have

solar whale
#

BTW -- it took me a few tries to get the .uf2 loaded -- have you seen any odd behavior with NRFBOOT on linux?

#

to use OPEN_DRAIN -- just set led.drive_mode=digitalio.DriveMode.OPEN_DRAIN ?

rustic nymph
exotic pumice
#

you probably could, but I don't think the bootloader is set up to read it

#

maybe you could eval from file

#

idk

solar whale
#

@rustic nymph you can save/run code from an SD Card -- looking for guide...

exotic pumice
#

my bad

solar whale
#

The bootlader does not access teh SDCard. You mount it after boot then set path and run code from it.

rustic nymph
#

thank you

raven canopy
#

@solar whale @tulip sleet i can't seem to remember, and confidently answer my own question: did ustruct get renamed to struct on ESP8266? i've recommended try: import struct except: import ustruct on a library review. πŸ˜„

tulip sleet
#

@raven canopy yes, it appears (from RTD) that it was renamed in 3.x; was ustruct in 2.x

#

but you need import ustruct as struct or vice versa to get consistent naming

solar whale
manic glacierBOT
raven canopy
#

@tulip sleet @solar whale thanks. my reading of the makefile, and mpconfigport, were telling me that it has changed. but i just couldn't trust myself. πŸ˜„ so, is there any reason a library would need ustruct anymore?

tulip sleet
#

only if you were importing some third-party lib that used ustruct

#

then import struct as ustruct

raven canopy
#

or...to remain compatible with 2.x? yeah, i have it suggested like that. well, like so:

try:
    import struct
except ImportError:
    import ustruct as struct
tough flax
#

Howdy folks: first THANK YOU! I have a fantastic solution for our user who wants to alert their professor (red/yellow/green/etc). I use PowerShell (yuk) and input() works (blocking, but it's good for now).

#

Second, is there a way in CircuitPython to show images to the HalloWing's TFT display?

raven canopy
#

@tough flax yay! kludgey still gets the job done! πŸ˜„

tough flax
#

It would be a fantastic addition to this set of solutions

solar whale
#

@tulip sleet sorry - just realized what you asked me to do - I don't have any dotstar LEDs to test.. I did try OPEN_DRAIN and it seems to work.

tulip sleet
#

no problem - it will get a shakeout in the usual way. I did basic "unit testing" and I think it's ok. arturo182 will also take a look at the underlying code

solar whale
#

sounds good.

tough flax
solar whale
#

@tulip sleet can you confirm that this is the same build with pr 1177 ```Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-alpha-1070-ge335c74ac on 2018-09-09; PCA10059 nRF52840 Dongle with nRF52840

#

nevermind -- I found it in the PR

manic glacierBOT
manic glacierBOT
raven canopy
#

@tough flax I totally missed your HalloWing question. Thanks to Scott, the initial displayio module is in. Is still early days on it, and i can't explain how to use it..

meager fog
#

@tough flax TFT + bitmap support for hallowing is coming very very soon, scott's hacking away at at, called displayio

#

woopz jinx

raven canopy
#

πŸ˜†

meager fog
#

great minds

tough flax
#

Thanks guys! πŸ˜ƒ

meager fog
#

i think maybe this week we can show it off

#

it just got merged?

raven canopy
#

yep. 2 days ago.

meager fog
#

its there!

#

but i have no idea how to use it either

raven canopy
meager fog
#

here's a hint code chunk

#

ok i got some zigbee radio action goin

#

im gonn zzz

raven canopy
#

i have been waiting to pounce on the PR. πŸ˜„ good πŸ’€s @meager fog

meager fog
#

iti has a long way to go

#

i just got a sniffer demo ported

#

which is a nice way to 'prove it works'

#

i dont have any way to send/receive packets yet

raven canopy
#

@slender iron DMA is going to be required. 😦 COUNT is not updated when using capture; it all goes to CC. at least on M4; haven't tried on M0 yet. Here are the registers during a couple captures.

1: without setting the TOP (COUNT16.COUNT.reg default):

slender iron
#

@raven canopy your code somewhere?

raven canopy
#

@slender iron not yet. going to bed, so late tomorrow most likely. have a thing tomorrow night...

slender iron
#

kk, please post it so I can see what you are doing

raven canopy
#

will do!

slender iron
#

thanks! goodnight! thanks for all of the reviews!

raven canopy
#

πŸ‘

manic glacierBOT
solar whale
#

@tulip sleet looking at the data sheet, I don't see nay restrictions on which GPIO Pins for the PCA10059, can be used for I2C or SPI. Is that the case, Any available pins can be used? It looks like the nrf52 is a bit for flexible than the SAMD51 in this regard, or am I missing something?

manic glacierBOT
manic glacierBOT
#

On trinket m0, with CircuitPython 3.0.1, connecting through Mu (or any serial connection), on the REPL run command:

print("111111111122222222223333333333444444444455555555566666666667777777777888888888899999999990000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999000000000011111111112222222222333333333344444444445555555555")

After successful execution, press arrow up key.

Expected Result: view the previously executed command from ...

timber mango
#

Hi,
any idea of when will the next CircuitPython release be?

solar whale
#

@tulip sleet @indigo wedge I'm a bit confused about the pin assignments on the various nrf52840 boards - it may be that the pin packaging is different for the different boards so the restrictions for using some GPIO pins for low frequency (<10Khz) don't apply to all of the boards. On some of the boards - P1.10-15 are for Low frequency only, but are being assigned for use with SPI or I2C on different boards. For example on the feather_52480_express I2C is on P1.11/12 in pins.c -- I'm not sure which chip is on that board. But the table in that data sheet says they are for low freq on the part described there. http://infocenter.nordicsemi.com/pdf/nRF52840_PS_v1.0.pdf (Table 7) On the PCA10056, I have been using P1.10/11/12 for SPI and I note that the pins.c uses p1.13/14/15 but according to this document, those should all be low frequency. Am I looking at the wrong data sheet? Am I just confused....

slender iron
#

@timber mango what for?

timber mango
#

@slender iron no reason, I'm just curious
loading bunch of trinkets with software

slender iron
#

we don't usually schedule it. we'll do a 3.0.2 soon to fix neopixels on the m4 but thats it

slender iron
#

<@&356864093652516868> Meeting in just under an hour!

manic glacierBOT
slender iron
tidal kiln
#

@slender iron fly-on-the-wall mode for me this week

slender iron
#

kk

tulip sleet
#

@slender iron I can take notes again

slender iron
#

thanks @tulip sleet

raven canopy
#

I may be a little late. Had some colleagues pop in unannounced.. πŸ˜„

wraith tiger
#

Lurking today

turbid radish
#

spamming the channel for two posts:

#

Newsletter

tidal kiln
#

i count 4 :)
(1) stats (2) hugs (3) progress (4) in the weeds

wraith tiger
#

I'll delurk for :

Hug report:
Group hug
Status report:
I'm part of the micro:bit beta testing and I'm testing a new firmware and makecode & micropython editors that implement WebUSB to allow direct flashing to the micro:bit.

<lurk mode reactivated>

raven canopy
#

I have the fuzz too.

stuck elbow
#

group hug

raven canopy
#

@"The nRF Crewe" (Dan, thach, Arturo, & Jerry) for continued work on that port. @tannewt for displayio foundation. Group hugus-maximus for any I'm missing!

errant grail
#

just lurking today.

inland tusk
#

General hug report

manic glacierBOT
#

@tannewt does the relocation code fixup the names that are bound to the object that's being relocated?

I guess it does, so it seems to be some function wrapping going on here:

=== f = None
===
=== class A:
===     def a(self):
===         pass
===     print(a, hash(a))
===     global f
===     f = a
===     print(f, hash(f))
===
<function a at 0x200029d0> 536881616
<function a at 0x200029d0> 536881616

>>> print(f, hash(f))
<function a at 0x2002d890> 537057424

>>> pr...
stuck elbow
#

Busy at day job: no progress. Preparing for Maker Faire Zurich this week.

raven canopy
#

@tulip sleet I peeked the other day too at PWM. Def not obvious...

solar whale
#

weeds topic -- nrf52 pin definitions

errant grail
#

Congrats on the book, Mike!

raven canopy
#

FrequencyIn: OSCULP32K as DPLL source in work for crytaless boards. Have to establish a GCLK since it can't be sourced directly like XOSC32K. Then I should be able to assess jitter cause, as mentioned last week. Still discussing TC register usage/DMA with @tannewt.

Going to update VEML6070 library to match the new VEML6075 library in usage/structure.

turbid radish
#

Thanks @errant grail

wraith tiger
#

O/

inland tusk
#

@slender iron I will figure out what happened

raven canopy
#

Thanks everyone! Keep up the amazing work! πŸ‘‹ blinka

stuck elbow
#

thanks

turbid radish
#

πŸ‘

raven canopy
#

So, we need to all buy the same cake for recording #52. 🍰

wraith tiger
#

I used to live a few blocks from the Atlantic, but have never seen the Pacific.

stuck elbow
#

Schwartzwalderkirchtorte

raven canopy
#

Black Forest peach? I've forgotten "kirch"...

wraith tiger
#

There’s an Aberdeen in NJ, too.

raven canopy
#

And Maryland...

stuck elbow
#

@raven canopy cherry

solar whale
#

is "kirch" "church"?

#

ah

raven canopy
#

Doh! So "close"...

stuck elbow
#

sorry, kirsch

wraith tiger
#

Yes, in Dutch, Kirk is church.

solar whale
#

sounds delicious!

wraith tiger
#

Oh, never mind, I read it wrong

inland tusk
#

@slender iron I am back to having the same problem I had before with the mike. I am using the app and not the browset. D

#

Did you mute me?

cunning crypt
#

OK, so. I completely missed the meeting... because I've got my mind in the guts of a CP project. A little ironic. Working on a Feather M0 Express, getting memory allocation failed when loading, but when I go into the REPL and use "Import main" (It's, so far, just a bunch of classes that I haven't put together into a functioning program yet), everything works fine.

#

This seems... odd

stuck elbow
#

do you know at which moment you get the error?

cunning crypt
#

I added another class, and it would do that. But if I go into the REPL, and import main, and use main.thatclass(), it works fine.

#

Right now I'm trying to tackle a different problem. I'm using the GPS library. Example works great. Writing my own code works... about 90% (So far)

#

That 10% is the GPS info won't update. Even using gps.update() until it returns "True". Even when doing that a few times, it still returns the same information.

slender iron
#

@inland tusk I don't think I had you muted but I can check next week

slender iron
fluid helm
#

Oh

#

Did I miss it

#

☹️

slender iron
#

yup, it was 3 hours ago

manic glacierBOT
cunning crypt
#

Don't worry, @fluid helm, I was at my computer and I missed it.

manic glacierBOT
#

unittest want to add properties to functions.
MicroPython doesn't support this: http://docs.micropython.org/en/latest/unix/genrst/core_language.html#user-defined-attributes-for-functions-are-not-supported

The workaround is to use a dictionary: FUNC_X[f] = 0

My problem is that the function object doesn't stay the same, so I can't use it as a key and look it up in the dict later.

I'm not sure if relocation is the first problem to attack here, because it looks like MP is wrapping...

slender iron
#

worth reading

stuck elbow
#

the largest Python project in the world

arctic heron
#

Circuit python hint of the day: If you are prototyping on a regular platform and deploying on a CP device, do NOT name your primary file code.py.
code is a built-in module and can confuse the debugger mightly

#

main.py gets along with other things much better.

arctic heron
#

Ugh, not that anyone cares (since it isn't even enabled in CP), but the prototype for
async def __aiter__(self):
is different in uPY/CP then in Python 3.7 (where it is
def __aiter__(self):
These little differences can drive you crazy

#

On the upside, you can defined a method in an if....

timber mango
tough flax
#

Hmm... Does the board auto-reload on ANY file change? Replacing the /lib directory contents seems to be taking forever

scarlet fjord
#

yeah ive found replacing /lib takes ages too

tough flax
#

It went faster (but still slow) after I deleted main.py (I have a copy πŸ˜ƒ )

raven canopy
tough flax
#

@raven canopy I'm having trouble getting Mu to connect to the repl/USB IO... but I can connect with Putty... any ideas? This is after going to the latest build.

#

(Re-installing Mu now)

raven canopy
#

hmm. the only thing i could see interfering is if the serial connection was already claimed. which Mu version are you using? i vaguely remember an issue with beta-15...

tough flax
#

(I have a pulsing green LED)

#

1.0.0 on Mu - same after reinstall

raven canopy
#

which board? i'll see if i can replicate. i need to update Mu anyway. πŸ˜„

tough flax
#

hallowing

meager fog
#

Mu doesnt support hallowing yet

#

coming soon

tough flax
#

AH!

#

Thanks Limor!

raven canopy
#

at any rate, i couldn't replicate that. i've been on a purchasing drought. πŸ˜„

tough flax
#

I'm so glad you were listening - that would have taken forever πŸ˜ƒ I've been swapping between Trinket M0, CPX and the HalloWing and couldn't see the pattern πŸ˜ƒ

#

Mu's still good as an editor, right? Just no IO

meager fog
#

yeah

#

we're making it so going forward it wont be as picky

#

but right now each board must be programmed in

tough flax
#

I was spoiled (I like mu! and I live/die w/Emacs!)