Skip to content

Commit

Permalink
core mods adapted, MiniCore works
Browse files Browse the repository at this point in the history
  • Loading branch information
felias-fogg committed Dec 31, 2024
1 parent e0c74c7 commit 1f28c41
Show file tree
Hide file tree
Showing 7 changed files with 201 additions and 15 deletions.
151 changes: 151 additions & 0 deletions core-mods/MiniCore-mods/Add_dw-link-tools-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
#!/bin/bash

AUTHOR=felias-fogg # Github username
REALAUTHOR=MCUDude # Real author name
REPOSITORY=MiniCore # Github repo name

DWTOOLS_VERSION="1.3.0"

OS_PLATFORM1="Linux_ARMv6"
OS_PLATFORM2="Linux_ARM64"
OS_PLATFORM3="macOS_64bit"
OS_PLATFORM4="Linux_64bit"
OS_PLATFORM5="Linux_32bit"
OS_PLATFORM6="Windows_32bit"

HOST1="arm-linux-gnueabihf"
HOST2="aarch64-linux-gnu"
HOST3="x86_64-apple-darwin"
HOST4="x86_64-linux-gnu"
HOST5="i686-linux-gnu"
HOST6="i686-mingw32"

FILE1=dw-link-tools-${DWTOOLS_VERSION}_${HOST1}.tar.bz2
FILE2=dw-link-tools-${DWTOOLS_VERSION}_${HOST2}.tar.bz2
FILE3=dw-link-tools-${DWTOOLS_VERSION}_${HOST3}.tar.bz2
FILE4=dw-link-tools-${DWTOOLS_VERSION}_${HOST4}.tar.bz2
FILE5=dw-link-tools-${DWTOOLS_VERSION}_${HOST5}.tar.bz2
FILE6=dw-link-tools-${DWTOOLS_VERSION}_${HOST6}.tar.bz2

URL1=https://felias-fogg.github.io/dw-tools/${FILE1}
URL2=https://felias-fogg.github.io/dw-tools/${FILE2}
URL3=https://felias-fogg.github.io/dw-tools/${FILE3}
URL4=https://felias-fogg.github.io/dw-tools/${FILE4}
URL5=https://felias-fogg.github.io/dw-tools/${FILE5}
URL6=https://felias-fogg.github.io/dw-tools/${FILE6}

# Download files
wget --no-verbose $URL1
wget --no-verbose $URL2
wget --no-verbose $URL3
wget --no-verbose $URL4
#wget --no-verbose $URL5
wget --no-verbose $URL6

SIZE1=$(wc -c $FILE1 | awk '{print $1}')
SIZE2=$(wc -c $FILE2 | awk '{print $1}')
SIZE3=$(wc -c $FILE3 | awk '{print $1}')
SIZE4=$(wc -c $FILE4 | awk '{print $1}')
#SIZE5=$(wc -c $FILE5 | awk '{print $1}')
SIZE6=$(wc -c $FILE6 | awk '{print $1}')

SHASUM1=$(shasum -a 256 $FILE1 | awk '{print "SHA-256:"$1}')
SHASUM2=$(shasum -a 256 $FILE2 | awk '{print "SHA-256:"$1}')
SHASUM3=$(shasum -a 256 $FILE3 | awk '{print "SHA-256:"$1}')
SHASUM4=$(shasum -a 256 $FILE4 | awk '{print "SHA-256:"$1}')
#SHASUM5=$(shasum -a 256 $FILE5 | awk '{print "SHA-256:"$1}')
SHASUM6=$(shasum -a 256 $FILE6 | awk '{print "SHA-256:"$1}')

printf "File1: ${FILE1}, Size: ${SIZE1}, SHA256: ${SHASUM1}, URL1: ${URL1}\n"
printf "File2: ${FILE2}, Size: ${SIZE2}, SHA256: ${SHASUM2}, URL2: ${URL2}\n"
printf "File3: ${FILE3}, Size: ${SIZE3}, SHA256: ${SHASUM3}, URL3: ${URL3}\n"
printf "File4: ${FILE4}, Size: ${SIZE4}, SHA256: ${SHASUM4}, URL4: ${URL4}\n"
#printf "File5: ${FILE5}, Size: ${SIZE5}, SHA256: ${SHASUM5}, URL5: ${URL5}\n"
printf "File6: ${FILE6}, Size: ${SIZE6}, SHA256: ${SHASUM6}, URL6: ${URL6}\n"

