Skip to content

Commit

Permalink
Update RV2 to use Clang 17 (#56)
Browse files Browse the repository at this point in the history
- uses Clang 17.0.1
- reworked target layers to use Cortex_DFP
- output is now generated via semihosting
  • Loading branch information
JonatanAntoni authored Nov 24, 2023
1 parent 4c8836e commit 988f4e6
Show file tree
Hide file tree
Showing 167 changed files with 9,921 additions and 10,029 deletions.
93 changes: 33 additions & 60 deletions .github/workflows/cmsis_rv2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,42 +25,28 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
path: CMSIS-RTOS2_Validation

- uses: actions/checkout@v4
with:
repository: ARM-software/CMSIS_6
path: CMSIS_6

- working-directory: /home/runner
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ -d CMSIS_6 ]; then
cd CMSIS_6
git fetch origin main
git checkout -f origin/main
else
gh repo clone ARM-software/CMSIS_6
fi
- uses: actions/checkout@v4
with:
repository: ARM-software/CMSIS-RTX
path: CMSIS-RTX

- working-directory: /home/runner
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ -d CMSIS-RTX ]; then
cd CMSIS-RTX
git fetch origin main
git checkout -f origin/main
else
gh repo clone ARM-software/CMSIS-RTX
fi
- uses: actions/checkout@v4
with:
repository: ARM-software/Cortex_DFP
path: Cortex_DFP

- working-directory: /home/runner
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ -d CMSIS-FreeRTOS ]; then
cd CMSIS-FreeRTOS
git fetch origin main
git checkout -f origin/main
else
gh repo clone ARM-software/CMSIS-FreeRTOS
fi
- uses: actions/checkout@v4
with:
repository: ARM-software/CMSIS-FreeRTOS
path: CMSIS-FreeRTOS

- uses: actions/setup-python@v4
with:
Expand All @@ -74,7 +60,7 @@ jobs:
- name: Python requirements
run: |
pip install -r ./Project/requirements.txt
pip install -r ./CMSIS-RTOS2_Validation/Project/requirements.txt
- name: Cache packs
uses: actions/cache@v3
Expand All @@ -93,34 +79,19 @@ jobs:
path: /home/runner/.vcpkg

