#circuitpython-dev

1 messages Β· Page 112 of 1

stuck elbow
#

hm?

stuck elbow
#

@slender iron I'm trying ot use the PA00 and PA01 pins for something other than the APA LED, is it enough for me to remove the HW_APA102 defines from mpconfigboard.h?

#

because I suspect that this might be crashing it...

slender iron
#

@stuck elbow I think so. Check the list of pins that don't get reset in that file as well

stuck elbow
#

I was wondering what the MICROPY_PORT_A was for

slender iron
#

yeah, those pins don't get reset

#

shoudl probably rename it πŸ˜ƒ

stuck elbow
#

there is one more possibility -- that there is some bug on deinit of spi that makes it crash when a soft reset happens during an spi transfer...

#

I will test it on a normal trinket m0 to make sure

slender iron
#

bugs are possible πŸ˜ƒ

floral dagger
#

huzzah update 2...it works....sort of? So I decided to put it on a bread board and manually pull the pins to the proper values to try and see if that would stop it rebooting. As I was getting some resistors I glanced over and noticed it seemed to be running fine. Checked it out, and sure enough it's good.. BUT whenever it is removed from the breadboard it starts the reboot cycle again.

formal plover
#

@floral dagger hmm interesting

floral dagger
#

I'm slightly confused lol

idle owl
#

That is odd

#

Confused is a correct response

#

I just soldered headers onto my Huzzah, haven't tried to flash it yet.

formal plover
#

Mines been on a breadboard since day one. I still have 2.0 on it.

idle owl
#

@floral dagger Maybe there's stray solder or something up under the pins that's bridging something but when it's in the breadboard it's forced to be straighter so it works?... I'm reaching here, but it doesn't make sense to begin with.

floral dagger
#

maybe @idle owl. I even thought maybe the pins are somehow floating and there's just enough capacitance/resistance in the breadboard to stabilize it.

idle owl
#

Exactly, something like that.

stuck elbow
#

@slender iron the bug is the gamepad module

#

@slender iron is there some way for me to run some code before shutdown?

#

@slender iron to disable key scanning

floral dagger
#

I swear, I end up with the weirdest issues sometimes

slender iron
#

@stuck elbow ah, on reload? its common for implementations to add a reset_* method that gets run when the port resets

#

looks for reset_all_pins as an example

stuck elbow
#

thanks

formal plover
#

Look at that, @floral dagger has a photo now!

slender iron
#

no problem @stuck elbow

stuck elbow
#

that was it, phew

#

a patch is coming

slender iron
#

πŸ‘

umbral dagger
#

@formal plover Yeah.. I didn't recognise him.

stuck elbow
#

@slender iron it should go to master, or also to 2.x?

slender iron
#

both?

stuck elbow
#

ok

manic glacierBOT
stuck elbow
#

@slender iron that part with resets is commented out in master currently, so I added the code as commented

drowsy geyser
#

Another silly question, I guess. Is there a 3.0beta library bundle? Or is "latest" ok?

#

