diff --git a/README.md b/README.md
index 0e03205..7743744 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,68 @@
# ArduinoCore-AT32F4
-## Using this core with the Arduino IDE
+## Introduction
-To compile for this core with the Arduino IDE, add the following URL to the boards manager.
+This repository is a fork of the original work by [WeActStudio](https://github.com/WeActStudio/ArduinoCore-AT32F4).
-`https://raw.githubusercontent.com/WeActStudio/ArduinoCore-AT32F4/main/package_at32_index.json`
-![image](https://user-images.githubusercontent.com/57818792/180649925-ed366423-5f76-42d5-b801-dd5ed2923825.png)
+The purpose of this fork is to extend support for compiling and uploading Arduino code to WeAct AT32F4-based boards. It's important to note that this fork does not aim to introduce improvements or fixes to the original work by WeActStudio.
+
+### Changes for macOS M1
+
+This fork includes the following changes specifically for macOS M1:
+
+- Addition of the ARM64 version of the GCC compiler (`xpack-arm-none-eabi-gcc-11.2.1-1.2-darwin-arm64`).
+- Inclusion of the Artery OpenOCD port, which provides versions for Windows, Linux, and macOS.
+- Addition of a shell script for the Artery ISP Console upload method. This script prints a message indicating that this upload method is currently not available for macOS.
+
+### Supported Upload Methods
+
+Currently, the following upload method is supported:
+
+- OpenOCD via a DAPLink adapter.
+- OpenOCD via a ST-Link adapter
+
+For testing purposes, the [WeActStudio Mini Debugger](https://github.com/WeActStudio/WeActStudio.MiniDebugger) (ST-Link STM32F103CBT6 and DAPLink APM32F103CBT6) was used.
+
+### Adding the Core to Arduino
+
+To add the core to Arduino, follow these steps:
+
+1. Add the following URL to the Arduino Boards Manager:
+
+`https://raw.githubusercontent.com/KenjutsuGH/ArduinoCore-AT32F4/main/package_at32_index.json`
+
+2. Proceed to **Tools** -> **Boards Manager** in the Arduino IDE and search for **AT32**.
+
+
+
+3. After the installation is complete, you'll be able to select the WeActStudio board.
+
+
+
+## Uploading to the WeActStudio board
+
+For the purpose of this demonstration, navigate to **Files** -> **Examples** -> **01.Basics** -> **Blink**. Under the **Tools** menu, the following upload methods are available:
+
+
+
+- The default option, **Artery DFU ISP**, is currently not supported on macOS and will produce the following error when attempting to upload to the board:
+
+
+
+- The next option is **Artery OpenOCD DAPLink**. Ensure that the DAPLink adapter is correctly connected to the AT32F4 board before proceeding with the upload. Now the upload should proceed as expected:
+
+
+
+- The next option is **Artery OpenOCD ST-Link**. Ensure that the ST-Link adapter is correctly connected to the AT32F4 board before proceeding with the upload. Now the upload should proceed as expected:
+
+
+
+
+## Disclaimer
+
+The code and information provided in this repository are for educational and informational purposes only. While efforts have been made to ensure the accuracy and reliability of the content, no warranty, express or implied, is provided regarding the completeness, accuracy, reliability, suitability, or availability of the code or information contained herein.
+
+Usage of the code and information from this repository is at your own risk. The author(s) and contributors of this repository shall not be liable for any loss, damage, or injury arising from the use of or reliance on the code or information provided, including but not limited to direct, indirect, incidental, consequential, or punitive damages.
+
+Furthermore, the code and information provided in this repository may be subject to change without notice. The author(s) and contributors reserve the right to modify, update, or remove any content from this repository at their discretion.
+
+By accessing and using the code and information from this repository, you agree to indemnify and hold harmless the author(s) and contributors from any claims, damages, losses, liabilities, costs, and expenses arising from or related to your use of or reliance on the code or information provided herein.
diff --git a/boards.txt b/boards.txt
index c251953..557f002 100644
--- a/boards.txt
+++ b/boards.txt
@@ -85,4 +85,14 @@ WeActStudioAT32F4.menu.pll_output_range.pll_output_range_le72mhz.build.f_pll_out
WeActStudioAT32F4.menu.upload_method.USBDFUMethod=Artery DFU ISP
WeActStudioAT32F4.menu.upload_method.USBDFUMethod.upload.protocol=Artery_ISP
WeActStudioAT32F4.menu.upload_method.USBDFUMethod.upload.tool=Artery_ISP_Console
-WeActStudioAT32F4.menu.upload_method.USBDFUMethod.upload.maximum_size=1048576
\ No newline at end of file
+WeActStudioAT32F4.menu.upload_method.USBDFUMethod.upload.maximum_size=1048576
+
+WeActStudioAT32F4.menu.upload_method.OpenOCDDAPLink=Artery OpenOCD DAPLink
+WeActStudioAT32F4.menu.upload_method.OpenOCDDAPLink.upload.protocol=cmsis-dap-v2
+WeActStudioAT32F4.menu.upload_method.OpenOCDDAPLink.upload.tool=ArteryOpenOCD
+WeActStudioAT32F4.menu.upload_method.OpenOCDDAPLink.upload.maximum_size=1048576
+
+WeActStudioAT32F4.menu.upload_method.OpenOCDSTLink=Artery OpenOCD ST-Link
+WeActStudioAT32F4.menu.upload_method.OpenOCDSTLink.upload.protocol=stlink
+WeActStudioAT32F4.menu.upload_method.OpenOCDSTLink.upload.tool=ArteryOpenOCD
+WeActStudioAT32F4.menu.upload_method.OpenOCDSTLink.upload.maximum_size=1048576
diff --git a/images/BoardSelected.png b/images/BoardSelected.png
new file mode 100644
index 0000000..e73c448
Binary files /dev/null and b/images/BoardSelected.png differ
diff --git a/images/BoardsManagerAT32.png b/images/BoardsManagerAT32.png
new file mode 100644
index 0000000..a3321b8
Binary files /dev/null and b/images/BoardsManagerAT32.png differ
diff --git a/images/DFU.png b/images/DFU.png
new file mode 100644
index 0000000..6bc0caf
Binary files /dev/null and b/images/DFU.png differ
diff --git a/images/OpenOCD.png b/images/OpenOCD.png
new file mode 100644
index 0000000..4a3d17c
Binary files /dev/null and b/images/OpenOCD.png differ
diff --git a/images/UploadMethods.png b/images/UploadMethods.png
new file mode 100644
index 0000000..ab3cdde
Binary files /dev/null and b/images/UploadMethods.png differ
diff --git a/package_at32_index.json b/package_at32_index.json
index 8e50268..698aeec 100644
--- a/package_at32_index.json
+++ b/package_at32_index.json
@@ -4,9 +4,9 @@
"name": "WeActStudio",
"maintainer": "WeActStudio",
"email": "",
- "websiteURL": "https://github.com/WeActStudio/ArduinoCore-AT32F4/",
+ "websiteURL": "https://github.com/KenjutsuGH/ArduinoCore-AT32F4/",
"help": {
- "online": "https://github.com/WeActStudio/ArduinoCore-AT32F4/"
+ "online": "https://github.com/KenjutsuGH/ArduinoCore-AT32F4/"
},
"platforms": [
{
@@ -14,7 +14,7 @@
"architecture": "at32f403a",
"version": "0.0.9",
"category": "Contributed",
- "url": "https://github.com/WeActStudio/ArduinoCore-AT32F4/archive/refs/heads/main.zip",
+ "url": "https://github.com/KenjutsuGH/ArduinoCore-AT32F4/archive/refs/tags/v0.0.9.zip",
"archiveFileName": "ArduinoCore-AT32F4-main.zip",
"help": {
"online": ""
@@ -34,6 +34,11 @@
"packager": "WeActStudio",
"name": "Artery_ISP_Console",
"version": "0.0.1"
+ },
+ {
+ "packager": "WeActStudio",
+ "name": "ArteryOpenOCD",
+ "version": "0.1100.220911"
}
]
}
@@ -56,8 +61,14 @@
"archiveFileName": "xpack-arm-none-eabi-gcc-11.2.1-1.2-linux-x64.tar.gz",
"checksum": "SHA-256:7479becc1ea98fbceecadf1f036ddaba8dc39c9cce5cb45f0a7a36e923d33c9a",
"size": "235243515"
+ },
+ {
+ "host": "x86_64-apple-darwin",
+ "url": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v11.2.1-1.2/xpack-arm-none-eabi-gcc-11.2.1-1.2-darwin-arm64.tar.gz",
+ "archiveFileName": "xpack-arm-none-eabi-gcc-11.2.1-1.2-darwin-arm64.tar.gz",
+ "checksum": "SHA-256:85afae936d84b5ed94ad15300d2333d4b0af34b53bbf92283e558a96209d0dd7",
+ "size": "231851100"
}
-
]
},
{
@@ -77,8 +88,42 @@
"archiveFileName": "Artery_ISP_Console_Linux_V3.0.01.tar.bz2",
"size": "14810873",
"checksum": "SHA-256:f84a0a2156a6b4bb8e8ccbc6d9b297517a526dfc857c4789176a906c91c26f77"
+ },
+ {
+ "host": "x86_64-apple-darwin",
+ "url": "https://raw.githubusercontent.com/KenjutsuGH/ArteryOpenOCD_Arduino_Tools/main/tools/Artery_ISP_Console_MacOS_Unavail.tar.bz2",
+ "archiveFileName": "Artery_ISP_Console_MacOS_Unavail.tar.bz2",
+ "size": "398",
+ "checksum": "SHA-256:84e48941ec8cc17617662e5d0cb5864e8064b4d6f81a847e3918834f17180448"
}
]
+ },
+ {
+ "name": "ArteryOpenOCD",
+ "version": "0.1100.220911",
+ "systems": [
+ {
+ "host": "i686-mingw32",
+ "url": "https://raw.githubusercontent.com/KenjutsuGH/ArteryOpenOCD_Arduino_Tools/main/tools/tool-openocd-at32-0.1100.220911.tar.gz",
+ "archiveFileName": "tool-openocd-at32-0.1100.220911.tar.gz",
+ "size": "5816791",
+ "checksum": "SHA-256:21ab0c36b9b43412a91ff972dde63c1cd7faf5d80ef81d0d2c7384256fa4ad17"
+ },
+ {
+ "host": "x86_64-pc-linux-gnu",
+ "url": "https://raw.githubusercontent.com/KenjutsuGH/ArteryOpenOCD_Arduino_Tools/main/tools/tool-openocd-at32-0.1100.220911.tar.gz",
+ "archiveFileName": "tool-openocd-at32-0.1100.220911.tar.gz",
+ "size": "5816791",
+ "checksum": "SHA-256:21ab0c36b9b43412a91ff972dde63c1cd7faf5d80ef81d0d2c7384256fa4ad17"
+ },
+ {
+ "host": "x86_64-apple-darwin",
+ "url": "https://raw.githubusercontent.com/KenjutsuGH/ArteryOpenOCD_Arduino_Tools/main/tools/tool-openocd-at32-0.1100.220911.tar.gz",
+ "archiveFileName": "tool-openocd-at32-0.1100.220911.tar.gz",
+ "size": "5816791",
+ "checksum": "SHA-256:21ab0c36b9b43412a91ff972dde63c1cd7faf5d80ef81d0d2c7384256fa4ad17"
+ }
+ ]
}
]
}
diff --git a/platform.txt b/platform.txt
index 04eae01..ce381b1 100644
--- a/platform.txt
+++ b/platform.txt
@@ -68,3 +68,17 @@ tools.Artery_ISP_Console.path={runtime.tools.Artery_ISP_Console.path}
tools.Artery_ISP_Console.upload.params.verbose=-d
tools.Artery_ISP_Console.upload.params.quiet=
tools.Artery_ISP_Console.upload.pattern="{path}/{cmd}" "{build.path}/{build.project_name}.hex"
+
+#
+# OpenOCD DAP-Link / ST-Link
+#
+
+tools.ArteryOpenOCD.cmd=openocd
+tools.ArteryOpenOCD.cmd.macosx=bin-darwin_x86_64/openocd
+tools.ArteryOpenOCD.cmd.linux=bin-linux_x86_64/openocd
+tools.ArteryOpenOCD.cmd.windows=bin-windows_amd64/openocd.exe
+tools.ArteryOpenOCD.path={runtime.tools.ArteryOpenOCD.path}
+
+tools.ArteryOpenOCD.upload.params.verbose=-d
+tools.ArteryOpenOCD.upload.params.quiet=
+tools.ArteryOpenOCD.upload.pattern="{path}/{cmd}" -s {path}/scripts -f {path}/scripts/interface/{upload.protocol}.cfg -f {path}/scripts/target/at32f403axx.cfg -c init -c "program {build.path}/{build.project_name}.hex verify reset exit"