#circuitpython-dev
1 messages Β· Page 114 of 1
If you can come by during the day (US time zones), there will be more people with more relevant CP experience than me around
yeah I know, I just have a habit of "One more thing..." cycles before bed
same here
Feeling the CircuitPython love. Fired off a tweet late late night. Checked it today 17 β€ and 5 re-tweets
@formal plover I did a search on Amazon in my Kindle Books for CircuitPython and got zero results. Looks like a niche to me. Who will be the first? Simon Monk perhaps? Will be waiting impatiently. ><>
@lofty topaz it'll probably be a good while till there's a book out on it. Maybe a make magazine special for it first.
Hope so. Just renewed my Make mag subscription. Such a cool publication.
There's a make "getting started with the Trinket". Original trinket of course
@lofty topaz agreed. Make magazine is awesome. I snag bulk copies from humble bundle
Yup, by Mike Barela I believe. Good book.
In fact, I'm recieving a Trinket M0 today. Came free with my order.
Woot woot! Love the freebies.
I can't even put in words how cool it is.
I know, just when I needed to replenish my workshop with a rather large order, Adafruit comes along and provides this program for getting all this free stuff. I was very happy indeed.
My package arrives today. It's Christmas time in the fall. Gotta love it.
That's awesome @lofty topaz
A lot of us that hang out here have the Trinket M0, so if you have any questions there will be plenty of help available
@formal plover Oh, I know, some of you guys and gals seem to live in here. I would if I could but I can't. Nice to know though that whenever I need help, it's just a click away. Sort of like an online "Hit F1". Remember that?
@lofty topaz There's at least one MicroPython book.
@lofty topaz Mostly PyBoard focussed, with a chapter on the ESP8266
@umbral dagger Yup, Got it. Use it. Got the pyBoard, OpenMV M7 uses it as well. Very well done.
Programming with MicroPython Embedded Programming with Microcontrollers and Python Nicholas H. Tollervey
@lofty topaz No.. I was thinkign of (and have) "Python for for Microcontrollers" by Donal Norris (McGraw Hill)
There's also a "Getting Started..."
Yup, that's it. got it to
Also - OpenMV Development Workshop by Agus Kurniawan. Very well done.
@lofty topaz As for discord, I've been just leaving it open in this channel and check in occasionally.
@lofty topaz Then again, I work from home 100% and am pretty much self-directed.
@umbral dagger See, I pop in and pop out from the taskbar icon. Otherwise, the window would be open on one of the three screens and I would be reading things all the time. The place is great, but you can get caught up in it as well. I've learned that lesson long ago.
@lofty topaz Yup... which is one reason I'm limited twitter usage to my tablet.
I'm at home 100% as well. Just that I'm retired.
I'll tell ya what tho, I love Arduino. And Adafruit makes it so much fun.
@lofty topaz What is it that you love about Arduino? (don't worry, I do too)
Can you imagine having Adafruit back in 1977 when I was build Z80 micros for work?
@umbral dagger What I love about Arduino is the same thing I love about Circuit Playground, no OS.
@lofty topaz Yeah, seriously. I did alot of business with Jameco back then. And there was a place about an hour from where I lived. No online ordering or next day delivery. How did we manage?
@umbral dagger Purchasing agents.
@lofty topaz That does streamline many things. Though, I am looking at some sort of RTOS for my next gen (ARM Cortes-M4 based) smarthome sensor node. FreeRTOS looks capable yet fairly minimal and unobtrusive.
@lofty topaz I didn't have the luxery of a purchasing agent. My work was either hobby or solo contracts.
@lofty topaz We've wander off topic I fear.
@umbral dagger Zenith gave me $25,000/year for parts and test equipment. I was 20 years old.
@lofty topaz Sweet deal.
@umbral dagger My Z80 controlled machines produced products that saved them 40 million a year. They liked me a lot.
@lofty topaz But re: no OS. I feel CP gives you just enough (REPL + flash drive). I'd argue that is a basic OS. You have a flash file system. Between that ease of use and the Python language it's very approachable.
It was so sweet, I turned down Bill Gates when he offered me a job with his new startup in Seattle.
@lofty topaz Good on you... you got to keep your soul.
I know, but......
@lofty topaz Investing would have been smart π
A house wife, 3 kids, 2 cars, mortage, bills, food, clothing, education, yeah, I should have invested.
But 10 cents don't buy much stock.
π
However, I did invent a way to squeeze blood out of a turnip.
@lofty topaz You should have worked for the Red Cross.
@umbral dagger It was more of a process I call "Don't Ask for Permission, just Beg for Forgiveness".
Works every time. π
@lofty topaz Yes, and if you're good/lucky you end up not having to beg very often.
BINGO!
Now I just need to intercept that delivery truck so she doesn't see it.
I got a boat load of parts from Adafruit coming today.
Hey @umbral dagger , you ever use those wireless chargers? I'm getting that Qi stuff and going to play with it.
@lofty topaz I have not.
Just wondering. New to me. Good learning oppurtunity. Wanna see how they do it and how good they are. Where's the technology at and so forth. Gotta love hacking.
@lofty topaz I expect it's basically a transformer: incoming in the base, outgoing in the device.
@umbral dagger Right, but what is the frequency. What levels are they using. My curiosity needs to know. That's all.
@lofty topaz Sounds like your findings woudl make for an interesting read. Especially if there were information on how to abuse it π
@umbral dagger Well, that's true, but I was thinking more along the lines of shaping the coils for maximum energy transfer. They look like they're just flat wound. Wonder what the tesla levels are?
@lofty topaz ZThe Nicholas Tollervey book talks about CircuitPython on the CircuitPlayground Express
@slender iron Your absolutely correct. Just looked. Nice piece of work to. Thanks eh... ><>
no problem! @plucky flint would be happy to hear you are reading it
@timber lion thanks for adding the high side/low side thermistor support
@slender iron sry, was afk 2nd half of yesterday
eyes on request was for:
https://github.com/caternuson/CircuitPython_ADS1x15/tree/multi
uses one of your earlier suggestions and breaks into multiple files
to deal with the various modes: single, differential, etc.
π
only the ADS1115 is implemented, ADS1015 is empty but would be same
api looks good to me
the differential and single ended read code should be pushed down so itys only loaded when needed
refactor out of the ADS1x15 class?
'loaded' = when an import is done? to conserve limited space?
that's what the ADS1x15 is currently
right, so keep that to store the _read code thats completely shared
My M4 arrived btw everyone!
yay @formal plover
so same setup, just need to refactor some stuff out of the current ADS1x15?
Totally going to post it with #leeks on Instagram later Lolololol
yeah, think so @tidal kiln
in ADC_Channel you don't need _value and _volts, you can just return them directly
thanks. yeah. figured that. a detail i was still learning / uncertain about with the whole @ property thing.
π
another thing that migh tbe nice is to make the getitem for differential take a tuple instead of index
so (0, 1) instead of 0
meaning dif of chan 0 and chan 1?
exactly
it doesn't work that way, there are only preset channels, so it's more like a mode than an arbitrary setup
0 = Channel 0 minus channel 1
1 = Channel 0 minus channel 3
2 = Channel 1 minus channel 3
3 = Channel 2 minus channel 3
and that's what you're passing in
right, thats what you give the hardware but should the user have to do that?
you can throw an error for an invalid combination
yeah, could do that. so only valid options would be (0,1), (0,3), (1,3), (2,3)
people wouldn't read manual, think it would allow for any combination, but most combos they try would throw an error
could be frustrating
esp. since the modes it does support are kind of weird
0 and 3 make sense
@lofty topaz This brand new book includes CPX with CircuitPython as one of the main examples of using MicroPython/CircuitPython. @plucky flint, the author has been in the chat. https://www.amazon.com/Programming-MicroPython-Embedded-Microcontrollers-Python/dp/1491972734
He works on the mu Python editor as well.
@tulip sleet Yes, It's on my Kindle, along with all the others. I'm reading about 4 books right now. This is one of them.
@slender iron @tulip sleet @lofty topaz Just bought it. Looks good.
I am looking for the Exclusive "CPX" book to come out. They will come. Look at how fast Micro:bit sprang up books and pdf's, it was great. MicroPython and CircuitPython put Python in the hands of the embedded developer. aka Hacker/Maker.
And I will defend my opinion that there is no OS. It's more of an Operating Environment. I know it has file access and who knows, some day a shield will have a hard-drive. 'em, Lot's of SD's.
But Arduino and CPX are perfect embedded platforms for ages 1 - adult. And I use that term adult loosely. π
Sorry Raspberry Pi, but it's time to move over, just a little anyways.
Try doing pip3 install pycodestyle here. I don't think the language setting isn't having influence over this because only one language (c in this case) can be selected at a time.
Put it this way, my snake doesn't have a charmer name Linux to deal with, it's free to do as it pleases.
@tidal kiln yup, thats what I'm thinking
@tulip sleet I'm gonna start working on the nrf52 merge today so ktown can start hacking on it in master
@slender iron sounds good; i have some leads on the USB MSC problem. When things are bad system logs are filled with
Oct 23 21:22:04 salmonx kernel: [28976.968206] sd 6:0:0:1: [sdd] Sense Key : Illegal Request [current]
Oct 23 21:22:04 salmonx kernel: [28976.968207] sd 6:0:0:1: [sdd] Add. Sense: Invalid command operation code```
so it's something in the way the MSC device is responding to certain requests, it appears
@lofty topaz I use my Raspberry Pi to work on my CircuitPython boards.
Best of both worlds.
And Chromebook depending on what I'm doing.
@formal plover π Gotta love it...
@lofty topaz yup!
@tulip sleet ok cool. I think my brain just figured out the cdc corruption issue so I'm gonna take a peek now
@slender iron travis speedups: 2 cores is the default: https://docs.travis-ci.com/user/reference/overview/#Virtualization-environments. So we could use make -j2 effectively. Some other hints about parallelizing things: https://docs.travis-ci.com/user/speeding-up-the-build/
π
@slender iron ok. ill work on it and ping you when i got next rev.
thanks @tidal kiln
@lofty topaz No OS the way the original Smalltalk and Lisp systems had no OS. They were the OS.
OS = something that lets you load code and execute it. And provide I/O capabilities.
@umbral dagger Well, sort of. Do you remember the old "Monitor" programs? Once the bootloader set itself up, the Monitor would take over allowing you to do just what you said. Load code from somewhere or display memory or set I/O bits etc.
All controlled from a teletype over RS 232
@slender iron lock3 test travis failure - rerunnning
@lofty topaz I remember them well.
@umbral dagger Nice.
@lofty topaz Still an OS. Not a Disk OS.
Although with the USB drive thingy...
@lofty topaz βJust Enough OSβ π
@lofty topaz Iβm using a very liberal definition of βOSβ
@umbral dagger Oh, well, I suppose so, but normally an OS will wait for you to tell it what to run, not Load-n-Go like Arduino and CPX. But I understand your point and it's well taken. I just think there should be a distinction between these type systems before we go much further into the future. π
@lofty topaz A βruntimeβ?
Ah ah ah ah ... wow, haven't used that term in soooooo long. But, yup, a runtime.... ><>
@lofty topaz Loader, executer, I/O libraries, REPL.
@umbral dagger That's right, a very understandable way to interact with an interpretive environment. I keep getting asked by young people what the difference is between Arduino and Raspberry Pi. I say no OS and they look at me with a confused face. That worries me.
Why would that worry you?
Or I say "headless".
@pastel panther What's the difference between a bicycle and a car? They need to know the difference when it's major.
Just my opinion.
@lofty topaz I suppose it depends on your definition of "needs to". Expectations should vary depending on the person and the position. Also ignorance shouldn't be a problem unless it's willful
@pastel panther OH, absolutely, my concern is for those interested in the fields of our realm. Not everybody.
My bias is that statements that sound like "kids these days..." send me into anaphylactic shock
I say it all the time. Kids these days are so smart. Kids these days work so hard. Kids these days know so much.
Gak!
π
My oldest is an Aerospace Engineer and my 2nd is a Mechanical Engineer and the 3rd is a teacher.
You must be so disappointed in them! π
My mum's a psych NP
Once all the kids where in school that is.
Otherwise, when they came through the door and hollored MOM, mom was there.
There's money to be made there! Apparently....
@marble talon That is great. I know many who have had lots of success on YT
YT is the greatest Marketing Tool since the Bikini.
Both eschewed technology π¦
@umbral dagger Yeah but food.........
@umbral dagger I wish I could weld, I wish I could cook. But I can't and thank Gawd there are those who can.
So to do another build of 3.0: 1. Do I need to clear out the current one, 2. Can I have more than one build in that folder at a time or does it overrwrite it
@idle owl I was about to say that they picked their field and excelled.
@umbral dagger I wish I could weld, I wish I could cook. But I can't and thank Gawd there are those who can.
@umbral dagger I already knew you thought the world of them. I was saying food is delicious.
ugh
I think the asf4 usb code is only caching our output when its not aligned
@idle owl Culinary would have been my second choice.
Looks like my shipment from Adafruit will come tomorrow instead. Oh Well.
@slender iron hmm
so every fourth character is random when printing from dynamin memory
oi
@idle owl jsut do the make clen then mak and it will selete tthe old one and build a new on e
@slender iron That kinda jives with what I was seeing.
Wanted to hookup that trinket M0
@solar whale Right but is that how it works regardless? Or can I have simultaneous debug and non debug builds?
the m0 must be slow enough that its less likely that we change the memory befor eit gets output on usb
#Illcachemyselftyvm
So the M0 would have done the same thing but it's too slow to have the issue?
thats my guess
@idle owl As far as I know - only if you create a whole new syste, That is a new clone of the repo.
Hah!
@solar whale Ok thanks. I want to understand it, I don't necessarily need 2 builds
Or kust build it twice and save the .uf2 files as different names
for the python aka Circuit one
@solar whale That's what I was going to do if I decided to do it
@katni Uh, newbie question. How do I sync the current source directory with the Git repo? Is there anything besides git submodule update --init --recursive?
@slender iron you have learned a lot with wireshark when doing debug with M0 and M4?
@slender iron increased speed has hidden impacts π
@drowsy geyser git pull if you did a straight clone
Thank you, @umbral dagger !
@drowsy geyser assuming you want to freshen your copy.
if you switch branches you may have to pull the submodules as well
Ok. Still learning git.
If you have your own fork youβll have to set an upstream remote and fetch/pull that.
I think there is a way to clone and pull submodules but I don't remember it offhand, and I don't know if it works when switching branches
@drowsy geyser One never finishes learning git π
@umbral dagger I don't have my own fork. I just did a straight clone.
@drowsy geyser just git pull then
Ah, here it is: git clone --recursive -j8 git://github.com/adafruit/circuitpython.git
And a friend of mine (Jon Lolinger) wrote an O'Reilley book on Git. I need to go dust it off. π
refreshing the submodules is a good idea as well
Though you'll need git 1.9+ for that
Ok. I'm running the latest git...
Honestly stackoverflow tends to be more useful than a book for most "how do I" questions
Oh nice. It tells you the diff summary. Lots of analogio changes.
@pastel panther True! I figure I should do my homework first and get a better understanding of the repo system.
@drowsy geyser Sure, just make sure you're reading something fairly current
@drowsy geyser This book is pretty good (and free): https://git-scm.com/book/en/v2
@drowsy geyser Sorry, I stepped away! Did you get it sorted?
If you prefer a gui for git at times (I love me some visual diffs) Iβm using GitKraken these days Windows/MacOS/Linux
Free for OSS use
Does anyone know if there is a good visual diff tool for Atom?
It will nag if you use it with a private repo, but doesnβt enforce anything.
I should have googled before speaking: https://atom.io/packages/split-diff
@pastel panther We all say that. Often π
@umbral dagger I'm pretty sure internalizing that concept is a large part of moving from Jr. to Sr. engineer
ok, I have a patch for you folks to test
Weeee
Once my internet comes back .... (on my phone)
@slender iron Excellent
@slender iron Nice! - be a few hours befor I can try, but I will as soonas possible.
The internal cache is only used when the memory isn't aligned even if we're
going to change the memory immediately after.
Ok.. Not sure how to test it
be back in ~30
Ok
That would mean having travis π
Travis is your friend so is Rosie
Well it mounted CIRCUITPY the first time on flash this time. That's an improvement.
Hey! It works! >>> dir(board) ['A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'D0', 'D1', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7', 'D8', 'D9', 'D10', 'D11', 'D12', 'D13', 'SDA', 'SCL', 'NEOPIXEL', 'SCK', 'MOSI', 'MISO', 'LED_RX', 'LED_TX']
@slender iron Well done π
Great success!
@idle owl multiple up-arrows?
Cool!
@idle owl - how di you get the udated code?
I copied it from the raw github file and pasted it into /circuitpython/atmel-samd/usb.c
ah - sneaky....
So kludgey, but.... I have no idea how to get travis going, and no idea how to get the info from a PR that isn't already merged
Then I did a visual comparison of a few lines of code, and then a git diff to verify that it had the changes.
@umbral dagger Any other stuff to test that I missed?
@pastel panther Thanks for that link! I'll go look at it.
@idle owl Yep, thank you!
I had forgotten about the up arrow, that's why I ask
@idle owl hmm... boot & circuitpy drive showing up consistantly, repl access consistantly, line editing in the repl (up down, back forth, editing), consistant/correct repeated dir of a module.
I was having trouble with all that last night.
The fact that the M4 is fast enough for timing problems like this to show up is awesome, though! Zoom, zoom!
@idle owl I tend to use main.py... which helps if I have split things into multiple files.
Ah. Second flash, it didn't show up as CIRCUITPY following. So that's still inconsistent. But I don't think this was meant to fix that anyway.
[Aside: goodness it's hard to keep up with #circuitpython-dev while at work!]
looks like travis posted the new builds if yo udon't want to buid you own... https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/metro_m4_express/
@solar whale If the last modified is correct, it doesn't include the patch Scott wanted us to test.
Now it won't mount CIRCUITPY at all. Blergh. This is why you test repeatedly π
@idle owl I may be wrong, but I think that site is where travis posts the builds form each pull request. Can somaone confirm/deny.
@solar whale That would explain what Scott said before he left, so you may be right
@idle owl yeah - but the time for the last post is too old - never-mind....
Hey there it is, lol.
Flashed it a few more times then decided to rebuild the uf2, and while it was building, CIRCUITPY shows up.
but dan released it!
@solar whale I see that! I'll have to do a pull this evening and re-test the use cases....
folks, I have a firend in here with a CPX which he has programmed previously with Arduino and and make code, and now we can't get circuitpython on it
better late than never π
@stuck elbow Can you get to the bootloader?
the uf2 bootloader comes up normally when we press reset twice, but then when I copy the uf2 on it, it restarts and the old program he programmed on it runs
Download the flash eraser from here https://github.com/adafruit/Adafruit_SPIFlash/tree/master/examples/flash_erase_express
Run that first and see if it clears up the issue
thanks
If len (same as output_len here) > 64 AND the input buffer is not aligned on a 4-byte boundary, then I think the memcpy will write past the end of cdc_output_buffer, which is only 64 bytes long.
oops - premature - the new commit is not released yet - sorry for the confusion.
it works \o/
@stuck elbow Great!
@idle owl you rule! π
@stuck elbow Thank you! I'm glad it worked!
@idle owl @solar whale I forgot. PR builds aren't on S3
@slender iron I figured out a way to do it.
Did anyone else see the issue I saw with master/3.0 making /dev/tty.usbmodem1411 disappear on a m0?
@slender iron This patch was about output issues right? It's unrelated to mounting the device after flashing?
Ok. I wanted to know what to put in my review comment, making sure I was right about the mounting issue being irrelevant to this PR
Stupid question but is mass storage related to usbmodem stuff?
3.0 is presenting two mass storage devices at once (may be a mistake), and the second one does not behave well. That could cause various issues with stuff like the terminal. On Linux, it makes the daemon process running the USB stuff act up.
Still looking at this.
@tulip sleet did you try turning the second one off?
@slender iron I was just about to do that. Looking for where they were both turned on.
there are a number of lun checks I believe I hard coded π¬
Nah, if we're on the last packet we need to copy to the buffer because we'll return before its transmitted. I added a length check.
but if the buffer is "misaligned" don't you have to do this on every transmission? As Dan pointed out, if buffer length is > 64 and misaligned it will send it all on the first pass.
64 is a repeated magic number. Is it the size of the internal cache? Are you willing to static const or #define it or use sizeof(cdc_output_buffer) ?
Yup, let me find the one I want. Its the endpoint size.
waitin' for travis before the actual commit
yeah, I can watch it and squash once its going
sure
purple
I think that's just his image
awww
Haha sorry
There was a video of them being made posted to the blog a couple of days ago. It was really neat.
It's been raining here in Michigan for like a year, so the lighting was terrible, hence the filtering
@idle owl Yeah I saw that!
@Regrann from @adafruit - Get ready for the Metro M4! The Adafruit Prototyping League is at it again, this time manufacturing our first test batch of Metro M4βs. We hand stencil each PCB using a laser cut jig and send the boards through the pick βn place one by one. After visual inspection they head into the reflow oven where the solder paste transforms into solid metal joints. Stay tuned for more! #adafruit #manufacturing #manufacturingmonday #metro #metrom4 #circuitpython-dev #diyelectronics #madeinnyc #prototyping - https://www.instagram.com/p/Bal3rSrjQX2/
This code was designed in response to this issue. It wasn't a good fit for that library.
It is a start for another library that could be for the Circuit Playground Express, or usable across multiple boards. I'm posting the code here so anyone who wants to pick this up has a place to start. The idea is to allow for iteration across all capacitive touch inputs (in the current case, the touch pads on the CPX), ...
@tidal kiln I closed the touch tuple issue after posting and cross referencing it in the CP repo issue.
Hello. I did install a version of Windows Powershell and Vagrant up did try to create the target.
However, --debug states:
ERROR vagrant: #<VagrantPlugins::HyperV::Errors::PowerShellFeaturesDisabled: The Hyper-V cmdlets for PowerShell are not available! Vagrant requires these to control Hyper-V. Please enable them in the "Windows Features" control panel and try again.>
This is all new to me so I will try some more.
If you surround your comment with three backticks, it'll put it in a code block. Single backticks around it will make it inline
hello
The backtick on the upper left of your keyboard above the ~
Yeah!
It helps with terminal output, which you will probalby be dealing with a lot π
very useful. thanks, @idle owl
@hollow tartan No problem π
@microwattblot I would actually suggest NOT trying to get vagrant for building CPy running under Windows. It can be painful for various reasons. If you'd like to do builds under Windows, an easy way is with WSL (though it's a little slow in the I/O department).
https://forums.adafruit.com/viewtopic.php?f=60&t=109632
https://forums.adafruit.com/viewtopic.php?f=60&t=112975
How do I clear the stash after doing git stash if I have no need for it. Is it git stash drop or git stash clear... I made a change to the repo for testing, the repo was updated, I stashed my local changes and did git pull. Now I have a stash I don't need.
git stash drop will pop it off the stash stack and discard it.
@tulip sleet Thank you
my win7 is 64 bit, it is unclear if vagrant and VirtualBox are 32 bit apps.
that's not really the problem - it's that VirtualBox + Vagrant need all kinds of setup.
have you upgraded to the Fall Windows Creators Update yet?
(you don't have to)
@brave cipher no .. FWCU . who provides that?
DId that update include Win7 or was it only Windows 10?
oh, you have Win7 , oh oh, sorry.
For Win7 I'd suggest instead download VMWare Workstation Player (or use plain Virtual Box), and just install an Ubuntu image on it (16.04) is fine as a regular VM.
The Power Shell update I got for win 7 64 bit. "Pro"
Or, do you have an external USB3 disk enclosure you could use (USB2 is OK but will be slower)?
I am going to suggest installing Ubuntu on an external drive and booting off that.
@tulip sleet I do have an external Harddrive but rarely use it.
are you willing to wipe it and install Ubuntu on it? What's the base machine you have? have you ever booted from another drive via the BIOS?
some years ago, yes.
what's your goal, to build circuitpython?
first micro python and then circuitpython, yes.
Is the machine a desktop that you could add another internal drive to? Do you have a spare drive?
tried latest CP 3.0 master on M4 - works OK on MacOS as usual, but on Linux box ```[126126.982437] sd 8:0:0:1: [sdd] Unit Not Ready
[126126.982442] sd 8:0:0:1: [sdd] Sense Key : Illegal Request [current]
[126126.982446] sd 8:0:0:1: [sdd] Add. Sense: Invalid command operation code
[126126.983287] sd 8:0:0:1: [sdd] 0 512-byte logical blocks: (0 B/0 B)
[126126.983290] sd 8:0:0:1: [sdd] 0-byte physical blocks
[126126.983989] sd 8:0:0:1: [sdd] Test WP failed, assume Write Enabled
[126126.987182] sd 8:0:0:1: [sdd] Asking for cache data failed
[126126.987190] sd 8:0:0:1: [sdd] Assuming drive cache: write through
@tulip sleet yes
@solar whale I'm working on that - it's presenting two drives but there's really only one.
Make this patch (one line change):
diff --git a/atmel-samd/usb.c b/atmel-samd/usb.c
index 4f7080dc8..fb7d77ec0 100644
--- a/atmel-samd/usb.c
+++ b/atmel-samd/usb.c
@@ -205,7 +205,8 @@ void init_usb(void) {
cdcdf_acm_init();
pending_read = false;
- mscdf_init(1);
+ // mscdf_init(1);
+ mscdf_init(0);
// hiddf_mouse_init();
// hiddf_keyboard_init();
just make mscdf_init(1) be mscdf_init(0). That will get rid of the bad drive. It still isn't working right (CIRCUITPY disappears after 30 seconds sometimes), but it gets rid of the voluminous errors.
I'll give it a try
my gut feeling about dual drives in one desktop case, is that harmonics are going to byte you.
@tulip sleet thanks for the inputs, I will work on Vagrant for another day or two to see for myself.
alternatively just install plain VirtualBox or VMWare Workstation Player (free) and then install Ubuntu as a regular VM.
@idle owl cool. thanks for documenting the discussion.
@tulip sleet with that change - I just keep going back to METROM4BOOT
@tidal kiln Sure! I had written some of it down and it made sense to include it since if it gets picked up again, all the same ideas and opinions will still be there for it.
@solar whale I am testing on M0 Metro, not M4. You just changed the 1 to a 0, right?
@tulip sleet That lets me bring up METROM4BOOT, flash the new build onto it, then it comes up with CIRCUITPY. Hoever screen just gives nothing. Exiting out takes a while (C-a k y... wait)
@idle owl yes. good. also because there's a good chance i'll re-think of this idea and ask for it again in a few months.
@tulip sleet yes - but now it boot on my MAc, bit does not mount CIRCUITPY
@tidal kiln lol. Understood. I do the same thing π
and it dies after a few minutes... π¦
@solar whale you included this afternoon's CDC fixes from Scott, right?
yes - did git pull
@tulip sleet Also, I can edit main.py on CIRCUITPY. Saving updates it and stops the running code, but doesn't reload. Resetting starts it running (and CUIRCUITPY once again is there).
@tulip sleet This is after pulling in the latest changes in master, along with applying you 1->0 patch locally.
@tulip sleet it is working now on Linux ! but Mac is not happy....
@solar whale @tulip sleet I'm on Linux as well Ubuntu 17.04
@tulip sleet but on;ly once π after disconnect it hangs
@solar whale yes, this is just fixing one problem (maybe). There were two raw devices presented (sg3 and sg4), but one was always reporting "not ready", which seemed to make the driver ask again and again, "ready yet? ready yet? ready yet?" It was in there to eventually allow access to CIRCUITPY and an SD card, but we can take out the latter for now.
it's still pretty unhappy
If you plug it into Linux you'll see it appear, and fail to answer some questions (is write enabled?, etc.). Then every 30 seconds the driver resets it and goes through the initial dialog again. I'm comparing the USB traffic with 2.1.
I mean if you tail kern.log or syslog
sigh - reverted back to master for now - at least it is somewhot well behaved on the MAc.
or it was - not not working at all....
@solar whale I had to reset it a bunch to get it to show up.
@solar whale And I had to rename main.py/code.py to anything else to get the REPL to work. It'll make the serial connection, but I can't get to the REPL without renaming that.
got it back - unplugged USB and replugged
@tulip sleet Hmm... I didn't notice this before. When I edit/save main.py on CIRCUITPY not only does the previous version stop running, but if I have CIRCUITPY open in a file browser it sits spinning "loading" trying to refresh it.
@umbral dagger this is 3.0, right?
@tulip sleet And this shows up in syslog: Oct 24 17:41:55 rohan kernel: [91758.577779] usb 3-1.4.4: reset full-speed USB device number 41 using xhci_hcd Oct 24 17:41:55 rohan kernel: [91758.733080] cdc_acm 3-1.4.4:1.0: ttyACM0: USB ACM device Oct 24 17:41:55 rohan kernel: [91758.733485] sd 6:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_TIME_OUT driverbyte=DRIVER_OK Oct 24 17:41:55 rohan kernel: [91758.733490] sd 6:0:0:0: [sda] tag#0 CDB: Read(10) 28 00 00 00 00 03 00 00 01 00 Oct 24 17:41:55 rohan kernel: [91758.733493] blk_update_request: I/O error, dev sda, sector 3 Oct 24 17:42:28 rohan kernel: [91791.353575] usb 3-1.4.4: reset full-speed USB device number 41 using xhci_hcd Oct 24 17:42:28 rohan kernel: [91791.509351] cdc_acm 3-1.4.4:1.0: ttyACM0: USB ACM device Oct 24 17:42:58 rohan kernel: [91822.053238] usb 3-1.4.4: reset full-speed USB device number 41 using xhci_hcd Oct 24 17:42:58 rohan kernel: [91822.208564] cdc_acm 3-1.4.4:1.0: ttyACM0: USB ACM device
but lost it again....
@tulip sleet Yes, latest master (plus your patch to only open one device)
(yes, my linux box is rohan.. open grassy plains, majestic snow capped mountains... my Mac is morder....)
@umbral dagger I see that too. Don't know why. I'm reading the ASF4 driver code now. Scott's code seems to be doing the right thing with respect to it, but the low-level code may be buggy.
Do we have like a step 123 for getting the M4 up to testing level?
@tulip sleet And a bit later this shows up: ```Oct 24 17:43:29 rohan kernel: [91852.788957] usb 3-1.4.4: reset full-speed USB device number 41 using xhci_hcd
Oct 24 17:43:29 rohan kernel: [91852.944158] cdc_acm 3-1.4.4:1.0: ttyACM0: USB ACM device
Oct 24 17:44:02 rohan kernel: [91885.540724] usb 3-1.4.4: reset full-speed USB device number 41 using xhci_hcd
Oct 24 17:44:02 rohan kernel: [91885.695843] cdc_acm 3-1.4.4:1.0: ttyACM0: USB ACM device
Oct 24 17:44:35 rohan kernel: [91918.320272] usb 3-1.4.4: reset full-speed USB device number 41 using xhci_hcd
Oct 24 17:44:35 rohan kernel: [91918.475796] cdc_acm 3-1.4.4:1.0: ttyACM0: USB ACM device
Oct 24 17:45:05 rohan kernel: [91949.028043] usb 3-1.4.4: reset full-speed USB device number 41 using xhci_hcd
Oct 24 17:45:05 rohan kernel: [91949.179491] cdc_acm 3-1.4.4:1.0: ttyACM0: USB ACM device
Oct 24 17:45:05 rohan kernel: [91949.180056] sd 6:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK
Oct 24 17:45:05 rohan kernel: [91949.180058] sd 6:0:0:0: [sda] tag#0 CDB: Read(10) 28 00 00 00 00 03 00 00 01 00
Oct 24 17:45:05 rohan kernel: [91949.180059] blk_update_request: I/O error, dev sda, sector 3
Oct 24 17:45:05 rohan kernel: [91949.180097] FAT-fs (sda1): FAT read failed (blocknr 2)
Oct 24 17:45:36 rohan kernel: [91979.759821] usb 3-1.4.4: reset full-speed USB device number 41 using xhci_hcd
Oct 24 17:45:36 rohan kernel: [91979.911388] cdc_acm 3-1.4.4:1.0: ttyACM0: USB ACM device
Oct 24 17:46:09 rohan kernel: [92012.515535] usb 3-1.4.4: reset full-speed USB device number 41 using xhci_hcd
Oct 24 17:46:09 rohan kernel: [92012.666858] cdc_acm 3-1.4.4:1.0: ttyACM0: USB ACM device
@umbral dagger yeah same here
@slender iron @tulip sleet Do you have an updated version of the uf2 installer or is the one from 22 October stil valid
OK - Mac is happy again with 3.0 Master build - blinky is running CIRCUITPY is mounted - life is good.... nobody move.
@idle owl I think the changes since then only impact the arduino boot.
Ah I think you're right. I remember that now
@idle owl did you try the one in https://github.com/tannewt/uf2-samd? I don't know how far Scott got on it?
Did that need to be built?
I am using that now and it works well.
Yes
I want to get a bootloader.bin or .elf file to Kurt so he can get it on his M4
I'm working on the self updater for uf2 now
I think it finially flashed but hosed the bootloader...
I have been using it with no problems - on my MAC anyway
@slender iron are you referring to reloading the bootloader itself via UF2 - I loaded it with JLink, but I can load CP with it just fine.
Ok, @formal plover is downloading the jlink software now. He's got a fresh M4 so he needs to start from scratch where we were this weekend. I have to go in a few minutes here. @solar whale I gave him my bootloader.bin and bootloader.elf but they're older than the one you're using, so if you could upload yours that would be helpful.
You can put me in the same cart as Kurt however I won't have my jlink until probably next week
@slender iron any objection to my sharing the current build?
@slender iron Coming in late from a meeting. I was able to flash my M4 using my compiled image and bossac, but the UF2 load doesn't work (as you know).
Is there any documentation/open issues/bug tracker for the current status of the M4 build?
I know @tulip sleet and @slender iron are fixing USB issues, but @idle owl was referencing progress being made from the weekend so I wasn't sure if there was more to the story
Ooh! I have not tried it on a pi yet. Good luck!
@formal plover If you're up for it, you should document your methods so others can share in the joy
For sure @pastel panther! This is on a Pi, but I'm sure I'm not the only one doing this
@formal plover that's what I was hoping for. Now that I think of it, a Pi might be a decent alternative dev environment for people in windows land
It's a cheap way of having a Linux box for those "You need Linux" moments. It works great for what I've been doing
@pastel panther ... I actually just ordered a new desktop on which to install Ubuntu for just this purpose. π
Running and testing CircuitPython boards and Arduino boards isn't extremely resource heavy
Though I've had good luck compiling in the Bash shell (Ubuntu) on Windows 10.
I've heard from a coworker that it's actually pretty decent
I still have flashbacks from when I had to develop for a linux environment on a windows machine...
I can do without the GUI, but you know I'm a millennial, so if I can use the GUI, prob going to use it
lololol
I would always use a GUI if it worked as well as command line. Heck, my IDE is a GUI
To each their own
@drowsy geyser well there is other bash shells in windows 10 like suse
True, but the Ubuntu shell is supported. π
in circuitpython right?
here is openSUSE Leap 42 https://www.microsoft.com/store/productId/9NJVJTS82TJX
What do you mean by in circuitpython? CP being supported in Ubuntu?
AFAIK CP is fairly platform agnostic
for development at least
@sick creek I'm confused. The standard Ubuntu shell is working, so why should I change?
building from source may be easier or harder on different plaforms but using a CP should be doable on anything with a usb port and a text editor
@tulip sleet interesting observation - I rebuilt 3.0 with you mod to usb.c - on the Link Box, twice now it seems to mount CIRCUITPY when I open screen to acces the REPL -coincendence?
@pastel panther I can confirm your assertion.
@drowsy geyser well adding option as you can use ubuntu, openSuse like a app
@tulip sleet definite correlation....
jlink hooked up... Nothing blew up, that's good
@formal plover What's your operating environment? Like, which OS, and which debugger are you going to use?
@solar whale hah - so that's why I only saw CIRCUITPY once! Thanks for that! It's another clue.
@tulip sleet but the box is much happier! moving my dev environment back to it!
@drowsy geyser Raspberry Pi "Stretch"
Cool! Thank you!
jlink commander
What do I pick for "Device"
Did connect and now it wants my device. You're welcome @drowsy geyser !
mind reader @solar whale
been there
speed
Yup. 1000 KHz
1Mhz
fail
??
Oh? I was using 1000 and it worked on Win 10....
1000Khz=1Mhz?
Yup yup,
I don;t think it was the spped that failed
Ok.
J-Link>speed 1Mhz Selecting 1 kHz as target interface speed
`*** J-Link V6.20g API Error ***
JLINKARM_SetSpeed(1000000 kHz): Maximum JTAG speed exceeded. Did you specify speed in Hz instead of kHz ?
*** J-Link V6.20g API Error ***
****** Error: JLINKARM_SetSpeed(1000000kHz): Maximum JTAG speed exceeded. Did you specify speed in Hz instead of kHz ?
Connecting to target via SWD
Cannot connect to target.`
sorry - so with 1000 it fails?
`Connecting to target via SWD
Cannot connect to target.
J-Link>speed 1000
Selecting 1000 kHz as target interface speed
J-Link>connect
Device "ATSAMD51J19" selected.
Connecting to target via SWD
Cannot connect to target.`
+1 @solar whale - was just going to ask that
jlink to the port on the metro, knotch lined up
I got the smaller cable btw, there are no left over pins
but on the Jlink is the tab out or in. shoul point away from USB
is there a way to update the jlink firmware?
@idle owl @solar whale I think I found the reason you need a double flash sometimes
Dumb question, but you have the USB Micro connected to, yes? And the red wire on the cable is aligned with the "1" printed on the JLink?
you have a Jlink Mini?
Yes I have the mini
red wire by 1 -- tab out
@slender iron do tell!
my logic for savign data about to be erased was wrong
@pastel panther quit teasing the bot π
so red should be on the right?
by the 1 on the Jlink bord
What does it have against the instrument Louis Armstrong plays?!
maybe president related?
haha
interestin - mine is reverse - - depend which end is used
Mine's reversed, too.
`Selected interface (1) is not supported by connected debug probe.
J-Link>speed 1000
Selecting 1000 kHz as target interface speed
J-Link>connect
Device "ATSAMD51J19" selected.
Selected interface (1) is not supported by connected debug probe.
J-Link>`
sets jlink on fire
yes. ends are diff. but red is 1.
Haha I'm just being snarky @drowsy geyser
@slender iron I removed the unused second MSC device, as you may have seen above. It still is not responding to queries properly from the host - for instance, the host asks if write-protect is on, and it doesn't answer properly. Your calls to the MSC library appear OK, but I have to dig deeper into the library impl. I downloaded the latest ASF4 zips from Atmel START (hoping against hope), but there's no change since last time.
kk, thats kinda what I figured
So yeahhh device is wrong?
ktown, limor and I were talking about switching to a shared tinyusb for ports in 4.x
@kurt - looks correct
@solar whale ok
@slender iron is tinyusb the impl in UF2?
nah, its a different open source one done by thach
oh, yeah, now I remember thach's website name!
we still have to get something working on 3.x. Hopefully it can be debugged.
I'm sure we can figure it out
We use the jlink to flash the bootloader, correct?
I mean, I wouldn't see any other way of doing it.
@formal plover That's how I did it
@formal plover yes - BTW I just end-for ended my caple so it looks like @umbral dagger and it still works!
yes it does - on both ends
key will force it on Metro - the otehr end has to go with red at 1 - regardless of direction
looks good
We have different cables then
no
The other way
Well when my red is on the same side as "1" the ribbon cable goes over the top
of the jlink
Which just seems backwards to me
depends on which end is in the metro
lordy
πΏ π
Stupid question: does the board need power?
@pastel panther I just a 9v wallwart
Kurt, is your power switch on and board plugged in?
@pastel panther Yes, powering it via usb (the metro)
@formal plover That might be a problem.
metro powered via usb, that's no good?
@formal plover I believe people were saying that on the weekend
They were mentioning that on Macs
@formal plover @pastel panther The jLink won'y power the baord adequately ... power led is not lit
mine was lit
I'm not trying to power the board via jlink
jlink and metro are both plugged in
@formal plover It is helpful to use a 9V supply to the barrel connector - do you have one?
I use the barrel connector to power with the klink
Yes
better check
A range is fine... 7-12 maybe.. 9 is typical.
Just as long as the polarity is correct
Metro_m0 says 7-9
Makes sense since it's just getting 3v3 from it, and not 5 like the Uno
I'm still getting used to the 3v3 thing... I grew up with 5v. Everythign could take 5v.
@kurt with respect to the cable - at leas on mine if you unplug and swap ends then it will lie the other way to keep red on pin 1 - yours mey be different buts it works both was for me.
notches on same side w.r.t. to cable or not? they are different for the two ends for the adafruit one:
https://www.adafruit.com/product/1675
I don't have the barrel power supply
In the picture theyre actually the same though it looks reversed. If you look, both connectors are oriented to the cable the same way
notch w.r.t. cable is different
notch w.r.t. pin1 is same
yes. it is confusing.
the "tab" always point away from the USB connector on the Jlink - one way the cable is on the tab side - the other way it is reversed.
I switched the cables, same deal
red is 1, trust that unless the notch/tab forces you to something different, at which point you need to stop and investigate
@formal plover in the long run a 9V supply will be helpful. I often have to disconnect the USB and power it form the 9V to get Jlink to connect.
not sure that is your problem now.
So the tab always has to face away from usb @solar whale?
That's what you said right?
1 has to be 1
If you have a friend that plays guitar, you can raid their pedal box for a 9v adaptor. Stabbings may occour.
okay, well there's only a 1 on the jlink
@formal plover is tehre a conflict between @tidal kiln instructions and tab location? should eb the same red wire at pin1
the Metro is keyed - cant do it wrong
but the red wire shou be by teh arrow - outer edge of the board.
lol I think everyone has suggested a different way so far
red is on the 1 jlink
tabs are lined up on the metro
tab to slot
and on the metro red is at outer edge - there is a small arrow
yes
good to go
that sounds correct then
which means the notch lines up with the slot
I don't undestand
The notch/key on the cable, there's a hole for that on the metro
yes - only one way to plug it in.
red wire will alway be oon outer edge - no matter which end of the cple you use
hopefully
ahhhhhhh
then on Jlink - just nake sure red wire is on pin 1.
`SEGGER J-Link Commander V6.20g (Compiled Oct 20 2017 17:11:04)
DLL version V6.20g, compiled Oct 20 2017 17:10:55
Connecting to J-Link via USB...O.K.
Firmware: J-Link EDU Mini V1 compiled Oct 6 2017 16:39:00
Hardware version: V1.00
S/N: 801001548
License(s): GDB
VTref = 3.274V
Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify device / core. <Default>: ATSAMD51J19
Type '?' for selection dialog
Device>
Please specify target interface:
J) JTAG (Default)
S) SWD
TIF>SWD
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>1000
Device "ATSAMD51J19" selected.
Connecting to target via SWD
Found SW-DP with ID 0x2BA01477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: AHB-AP (IDR: 0x74770001)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0x41003000
CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ 41003000
ROMTbl[0][0]: E00FF000, CID: B105100D, PID: 000BB4C4 ROM Table
ROMTbl[1] @ E00FF000
ROMTbl[1][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS
ROMTbl[1][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
ROMTbl[1][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl[1][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
ROMTbl[1][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
ROMTbl[1][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
ROMTbl[1][6]: E0042000, CID: B105900D, PID: 003BB907 ETB
Cortex-M4 identified.`
woohooo!
I seriously just picked a different USB port
jlink cable was the same after everyone said red to 1.
we wer consistent
Yeah.
It was just the usb port of choice the whole time
1 port the neopixel wouldn't light, but the smaller lights by the port did
switched ports and the neopixel lit up and the connection worked
yaay!
Wait... my neopixel doesn't light up. The blink code is running fine, though.. and CIRCUITPY shows up. Odd
Ya?
ther is no Neopixel driver in 3.0 yet.
Remember, I haven't flashed the board yet lol.
It lights up as is right now.
Not sure what's on it now
I think it started with a bootlater that will work with an updated bossac - you can go taht route or use the jlink to load an image to it. You can also use the jlink to load a new bootloader taht supports UF2
so the uf2 bootloader I sent you all definitely has bugs
@slender iron so do you recomment sticking with bossac or using it as is for now?
take your time!
I'll wait for that one to flash then @slender iron
@formal plover I have not use JLink Commander for loading - Do you have the JLinkGDBServer
@solar whale all the things! Lol. It's a software pack
Commander is what I pasted the output from though
It's a special ARM version for the Raspberry Pi
the guid https://learn.adafruit.com/debugging-the-samd21-with-gdb/setup?view=all has goo instructions for loading via the GDB server
Is Ozone available for the Pi?
IT has worked well for me on the Mac and Linux.
in commander you may just need to use loadbin but I ahve not tried it.
No Ozone
it wasa separate down load from Segger
@solar whale what file format do you need?
I see it for "Linux" - not an arm version
elf?
elf or bin
Yeah, don't think it's available
gdb will work fine
ok
new uf2
Model: Metro M4
Board-ID: SAMD51G19A-Metro-v0``` is this correct - not sure if it worked
cool
gdb server opens in terminal, has text then closes
looks up where it gets the version number
ddi you do this? JLinkGDBServer -if SWD -device ATSAMD51J19
no at terminal session - exit commander
I usually do it through gdb
does the bootloader load to address 0?
yeah thats where the bootloader goes
tried new bootloader, but 2 issues - drag/drop does not work - copied .uf2 via command lin and it went but I cant get to REPL or mount CIRCUITPY yet....
hrm ok
tryin on MAC
I can't get gdbserver to stay open long enough to read what it's saying lol
taht is JLinkGDBServer
@slender iron drag/drop OK on mac - so thsi may still be the linux fussiness
need to rebuild mac-compatible CP 3.0 just a sec
@kurt - you can try Jlink commander but may want to wait untyl bootloader works better
Ok @solar whale
@slender iron still unable to boot CP after load
@silent radish do you have Dans mod in place?
off by a factor of 4?
yeah, first dst was uinr32_t* and I was shifting it by too much, then I realized it was wrong so I replaced it with block_address, a uint8_t* but didn't change the math
@solar whale I do
@solar whale At least I think so.. rebuilding to be sure
@solar whale Yes, confirmed
Everything looks good except no screen/repl
Interesting thing: screen connect and does nothing. Existing takes forever... but if I reset the m4, screeen exists immediatly
did you load the new bootloader tonight?
Well, and saving the code onto CIRCUITPY halts execution but does not restart it. But CIRCUITPy is still there and the file has been updated.
@umbral dagger it'll do that, the os removed the device screen was connected to when you reset
@solar whale I believe so.. Ozone, the new bootloader bin that @slender iron posted
OK - for me - CIRCUITPY does not appear
Ozone does complain that the mcu can't be halted
I get taht all the time - disconnect USB then force to bootloader and it is happy.
OK.. did it a bit differently.. Ozone behaved like I expected. Confirmed that the new bootloader was flashed.
Still same behaviour: things other than screen/repl seem good
hopefully fixed uf2 bootloader
cool!
I do seem to have flaky mass storage here as well
something is still weird
ans I verivied that I can go back to bootloader and then reboot to CP - What is wrong?
I tried turning on neopixel and using the self updater to do so but it has a crc problem
which I think means the bootloader flashed it wrong
ah, nope I think its a crash in the neopixel code π
On Mac it's... um... different
I get stuff from screen.. but can't get a repl prompt
@solar whale Saw the same on Mac, seeing the same on Linux
My screen session connects, but no response.
Huh
trying without dans mod
@umbral dagger what version are you running?
BTW, 3.0current does not work on a Feather M0 Express. Local build, flashed with bossac, no D:\CPYTHON and no REPL working. Tried various permutations.
without DAns mod - REPL works on the Mac
in repl. copy main.py onto CIRCUITPY. C-d, code starts... AND I can get back into the repl.
linux... assume I'm on linux unless I mention otherwise.
Ubuntu 17.04 to be exact
@formal plover sorry to leave you hanging.....
@slender iron CP currently: Adafruit CircuitPython 3.0.0-alpha.0-38-g0933bf8fb-dirty on 2017-10-24; Metro M4 Express with samd51j19
It's okay @solar whale
I can't help at the moment. deep in uf2 bootloader land
NP - keep at it.
@slender iron Just confirming version now that I can get in the repl to actually see it
@solar whale Ok, thanks. I was just checking someone else's work (who now appears to have changed his handle. π )
Going back to "production" code works fine.
The more deep into something you are @slender iron, the more progress is being made. Haha so no love lost here. Keep up the good work!
π
New bootloader, nice!
@formal plover if you want to try this bootlaoder, it does work
@solar whale well gdb server doesn't appear to work so u dunno how I would go about flashing it
I think you can use jlink commander -- loadbin command
Let's see if it worked. Since I have no idea how to read what the jlink is telling me and it's still full of halt errors - but it did the same thing last time and it still loaded the bootloader.
unplug you USB - and reenter bootlader - if it pulses fast, it is the new one!
continues as long as USB is out
@solar whale okay. What's that command?
I believe the latest one will also have a different version string
thats no fun π
How do I find the version string?
enter bootloader - in METROM4BOOT open INFO_UF2.TXT
Model: Metro M4
Board-ID: SAMD51G19A-Metro-v0```
Nice!
hmmm
it works
I grabbed the one you uploaded last.
@formal plover once you get JLink connected at JLink> prompt try loadbin bootloader.bin (assuming you have bootlaoder.bin in currend directory)
@umbral dagger I forgot - On linux now I don;t get CIRCUITPY mounted until I connect screen and enter REPL
@solar whale uh, no. What? Lol
let me try it first
I tried doing it through JLinkExe and it's still 1.23.0
Either that or it had already worked with Ozone and loadbin did nothing......
If I put the output in, can you decipher it?
Where do I have to have the bootloader stashed to load it?
Target connection not established yet but required for command.
Please specify device / core. <Default>: ATSAMD51J19
Type '?' for selection dialog
Device>ATSAMD51J19
Please specify target interface:
J) JTAG (Default)
S) SWD
TIF>S
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>1000
Device "ATSAMD51J19" selected.
Connecting to target via SWD
Found SW-DP with ID 0x2BA01477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x24770011)
AP[1]: AHB-AP (IDR: 0x74770001)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0x41003000
CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ 41003000
ROMTbl[0][0]: E00FF000, CID: B105100D, PID: 000BB4C4 ROM Table
ROMTbl[1] @ E00FF000
ROMTbl[1][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS
ROMTbl[1][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
ROMTbl[1][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl[1][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
ROMTbl[1][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
ROMTbl[1][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
ROMTbl[1][6]: E0042000, CID: B105900D, PID: 003BB907 ETB
Cortex-M4 identified.
Syntax: loadbin <filename>, <addr>
J-Link>```
@formal plover I specified the path to where it downloaded
@idle owl I dont think you actully ran it - need to do it after connectin=on established.
yes - just a sec
Holding
This is what I have for bootloader: UF2 Bootloader v1.23.0-12-ga89e9fb SFHR Model: Metro M4 Board-ID: SAMD21G19A-Metro-v0
@solar whale Yeah it failed to halt
J-Link>loadbin bootloader.bin Syntax: loadbin <filename>, <addr>
Add the ,0 with no space after.bin
is that the one scott uploaded or did you build it yourself?
Scott uploaded.
We need to start name tagging agin
lol
@idle owl are you telling me to add the ,0?
I have another coming in a sec
@idle owl yes add ,0
good - hopfull with a new verifiable version! π
Hi everyone
Hello @pulsar bloom
@formal plover waht did you type?
loadbin bootloader.bin,0
now with more blinky
@formal plover You're at the JLink> prompt after running JLinkExe ?
need to be in JLink - connected and at Jlink> prompt
connectedv@idle owl @solar whale
UF2 Bootloader v1.23.0-14-g3db9182 SFHR
Have CP express with main .py corrupt. Can get to REPL, will go into bootloader, bossac can not find it , or can Arduino .
I tried reconnecting, still can't halt, so still not getting anywhere with loading.
@pulsar bloom Can you get to the bootloader?
ooh - neopixel!
@idle owl yes will go into bootloader
@idle owl you need to force it into bootloader - I do it by disconnectiin USB then doubletap - then restart and connect JLINK
I realized it be pretty easy because we're only at 48 mhz in the bootloader just like the SAMD21
@pulsar bloom You'll lose everything on it, but download the uf2 flash eraser from here: https://github.com/adafruit/Adafruit_SPIFlash/tree/master/examples/flash_erase_express and follow the steps here: https://circuitpython.readthedocs.io/en/latest/docs/troubleshooting.html#file-system-issues
@pulsar bloom Should clear it up.
Thanks
Model: Metro M4
Board-ID: SAMD51G19A-Metro-v0``` but neopixelis on??
I read INFO_UF2.TXT
hrm
how else can I get version?
none that I know of
if the neopixel is going then you definitely have the latest
are you looking at a cached version?
soooo....i'm probably going to be the last one to come online with my M4, busy with something else right now. has someone documented all the noob startup steps?
apparently ```UF2 Bootloader v1.23.0-14-g3db9182 SFHR
Model: Metro M4
Board-ID: SAMD21G19A-Metro-v0
Oh man. It halted and now it's saying it failed to open file...
linux still struggling with file manager
loadbin bootloader.bin, 0 works after I moved the file to the same folder as jlink
J-Link>loadbin bootloader.bin, 0 Downloading file [bootloader.bin]... Comparing flash [100%] Done. Erasing flash [100%] Done. Programming flash [100%] Done. Verifying flash [100%] Done. J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (16384 bytes) J-Link: Flash download: Total time needed: 0.434s (Prepare: 0.056s, Compare: 0.019s, Erase: 0.093s, Program: 0.236s, Verify: 0.016s, Restore: 0.012s)
Noted!
assuming that all looks right
@idle owl you can use Ozone if that is cleaner.
@formal plover looks great! - If you doubletap you should get a METROM4BOOT File system
@formal plover That did it!
all my code is here, https://github.com/tannewt/uf2-samd/commits/master
I'm off to eat something
@idle owl can you get into bootloader
thanks all for your help!
@slender iron Thank you!!
@slender iron Great job, thank you!
Yayyyy! Hugs all around!
@idle owl - if you disconnetc USB and just have 9v connected can you enter bootloader?
@solar whale I don't have a 9v adapter. This is all via USB
I entered the bootloader connected to USB
oh - sorry - I thought you had one -hmmm - how have you gotten around the "unable to halt" in the past?
I keep connecting it to a USB power adapter when I'm doing the jlink stuff.
I didn't. It was never corrected.
This time I reset it a few times, tried to force it into the bootloader, and reconnected it.
OK - you are in bootloader now - try connecting JLINK
Ok
First of all it resets when I plug the cable back into the M4, but the bootloader came back up.
@solar whale Now what do you want me to do to test it? It didn't give me the halt error until I tried to flash the bootloader. Should I try to do that again?
Or is it not clear that the process was successful...
I should have give report like @formal plover showeed above.
are you in Ozone or JLinkExe
Comparing flash [100%] Done.
Erasing flash [100%] Done.
Programming flash [100%] Done.
Verifying flash [100%] Done.
J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (16384 bytes)
J-Link: Flash download: Total time needed: 0.410s (Prepare: 0.049s, Compare: 0.018s, Erase: 0.094s, Program: 0.220s, Verify: 0.017s, Restore: 0.009s)```
looks good
I checked the version string, it's updated
yay!! -- is the neopixel on?
Yep!
Yeah I had to do what Kurt said, and put the bootloader.bin in the same directory as JLinkExe. No idea why it started halting.
And firmware flash worked the first time!
@formal plover you can try flashing CP3.0
$ vagrant ssh
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-133-generic x86_64)
* Documentation: https://help.ubuntu.com/
System information as of Wed Oct 25 01:52:02 UTC 2017
System load: 0.7 Processes: 86
Usage of /: 3.6% of 39.34GB Users logged in: 0
Memory usage: 13% IP address for eth0: 10.0.2.15
Swap usage: 0%
Graph this data and manage this system at:
https://landscape.canonical.com/
Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud
0 packages can be updated.
0 updates are security updates.
New release '16.04.3 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
vagrant@vagrant-ubuntu-trusty-64:~$
Yeah, @idle owl gave it to me @solar whale
@formal plover t - great - have you tried it yet?
Trying to connect to serial
I had to remove it manually and reconnect it before it would let me do anything with it.
What port for linux?
@formal plover take a look at dmesg and see if you are getting flooded with USB errors?
/dev/ttyACM0
thats a zero
cross compiling micro python and circuit python for esp8266
`>>> t
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 't' is not defined
r
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'r' is not defined
ot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'ot' is not defined
(
...
...
...
... e
... oott o(-
... l
... t
`
I can rename main.py back to main.py while I'm in the REPL and then it lets me flow back and forth between the live serial connection and the REPL no problem. screen connect with main.py in /, and it won't accept input. Interesting. Wouldn't even let me do it from already being in the REPL before, so this is an improvement.
you can try this verison - may be better for RPi
@idle owl the vrsion you gave Kurt was from your Mac and ddi not hav Dans mod to usb.c in it, correct?
@formal plover - try the version I kust posted
Might explain my first flash issue too. I'm going to try yours.
@solar whale k
@idle owl don't - it won't work on Mac.
Oh. Noted.
REPL will not work
I didn't realise compiling it affected how it worked on the device... I thought it was what it was.
I thought it might be different but I thought I was wrong.
the modification to usb.c is the issue
@hollow tartan FYI Ubuntu 17 released this past spring.
it works on Linux but not on Mac.
Ah. So it's not a general thing, it's specifically this.
yes
Ok. So I wasn't off there. Good to know.
I didn't check that in anywhere, just something to try.
I hope Raspberry Pi responds the same.
@formal plover once you flash it, you will not see CIRCUITPY until you connect via screen and start REPL
At least taht is how it works for me....
So it's "working" pretty much. Sort of. I can get it into a state where I can update code on CIRCUITPY, and it reloads. I can get into the repl consistantly. It takes a littel finessing to get there, though.
I'm having issues. Trying to diagnose.
ruh roh..
Welp can't get it to enter bootloader anymore
do you still have JLink connected - if so remove it.
No @solar whale
Removing from command line just works, though. Once I have main.py removed, CIRCUITPY does NOT show up until I screen in (getting dropped into the repl).
after I loaded the 3.0 @idle owl gave me it won't work
@formal plover ah - you may have to reboot your RPi --
Jlink again?... π
the USB issues can make it very unhappy.
@idle owl is fired
shows herself out
or try this: sudo systemctl restart systemd-udevd
lol just rebooting
okay - tuck that away for next time.
I need to spin up another pi
This is my pihole server
constant reboots are no fun
lol
@formal plover Hey I know the guy who wrote PiHole! He just did a preso at the group I had a board meeting for tonight. He'll be presenting again in December.
@formal plover does the board enter bootlaoder - taht is neopixel on even if you dont see METROM4BOOT?
Ok, @umbral dagger thank you for mentioning the force removal of main.py. Mine is now acting like the rest do, where when I connect it, it doesn't show up until I connect to the REPL.
Oh man it's really borked now
@idle owl Wow - I had not gotten to that stae on the Mac, but there is something still funky with USB
@formal plover is taht a technical term?
Output below. I am using Ubuntu 16.04. I have compiled the UF2-SAMD21 without errors and flashed the bootloader.bin so my toolchain worked for that. (The bootdrive shows up on a double click but nothing else) I just cloned circuitpython today and tried a few boards but all the same. Typical output below. I do not understand the error at all.
Output:
/circuitpython/atmel-samd$ make V=1
GEN build-metro_m0_express/genhdr/qstr.i.last
cc1: error: -Werror=lto-type-mismatch: no option -Wl...
@solar whale "borked" oh ya. I've heard that used for... like... ever
@solar whale lol sure is
It took some nonsense to even let me do it via commandline.
@formal plover waht is happening?
@idle owl Then if I copy it back onto CIRCUITPY and C-d it starts up and I can get back to the repl as expected. C-c <return>
Maybe some weird threading issue keeping the repl from starting? If so it could be that main.py loads and starts execution so much faster on the m4. I'll have a peek at the startup code.