(I ask 'cause busio has gone away and I need to instantiate an I2C device....)

#

LOL. NM. I'm RTFMing. πŸ˜ƒ

idle owl
#

@drowsy geyser πŸ˜ƒ

drowsy geyser
#

@idle owl Yeah, but I think I still need busio, but it isn't in the 3.0beta for the M4.... I'm not sure how to get it. Still looking.

#

(I'm starting out by testing the si7021 sensor)

idle owl
#

@drowsy geyser Hmm, yeah. I'm not sure either. Is it adafruit_bus_device or is that different?

drowsy geyser
#

No, that just has the i2c_device interface.

idle owl
#

Ah

drowsy geyser
#

It looks like you need to do something like i2c = busio.I2C(board.SCL, board.SDA) and then initialize it with the i2c_device....

#

The interface definitely seems to have changed, though.

idle owl
#

Could be it's not included yet? I'm not entirely sure how all of that works so it's only conjecture.

drowsy geyser
#

Could be. I'll ask Scott when he's done gaming.

idle owl
#

As in I'm not even sure it can be not-included.

drowsy geyser
#

Yes, I'm not sure either.

idle owl
#

I'm wondering if it's pin mapping. I know the dir(board) shows some weird stuff. But that seemed more like a REPL issue.

#

But I also have no idea how that works.

drowsy geyser
#

I don't think so. I get a no such module error when I try to import busio

idle owl
#

Ah

formal plover
#

@drowsy geyser what board are you using?

drowsy geyser
#

Metro M4 Express.

formal plover
#

Sorry, I didn't back read. Just hopped on

#

Oh the M4 hahaha good luck

drowsy geyser
#

LOL!!!!

formal plover
#

That doesn't have spi yet either

drowsy geyser
#

Ahhhh, ok.

solar whale
#

@drowsy geyser I think you will find 3.0 has fairly minimal library support at this time.

#

I have confirmed that configuring a JLink for samd51 and then trying to use it in a samd21 does not work πŸ˜‰ even if you try repeatedly!

idle owl
#

I never really got it working, but that's good to know since I might have tried going to the Metro M0 to try it.

solar whale
#

I wanted to try it with a 2.1 build on metro M0 just to confirm it was all working. It is if configured correctly!

#

When misconfigured I had a lot of β€œcan’t halt” errors

idle owl
#

That's as far as I could get. What command do you use to start it?

idle owl
#

Hey I got my OLED Featherwing working on CircuitPython!

floral dagger
#

hey folks. Trying to use neopixels w/2.1, and I keep getting this errorTraceback (most recent call last): File "<stdin>", line 1, in <module> File "/lib/neopixel.py", line 75, in __init__ TypeError: Expected a Pin
Code:```from machine import Pin
from neopixel import NeoPixel

pin = Pin(2, Pin.OUT)
np = NeoPixel(pin, 1)```

Any thoughts on what I may be doing incorrectly?

idle owl
#

@floral dagger What board are you using?

#

That doesn't look quite right to me.

floral dagger
#

esp8266

idle owl
#

Ah ok that would be why.

#

I haven't used the ESP8266 yet.

solar whale
#

@floral dagger use digitalio not machine. This changed with 2.1 to use the new library

floral dagger
#

ahhhh...ok. I'll give that a try then. Thanks @solar whale

solar whale
#

If you really want to use machine you can load the MicroPython neopixel.py

floral dagger
#

I must have the wrong neopixel library then. I had to go look for one since it doesn't load from the bundle

solar whale
#

Are you using the new bundle?

floral dagger
#

yeah, just downloaded it a little whileago

#

adafruit-circuitpython-bundle-2.1.0-20171019

solar whale
#

It has neopixel

floral dagger
#

If I remove the one I uploaded, I get this ```from neopixel import NeoPixel
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'neopixel'

solar whale
#

Did you upload lib/neopixel.mpy from bundle?

#

There is no β€œbuilt in β€œ neopixel now

floral dagger
#

I uploaded the library

#

I uploaded the whole folder

solar whale
#

Hmm. I did not think it would fit.

floral dagger
#

ampy --port COM12 put C:\Users\tbrad\Documents\Repos\adafruit-circuitpython-bundle-210/lib /lib

#

just noticed the wonky slashes..oops

#

weird...you're right. Looks like it just created the directory structure but didn't upload the files

#

got that sorted, but it still throws the "expected a Pin error"

solar whale
#

huh???

#

not sure waht I said

#

post your code

#

the language bot is in a bad mood πŸ˜‰

floral dagger
#

lol

#
import board

np = NeoPixel(board.GPIO2, 1)   
np[0] = (255, 255, 255) 
np.write()  ```
#

I changed it to that, and that seems to run, but I may need to double check my wiring. Not getting any output on the pixel

solar whale
#

that should work

#

the default is autowrite=True so you don't really neeed the np.write() either.

floral dagger
#

oh...that's handy. I'm sure I'm overlooking something dead simple. Thanks @solar whale

solar whale
#

good luck!

floral dagger
#

it is working, but it's only writing the first value np[0] = (255, 255, 255) np[0] = (255, 0, 255) np[0] = (255, 255, 0) all give red, for example

#
np[0] = (0, 255, 0)  ``` green
solar whale
#

its r g b so (255,0,0) is red , no?

#

(0,255,0,) is green

floral dagger
#

all of the first three result in red when used.

#

the next two are green

solar whale
#

odd - just a minute, I'll hook mine up

floral dagger
#

ok, maybe I just got some crappy LEDs. at 255 red is all that I see. If Idrop it to 100 or so, green start to show as well

solar whale
#

odd - you can try setting the "brightness" to < 1 np=NeoPixel(board.GPIO2,1,brightness=.5)

#

works OK on my "jewel" 7 pixel board (255,0,0) is red (0,255,0) is green

drowsy geyser
#

@solar whale Ok, thanks!

solar whale
#

@drowsy geyser I think we need to be patient with 3.0 ... especially on the M4!

floral dagger
#

right, @solar whale that works fine, but for me (255,255,0) is also (mostly) red

solar whale
#

@floral dagger its bright yellow almost white on mine

floral dagger
#

Yeah, it's probably just down to my LED

#

lol remember how I saidit was probably something stupid?

solar whale
#

GPIO2 has a 10K pullup on it - I am using GPIO15 - may be an issue.

floral dagger
#

it was....I had a resistor in the wrong spot. It was on the 5v pin instead of the gpio

solar whale
#

GPIO15 has a 4.7K pulldown ....

#

are you using 5V or 3.3 for the neopixel power?

drowsy geyser
#

@solar whale Well, PhilT, Limor, and Scott wanted me to help test things, so I was starting with sensor I thought were done. I'll go back to more basic circuits and make sure they work first....

solar whale
#

pullups shouldnt mattter for the control line

floral dagger
#

5v

solar whale
#

@drowsy geyser sorry - I did not mean to discourage testing and reporting problems.

floral dagger
#

I think I was just dropping the current too much going in, so once it passed over the first color there wasn't much left to power the rest.

solar whale
#

I am just using 3.3 for my tests - since the GOIP pin is 3.3 - yo may get beter results using 3.3 for power . If yo want to use 5V tehn oyu may need to level shif the GPIO to 5V as well.

drowsy geyser
#

@solar whale Oh, no, I didn't take it that way! I guess I thought it was farther along than it is. Which is no problem. I'll work on more basic programs and work my way up from there. πŸ˜ƒ

formal plover
#

I have a NeoPixel ring I'll test with my HUZZAH tomorrow @solar whale @floral dagger

floral dagger
#

it's working now @formal plover the error appears to have been sitting at the keyboard.

formal plover
#

Scott's working on his toaster right now, but when he starts up again, there's no telling how far it'll go in one session @drowsy geyser

#

I gotcha @floral dagger sounds like working-ish

solar whale
#

Nepixel "should" be at 5V but you can get away with 3.3 but I think it best to be consistent if 5V power then shift GPIO to 5V as well.

#

What was the error @floral dagger

floral dagger
#

I was πŸ˜ƒ

idle owl
#

@solar whale What command are you using to get the j-link started?

floral dagger
#

I was the error. I placed the resistor on the 5v line instead of on the gpio input

drowsy geyser
#

@formal plover I thought he was gaming. But toastering is just as good. πŸ˜ƒ No rush. I know there's plenty to work on!

formal plover
#

Oh yeah, I believe you're correct on that @drowsy geyser. Same thing though, lol he'll crank out some crazy progress when he starts on it again.

idle owl
#

@drowsy geyser Yeah getting blinky working was a huge deal, lol. One mountain at a time.

solar whale
#

@idle owl Mostly, I have been using teh Ozone tool, but I did get it to work with gdb using JLinkGDBServer -if SWD -device ATSAMD51J19

idle owl
#

Hmm that's what I tried. Blergh.

#

Looking at Ozone now

solar whale
#

what did you see?

idle owl
#

I mean looking at even getting it.

drowsy geyser
#

@idle owl I got the GDB server running using the GUI....

idle owl
#

I'm on MacOS... I have a Windows machine and I tried the GDB server on that too, and it failed, although I'm not sure I used the right settings

#

Ozone exists for Mac. I'm going to at least try it

drowsy geyser
#

Ahhhhhhh, MacOS. Ok. That's different.

idle owl
#

Yep

drowsy geyser
#

If you go back to Windows I can give you the settings that worked for me.

#

Just let me know if you want them.

idle owl
#

In the meantime, so I could have a success for the day, I got my OLED featherwing working on my Feather M0 Express with CP 2.1. Used a Feather Doubler. So successful soldering today as well.

#

@drowsy geyser If Ozone doesn't get me further on Mac, then I'll be asking for the settings.

drowsy geyser
#

Ok, any time. I'll probably be up for a while. πŸ˜ƒ

idle owl
#

I'm 3 hours ahead of you as well πŸ˜ƒ

drowsy geyser
#

Oh that's right. I forgot about that. πŸ˜ƒ

idle owl
#

Ok, so Ozone wants Target Interface, Target Interface Speed (MHz)

#

I'm assuming JTAG is correct, what speed should it be? It defaults to 1MHz

#

No wait, should it be SWD?

#

The target interface I mean

#

@drowsy geyser Does any of this sound like settings you needed to use?

drowsy geyser
#

Target interface should be SWD

#

Hang on, I'll pull up the settings...

idle owl
#

Thank you!

drowsy geyser
#

Connection to Jlink: USB

idle owl
#

Got that

drowsy geyser
#

Target device atsamd51j19

#

Little endian

#

Target interface: SWD

idle owl
#

It asked for target device first, and hasn't asked for endian yet

#

Did you set a speed?

drowsy geyser
#

1000 Khz

idle owl
#

Ok keen

drowsy geyser
#

As soon as it connected to the JLink it updated firmware and then was ready to go.

idle owl
#

Oh hmm. It's asking for a Program File (Choose the program to be debugged) and it opens an explorer window...

drowsy geyser
#

Yes, that's where I stopped. It wants the CP .elf file with the debugging symbols included. I didn't proceed because I hadn't compiled CP myself.

idle owl
#

Oh. Neither have I, that's for sure. Mine says binary file is an option, hmm...

drowsy geyser
#

Oh, try it. I didn't get that option.

idle owl
#

Yeah about to!

#

Nope, the software hangs. It never leaves the new project window and won't let me click on anything in the actual software window. No target connection.

#

Owait.

drowsy geyser
#

waiting

idle owl
#

Oh snap! Ok, so I closed the new project window manually, x-ed it from the top corner. Then I was able to click "Load" on the window offering to load the .bin file I chose. Then nothing happened. So I looked and there was a power-icon button on the top left corner, that said something about connecting and loading, so I clicked it. It did some Things!

drowsy geyser
#

COOL!!!

idle owl
#

Still getting the same error as I did from GDB server though, where it's failing to halt.

#

But It did a lot more than GDB server did. Looks like it tried some different things?

drowsy geyser
#

Do you have a breakpoint set?

idle owl
#

It at least thinks it has a target connection, GDB was never able to get that

#

No idea, so probably not

#

I'm totally new to this, have no idea what I'm doing

drowsy geyser
#

But it sounds like you're making a lot of progress!

#

That's ok, the last time I really used gdb was 1994 when I was using it to debug a running UNIX (BSD 4.2 Reno) kernel on a dual VAX-11/780.

idle owl
#

Nice!

drowsy geyser
#

It was, until I wrote 8 bytes into the wrong memory location. It stayed up.... for a few seconds. πŸ˜ƒ

#

That's a lot of years of rust I'm going to have to knock off.

idle owl
#

So there's memory information, there's Disassembly information, Registers, and Console. Console says the same errors I got from GDB at the end, but it tried a bunch more stuff before giving those errors.

#

I assumed that the j-link could give me some data from the board, and that was my goal today was to get some data.

drowsy geyser
#

That's progress!

idle owl
#

The dialog for the power-icon button is exactly: "Download and Reset Program"

#

I ended the debug session to get back to the start state.

#

And if I power the M4 off and on again, blinky is still happy!

#

So I didn't also break it in the process, which I was fairly certain was a potential outcome.

drowsy geyser
#

Are you blinking the D13 LED, or the NeoPixel?

idle owl
#

D13. I can't figure out what pin the NeoPixel is. I tried a few things and it didn't work, so I stuck with D13.

drowsy geyser
#

I think the NeoPixel is predefined as board.NEOPIXEL. I could be mis-remembering, though.

idle owl
#

It returns PAXX is in use... XX being some number I can't remember from yesterday.

#

So it might be board.NEOPIXEL but it's not working at the moment

drowsy geyser
#

Ok, good to know. I'm going to get blink working tonight, and then try the neopixel.

solar whale
#

Ithere is a NEOPIXEL define in pins.c so it may work - I have not trield uploading the libraries yet.

#

I manged to get it working via gdb, but not without a fair amount of failing around....

idle owl
#

What is breakpoint? I just right clicked on a blank part of the app and it offered Set Breakpoint

solar whale
#

you can force the code to stop at a specied point in the code so you can examine that state of things.

drowsy geyser
#

A breakpoint is an instruction where the debugger will halt the program.

idle owl
#

Ah

drowsy geyser
#

You can then print variable values, read (or change) registers, etc.

solar whale
#

Yu really need a "special" version compiled with DEBUG =1 to be able to use many of the debugger tools.

idle owl
#

Ok

#

Like I said, I wanted to see some data from the board. I see some data πŸ˜ƒ

drowsy geyser
#

True that. What @solar whale said.

idle owl
#

So goal accomplished!

#

Thank you guys so much for the help, I was floundering blind with this one.

solar whale
#

If yo have it set up right - you can see the source code and step though it line by line - very nice...

idle owl
#

Neat!

drowsy geyser
#

Interesting. My NeoPixel was on but I disconnected the board to put it in a case. Now the NeoPixel is off.

idle owl
#

So I'm powering the M4 off USB, is that part of the issue?

#

We were going to try to find a 9v adapter around here somewhere tomorrow because I seemed to remember someone mentioning power issues.

solar whale
idle owl
#

Mine did not look like that lol.

drowsy geyser
#

That's awesome! I love graphical debuggers!

solar whale
#

Tis is Ozone from Jlink - Just getting used to it - lots to learn

idle owl
#

@drowsy geyser I specifically meant my Ozone window didn't look like that. Not nearly that much info.

#

That's the same app I used tonight.

solar whale
#

@idle owl I am using the 9V and USB - and sometime I have to disconnect th USB to get JLink to connect - still not sure what is goin on. BTW - I switched over to using my MAC for this and so far so good. I kept hainging up my Linux box. It si not happy with the USB.

idle owl
#

Ah, yeah unhappy USB will cause issues

solar whale
#

If you have not built the image locally, yo wont see the source code.

idle owl
#

Ok

#

I guess that should be the next goal πŸ˜ƒ

solar whale
#

one step at at time!

idle owl
#

Well I got through this step, so that can be the next one

#

Btw, it offered to update the firmware when I first plugged it into Windows, and I said no because I wasn't sure if it would cause issues on the Mac. After not being able to get it to work on the Mac (so many reasons earlier, @solar whale you solved a lot of those then), I plugged it into Windows again, but when I opened the app to udpate the firmware, I had to do it manually and it said it was already up to date. It says it was compiled 6 October 2017 at 16:39. Did it get updated?

solar whale
#

@idle owl I'm not sure - I have seen it update when I first connect, but have not paid much attention. I don't think it will matter where you update since the firware is in the JLink and it should work with both Windows and MACOS.

idle owl
#

Sorry I should have been clearer. Can you check your firmware so I can compare?

#

And the more I thought about it, the more I realised, obviously it doesn't matter where you update the firmware, it's irrelevant to what you're connecting it to.

solar whale
#

segger updates the tools often - oh ok - how do you check it?

idle owl
#

When I ran the GDB command line thing, it showed it (even though it didn't finish connecting to the target)

#
J-Link is connected.
Firmware: J-Link EDU Mini V1 compiled Oct  6 2017 16:39:00
Hardware: V1.00```
solar whale
#

Firmware: J-Link EDU Mini V1 compiled Oct 6 2017 16:39:00

idle owl
#

Nice!

#

@solar whale Thank you!

solar whale
#

@idle owl you are very welcome!

manic glacierBOT
solar whale
#

@drowsy geyser thanks for your help too! Looking forward to working with this board.

idle owl
#

Earlier I was able to get to the serial connection on the M4 and then get to the REPL. Now, it goes to the serial connection, it works (I can put a print statement in code.py and it prints), but it won't let me get to the REPL. I thought it might be because of the j-link cable so I disconnected it completely but nothing changed. Odd.

solar whale
#

hmm - should work - did you enter conrol-C to stop your code.py from running?

idle owl
#

Yep tried that

#

It's not registering any input

#

Already reset and reconnected it

#

Also if I save the code.py file, it reloads the serial connection, so that seems to be working fine

solar whale
#

did it come back?

idle owl
#

Yeah after I reconnected to the serial connection

solar whale
#

alls well that ends well πŸ˜‰

idle owl
#

No I meant it came back up. It's still not accepting input or letting me get to the REPL

umbral dagger
#

Ozone is pretty sweet

solar whale
#

oh - I'll admit I have had some odd issued with my serial connections - are you using scree to /dev/tty.usbmodemxxxx

idle owl
#

Yeah

umbral dagger
#

I have it connecting to the SAME54 board

idle owl
#

I'm wondering if I messed something up with all the j-link attempts.

#

And need to reflash it.

solar whale
#

hard to say, but it won't hurt - still if you are gettin goutput, I suspect it is working OK. I'm still not srue about the whole USB connection and how the host computers deal with it. I had to reboot by linux machine often to get it to work properly.

#

If it is not too painful try rebooting your Mac to see if that clears of the comm ports

#

I think I 've had enough fun for tonight - - good night - I hope you get the REPL back @idle owl

idle owl
#

@solar whale Thanks for all your help! Have a good one!

floral dagger
#

Took most of the day to get everything going, but I finally have a convincing neopixel candle running on circuit python woot!

idle owl
#

@floral dagger Nice job!

#

Reflashed and I have the REPL again!

floral dagger
#

nice!

meager fog
#

woo

#

hey kattni, i'm around if you need any m4 help

#

i can also get you set it up with it on arduino if you are interested

#

(there's a ton more you can do w/th eboard using arduino)

idle owl
#

Nice! Thanks for letting me know!

meager fog
#

im going to work on writing a device driver, this will be the first time i write a driver in python before i write it in arduino

idle owl
#

oh keen! I've never written a driver in either

meager fog
#

tony wrote a great driver guide

#

so im going to follow that

#

also its good practice for me, and will be faster than 'duino

idle owl
#

bonus on all counts

#

I'm currently writing cpx library examples of the code in the Introduction to CPX Guide you and JP wrote

meager fog
#

ow

#

er wow

#

hopefully not ow

#

thats awesome, its a good way to check that everything works

#

blinka πŸ˜ƒ

idle owl
#

πŸ˜ƒ

#

There's no equivalent to analog in/out in the API, but I have examples written up for everything else up to NeoPixel. Your NeoPixel example is entirely more invovled than the CPX NeoPixel API can do. I'm trying to figure out what I want to do with the example for that.

meager fog
#

can you expose the neopixels as a member of the cpx object?

idle owl
#

No, if I understand the question

meager fog
#

huh really, thats odd

idle owl
#

I might not understand the question

meager fog
#

in c++ you can just make an instance of the NeoPixel object a member of the parent class in a 'public' manner

#

then its basically identical to the neopixel object

#

just pre-instantiated

idle owl
#

in the express class it's ._pixels which I think means it can't be exposed in the code? Or am I way off here

meager fog
#

oof i honestly dont know

#

sry :?

idle owl
#

Hey I got one simple circle to work though!

meager fog
#

)

#

πŸ˜ƒ

#

k back to hackin, @ me if ya need somethin

idle owl
#

Will do, thanks!

meager fog
#

good luck

#

& godspeed πŸ˜ƒ

idle owl
#

thank you, you too! πŸ˜ƒ

drowsy geyser
#

@meager fog Thank you (and Phil) for the M4. I hope I can do enough with it to justify it! πŸ˜ƒ

umbral dagger
#

@meager fog what @drowsy geyser said

drowsy geyser
#

Woohoo! Blink works on D13. (It's the little things in life sometimes.) πŸ˜‰

idle owl
#

I left it going because it's so satisfying to have it work!

drowsy geyser
#

I was planning to do that, too, @idle owl !!!

meager fog
#

yay thanks folks - your help will be awesome as we start rolling out updates!

drowsy geyser
#

@meager fog I'm just happy to give back to you and the community!

#

@idle owl It looks like neopixel_write hasn't been ported to 3.0/M4 yet. If I try to import neopixel it throws an error. I guess tomorrow I set up the build toolchain so I can compile CP myself and then start looking at how hard it would be to get the NeoPixel support working.

idle owl
#

@drowsy geyser I noticed the same thing. That's what I was trying to do with the REPL when I realised I had lost it

drowsy geyser
#

Ahhh, I see.

#

scampers off to see if his REPL is still working.

#

Oh yeah, we're good.

idle owl
#

@drowsy geyser I think I messed with something when I kept trying with the j-link. I reflashed and it fixed it

drowsy geyser
#

That's entirely possible!

manic glacierBOT
#

yay safemode, here's a code snippet. no i should not be trying to read 0 bytes. but it also should not hardfault :D

Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit Metro M0 Express with samd21g18


    self.sgp_run_profile(["iaq_init", 0x2003, 0, 0.01])

    def sgp_run_profile(self, profile):
        name, command, signals, delay = profile
        print("running profile: %s, command 0x%x, %d, delay %f" % (name, command, signals, delay))
        with self._device:
    ...
meager fog
#

@slender iron made a new sensor driver, not too bad, 2 hours to write a fresh driver from datasheet

slender iron
#

@meager fog thats awesome! I saw you were doing python to start!

meager fog
#

yah mostly me following tony's guide

slender iron
#

perfect!

meager fog
#

i think once i get the hang of it, it'll be faster than arduino -

#

i have to do the bme680 - might try doing that in python first too

slender iron
#

awesome! I just demoed it to my friend on windows and it went well too

meager fog
#

demo'd what, circuitpython or writing driver?

slender iron
#

circuitpython

meager fog
#

k rad, im done with pcb rev. nite!

slender iron
#

good night @meager fog !

manic glacierBOT
drowsy geyser
#

Oh hey, that Ozone is a nice debugging tool. I wonder what the "evaluation purposes only" restriction interferes with. Is it worth getting the JLink Base in order to have the full version of Ozone available?

solar whale
#

@meager fog You mentioned arduino support for the Metro-M4 - If you are looking for additional testers of the Arduino support, I would be happy to check it out.

umbral dagger
#

@drowsy geyser I was wondering about that statement as well. I got the edu-mini partly to eval it with Linux. The propriatariness of Segger bugs me, but if it works well I will likely upgrade to the full/pro version eventually.

#

@drowsy geyser I do want to get things running with gdb. That’s the next step I guess.

solar whale
manic glacierBOT
umbral dagger
#

@drowsy geyser gdb from within emacs to be specific.

solar whale
#

@umbral dagger ooh - that brings back memories....

#

@slender iron One interesting thing I have noticed is that when connected to my MAC, I do not see the UNB errors from the Metro-M4 taht I saw on the linux box and raspberry pi. Not sure why but the Mac ssems to be more tolerant of the connection.

floral dagger
#

took the better part of a day and a half, but now my neopixel pumpkin can be controlled via adafruit io using circuit python 2.1

solar whale
#

@slender iron never-mind - spoke too soon - the errors are just different ```HoRNDIS: init: HoRNDIS tethering driver for Mac OS X, by Joshua Wise (rel8 final)
HoRNDIS: probe: probe: came in with a score of 60000
HoRNDIS: probe: probe: this composite device is not for us
AppleUSBInterface: family specific matching fails
AppleUSBInterface: family specific matching fails
AppleUSBInterface: family specific matching fails
AppleUSBInterface: family specific matching fails
USBMSC Identifier (non-unique): 0x239a 0x8015 0x100
AppleUSBInterface: family specific matching fails

solar whale
#

@slender iron another observation - When I try to use the J-Link - it sometimes says it can't halt the processor. What I have found to work involves a few steps that may or may not make sense. ```
Disconnect USB - leaving 9V power connected
doubletap reset to enter bootloader
then retry JLink and it is able to connect and halt the processor
I can then reconnect USB and resume

tidal kiln
#

hey @idle owl, have you done any work on tuple for touch yet?

drowsy geyser
#

Morning, everyone....

solar whale
#

only for 6 more minutes...

idle owl
#

@tidal kiln A little. I ended up scramblng to get play_file in and haven't gotten back to it.

tidal kiln
#

@idle owl ok. was hoping to put in some time today on drivers. was thinking of pr'ing that one.

split ocean
#

and again I thank you for that @idle owl :)

idle owl
#

@split ocean You're welcome!

split ocean
#

I may use both play_file and play_tone for the UFO, hoping to finish it up today.

idle owl
#

@tidal kiln You're welcome to it if you'd like. I was going to work on that and getting brightness into neopixel today.

drowsy geyser
#

@idle owl NeoPixel on 3.0 or NeoPixel on M4, or both?

idle owl
#

@drowsy geyser Neither. I'm working on the CPX API

drowsy geyser
#

Oh! Ok. I'll just go back to breakfast. πŸ˜ƒ

tidal kiln
#

@idle owl if you've already started on it, no worries then. i'm going to give priority to getting back to the ads1x15 lib anyway.

idle owl
#

@tidal kiln Ok sounds good. I'll probably need your help anyway, heh

#

@split ocean That's awesome!

tidal kiln
#

sure. bug me whenever. happy to help*.
(*if able to)

drowsy geyser
#

When someone has a sec, could you shoot me a link to the correct branch/release for CP 3.0 on the M4? I can't seem to "find" it.... I need to figure out how to build my own images.

idle owl
#

Those aren't already built?

solar whale
#

oops sorry that is the build - just a sec.

idle owl
#

lol ok. I was thinking I totally missed something.

drowsy geyser
#

πŸ˜ƒ Standing by. Thank you!

solar whale
drowsy geyser
#

AH! Enlightenment! Thank you!

slender iron
#

<@&370994983664091136> I forgot to mention that using the JLink while connected to USB is a tricky process and can mess with your USB bus. I power my metro separately and have a usb cable I can turn off and on. Once I hit a breakpoint I tend to turn the cable off to keep my computer happy.

idle owl
#

I really should have ordered the 9V plug, heh

umbral dagger
#

I wonder if the same thing is true under Linux

idle owl
#

@slender iron What USB cable do you use?

drowsy geyser
#

I have not had a problem under Windows, but I haven't worked extensively with it, either.

solar whale
#

@umbral dagger I think it is - I have had lots of problems under linux.

slender iron
#

@idle owl looking now

idle owl
#

Thank you

slender iron
#

I didn't expect you all to pick up the jlink stuff. πŸ˜ƒ I thought it'd only be for emergency bootloader repair

drowsy geyser
#

I thought it was a strong suggestion. πŸ˜ƒ

idle owl
#

Really? If you give a nerd a j-link....

slender iron
#

yup, my mistake πŸ˜ƒ

drowsy geyser
#

Not a mistake - the JLink is way cool....

slender iron
#

I haven't actually tested it with my setup though. The cable I have is something I got while at google

idle owl
#

His mistake was assuming we wouldn't try to use it.

slender iron
#

yeah, having jlink skills is good πŸ˜ƒ

idle owl
#

@slender iron Ok thanks

slender iron
#

now you could implement busio @drowsy geyser πŸ˜‰

drowsy geyser
#

True, @slender iron ! I was going to pick on the low-level neopixel support first, though.

#

I suppose busio would be more helpful.

formal plover
#

Oh wow, we have a special group now

slender iron
#

@drowsy geyser check with @timber lion he got neopixel going on the 21 again and was gonna look at the 51 once he got it

drowsy geyser
#

Will do! Thanks!

formal plover
#

Group within a group. It's a groupception

idle owl
#

@formal plover Yeah hidden role so we can tag all the testers if needed.

slender iron
#

busio is actually pretty tough too

#

its next on my list once I have the uf2 bootloader going

#

(thats why you need the jlink, in case I break the bootloader)

drowsy geyser
#

Gotcha. Say, off topic, how's the toaster oven?

slender iron
#

still in pieces. didn't actually work on it yesterday

drowsy geyser
#

Ah, ok.

slender iron
#

got a flu shot, shopped for groceris, played PUBG then dinner with a friend

#

it was good πŸ˜ƒ

formal plover
#

πŸ˜ƒ

idle owl
#

Excellent!

drowsy geyser
#

Life is important.

slender iron
#

yup yup, gonna spend an hour or two looking at the bootloader and then head ot the farmers market

brisk cairn
#

I'm trying to erase the flash from the Arduino IDE on a circuit playground express.

#

When I run "flash_erase.ino

#

I get hair message.

#

I get an error message

#

Sorry… Dictation software misunderstands me sometimes πŸ˜ƒ

slender iron
#

no worries @brisk cairn ! whats the error message say?

brisk cairn
#

Arduino: 1.8.3 (Windows 10), Board: "Adafruit Circuit Playground Express"

flash_erase:33: error: 'SS1' was not declared in this scope

#define FLASH_SS SS1 // Flash chip SS pin.

                    ^

C:\Users\Chris.cy\Documents\Arduino\libraries\Adafruit_SPIFlash\examples\flash_erase\flash_erase.ino:36:25: note: in expansion of macro 'FLASH_SS'

Adafruit_SPIFlash flash(FLASH_SS, &FLASH_SPI_PORT); // Use hardware SPI

                     ^

flash_erase:34: error: 'SPI1' was not declared in this scope

#define FLASH_SPI_PORT SPI1 // What SPI port is Flash on?

                    ^

C:\Users\Chris.cy\Documents\Arduino\libraries\Adafruit_SPIFlash\examples\flash_erase\flash_erase.ino:36:36: note: in expansion of macro 'FLASH_SPI_PORT'

Adafruit_SPIFlash flash(FLASH_SS, &FLASH_SPI_PORT); // Use hardware SPI

                                ^

exit status 1
'SS1' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

#

I need to know the pin number for the flash_ss

#

That sketch apparently is defaulted for feather M0

slender iron
#

ah, I'm an arduino newbie

brisk cairn
#

I can't believe you are a newbie at anything Scott πŸ˜ƒ

slender iron
#

I am at a lot of things. Thats how I can focus on others. πŸ˜ƒ

#

the pin is PB22 on the mcu

solar whale
brisk cairn
#

My original problem is I tried to put Circuit Python 2.1 on a circuit playground experience that was running 1.0 or perhaps even 0.9 something

idle owl
#

Try the one @solar whale posted. If you're trying to put CircuitPython on it, that's what you need.

brisk cairn
#

For some reason a control-C would not stop the previous running Circuit Python program. And loading a new code.py had no effect.

#

I will give that a try.

slender iron
#

@brisk cairn with 2.1?

brisk cairn
#

That's right I loaded "adafruit-circuitpython-circuitplayground_express-2.1.0.uf2". A circuit playground express many continued to run an old IRLibcp that I have looted under Circuit Python 0.9.

#

It would not load any new code. So I figured I needed to switch back to Arduino mode, erase the flash and reformatted, and then reload the 2.1.uf2.

slender iron
#

ah ok. yeah, erasing the flash is good way to get back to a known state

tidal kiln
#

which loading an arduino sketch will do. any sketch.

slender iron
#

@tidal kiln not for an express board

tidal kiln
#

oooohhhh

#

been working with the trinket for too long

slender iron
#

πŸ˜ƒ

manic glacierBOT
meager fog
#

@solar whale heya you around?

solar whale
#

@meager fog yes

meager fog
#

ok u wanna get arduino m4 going? are you on mac or win or lin?

solar whale
#

linux or mac - both available

meager fog
#

ok lets try mac because i know how to do that

#

on your mac get IDE 1.8,5+ installed

solar whale
#

just installed 1.8.5 is there a + - do I need latest build?

meager fog
#

no just latest

#

k if you have adafruit samd support in BSP manager, remove it

solar whale
#

starting up arduino - slow...

#

ok removed adafruit SAMD - still have arduino samd

meager fog
#

gr8

#
  1. make a folder in your ArduinoSketchFolder called "hardware", then make a folder "hardware/Adafruit"
  2. in "hardware/Adafruit" git clone https://github.com/adafruit/ArduinoCore-samd, and rename the folder "samd"
  3. Check you now have "ArduinoSketches/hardware/Adafruit/samd/boards.txt"
  4. git checkout samd51, and check boards.txt contains "# Adafruit Metro M4 (SAMD51)"
solar whale
#

on my MAc, my sketches are jus in Arduino - is that OK?

#

all set in Arduino/hardware/Adafruit/samd

meager fog
#

yah

#

whatever it is called

solar whale
#

OK - all set to continue

meager fog
#
  1. Now we need to replace CMSIS! Download https://github.com/adafruit/ArduinoModule-CMSIS-Atmel/archive/master.zip and unzip
  2. Find your Arduino CMSIS, in Mac its "~/Library/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS" version # may vary, you'll need "Go to folder..." feature in the Finder to get to " ~/Library/Arduino15" as it is hidden. In Windows it is "C:\Users\yourusername\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.1.0\CMSIS" Inside is a folder named Device
  3. Inside the downloaded CMSIS zip, go into the CMSIS-Atmel/CMSIS folder, you should see a folder named Device. DRAG THE DEVICE FOLDER ONLY from the zip to your arduino Library folder so that Device is merged with Device. It will replace a bunch of file.
  4. You will also need to replace bossac. Go here https://github.com/adafruit/BOSSA/releases and download either windows exe or mac app of latest bossac. unzip
  5. Replace the binary at "~/Library/Arduino15/packages/arduino/tools/bossac/1.7.0/bossac" or "~\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.7.0\bossac"
#

its complex because its a whole new arch and Arduino SAM is not easy to update - hopefully we will be able to make it fully a BSP, might require an "Adafruit SAM" package (which i'd like to avoid but...)

idle owl
#

That got over my head rather quickly. I've used Arduino once.

meager fog
#

its not hard, just...detailed πŸ˜ƒ

solar whale
#

I don't want to replace device - but merge files

meager fog
#

yah

#

just dont put Device in Device

solar whale
#

ok but if I pit it in CMSIS it says one alredy ther OK to replace. Is that OK to do?

meager fog
#

ah

#

thats the point

#

you want to merge the folders

solar whale
#

ok

meager fog
#

but because arduino uses a version # you have to get to the Device subfolder

#

otherwise you dont do the merge properly

solar whale
#

ok - shoudl be all set

#

wait - need to do bossac

slender iron
#

haha! UF2 works!

meager fog
#

@slender iron niiiiiiiiiiiiiiiiiiiiiiiice

#

do you have commit privs?

slender iron
#

I think so but I'll probably do it as a PR

meager fog
#

totez

solar whale
#

OK - all set bossac updated

meager fog
#

good work - that was faster than expected!

slender iron
#

I reorganized it πŸ˜ƒ

#

I didn't redo the usb stack which helped

meager fog
#

@solar whale thats it! try Blink πŸ˜ƒ

#

@slender iron +4000 points to atmel for mostly-keeping-periphs-the-same

solar whale
#

wooohoo - giving it a try

slender iron
#

yup yup

meager fog
#

@slender iron toss me a .bin when ya like and ill update my m4's

idle owl
#

@slender iron Yay!

slender iron
#

I'm still testing it

#

non-debug is finnicky

meager fog
#

np

solar whale
#
Sketch uses 11416 bytes (2%) of program storage space. Maximum is 507904 bytes.
An error occurred while uploading the sketch
No device found on cu.usbmodem142431
#

am I missing something

meager fog
#

turn on verbose upload

solar whale
#

ah - I forced it into bootloader (doubletap) and it worked !!

meager fog
#

gr8!

solar whale
#

it blinkds

meager fog
#

huzzah

solar whale
#

Thank you - I'll explore

meager fog
#

sure, everything should work

#

so if something doesn't, open up an issue

solar whale
#

let me know if there are particular things you want tested.

meager fog
#

if you want to use the DACs, they are on A0 and A1 but you have to short the jumper underneath the board

solar whale
#

the one ad the d in adafruit?

meager fog
#

i think peripherals are most useful to test - I2C, SPI, ADC, DACs...I2S isn't ready yet

#

yah

#

grab your favorite shield or sensor, check if it works πŸ˜ƒ

solar whale
#

great - lots to try.

meager fog
#

it is very very fast

#

neopixel is ported so i know you can try that

#

the only annoying thing is the flash is so huge, it takes a while longer to upload sketches

#

because it has to erase the entire chip

solar whale
#

I can live with that πŸ˜‰

meager fog
#

i cant even comprehend when we get to the 1MB flash chip

tidal kiln
slender iron
#

@tidal kiln I'll take a look tomorrow

solar whale
#

@meager fog do I need something special for neopixel - I tried strandtest and got``` Users/jerryneedell/Documents/Arduino/libraries/Adafruit_NeoPixel/Adafruit_NeoPixel.cpp: In member function 'void Adafruit_NeoPixel::show()':
/Users/jerryneedell/Documents/Arduino/libraries/Adafruit_NeoPixel/Adafruit_NeoPixel.cpp:1659:3: error: 'Pio' was not declared in this scope
Pio *port;
^
/Users/jerryneedell/Documents/Arduino/libraries/Adafruit_NeoPixel/Adafruit_NeoPixel.cpp:1659:19: error: 'port' was not declared in this scope
Pio *port;
^
/Users/jerryneedell/Documents/Arduino/libraries/Adafruit_NeoPixel/Adafruit_NeoPixel.cpp:1663:29: error: 'pmc_set_writeprotect' was not declared in this scope
pmc_set_writeprotect(false);
^
/Users/jerryneedell/Documents/Arduino/libraries/Adafruit_NeoPixel/Adafruit_NeoPixel.cpp:1664:43: error: 'pmc_enable_periph_clk' was not declared in this scope
pmc_enable_periph_clk((uint32_t)TC3_IRQn);
^
/Users/jerryneedell/Documents/Arduino/libraries/Adafruit_NeoPixel/Adafruit_NeoPixel.cpp:1666:5: error: 'TC_CMR_WAVE' was not declared in this scope
TC_CMR_WAVE | TC_CMR_WAVSEL_UP | TC_CMR_TCCLKS_TIMER_CLOCK1);
^
/Users/jerryneedell/Documents/Arduino/libraries/Adafruit_NeoPixel/Adafruit_NeoPixel.cpp:1666:19: error: 'TC_CMR_WAVSEL_UP' was not declared in this scope
TC_CMR_WAVE | TC_CMR_WAVSEL_UP | TC_CMR_TCCLKS_TIMER_CLOCK1);
^

meager fog
#

oh wait i think i didnt bump the version

#

can you do a git pul from within the adafruit_neopxiel folder

#

let me know if that works

#

if it does ill push

solar whale
#

sure - - trying it now

meager fog
#

er ill do a release

slender iron
#

@meager fog want a bin to load with a debugger. I haven't fixed the self update code yet or actually tested bossac though I think it'll work

meager fog
#

sure

#

why not #YOLO

solar whale
#

@meager fog works great!!

meager fog
#

@solar whale thank you! i'll push a release. keep on tryin things - if im not here file an issue

#

that will be the most helpful thing

slender iron
#

use a debugger to load. I'll do the self updater later if I have time

solar whale
#

I'll be happy to - Thanks for the help and providing the test board!

slender iron
formal plover
#

Woot woot UF2! Nice job @slender iron

slender iron
#

thanks! Its very untested still but worth a shot.

solar whale
#

@meager fog cool! mcp9808 temp sesnor works fine!

meager fog
#

yay

manic glacierBOT
meager fog
#

jlinkin now

#

wait shoot i think i cant jlink this

idle owl
#

@meager fog How do you use j-link? I don't mean that in a general teach me sense, I mean how do you personally use it... commandline or Ozone or whatever else there is...

meager fog
#

from within atmel studio

idle owl
#

Ah

slender iron
#

ah, I'm fixing up the self updater now

meager fog
#

yah

#

i dont want to gut my arduino zero if i can avoid it

slender iron
#

yeah, I understand that

#

I'm not having jlink connectivity issues anymore

formal plover
#

We need shirts. "bruh, do you even jlink?"

meager fog
#

im in atmel start - not a good way to have a sunday

solar whale
#

@slender iron I the new bootloader something we should try? If so - just load via jlink?

slender iron
#

sure if you are feeling adventurous @solar whale

#

gdb may need the elf actaully

solar whale
#

so just downlaod that to the board - and cross fingers? any special setup

slender iron
#

yup just load it

#

and then quit out. jlink doesn't like the double tap

#

it should actually just run the code afterwards I think

idle owl
#

Also trying it.

#

Ozone isn't playing along.

solar whale
#

Ozone worked for me. loaded and now at METROBOOT!

idle owl
#

Oh snap! It claimed it didn't work but it did!

#

I used the .bin file

#

It probably didn't claim it didn't work. I'm sure I didn't understand the results.

#

@solar whale Did you use the .elf or .bin file?

solar whale
#

I'm trying to load CP image, ut it is not working - keep rebooting to NETROBOOT

#

I used .elf

idle owl
#

Mine reboots to the bootloader as well.

solar whale
#

info_uf2.txt ```UF2 Bootloader v1.23.0 SFHR
Model: Metro M4
Board-ID: SAMD21G19A-Metro-v0

idle owl
#

Same.

solar whale
#

able to load image via Ozone

slender iron
#

I had to fix the uf2 generation too

#

so the circuitpython uf2s you build are likely wrong

solar whale
#

ah

slender iron
solar whale
#

cool - doubletap brings up METROBOOT!

umbral dagger
#

I can't wait for my board to arrive tomorrow... I feel like I'm missing all the fun!

solar whale
#

taht UF2 works!!

idle owl
#

@slender iron It worked!

slender iron
#

ok, wanna review my PR?

#

its pretty straightforward

idle owl
#

Sure

slender iron
#

then travis' builds will work

idle owl
#

Do I just say tested and works?

slender iron
#

and sanity check the makefile changes

idle owl
#

Ok

solar whale
#

hmm REPL not working for me - won't take input

slender iron
#

I think thats a debug build

solar whale
#

crashes if I use ~D

#

contro;D

slender iron
#

weird

#

I think it works for me

#

is it: Adafruit CircuitPython 3.0.0-alpha.0-25-ga800a25e8-dirty?

solar whale
#

reloading

idle owl
#

REPL working for me as well

solar whale
#

Adafruit CircuitPython 3.0.0-alpha.0-25-ga800a25e8-dirty on 2017-10-20; Metro M4 Express with samd51j19
hapier now

#

working now

slender iron
#

huh, weird that it didn't work before

meager fog
#

@slender iron im sorta in jlink hell. sees the chip, cannot halt it

slender iron
#

this is why its good to have earlier testers πŸ˜ƒ

#

oh no! I've been there recetnly @meager fog

meager fog
#

do you know what you did?

solar whale
#

We all have!!

slender iron
#

to get out of it?

meager fog
#

to get it to halt yeah

slender iron
#

hacked arduino zero

#

what did you flash it with?

meager fog
#

originally? an EDBG

manic glacierBOT
slender iron
#

did you try to load the bootloader and now it won't halt?

meager fog
#

havent even gotten that far

#

this is just the initial connect

slender iron
#

oh no!

#

with a jlink instead of edbg?

meager fog
#

yeah

#

did you eventually get the jlink to connect to the chip

#

or is EDBG the only anwer

slender iron
#

I did once I loaded the uf2 on it

meager fog
#

weird

slender iron
#

I'm not sure the arduino bootloader has good clocks

meager fog
#

well, its worth having an EDGB - ill gut a zero

idle owl
#

@slender iron Do I need to click "review changes" on the file itself and approve it?

slender iron
#

yes please

idle owl
#

ok

slender iron
#

so I'm official πŸ˜ƒ

idle owl
#

Got it!

solar whale
#

@meager fog I have been able to get out by doubletapping into bootloader then connecting JLink

meager fog
#

oh yahh!

#

that worked thanks

manic glacierBOT
meager fog
#

i was just about to kil this zero

solar whale
#

Great!

slender iron
#

@meager fog did you have an arduino sketch or circuitpython flashed after the bootloader?

#

thanks for the review @idle owl now the next uf2 from travis should actually work

meager fog
#

@solar whale are you using jlinkexe or something else

solar whale
#

I've been using Ozone

idle owl
#

@slender iron As in I would be building that myself?

slender iron
#

@idle owl if you update to latest master and build it should work too

idle owl
#

I've never built anything. So that's something I have to learn. πŸ˜ƒ

meager fog
#

ynow

tidal kiln
#

just type make πŸ˜€

meager fog
#

why risk it - ill try ozone

idle owl
#

That's what I'm using

slender iron
#

make BOARD=metro_m4_express from within circuitpython/atmel-samd

idle owl
#

Oh. That's easy.

meager fog
#

@slender iron success. ozone was key

slender iron
#

πŸ‘

meager fog
#

ill test it w/arduino

slender iron
#

🀞

solar whale
#

hmmm - just made new build - - boots to CIRCUITPY, but RELPL not working....

tidal kiln
#

@idle owl yep. once you got a good makefile. tons of magic in there.

solar whale
#

it dies and unmounts after a few minutes

slender iron
#

@solar whale sounds like its hanging somewhere

#

are you loading through the debugger?

solar whale
#

no - copied UF2

#

i pulled the updates

#

I think

slender iron
#

using the debugger you should be able to get a backtrace to where its stopped

solar whale
#

will try

slender iron
#

if you are powering separately you'll want ot unplug usb to save your comp from confusion

solar whale
#

It is working with Jlink loaded version!

#

may be issue with UF2 - possible I missed something in the update - will look

#

say I'm up to date

slender iron
#

@solar whale is the jlink loading it at start address 0x4000?

solar whale
#

where can I check?

slender iron
#

when using gdb it usually status in the status after load

solar whale
#

J-Link: J-Link: Flash download: Bank 0 @ 0x00000000: 2 ranges affected (40960 bytes)

#

disconected Jlink - still boots OK

#

rebuiling - will try again @idle owl did it work for you?

idle owl
#

I haven't tried building one myself yet

solar whale
#

not happy with .uf2 files I build.

meager fog
#

@slender iron Metro M4 VID 0x239A PID 0x0020 # bossac only bootloader
PID 0x0021 # UF2 bootloader
PID 0x8020 # arduino
PID 0x8021 # circuitpython

#

fyi πŸ˜ƒ

slender iron
#

kk, updated them @meager fog

meager fog
#

thanks - it doesnt matter for lin/mac - but windows can srsly fall over if you mix up PIDs with different descriptors. askhowiknow

slender iron
#

hrm, thats good to know. I want to support dynamic descriptors at some point...

meager fog
#

it is ok if the MI varies

#

just not if there's no MI

solar whale
#

@slender iron I have to go - social duties!! Hopefully something wrong on my end. I'll try it again later or tomorrow. Great progress today!

slender iron
#

thanks for your help @solar whale!

#

@meager fog what do you mean by MI?

meager fog
#

lol bossa destroyed the bootloader or somethin

#

the USB VID has a MI version

idle owl
#

@solar whale thanks for your help! have a good one!

solar whale
#

No problem - happy to be part of it all.

slender iron
#

@meager fog the boot protection hasn't been set on these has it?

meager fog
#

umm no

#

how else would be able to update the boards πŸ˜„

slender iron
#

πŸ˜ƒ the uf2 self updater unsets it, flashes and sets it

meager fog
#

im loading the bootloader.bin

#

usin' ozone?

slender iron
#

on the 51 it looks cool because you can disable it temporarily

#

yeah, that makes sense

#

at some point we want it on though

solar whale
#

@meager fog just treid to go back to arduino - bu not able to load - is this a bproblem with tnew bootloader?

meager fog
#

yah ^^^

slender iron
#

could be @solar whale I haven't tested it with arduino

#

@solar whale was the bootloader active? did you double tap before uploading?

meager fog
#

yah i got this

#

man cannot paste

#

one sec

solar whale
#

yes - now won't got to bootloader

slender iron
#

weird

#

I don't know what read word is trying to do

meager fog
#

i can have dean take a look

#

since he is bossa-master

slender iron
#

is it a bootloader PID issue?

solar whale
#

I reloaded bootloader.elf and got back to METROBOOT. I wait for update before trying arduino again.

#

Got CP 3.0 running again - gotta run - Thanks for all the fun and help. @meager fog let me know if you learn how to get arduino working again

slender iron
#

@meager fog it looks like that dump succeeded later

#

bye @solar whale

meager fog
#

you'll need to reload the bootloader w jlink

solar whale
#

ok - use taht one for arduino

slender iron
#

I've gotta take a break for now

#

shower + farmer's market πŸ˜ƒ

meager fog
#

@slender iron i dont hink its a PID or USB issue

slender iron
#

then cooking

idle owl
#

Sounds delightful

meager fog
#

i know some addresses changed

#

so we just have to #ifdef em

slender iron
#

k, dean's help would be appreciated. I want to redo their javascript scripts too

#

their = uf2 repo

#

using node js for basic file manipulation is crazy IMO

tidal kiln
#

@slender iron hurry. before all the eggs are sold out.

meager fog
#

@slender iron lol - swapping big endian to little endian requires 290 node packages

#

thats 'correct' bossa output

#

@slender iron if you pull your changes to our uf2 repo

slender iron
#

πŸ™„

meager fog
#

then dean can make changes

#

i should fastforward it tho, or you can

#

no rush

#

do it later πŸ˜ƒ

slender iron
#

yup yup, we can do that this week

#

kk, later all

idle owl
#

@slender iron later!

tulip sleet
#

@slender iron we have lots of relatives in town for a cousin's bat mitzvah. I'll be back in the swing of things Monday.

slender iron
#

@tulip sleet no worries! Glad you are taking a break on the weekend. πŸ˜ƒ

idle owl
#

@split ocean I meant to tell you, I was able to update the last code snippet the next day. So whatever the issue was it finally cleared up. πŸ˜ƒ

split ocean
#

@idle owl which issue was that?

idle owl
#

@split ocean It wouldn't let me update anything on one page of the guide.

#

And I was trying to get all the code linked to github

split ocean
#

Oh, yes, that. Glad to hear it! This is often the case with odd behavior on guides, they tend to just go away ; )

idle owl
#

Every other time it's gone away in minutes though, not hours. So I was concerned πŸ˜ƒ

split ocean
#

Or Justin and the gang fix them in the background

idle owl
#

Or days, in the end. πŸ˜ƒ But it's fixed!

glacial bronze
#

Woo, picked up a CPE from Micro Center. Later I'll put CP on the CP

idle owl
#

Nice! Our Microcenter never carried the Express, just the Classic.

hollow tartan
#

Is arm gcc and atom what I need for esp8266 development on Windows 7?

idle owl
#

That's a solid dev combo in general, but I haven't worked specifically with the ESP8266.

glacial bronze
#

Later this week, I'd like some help getting a Git account set up and whatnot so I can help contribute to the low-hanging fruit of CP

idle owl
#

Definitely! We'll be around, just ask!

hollow tartan
#

Circuit Python is compiled from C or C++ ?

idle owl
#

C

hollow tartan
#

tu

idle owl
#

@tidal kiln Touch iteration complete. That was a tough one πŸ˜ƒ For me anyway. I had a lot of help.

tidal kiln
#

@idle owl cool. what was tough about it?

idle owl
#

I'm still pretty new to python.

#

I thought I had it figured out but I didn't understand everything that needed to happen, so I was trying to get my initial code to do it, and I needed a lot more with it.

#

Learned a lot though! That's what I'm usually hoping for with doing stuff for this library.

tidal kiln
#

keen

#

is the code in the repo?

idle owl
#

Not yet, I'm still cleaning it up. And it needs docs, but I can drop the express to you and explain it before I do all that.

#

It'll be in my repo first anyway, I have it forked and do pull requests which likely won't be looked at until tomorrow. But I can get it to you before that.

#

I was able to paste in your examples as is, and they work. I assume as you expected them to. But it required two functions - one for returning numbers, and one for returning the pad name (A1 etc). So cpx.touched works like the first two, but the third one requires, at the moment, cpx.touched_padnames which I want to shorten up.

tidal kiln
#

i was thinking it would just be one or the other

idle owl
#

lol!

#

I did both πŸ˜ƒ

#

I didn't realise it was an 'or' request. It meant I learned more though! I'm actually laughing out loud over here.

tidal kiln
#

all good. great way to learn. sorry for confusion.

idle owl
#

Don't be sorry! Should we go with only one then? In my mind, you had a specific use-case for having them return numbers, but I really like having them return the pad names since it's labeled on the board. That's why I did both.

tidal kiln
#

seems like it's a design decision - so i'd let scott decide

idle owl
#

He'll tell us to decide. He's left it almost entirely up to me, and then gives feedback later if I'm way off, which I've been a little off once and that was it.

#

I think it's a matter of what we want to use

tidal kiln
#

i kind of like the pad names

idle owl
#

ok keen

tidal kiln
#

what you see on the board = what you use in code

idle owl
#

Yeah that's what I went with previously, I thought it made the most sense

tidal kiln
#

did you use a dictionary at any point?

idle owl
#

I don't think so? I can paste what it looks like. Hold on.

tidal kiln
#

k

idle owl
#

This is in init: self._pin = (board.A1, board.A2, board.A3, board.A4, board.A5, board.A6, board.A7)and this is the function: def touched(self): self._touch = tuple(touchio.TouchIn(p) for p in self._pin) return ['A{}'.format(i+1) for (i, v) in enumerate(self._touch) if v.value]

#

There's another one in express right now for numbers, but they're essentially the same

hollow tartan
#

atom says to first download and install MinGW . is that correct? is there an adafruit learn guide?

tidal kiln
#

@hollow tartan a learn guide for installing atom?

hollow tartan
#

I am trying to get started helping fix Circuit Python on Win 7.

tidal kiln
#

@idle owl looks ok. only works with consecutive numbered pins. (classic wasn't like that)

hollow tartan
tidal kiln
#

that one's good too @hollow tartan

#

and you're returing a list [], not a tuple ()

idle owl
#

Hmm

#

It works with () too.

#

Or instead rather.

tidal kiln
#

really? i'd think the list would work too.

idle owl
#

I'm probably missing what your point was. Did you mean for me to change it to a tuple instead of a list?

tidal kiln
#

that's what i'd suggest

#

it's a fixed sequence of info

idle owl
#

Ah ok yeah, then I was saying I changed the [] to () and it seems to work the same.

#

Riiight.... yeah we talked about that earlier

tidal kiln
#

oh. yeah. they are very similar.

idle owl
#

We changed something else from [] to () for the same reason

tidal kiln
#

it's a pretty subtle thing - the difference

#

the big one is mutability

idle owl
#

Ah

#

() immutable, [] mutable, right?

#

Although now I feel like I remember there being some [] that were one or the other. That it wasn't so black and white.

tidal kiln
#
>>> foo=[1,2,3]
>>> foo.append(4)
>>> foo
[1, 2, 3, 4]
>>> foo[2]=5
>>> foo
[1, 2, 5, 4]
#

but try it with a tuple:

#
>>> foo=(1,2,3)
>>> foo.append(4)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'tuple' object has no attribute 'append'
>>> foo[2]=5
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'tuple' object does not support item assignment
idle owl
#

And since it exists and we're just using it, we don't need or want mutability.

#

Right?

tidal kiln
#

that my thinking at least

idle owl
#

No it makes sense. Like I said we changed something else for the same reason, I think we just got onto this and glossed over that detail

tidal kiln
#

that's how i typically make the call, "is this a fixed chunk of info?"

#

but i'm sure there's more examples of why one vs. the other

idle owl
#

This general rule makes sense to me.

tidal kiln
#

another obvious one is when dealing with color, (r,g,b) vs. [r,g,b]

#

and i mentioned a dictionary, as that could provide a useful tool to map between ints and strings

#

or anything and anything, really

idle owl
#

ah

#

I've never used one

#

that I'm aware of anyway. Could have been built into something I used

tidal kiln
#

here's a good example:

#

configures gain for the ADC

idle owl
#

oohhhh... ok

tidal kiln
#

the ADC regsiter just wants to see a bunch of 1s and 0s

#

but it's easier to think in terms of the resulting gain 2/3, 8, 16, etc.

idle owl
#

right

tidal kiln
#

then you can use it like

config |= ADS1x15_CONFIG_GAIN[gain]
#

where gain can be set to 8 or 16 and not "what was the bit pattern again for 8 or 16???"

idle owl
#

ah yeah

tidal kiln
#

so for you, was thinking you could map ints to strings:

TOUCH_PADS = {
    1 : 'A1',
    2 : 'A2',
    # etc
}
idle owl
#

I had thought about doing it that way too, but we came up with the offset in the current code

tidal kiln
#

doesn't look all that useful when the ints map straight to the string

idle owl
#

Oh! Right.. because I thought you wanted both. So I couldn't do that, or it would always return the padname as a constant

#

I need to food, my brain is getting melty. Will you be around later?

tidal kiln
#

maybe. but also no worries.

#

what you have works, so maybe good enough

idle owl
#

I still want to understand the way you're suggesting. Learn something else new today! I'll ping you later, if you're around we can continue. if not, all good either way! Later!

tidal kiln
#

ok. go food. later.

glacial bronze
#

AAAAAAAAAAAAAA

#

The Circuit Playground makes noises when you plug it in

tidal kiln
#

wall-e boot sound?

glacial bronze
#

I guess. I jumped a mile

tidal kiln
#

your robot friend is alive and happy!

#

oh wait. i think it's a mario coin sound.

cunning crypt
#

Keep it that way. We don't want a robot revolution quite yet

tidal kiln
#

been a while since i booted a fresh one

glacial bronze
#

I will say, it's a very nice board. I'm impressed with it. It's like the perfect all-in-one education board exactly like I wanted a few years ago when I was first getting started

#

My only pet peeve is that it doesn't have 12 dotstars so I can port my neopixel pocket watch project to it

cunning crypt
#

The Circuit Playground has always sounded great, but my desires are always more... direct. If it doesn't have a direct purpose for me, I tend to not buy it.

glacial bronze
#

Yeah, I hear ya

cunning crypt
#

Then again, I do tend to learn backwards. "I want to do this. How do I do this. OK, and what will I need for that..."

glacial bronze
#

I got it so I could contribute to CircuitPython, but I went through that process to actually get where I am now

cunning crypt
#

I'm going to be getting one soon, so I can begin writing up examples for it

#

And/or adapting existing examples

glacial bronze
#

but there was a period where I really wanted to just... experiment with different modules and sensors and outputs to just see how they fit together

#

and this is a lot cheaper than the oodles of breadboard crap and Chinesium breakout boards I got and destroyed

cunning crypt
#

Mmm chinesium

#

Chinesium is fantastic for when you want to push stuff to see how far it'll go

tidal kiln
#

just so you know - contributing to CircuitPython doesn't have to be done with the Circuit Playground Express

glacial bronze
#

I know, but I primarily want to work on examples, too, and the only other board I had on hand was an ESP8266 WeMos D1 mini, and CP isn't mature there

cunning crypt
#

@tidal kiln This is true, but the Circuit Playground has a LOT of things on it which can be useful for contributing

tidal kiln
#

for sure. just wanted to make sure you didn't think that was the only hardware.

glacial bronze
#

There was a Feather M0 BLE there that I almost got, but that's more like an "I have a project" board

cunning crypt
#

Oh, no. I have an Adalogger, two M0 feathers, and an M0 Express feather. Oh, and a bunch of ESP8266 boards.

glacial bronze
#

They didn't have any Trinket M0s which made me sad

cunning crypt
#

Funny story about those - I managed to give myself an error when using those, and looking up the error led me to "Well, you bricked it!" So I bought a few more, then did it again, etc

glacial bronze
#

I love Trinkets. I have like 6 and then another literal dozen DigiSpark boards, all gotten on sale

cunning crypt
#

Turns out, it was just a wire to the wrong GPIO

glacial bronze
#

and the M0 version just makes me weak at the knees for all the cool stuff it does at a similar power draw and more pins available

cunning crypt
#

Myself? I have an inherent desire to want ALL of the pins broken out.

#

And knowing that a significant portion of the pins on the trinket are "Wasted" annoys that completionist part

glacial bronze
#

Yeah, I picked up a Xadow Duino board that I was really hoping to hack... it's an ATMega 32u4 for some kind of prebuilt modular RGBLED IoT system

#

but it literally just has i2C broken out, plus one pin for driving Neopixels

cunning crypt
#

Minimalism!

#

But with I2C, you can do SOOOOO much

glacial bronze
#

Why would you even use a 32u4 for that?

cunning crypt
#

...USB

#

From what I remember when I was looking at micros, the 32u4 was inexpensive, easy to acquire, and already supported with Arudino, and has native USB support

glacial bronze
#

Is it that much cheaper than the Trinket/Gemma ATTiny gimmick?

cunning crypt
#

Well, no

#

But ATTinys don't have native USB support.

#

Native USB means you don't have to put in extra hardware for serial conversion

glacial bronze
#

Trinkets and Gemmas and DigiSparks and whatnot bit-bang USB

cunning crypt
#

Which can be costly and large. Especially important when you're making 10000 of them.

glacial bronze
#

It's doable, at least well enough

cunning crypt
#

Yeah, but that's effort.

glacial bronze
#

They can't do serial over USB but they can do bootloading

#

But it's already been done! Just fork the Gemma bootloader instead of the Leonardo bootloader...

#

this really doesn't matter

#

I picked up a 32u4 clone board for $3 after this Xadow thing disappointed me

#

but dang if it doesn't make me nerd-rage!

cunning crypt
#

@glacial bronze Not that simple. Looks like you need a Vendor ID/Product ID to use the USB stuff

#

Which is... $3500-$4000 ish. Not a huge amount of money for a big company, but it's paperwork, and adhering to standards.

#

You know how well Chinesium likes to adhere to standards.

glacial bronze
#

Ech. I guess that's fair

cunning crypt
#

Who knows, though. Maybe they just got a sweet deal on 32u4s

tidal kiln
#

@glacial bronze the newer Trinket M0 and Gemma M0 have hardware USB (not bit banged)

glacial bronze
#

Yeah I know. I was being imprecise

tidal kiln
#

well, you did say attiny, and that was true in that case.

hollow tartan
#

do I want a) atom , b) pythonic atom, or c) atom ide ?

