Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
guriaregojo opened this issue Jan 18, 2021 · 19 comments
Open

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

guriaregojo opened this issue Jan 18, 2021 · 19 comments

Comments

@guriaregojo
Copy link
Contributor

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](https://user-images.githubusercontent.com/73877383/104900669-a1c82f80-597c-11eb-9de3-29e8e1f63392.jpg)

Screen Shot 2021-01-14 at 20 39 39

Screen Shot 2021-01-14 at 21 01 20

@pelikhan
Copy link
Member

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
Copy link
Contributor Author

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

@wallarug
Copy link
Contributor

wallarug commented Jan 19, 2021

@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
Copy link
Member

pelikhan commented Jan 19, 2021 via email

@guriaregojo
Copy link
Contributor Author

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
Copy link
Member

pelikhan commented Jan 19, 2021 via email

@guriaregojo
Copy link
Contributor Author

just opened a new one

@pelikhan
Copy link
Member

Could you paste the link here?

@guriaregojo
Copy link
Contributor Author

#329

@wallarug
Copy link
Contributor

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
Copy link
Member

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
Copy link
Contributor

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
Copy link
Contributor Author

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

@jamesadevine
Copy link
Member

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

Is that what you are looking for?

@guriaregojo
Copy link
Contributor Author

@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
Copy link
Contributor

wallarug commented Apr 10, 2021

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
Copy link
Contributor

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
Copy link
Member

pelikhan commented Apr 10, 2021 via email

@wallarug
Copy link
Contributor

No worries! PR is in. microsoft/pxt-common-packages#1245

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

Thank you everyone for your support on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants