Skip to content

Commit 0fa04e9

Browse files
committed
- Fixed USB issues. REPL & CIRCUITPY: drive now function correctly! - Fixed bugs with Internal Flash filesystem. Files now write & read back correctly. - Added copyright headers for all files.
1 parent e6c4c78 commit 0fa04e9

27 files changed

Lines changed: 243 additions & 180 deletions

ports/analog/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This file is part of the CircuitPython project: https://circuitpython.org
22
#
33
# SPDX-FileCopyrightText: Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
4+
# SPDX-FileCopyrightText: Copyright (c) 2024 Brandon Hurst, Analog Devices, Inc.
45
#
56
# SPDX-License-Identifier: MIT
67

ports/analog/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ Universal instructions on flashing MAX32 devices this project can be found in th
3838

3939
In addition, a user may flash the device by calling `make` with the `flash-msdk` target from within the `ports/analog` directory, as below:
4040

41-
$ make BOARD=<target board> flash-msdk
41+
```
42+
$ make BOARD=<target board> flash-msdk
43+
```
4244

4345
This requires the following:
4446
- A MAX32625PICO is connected to the PC via USB
@@ -48,4 +50,10 @@ This requires the following:
4850

4951
### Using the REPL
5052

51-
[**Section in Progress. USB support needs implementation & test.**]
53+
Once the device is plugged in, it will enumerate via USB as both a USB Serial Device (CDC) and a Mass Storage Device (MSC). You can connect to the Python REPL with your favorite Serial Monitor program e.g. TeraTerm, VS Code, Putty, etc. Use any buadrate with 8-bit, No Parity, 1 Stop Bit (8N1) settings. From this point forward, you can run Python code on the MCU! If you want help with learning CircuitPython-specific code or learning Python in general, a good place to start is Adafruit's ["Welcome to CircuitPython"](https://learn.adafruit.com/welcome-to-circuitpython/) guide.
54+
55+
### Editing code.py
56+
57+
Python code may be executed from `code.py` the `CIRCUITPY:` drive. When editing this file, please be aware that some text editors will work better than others. A list of suggested text editors can be found at Adafruit's guide here: https://learn.adafruit.com/welcome-to-circuitpython/recommended-editors
58+
59+
Once you save `code.py`, it gets written back to the device you are running Circuitpython on, and will automatically run and output it's result to the REPL. You can also automatically reload and run code.py any time from the REPL by pressing CTRL+D.

ports/analog/background.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// This file is part of the CircuitPython project: https://circuitpython.org
22
//
33
// SPDX-FileCopyrightText: Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
4+
// SPDX-FileCopyrightText: Copyright (c) 2024 Brandon Hurst, Analog Devices, Inc.
45
//
56
// SPDX-License-Identifier: MIT
67

ports/analog/background.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// This file is part of the CircuitPython project: https://circuitpython.org
22
//
33
// SPDX-FileCopyrightText: Copyright (c) 2019 Dan Halbert for Adafruit Industries
4+
// SPDX-FileCopyrightText: Copyright (c) 2024 Brandon Hurst, Analog Devices, Inc.
45
//
56
// SPDX-License-Identifier: MIT
67

ports/analog/boards/APARD/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,25 @@ For more info about AD-APARD32690-SL, visit our product webpages for datasheets,
1212

