Skip to content

ports: adafruit grand central board support #15889

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

graeme-winter
Copy link
Contributor

@graeme-winter graeme-winter commented Sep 21, 2024

Summary

Adds board support for Adafruit Grand Central M4 (this is an updated version of #11104 which I am about to close, and includes contributions from @robert-hh)

Board: https://www.adafruit.com/product/4064

Testing

Derived from PR which had fairly extensive testing, but re-built against current head of master to resurrect support: tested against hardware, DAC tests reported in previous PR.

@graeme-winter
Copy link
Contributor Author

Creating as draft PR to allow CI to run

@graeme-winter graeme-winter force-pushed the adafruit-grand-central-redux branch from 74a0c88 to afba2e5 Compare September 21, 2024 08:54
Copy link

github-actions bot commented Sep 21, 2024

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@graeme-winter
Copy link
Contributor Author

Following suggestion from @robert-hh on #11104 have split off the DAC fix commit into a separate PR #15890 and this one is rebased against that

@robert-hh
Copy link
Contributor

The PR still includes the commit for the changed machine_dac.c. You can remove it with git rebase -i

Include QSPI pin definitions suggested by @robert-hh, and link photograph
of board referenced from micropython-media. Also includes definitions to
allow SD card use, so bake in sdcard driver, and point at 8MB QSPI flash
for file system. ATSAMD51P20A has room for ~1MB compiled code so use.

Includes updated pins.csv from @robert-hh

Co-authored-by: robert-hh <robert@hammelrath.com>
Signed-off-by: Graeme Winter <graeme.winter@gmail.com>
@graeme-winter graeme-winter force-pushed the adafruit-grand-central-redux branch from 6d1b622 to 364abfa Compare September 21, 2024 16:32
@graeme-winter
Copy link
Contributor Author

The PR still includes the commit for the changed machine_dac.c. You can remove it with git rebase -i

Removed - I had left it in for testing assuming #15890 will get merged first

@graeme-winter graeme-winter marked this pull request as ready for review September 21, 2024 16:40
@graeme-winter
Copy link
Contributor Author

Will need to add TC to generate PWM signal alongside TCC, since some conspicuous pins (e.g. D13) are not connected to TCC peripherals on this board. Also need to extend pins.csv to cover all the pins.

@graeme-winter
Copy link
Contributor Author

Note: also need to check / update ports/samd/mcu/samd51/pin-af-table.csv

@graeme-winter
Copy link
Contributor Author

Will need to add TC to generate PWM signal alongside TCC, since some conspicuous pins (e.g. D13) are not connected to TCC peripherals on this board. Also need to extend pins.csv to cover all the pins.

From the notes: TC - These device are currently not assigned to Pin. the TC device pair 0/1 is used for ticks_us(). PB01 is connected to:

33 PB01          D13 IRQ: 1 ADC0:13 ADC1: - Serial1:  -  Serial2: 5/3 TC: 7/1 PWM1:  -  PWM2:  -

So 7/1 probably available

@robert-hh
Copy link
Contributor

Will need to add TC to generate PWM signal alongside TCC, since some conspicuous pins (e.g. D13) are not connected to TCC peripherals on this board. Also need to extend pins.csv to cover all the pins.

I was an intentional decision to use only TCC for PWM and keep TC for other tasks. TC is used for instance by ADC timed and DAC timed. That fact that not all pins can be used for PWM seems acceptable. That applies to other ports as well. Why do you need a PWM signal at D13?

@robert-hh
Copy link
Contributor

also need to check / update ports/samd/mcu/samd51/pin-af-table.csv

What is missing in pin-af-table.csv and adafruit grand central's pins.csv?

@robert-hh
Copy link
Contributor

What's missing in this PR is a chapter in the pins assignment document micropython/docs/samd/pinout.rst.

@graeme-winter
Copy link
Contributor Author

also need to check / update ports/samd/mcu/samd51/pin-af-table.csv

What is missing in pin-af-table.csv and adafruit grand central's pins.csv?

Now I see that I was looking for D53 but this had been differently aliased in your csv file, as CS, will explore if we can have both.

@dpgeorge dpgeorge added port-samd board-definition New or updated board definition files. Combine with a port- label. labels Jan 23, 2025
@dpgeorge
Copy link
Member

The DAC PR has now been merged.

This board definition looks OK to me, but as @robert-hh mentioned it needs a section added to docs/samd/pinout.rst.

@robert-hh
Copy link
Contributor

@graeme-winter To make your life a little bit easier, here is an updated pinout.rst file. I do not have the Grand Cemtral board, so I loaded the Image to another board with a SAMD51x20 using your pins.csv file. So it should match.

pinout.zip

@robert-hh
Copy link
Contributor

@dpgeorge Since this is about boards: since a while I have a set of GENERIC board definitions. Is it worth adding these? And there are a few other SAMD21 board definitions which could be added, if "Just another board" is not too boring.

@dpgeorge
Copy link
Member

since a while I have a set of GENERIC board definitions. Is it worth adding these?

For the samd port? Is it possible to make them generic, eg with generic clock/crystal settings (and I guess not SPI flash)? I guess that could be useful, but it would also be useful to then have a list of boards for which the generic firmware is known to work with, so that users can be somewhat assured that it's worth trying and won't brick their board (even though it's very unlikely to brick something).

And there are a few other SAMD21 board definitions which could be added, if "Just another board" is not too boring.

If you have the hardware for these and they are relatively common, then, yes, it's worth adding them.

But, please move this discussion to a separate PR so we don't derail this one.

@robert-hh
Copy link
Contributor

@graeme-winter Sorry, I should follow my own recipe of testing before posting. There was an error in the .rst file.
pinout.zip

@dpgeorge Will open a new PR. The generic boards use the internal oscillator, like the ItsyBitsy boards, and only the internal flash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
board-definition New or updated board definition files. Combine with a port- label. port-samd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants