-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add support for ADI MAX32690 microcontroller #9667
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the new port! I'm excited to try it. I've added a few comments. Nothing major.
@Brandon-Hurst Do you want a review on this? I'm back from paternity leave for the time being. |
It should be ready as far as all the requested changes and I've tested it pretty thoroughly. I had to rebase to fix the last erring CI check on the readthedocs task, and now it shows 300+ commits instead of like 30 so that may need to be fixed first 😅 sorry about that. |
…ent/unstub, but builds clean.
- Added simple status LED for initial testing - Generally cleaned up & implemented supervisor/port.c - Added some additional commenting from supervisor headers - Fixed a linkerscript issue copying .text into FLASH_ISR
- (build): added hex & bin targets for executable. - (build): temporarily modified .ld due to issue exiting MAX32 ROM code - (flash): added flash target for jlink & msdk, along with helper files under tools/ - Reorganized mpconfigport.mk for clarity - Moved flash driver & LED/PB definitions to board files (mpconfigboard._)
…Placed in supervisor/port.c - Moved LEDs & PBs from supervisor/port.c to boards/$(BOARD)/board.c for APARD - Reviewed Processor.c in common-hal/microcontroller - Prepared stubs for common-hal/microcontroller/Pin.c
…. - Enabled USB-based modules & dependencies in mpconfigport.mk
…umerates but has some issues starting interfaces for CDC/MSC/HID.
…be usable. - Had to adjust some shared modules to account for MAX32 devices not supporting IN/OUT endpoints on the same EP #
… Fixed bugs with Internal Flash filesystem. Files now write & read back correctly. - Added copyright headers for all files.
…h in microcontroller/Pin.c
…re. Added priority to remaining TODOs (low)
…h interrupt_after_ticks. - Move LED inidcator to STATUS_LED code.
… GPIO Port 4 (different on MAX32690). - Added MCR defs to max32_port.h.
…g pullup/pulldown
435ecc6
to
491b7bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small things. I'm excited to get this merged in!
// Enable GPIO (enables clocks + common init for ports) | ||
for (int i = 0; i < MXC_CFG_GPIO_INSTANCES; i++) { | ||
err = MXC_GPIO_Init(0x1 << i); | ||
if (err) { | ||
return SAFE_MODE_PROGRAMMATIC; | ||
} | ||
} | ||
|
||
// Init Board LEDs | ||
/* setup GPIO for the LED */ | ||
for (int i = 0; i < num_leds; i++) { | ||
// Set the output value | ||
MXC_GPIO_OutClr(led_pin[i].port, led_pin[i].mask); | ||
|
||
if (MXC_GPIO_Config(&led_pin[i]) != E_NO_ERROR) { | ||
return SAFE_MODE_PROGRAMMATIC; | ||
} | ||
} | ||
|
||
// Turn on one LED to indicate Sign of Life | ||
MXC_GPIO_OutSet(led_pin[2].port, led_pin[2].mask); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you get the status LED working? It should replace this code.
volatile uint32_t system_ticks = 0; | ||
|
||
void SysTick_Handler(void) { | ||
system_ticks++; | ||
} | ||
|
||
uint32_t board_millis(void) { | ||
return system_ticks; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this board specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems unusual to have to provide board_millis
. Unless I'm mistaken, this identifier is not otherwise used in CircuitPython. Rather, it seems it may be defined & used in tinyusb:
// lib/tinyusb/hw/bsp/max32690/family.c
#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
void SysTick_Handler(void) {
system_ticks++;
}
uint32_t board_millis(void) {
return system_ticks;
}
#endif
Perhaps there's a mistake with the #defines
for tinyusb?
Description
Add support for 2 boards: MAX32690EVKIT and AD-APARD32690-SL.
Status
At the moment, this port only includes
digitalio
in addition to the supervisor and USB workflow required to get CircuitPython functioning. Pinouts listed are currently just the MCU pins; happy to change as needed to better match any requirements for form factor or pin function. I plan to follow this up with abusio
PR soon, but will be more tied up in the next couple months. Still happy to make changes as needed to this PR though.USB Endpoint Enumeration Change
There is a small important bit I had to change to the way CircuitPython handles settings up USB Endpoints:
Many thanks to @tannewt and @dhalbert for the help :)