microsoft / pxt-maker

MakeCode target for "Maker" boards (beta)
https://maker.makecode.com/
Other
120 stars 82 forks source link

Adafruit grand central device doesn't read makecode program #328

Open guriaregojo opened 3 years ago

guriaregojo commented 3 years ago

Hi, I am working on the files for the adafruit grand central. The board is already on my local makecode. I can do a new project with it and the simulator works fine (for example when I program the neopixel to turn on as you can see in the screenshots). The problem is that when I download the .uf2 file and put it in my device it doesn't work. I've checked eveything and I can't see to find the problem. The bootloader is not a problem because I already updated it (I updated it with the adafruit v.10 first and then with the microsoft one: v.3.4, now my board is running with the microsoft one.) I dont know if the problem has to do with the files I created for the Grand Central (which seem to work fine as the board is on the simulator) or what the problem is.

PS: it is true that with other makecode blocks (when I program the "on button D2 click" purple block for example, some random cables and buttons appear in the simulator) So basically my problem is: 1) my device doesnt read any makecode program and 2) the simulator does random things.

If you need the updated files of the grand central, I can attach them. Thank you

Screenshot 2021-01-18 at 11 01 53

PHOTO-2020-12-22-11-30-57

Screen Shot 2021-01-14 at 20 39 39 Screen Shot 2021-01-14 at 21 01 20
pelikhan commented 3 years ago

Make sure that all the pins have been mapped properly. Check the values in config.ts against the schematics from Grand Central in Adafruit.

guriaregojo commented 3 years ago

Just checked it again and they are all mapped okay...

wallarug commented 3 years ago

@pelikhan Would there be any reason that MakeCode wouldn't like the fact that there are more registers in this SAMD51 processor compared to other boards? This board has PC and PD registers as well.

pelikhan commented 3 years ago

It’s usually the clocks. Where are your PRs?


From: wallarug notifications@github.com Sent: Tuesday, January 19, 2021 1:58:39 PM To: microsoft/pxt-maker pxt-maker@noreply.github.com Cc: Peli de Halleux jhalleux@microsoft.com; Mention mention@noreply.github.com Subject: Re: [microsoft/pxt-maker] Adafruit grand central device doesn't read makecode program (#328)

@pelikhanhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpelikhan&data=04%7C01%7Cjhalleux%40microsoft.com%7C70bade08bd47417ba7df08d8bc79f19c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637466579218275899%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=w7fyFzRjtjh7o2y12L67vlhr%2BGXfacLhzxsC9fdYPlI%3D&reserved=0 Would there be any reason that MakeCode wouldn't like the fact that there are more registers in this SAMD51 processor compared to other boards?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fpxt-maker%2Fissues%2F328%23issuecomment-762824122&data=04%7C01%7Cjhalleux%40microsoft.com%7C70bade08bd47417ba7df08d8bc79f19c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637466579218285893%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=EO0DLaoVGhvAlVnHjqJvUlg9Wa0V1EkC6KOKYmEgczs%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAA73QKOX5GCJ2Q2DUPAHT23S2V6X7ANCNFSM4WHBURXA&data=04%7C01%7Cjhalleux%40microsoft.com%7C70bade08bd47417ba7df08d8bc79f19c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637466579218285893%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Nk1QPVucHojEls5hi7uG6hWskunCVa6YvAtxzbHluJE%3D&reserved=0.

guriaregojo commented 3 years ago

Here are all the files for the grand central if you want to check them out. Also the dal.d.ts of core---samd51 https://drive.google.com/drive/folders/1aVYAzUJynknWLzuT9VYk9fQLoQf3P3P1?usp=sharing

pelikhan commented 3 years ago

A PR would be easier.


From: lalauria2000 notifications@github.com Sent: Tuesday, January 19, 2021 4:04:42 PM To: microsoft/pxt-maker pxt-maker@noreply.github.com Cc: Peli de Halleux jhalleux@microsoft.com; Mention mention@noreply.github.com Subject: Re: [microsoft/pxt-maker] Adafruit grand central device doesn't read makecode program (#328)

Here are all the files for the grand central if you want to check them out. Also the dal.d.ts of core---samd51 https://drive.google.com/drive/folders/1aVYAzUJynknWLzuT9VYk9fQLoQf3P3P1?usp=sharinghttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdrive.google.com%2Fdrive%2Ffolders%2F1aVYAzUJynknWLzuT9VYk9fQLoQf3P3P1%3Fusp%3Dsharing&data=04%7C01%7Cjhalleux%40microsoft.com%7Cfefe7a2e7b0e4dd91f5a08d8bc8b8d6c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637466654845700165%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=2ftsucqxQepmocZ%2Blvq1gUWqoZyvKIOhbfQ%2F8PFUHcM%3D&reserved=0

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fpxt-maker%2Fissues%2F328%23issuecomment-762900168&data=04%7C01%7Cjhalleux%40microsoft.com%7Cfefe7a2e7b0e4dd91f5a08d8bc8b8d6c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637466654845700165%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=J7iqvNAiR7Ycj7ztuSuvevI0CdAKDlRG8qi%2F76iGh7w%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAA73QKLLPZ4IAQWZC2AMR73S2WNQVANCNFSM4WHBURXA&data=04%7C01%7Cjhalleux%40microsoft.com%7Cfefe7a2e7b0e4dd91f5a08d8bc8b8d6c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637466654845710167%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=1TRPiKhA%2BrhuqvjtCxrT7sLreFcVXtwO82Whlly9VsA%3D&reserved=0.

guriaregojo commented 3 years ago

just opened a new one

pelikhan commented 3 years ago

Could you paste the link here?

guriaregojo commented 3 years ago

https://github.com/microsoft/pxt-maker/pull/329

wallarug commented 3 years ago

Hi there @pelikhan ,

RE: Adafruit Grand Central M4 Express

I have been testing this out and have more details on the problems with the physical hardware. I need some assistance from someone who understands the deep inner workings of MakeCode a bit better than me.

So the simulator works perfectly and as expected. The issue is with the software being deployed to the physical board.

I bought an Adafruit GC M4 Express and wanted to see this for myself. What happens is, no matter what program you put onto the board, it just flashes the D13/LED constantly in a set pattern.

3 very short bursts 3 short bursts

I cannot work out why the physical board is behaving this way.

I have changed the memory allocation, changed the openocd commands in the pxtarget file, adjusted all the pins to the correct Pwm / Digital IO setting. I've run out of ideas at this point and considered just starting from scratch using the Adafruit Metro M4 as the base board.

I suspect this behaviour has something to do with using the larger SAMD51P20A chip vs the currently supported SAMD51J19A chips.

Any ideas how to get this board up and running?

Thanks in advance.

pelikhan commented 3 years ago

It's SOS ... --- .... So something went wrong with the config or hardware. I think we have a guide somewhere to attach gdb and read the debug buffer, panic code. @mmoskal do you remember where you keep that guide?

wallarug commented 3 years ago

Thanks @pelikhan ,

If it's any help. I just did another test with the board using the Metro M4 Express and it is able to run a program no problem. Not sure if this will assist in pointing at the potential problem here.

image

I had an LED physically connected to A13 on the Adafruit Grand Central M4.

guriaregojo commented 3 years ago

Hi @pelikhan @mmoskal could you share the SOS guide to attach gdb and read the debug buffer??

jamesadevine commented 3 years ago

@lalauria2000 https://makecode.com/develop/hw-debugging

Is that what you are looking for?

guriaregojo commented 3 years ago

@jamesadevine It says it works for Circuit Playground Express devices, should I follow those guidelines for the Adafruit Grand Central? I really have no idea if I should use that guide or there is another one...

wallarug commented 3 years ago

Hey @jamesadevine ,

I have been also looking at this.

Could it be because the dependency on the itsybitsy-m4 codal library is not configured to build for a SAMD51P19A?

The Adafruit Grand Central does work with the Metro M4 board.

I'm going to keep striping back the Grand Central M4 code and swapping it with Metro M4 until something starts working. (I prefer this than getting the soldering iron out as per the debugging instructions)

wallarug commented 3 years ago

Hi All,

I think I have solved this one.

In this commit we updated the samd file to recognise the extra PC and PD registers but we did not update the total number of pins.

// if we ever want to support 100+ pin packages, need to add PC,PD ports and increase this to 128
#define DEV_NUM_PINS 128

It is even commented in there to do it. This was 64.

Updating it to 128 does not appear to affect the other board builds. I tested the Metro M4 build and all seems fine.

Can we make a PR and push this change into the pxt-common-packages repo?

pelikhan commented 3 years ago

A PR would be great!


From: wallarug @.> Sent: Saturday, April 10, 2021 5:01:26 PM To: microsoft/pxt-maker @.> Cc: Peli de Halleux @.>; Mention @.> Subject: Re: [microsoft/pxt-maker] Adafruit grand central device doesn't read makecode program (#328)

Hi All,

I think I have solved this one.

In this commithttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fpxt-common-packages%2Fcommit%2Ffd5a0753b498b48fd084d291cedc612618bc9619&data=04%7C01%7Cjhalleux%40microsoft.com%7C6846e76da6b649eca8ff08d8fc318407%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637536636890331249%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=XmOFUleWFYYQhn2l%2B2qE1myOYzGKr%2Fm46%2Fw%2FVTCfkWg%3D&reserved=0 we updated the samd file to recognise the extra PC and PD registers but we did not update the total number of pins.

// if we ever want to support 100+ pin packages, need to add PC,PD ports and increase this to 128

define DEV_NUM_PINS 128

It is even commented in there to do it. This was 64.

Updating it to 128 does not appear to affect the other board builds. I tested the Metro M4 build and all seems fine.

Can we make a PR and push this change into the pxt-common-packages repo?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fpxt-maker%2Fissues%2F328%23issuecomment-817149857&data=04%7C01%7Cjhalleux%40microsoft.com%7C6846e76da6b649eca8ff08d8fc318407%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637536636890331249%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Q0py5%2F%2FJC0GKhnc0CZ0e%2FvENNUB0%2Fe7YB1lJK82lwiY%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAA73QKO52X4NQ5K4FUGPG43TIBR4NANCNFSM4WHBURXA&data=04%7C01%7Cjhalleux%40microsoft.com%7C6846e76da6b649eca8ff08d8fc318407%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637536636890341242%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=aTXhZULEzEAZDbH1IdL6uqp33vSczPtD3%2ByyPE%2FweHE%3D&reserved=0.

wallarug commented 3 years ago

No worries! PR is in. https://github.com/microsoft/pxt-common-packages/pull/1245

I have tested that pins on PD do work as well.

Thank you everyone for your support on this.