cunning crypt
#

I've never used Atom

#

How is it?

hollow tartan
#

what did you use when compiling Circuit Python or a python library?

cunning crypt
#

I write in Editra. Sometimes Notepad if I'm doing something quick and dirty

#

Great thing about Python is it doesn't need compiling

sick creek
#

VS Code is cool too

#

with internal terminal where you can write extensions

#

if you like notepad editor

glacial bronze
#

Notepad++

sick creek
#

I used notepad++

#

instead of using notepad++ i use vscode now

cunning crypt
#

I like Editra, but it is old. And doesn't look like it's active. So eventually it will stop working

sick creek
#

VS Code is part of visual studio family

#

what is close to atom

tidal kiln
#

@hollow tartan where did you see those flavors of atom?

hollow tartan
#

"over-whelming" + " more than 31" + "omg"

solar whale
#

That is did I need to install this somewhere?

hollow tartan
#

Failed to add an "Open with Atom" context menu in the Explorer and make Atom available for association with files using "Open with...".

drowsy geyser
#

Say, what's the right command line for building CP for the M4? I'm using "make BOARD=metro_m4_express V=2" but I'm getting an error "cc1: error: -Werror=lto-type-mismatch: no option -Wlto-type-mismatch" I've been looking at this for a while and can't figure out the right option to avoid this error....