cp "package_${REALAUTHOR}_${REPOSITORY}_index.json" "package_${REALAUTHOR}_${REPOSITORY}_index.json.tmp"

### NOTE: OS platform 5 needs to be added!

jq -r \
--arg dwtools_version $DWTOOLS_VERSION \
--arg os_plaform1 $OS_PLATFORM1 \
--arg os_plaform2 $OS_PLATFORM2 \
--arg os_plaform3 $OS_PLATFORM3 \
--arg os_plaform4 $OS_PLATFORM5 \
--arg os_plaform6 $OS_PLATFORM6 \
--arg host1 $HOST1 \
--arg host2 $HOST2 \
--arg host3 $HOST3 \
--arg host4 $HOST4 \
--arg host6 $HOST6 \
--arg file1 $FILE1 \
--arg file2 $FILE2 \
--arg file3 $FILE3 \
--arg file4 $FILE4 \
--arg file6 $FILE6 \
--arg size1 $SIZE1 \
--arg size2 $SIZE2 \
--arg size3 $SIZE3 \
--arg size4 $SIZE4 \
--arg size6 $SIZE6 \
--arg shasum1 $SHASUM1 \
--arg shasum2 $SHASUM2 \
--arg shasum3 $SHASUM3 \
--arg shasum4 $SHASUM4 \
--arg shasum6 $SHASUM6 \
--arg url1 $URL1 \
--arg url2 $URL2 \
--arg url3 $URL3 \
--arg url4 $URL4 \
--arg url6 $URL6 \
'.packages[].tools[.packages[].tools | length] |= . +
{
"name": "dw-link-tools",
"version": $dwtools_version,
"systems": [
{
"size": $size1,
"checksum": $shasum1,
"host": $host1,
"archiveFileName": $file1,
"url": $url1
},
{
"size": $size2,
"checksum": $shasum2,
"host": $host2,
"archiveFileName": $file2,
"url": $url2
},
{
"size": $size3,
"checksum": $shasum3,
"host": $host3,
"archiveFileName": $file3,
"url": $url3
},
{
"size": $size4,
"checksum": $shasum4,
"host": $host4,
"archiveFileName": $file4,
"url": $url4
},
{
"size": $size6,
"checksum": $shasum6,
"host": $host6,
"archiveFileName": $file6,
"url": $url6
}
]
}' "package_${REALAUTHOR}_${REPOSITORY}_index.json.tmp" > "package_${REALAUTHOR}_${REPOSITORY}_index.json"

rm $FILE1
rm $FILE2
rm $FILE3
rm $FILE4
#rm $FILE5
rm $FILE6
rm "package_${REALAUTHOR}_${REPOSITORY}_index.json.tmp"
9 changes: 7 additions & 2 deletions core-mods/MiniCore-mods/Boards_manager_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,18 @@ jq -r \
{
"packager": "MiniCore",
"name": "avrdude",
"version": "7.1-arduino.1"
"version": "8.0-arduino.1"
},
{
"packager": "arduino",
"name": "arduinoOTA",
"version": "1.3.0"
}
},
{
"packager": "MiniCore",
"name": "dw-link-tools",
"version": "1.3.0"
}
]
}' "package_${REALAUTHOR}_${REPOSITORY}_index.json.tmp" > "package_${REALAUTHOR}_${REPOSITORY}_index.json"

Expand Down
31 changes: 31 additions & 0 deletions core-mods/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
##### Create a new Minicore release that contains debug support

All files necessary for modifying the core can be found in dw-link/core-mods

1. cd into MiniCore/avr (in branch master)
2. Run debugaddopt.py in this directory
3. Generate release
4. Branch to gh-pages in MiniCore
5. Copy Add_dw-link-tools-release.sh to MiniCore (branch gh-pages) if not done already
6. Run this script, if not done at an earlier release!
7. Copy modified Boards_manager_release.sh from core-mods/ MiniCore-mods to MiniCore
8. Run this script
9. commit and push