- name: Prepare vcpkg env
working-directory: ./Project
working-directory: ./CMSIS-RTOS2_Validation/Project
run: |
. <(curl https://aka.ms/vcpkg-init.sh -L)
vcpkg x-update-registry --all
vcpkg activate
echo "Fix library search path for VHT models"
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(dirname $(which VHT_MPS2_Cortex-M3))" >> $GITHUB_ENV
echo "Fix execute permissions for VHT models"
chmod +x $(dirname $(which VHT_MPS2_Cortex-M3))/VHT_*
echo "Patch CMSIS-Toolbox"
pushd $(dirname $(which cbuild))/../etc
curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/buildmgr/cbuildgen/config/AC6.6.18.0.cmake
curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/buildmgr/cbuildgen/config/GCC.10.3.1.cmake
curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/buildmgr/cbuildgen/config/CLANG.16.0.0.cmake
curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/buildmgr/cbuildgen/config/IAR.9.32.1.cmake
curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/buildmgr/cbuildgen/config/CMSIS-Build-Utils.cmake
curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/templates/cdefault.yml
curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/templates/ac6_linker_script.sct
curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/templates/clang_linker_script.ld
curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/templates/gcc_linker_script.ld
curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/templates/iar_linker_script.ifc
curl -O https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/buildmgr/cbuildgen/config/CLANG.17.0.1.cmake
popd
- name: Activate Arm tool license
working-directory: ./Project
working-directory: ./CMSIS-RTOS2_Validation/Project
run: |
. /home/runner/.vcpkg/vcpkg-init
vcpkg activate
Expand All @@ -137,26 +108,28 @@ jobs:
if: matrix.compiler == 'GCC'
uses: github/codeql-action/init@v2
with:
languages: cpp
languages: c-cpp
queries: security-and-quality

- name: Build
working-directory: ./Project
working-directory: ./CMSIS-RTOS2_Validation/Project
run: |
. /home/runner/.vcpkg/vcpkg-init
vcpkg activate
echo "Register local packs"
cpackget add /home/runner/CMSIS_6/ARM.CMSIS.pdsc
cpackget add /home/runner/CMSIS-RTX/ARM.CMSIS-RTX.pdsc
cpackget add /home/runner/CMSIS-FreeRTOS/ARM.CMSIS-FreeRTOS.pdsc
cpackget rm ARM::CMSIS ARM::Cortex_DFP ARM::CMSIS-RTX ARM::CMSIS-FreeRTOS || echo "Ok"
cpackget add ${{ github.workspace }}/CMSIS_6/ARM.CMSIS.pdsc
cpackget add ${{ github.workspace }}/CMSIS-RTX/ARM.CMSIS-RTX.pdsc
cpackget add ${{ github.workspace }}/CMSIS-FreeRTOS/ARM.CMSIS-FreeRTOS.pdsc
cpackget add ${{ github.workspace }}/Cortex_DFP/ARM.Cortex_DFP.pdsc
echo "Build test projects ..."
./build.py --verbose -r ${{ matrix.rtos }} -c ${{ matrix.compiler }} build || echo "::warning::=== Some configurations failed to build! ==="
- name: Execute
if: ${{ env.ARM_UBL_ACTIVATION_CODE }}
working-directory: ./Project
working-directory: ./CMSIS-RTOS2_Validation/Project
run: |
. /home/runner/.vcpkg/vcpkg-init
vcpkg activate
Expand All @@ -166,7 +139,7 @@ jobs:

- name: Deactivate Arm tool license
if: always()
working-directory: ./Project
working-directory: ./CMSIS-RTOS2_Validation/Project
run: |
. /home/runner/.vcpkg/vcpkg-init
vcpkg activate
Expand All @@ -185,7 +158,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: test-results-${{ matrix.rtos }}-${{ matrix.compiler }}
path: Project/*.junit
path: ./CMSIS-RTOS2_Validation/Project/*.junit


publish-test-results:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Doxygen/linkchecker-out.csv
Project/Validation.**/*
Project/*.zip
Project/*.junit
.clangd
10 changes: 5 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
"version": "0.2.0",
"configurations": [
{
"name": "RTX5, GCC, CM33_FP_VHT",
"name": "RTX5, AC6, Cortex-M33",
"type": "arm-debug",
"request": "launch",
"program": "${workspaceFolder}/Project/Validation.RTX5+CM33_FP_GCC/Validation.RTX5+CM33_FP_OutDir/Validation.elf",
"request": "launch",
"program": "${workspaceFolder}/Project/Validation.RTX5+CM33_AC6/Validation.RTX5+CM33_OutDir/Validation.axf",
// armdbg --cdb-list ""
"cdbEntry": "Arm FVP::MPS2_Cortex_M33::Bare Metal Debug::Bare Metal Debug::Cortex-M33_0",
"cdbEntryParams": {
"model_params": "-f ${workspaceFolder}/Layer/Target/CM33_FP_VHT/vht_config.txt",
"model_params": "-f ${workspaceFolder}/Layer/Target/CM33/model_config.txt",
"model_connection_address": "127.0.0.1:7100",
"connect_existing_model": false
},
"programMode": "ram",
"debugFrom": "Reset_Handler"
"debugFrom": "tf_main"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
}
],
"requires": {
"microsoft:ninja": "^1.10.2",
"arm:compilers/arm/arm-none-eabi-gcc": "^12.2.1-0",
"arm:tools/open-cmsis-pack/cmsis-toolbox": "^2.0.0-0"
"arm:debuggers/arm/armdbg": "^6.0.1"
}
}
1 change: 0 additions & 1 deletion Layer/App/Validation_FreeRTOS/App.clayer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ layer:
- group: Source files
files:
- file: ./main.c
- file: ./retarget_stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
*/

#include <stdlib.h>
#include "cmsis_rv2.h"
#include "RV2_Config_Device.h"

Expand All @@ -29,8 +30,6 @@ void TST_IRQ_HANDLER_B (void);
void (*TST_IRQHandler_A)(void);
void (*TST_IRQHandler_B)(void);

extern int stdout_putchar (int ch);

/*
Primary interrupt handler
*/
Expand Down Expand Up @@ -92,13 +91,7 @@ void TS_Init (void) {
*/
void TS_Uninit (void) {
/* Close debug session here */

/* Note:
VHT model shall have parameter shutdown_on_eot set to true.
Simulation is then shutdown when EOT, ASCII4, character is
transmitted via UART.
*/
stdout_putchar (0x04);
exit(0);
}

/*
Expand Down
5 changes: 0 additions & 5 deletions Layer/App/Validation_FreeRTOS/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@

#include "cmsis_rv2.h"

extern int stdio_init (void);

int main (void) {
/* Initialize stdio */
stdio_init();

/* CMSIS-RTOS2 validation entry */
cmsis_rv2();
}
Expand Down
115 changes: 0 additions & 115 deletions Layer/App/Validation_FreeRTOS/retarget_stdio.c

This file was deleted.

1 change: 0 additions & 1 deletion Layer/App/Validation_RTX5/App.clayer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ layer:
- group: Source files
files:
- file: ./main.c
- file: ./retarget_stdio.c
1 change: 0 additions & 1 deletion Layer/App/Validation_RTX5/RTE/CMSIS/RTX_Config.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,4 @@ __WEAK uint32_t osRtxErrorNotify (uint32_t code, void *object_id) {
break;
}
for (;;) {}
//return 0U;
}
Loading

0 comments on commit 988f4e6

Please sign in to comment.