#

(Ubuntu Bash environment natively on Windows 10, btw)

tidal kiln
#

make BOARD=metro_m4_express is what was suggested earlier. maybe try with out V=2?

drowsy geyser
#

Yup, tried that. No change. I read the makefile to see if there was an obvious CTAG I had missed, but to no avail. I figured this was a common problem that's already been solved. πŸ˜ƒ

tidal kiln
#

might be. haven't been able to try building yet myself.

drowsy geyser
#

No worries. Thanks for the suggestion! I'll keep trying to figure it out. πŸ˜ƒ

solar whale
#

@drowsy geyser I just do a make BOARD=x clean then make BOARD=x

#

Did you do git submodule update β€”init β€”recursive

drowsy geyser
#

Oops. No, I didn't. Let me try that.

solar whale
#

This are double dash

#

β€”init

drowsy geyser
#

Oooh , shiny. Lots of updates. πŸ˜ƒ

solar whale
#

No need for V=2

#

No idea what that does

tidal kiln
#

it sets V to 2? but that's just a guess...

drowsy geyser
#

It jacks up the verbosity so I can see more of the steps it's taking.

solar whale
#

I use DEBEG=1 if I want to use JLink for debugging

drowsy geyser
#

OH! Yes, I forgot about needing DEBUG=1