1313
[AD-APARD32690-SL Product Webpage](https://www.analog.com/en/resources/evaluation-hardware-and-software/evaluation-boards-kits/ad-apard32690-sl.html)
1414
[AD-APARD32690-SL User Guide](https://wiki.analog.com/resources/eval/user-guides/ad-apard32690-sl)
15+
16+
#### Building for this board
17+
18+
To build for this board, ensure you are in the `ports/analog` directory and run the following command. Note that passing in the `-jN` flag, where N is the # of cores on your machine, can speed up compile times.
19+
20+
```
21+
make BOARD=APARD
22+
```
23+
24+
#### Flashing this board
25+
26+
To flash the board, run the following command if using the MAX32625PICO:
27+
28+
```
29+
make BOARD=APARD flash-msdk
30+
```
31+
32+
If using Segger JLink, please run the following command instead:
33+
34+
```
35+
make BOARD=APARD flash-jlink
36+
```

ports/analog/boards/APARD/board.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is part of the CircuitPython project: https://circuitpython.org
22
//
3-
// SPDX-FileCopyrightText: Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
3+
// SPDX-FileCopyrightText: Copyright (c) 2024 Brandon Hurst, Analog Devices, Inc
44
//
55
// SPDX-License-Identifier: MIT
66

@@ -26,7 +26,7 @@ const int num_leds = (sizeof(led_pin) / sizeof(mxc_gpio_cfg_t));
2626

2727
// DEFAULT: Using the weak-defined supervisor/shared/board.c functions
2828

29-
/***** OPTIONAL BOARD-SPECIFIC FUNTIONS from supervisor/board.h *****/
29+
/***** OPTIONAL BOARD-SPECIFIC FUNCTIONS from supervisor/board.h *****/
3030
// Returns true if the user initiates safe mode in a board specific way.
3131
// Also add BOARD_USER_SAFE_MODE in mpconfigboard.h to explain the board specific
3232
// way.

ports/analog/boards/APARD/mpconfigboard.h

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// This file is part of the CircuitPython project: https://circuitpython.org
22
//
33
// SPDX-FileCopyrightText: Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
4+
// SPDX-FileCopyrightText: Copyright (c) 2024 Brandon Hurst, Analog Devices Inc.
45
//
56
// SPDX-License-Identifier: MIT
67

@@ -20,18 +21,18 @@
2021
#define FLASH_SIZE (0x300000) // 3MiB
2122
#define FLASH_PAGE_SIZE (0x4000) // 16384 byte pages (16 KiB)
2223

23-
#define BOARD_HAS_CRYSTAL 1
24+
#define BOARD_HAS_CRYSTAL 1
25+
#define NUM_GPIO_PORTS 4
26+
#define CONSOLE_UART MXC_UART0
2427

25-
#define NUM_GPIO_PORTS 4
26-
27-
#if INTERNAL_FLASH_FILESYSTEM
28-
#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR (0x102FC000) // for MAX32690
29-
#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (64 * 1024) // 64K
28+
// #if INTERNAL_FLASH_FILESYSTEM
29+
#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR (0x102E0000) // for MAX32690
30+
#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (128 * 1024) // 64K
3031

3132
#define MAX32_FLASH_SIZE 0x300000 // 3 MiB
32-
#define INTERNAL_FLASH_FILESYSTEM_SIZE 0x10000 // 64KiB
33-
#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x102FC000 // Load into the last MiB of code/data storage
33+
#define INTERNAL_FLASH_FILESYSTEM_SIZE CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE
34+
#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x102E0000 // Load into the last MiB of code/data storage
3435

35-
#else
36-
#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0)
37-
#endif
36+
// #else
37+
// #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0)
38+
// #endif

ports/analog/boards/APARD/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This file is part of the CircuitPython project: https://circuitpython.org
22
#
33
# SPDX-FileCopyrightText: Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
4+
# SPDX-FileCopyrightText: Copyright (c) 2024 Brandon Hurst, Analog Devices, Inc
45
#
56
# SPDX-License-Identifier: MIT
67

ports/analog/boards/APARD/pins.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// This file is part of the CircuitPython project: https://circuitpython.org
22
//
33
// SPDX-FileCopyrightText: Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
4+
// SPDX-FileCopyrightText: Copyright (c) 2024 Brandon Hurst, Analog Devices, Inc.
45
//
56
// SPDX-License-Identifier: MIT
67

ports/analog/common-hal/microcontroller/Pin.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2024 Brandon Hurst, Analog Devices, Inc
4+
//
5+
// SPDX-License-Identifier: MIT
16

27
#include <stdbool.h>
38

0 commit comments

Comments
 (0)