22
33readonly CMSIS_VERSION=" $1 "
44readonly CMSIS_ARCHIVE=" CMSIS-${CMSIS_VERSION} .tar.bz2"
5+ readonly CMSIS_DSP_VERSION=" $2 "
6+ readonly CMSIS_DSP_ARCHIVE=" CMSIS_DSP-${CMSIS_DSP_VERSION} .tar.bz2"
57
68# Use python venv
79python3 -m venv " $HOME /venv"
@@ -11,14 +13,23 @@ python3 -m venv "$HOME/venv"
1113python3 -m pip install --quiet --upgrade platformio
1214
1315# Install the development version of ststm32 platform
14- platformio platform install " https://github.com/platformio/platform-ststm32.git" || {
16+ pio pkg install --platform " https://github.com/platformio/platform-ststm32.git" || {
1517 exit 1
1618}
1719# Prepare framework for CI
20+ # Modify platform.json to use local framework-arduinoststm32 package
1821python3 -c " import json; import os; fp=open(os.path.expanduser('~/.platformio/platforms/ststm32/platform.json'), 'r+'); data=json.load(fp); data['packages']['framework-arduinoststm32']['version'] = '*'; del data['packages']['framework-arduinoststm32']['owner']; fp.seek(0); fp.truncate(); json.dump(data, fp); fp.close()" || {
1922 exit 1
2023}
21-
24+ # Modify platform.json to use local CMSIS package without owner and version restrictions
25+ python3 -c " import json; import os; fp=open(os.path.expanduser('~/.platformio/platforms/ststm32/platform.json'), 'r+'); data=json.load(fp); data['packages']['framework-cmsis']['version'] = '*'; del data['packages']['framework-cmsis']['owner']; fp.seek(0); fp.truncate(); json.dump(data, fp); fp.close()" || {
26+ exit 1
27+ }
28+ # Add to platform.json the CMSIS DSP package
29+ python3 -c " import json; import os; fp=open(os.path.expanduser('~/.platformio/platforms/ststm32/platform.json'), 'r+'); data=json.load(fp); data['packages']['framework-cmsis_dsp'] = {'type': 'framework', 'optional': true, 'version': '*'}; fp.seek(0); fp.truncate(); json.dump(data, fp); fp.close()" || {
30+ exit 1
31+ }
32+ # Create symbolic link to the framework-arduinoststm32 package pointing to the repository workspace
2233ln --symbolic " $GITHUB_WORKSPACE " " $HOME /.platformio/packages/framework-arduinoststm32" || {
2334 exit 1
2435}
@@ -29,6 +40,21 @@ wget --no-verbose "https://github.com/stm32duino/ArduinoModule-CMSIS/releases/do
2940tar --extract --bzip2 --file=" $CMSIS_ARCHIVE " || {
3041 exit 1
3142}
43+ # Create symbolic link to the framework-cmsis package pointing to the unpacked CMSIS package
44+ ln --symbolic " $GITHUB_WORKSPACE /CMSIS-${CMSIS_VERSION} " " $HOME /.platformio/packages/framework-cmsis" || {
45+ exit 1
46+ }
47+ # Download and unpack CMSIS DSP package
48+ wget --no-verbose " https://github.com/stm32duino/ArduinoModule-CMSIS/releases/download/$CMSIS_VERSION /$CMSIS_DSP_ARCHIVE " || {
49+ exit 1
50+ }
51+ tar --extract --bzip2 --file=" $CMSIS_DSP_ARCHIVE " || {
52+ exit 1
53+ }
54+ # Create symbolic link to the framework-cmsis_dsp package pointing to the unpacked CMSIS DSP package
55+ ln --symbolic " $GITHUB_WORKSPACE /CMSIS_DSP-${CMSIS_DSP_VERSION} " " $HOME /.platformio/packages/framework-cmsis_dsp" || {
56+ exit 1
57+ }
3258cd " $GITHUB_WORKSPACE /CI/build/" || {
3359 exit 1
3460}
0 commit comments