#

BTW, I'm writing down all the steps I take in a OneNote page so I can share the knowledge after it's working....

solar whale
#

Experience is recognizing your mistakes when you make them again πŸ˜‰

drowsy geyser
#

ROTFL!!!!

umbral dagger
#

Do you folks use -O0 (oh-zero) to disable optimization?

solar whale
#

I think DEBUG=1 implies that.

#

Invokes I should say. Should verify

idle owl
#

You guys have been busy

solar whale
#

Not me. I’ve been at a dinner party.

drowsy geyser
#

And I haven't gotten any actual programming done. I'm just figuring out how to compile CP to use with JLink debugging. πŸ˜ƒ

idle owl
#

@hollow tartan I use Atom with a specific set of packages installed. I have not tried Atom IDE, which if I understand it correctly works almost like a wrapper or package for standard Atom anyway.

#

@drowsy geyser That's great though!

drowsy geyser
#

Huh. Same error. Hmmmmm.

umbral dagger
#

@solar whale Yeah, that sounds reasonable.

tulip sleet
umbral dagger
#

I've been playing Pathfinder, then having dinner. My M4 doesn't arrive until tomorrow 😦 I've been prepping.

idle owl
#

@tulip sleet That's fantastic!

drowsy geyser
#

@tulip sleet I read that last night. Very helpful! Thank you for putting it together!