##### New MiniCore release and how to update current Debug-MiniCore

1. After a new release has been made by MCUdude, copy the current package.json and the MiniCore-debug release tar balls from the gh-pagebranch to somewhere safe.
2. Sync fork with upstream repo (removing the changes made by myself)
3. Run debugaddopt.py (in branch master in hardware folder)
4. Generate release (with smal "v" for version!)
5. Branch to gh-pages
6. Copy the additional parts from old package.json into the current one (releases and tools)
7. Copy the Minicore-debug releases tar balls back to the gh-page
8. Copy modified Boards_manager_release.sh to gh-page branch
9. Run script
10. git add all the manually added files
11. git commit and push
25 changes: 12 additions & 13 deletions core-mods/debugaddopt.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def gatherextra(lines, boards):
file.close()

if "#################### DEBUG FLAG HANDLING ####################\n" in alllines:
print("Board file already contains debug flag handling")
print("boards.txt already contains debug flag handling")
exit(1)

os.rename(filnam, filnam + ".backup")
Expand All @@ -72,9 +72,9 @@ def gatherextra(lines, boards):
file.writelines(alllines + newlines)
file.close()
if len(newlines) == 0:
print("*** No boards found, no lines added")
print("*** No boards.txt found, no lines added")
else:
print("Boards file successfully modified")
print("boards.txt successfully modified")

filnam = "platform.txt"

Expand All @@ -86,7 +86,7 @@ def gatherextra(lines, boards):
file.close()

if "# EXPERIMENTAL feature: optimization flags\n" in alllines:
print("Platform file already contains debug optimization flags\n")
print("platform.txt already contains debug optimization flags\n")
exit(2)

os.rename(filnam, filnam + ".backup")
Expand All @@ -100,8 +100,7 @@ def gatherextra(lines, boards):
file.write(line)
if "# ---------------" in line and "# AVR compile variables" in lastline:
file.write("\n")
file.write("# EXPERIMENTAL feature: optimization flags\n")
file.write("# - this is alpha and may be subject to change without notice\n")
file.write("# optimization flags for debugging\n")
file.write("compiler.optimization_flags=-Os\n")
file.write("compiler.optimization_flags.release=-Os\n")
file.write("compiler.optimization_flags.debug=-Og -g3\n")
Expand All @@ -128,15 +127,15 @@ def gatherextra(lines, boards):
file.write("debug.server.openocd.script=doesnotmatter\n")
file.write("debug.cortex-debug.custom.gdbPath={debug.toolchain.path}/avr-gdb\n")
file.write("debug.cortex-debug.custom.objdumpPath={runtime.tools.avr-gcc.path}/avr-objdump\n")
file.write("debug.cortex-debug.custom.serverArgs.0=-s");
file.write("debug.cortex-debug.custom.serverArgs.1=noop");
file.write("debug.cortex-debug.custom.serverArgs.2=-p");
file.write("debug.cortex-debug.custom.serverArgs.3=50000");
file.write("debug.cortex-debug.custom.postLaunchCommands.0=monitor mcu {build.mcu}");
file.write("debug.cortex-debug.custom.postLaunchCommands.1=break setup");
file.write("debug.cortex-debug.custom.serverArgs.0=-s\n");
file.write("debug.cortex-debug.custom.serverArgs.1=noop\n");
file.write("debug.cortex-debug.custom.serverArgs.2=-p\n");
file.write("debug.cortex-debug.custom.serverArgs.3=50000\n");
file.write("debug.cortex-debug.custom.postLaunchCommands.0=monitor mcu {build.mcu}\n");
file.write("debug.cortex-debug.custom.postLaunchCommands.1=break setup\n");


print("Platform file successfully modified")
print("platform.txt successfully modified")

file.close()

Binary file added dw-server/arm-linux-gnueabihf/-
Binary file not shown.
Binary file added dw-server/arm-linux-gnueabihf/avr-gdb
Binary file not shown.
Binary file added dw-server/arm-linux-gnueabihf/dw-server
Binary file not shown.

0 comments on commit 1f28c41

Please sign in to comment.