solar whale
#

@drowsy geyser have you updated arm gcc tools recently?

drowsy geyser
#

Yes, it's a completely new install.

#

I'm wondering if the Ubuntu environment on Windows is out of date, though.

umbral dagger
#

@tulip sleet Nice. I've been seeing them and thinking "ah.. problem" then screening in and reloading to see the output

tulip sleet
#

@drowsy geyser I just finished it?! Where did you read it last night? Maybe I duplicated something Scott wrote.

drowsy geyser
#

Oh! I was reading a link from ReadTheDocs in the CircuitPython documentation. I thought that's what you were referring to.

umbral dagger
#

@drowsy geyser Yes, upgrade your gcc arm stack

#

@drowsy geyser I was having the same problem when I went from 2.x to master

solar whale
#

@tulip sleet thanks for doing that!

drowsy geyser
#

I'll go read yours now, @tulip sleet ! πŸ˜ƒ

umbral dagger
#

@drowsy geyser I grabbed gcc-arm-none-eabi-6-2017-q2-update from the arm site.

idle owl
#

@tidal kiln I'm back if you're around

tulip sleet
#

I needed to refer to something in forum support.

drowsy geyser
#

@umbral dagger oh, that might be it. I'll go see if I can do that.

tulip sleet
#

@drowsy geyser re WSL: it uses the Ubuntu repos, so it should be up-to-date. But the arm-gcc stuff is in a PPA, so you need to install from that to get the latest stuff. Do you need a recipe?

#

@umbral dagger @drowsy geyser you can use the arm site, but using the PPA will keep you up to date automatically.

#
sudo apt update
sudo apt install gcc-arm-embedded python build-essential```
drowsy geyser
#

OH! Nice. I was downloading the arm package, but I like the automatic update. Thank you so much!

tidal kiln
#

@idle owl yes