Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renode toolset #339

Merged
merged 31 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
34e3636
Updated startup script and upgraded repl platform description to newe…
IshDeshpa May 1, 2023
6dd90b6
setting up new test dir
IshDeshpa May 7, 2023
8ad2c47
merge master into here
IshDeshpa May 24, 2023
27698c4
Working on better renode integration
IshDeshpa Jun 11, 2023
71d7c76
Enhanced run_test.sh to build and run test
IshDeshpa Jun 19, 2023
634a0b0
integrated VSCode tasks & debugger with Controls workflow
IshDeshpa Jun 23, 2023
688ee51
added robot resource file
IshDeshpa Jun 26, 2023
46ae401
added tests back to Tests/Leader
IshDeshpa Jul 10, 2023
7377bd2
Merge branch 'master' into renode-toolset
IshDeshpa Jul 10, 2023
7195e0c
rename Simulator/ to Renode/
IshDeshpa Jul 12, 2023
3cc060b
tooling changes
IshDeshpa Jul 12, 2023
001c5b9
more changes to structure of test framework
IshDeshpa Jul 12, 2023
20bb31f
small change to environment variables
IshDeshpa Jul 12, 2023
009a9a0
removed merge stuff
IshDeshpa Jul 12, 2023
e32b3d4
Big test framework changes; removed robot testing for the time being
IshDeshpa Jul 28, 2023
f591612
reset tests to master
IshDeshpa Jul 28, 2023
76444ac
Merge branch 'master' into renode-toolset
IshDeshpa Jul 28, 2023
ec66f59
moved main to test files instead of runner to allow old tests to func…
IshDeshpa Jul 28, 2023
99383a9
added test runner logic to support new test functionality
IshDeshpa Jul 28, 2023
3214028
Remove test runner infrastructure
Cam0Cow Oct 7, 2023
68590d1
More changes
Cam0Cow Oct 7, 2023
ac9c213
Merge branch 'master' into renode-toolset
Cam0Cow Oct 7, 2023
3fdf843
readme change
IshDeshpa Nov 3, 2023
402615c
Merge branch 'renode-toolset' of github.com:lhr-solar/Controls into r…
IshDeshpa Nov 3, 2023
52db71f
Merge branch 'master' into renode-toolset
IshDeshpa Nov 8, 2023
087f2a5
move files to Tests/Leader
IshDeshpa Nov 8, 2023
1ed186c
fixed issues pertaining to assertOSError
IshDeshpa Nov 8, 2023
8f6b598
remove motor sim and car sim
IshDeshpa Nov 11, 2023
5133574
remove leader folder
IshDeshpa Nov 11, 2023
4fea6a3
addressed review
IshDeshpa Nov 11, 2023
8790919
added updates for 1.14.0
IshDeshpa Nov 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ __pycache__
*.csv
.vscode
*.swp

!.vscode/LHR.code-workspace
!.vscode/c_cpp_properties.json
IshDeshpa marked this conversation as resolved.
Show resolved Hide resolved
298 changes: 298 additions & 0 deletions .vscode/LHR.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,298 @@
{
"folders": [
{
"path": "../"
},
{
"path": "../../Embedded-Sharepoint"
},
{
"path": "../../BPS"
}
],
"settings": {
"liveServer.settings.multiRootWorkspaceName": "renode",
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.profiles.linux": {
"bash": {
"path": "bash",
"icon": "terminal-bash",
"args": ["-i"]
},
},
},
"tasks": {
"version": "2.0.0",
"tasks": [
{
"label": "Build Controls",
"type": "process",
"command": "make",
"args": [
"${input:target}",
"TEST=${input:test}",
"DEBUG=${input:debug}"
],
"presentation": {
"echo": false,
"reveal": "always",
"panel": "dedicated",
"focus": true,
"clear": true,
"group": "build"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
},
{
"label": "Start Renode",
"type": "shell",
"command": "${workspaceFolder:Controls}/Scripts/start_renode.sh",
"presentation": {
"echo": false,
"reveal": "always",
"panel": "dedicated",
"focus": true,
"clear": true,
"group": "debug"
},
"isBackground": true,
"problemMatcher": {
"owner": "custom",
"pattern": {
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
},
"background": {
"activeOnStart": true,
"beginsPattern": "^.*",
"endsPattern": "^\"Renode Simulator is now active\".*"
}
}
},
{
"label": "Open UART2 Telnet",
"type": "shell",
"command": "echo \"Controls Leaderboard UART2\"; while ! nc -z localhost ${RENODE_UART2_TELNET}; do sleep 2; echo .; done; echo Connected && nc localhost ${RENODE_UART2_TELNET}",
"presentation": {
"echo": false,
"reveal": "always",
"panel": "dedicated",
"focus": true,
"group": "debug"
},
"isBackground": true,
"problemMatcher": {
"owner": "custom",
"pattern": {
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
},
"background": {
"activeOnStart": true,
"beginsPattern": ".",
"endsPattern": "."
}
}
},
{
"label": "Start OpenOCD debugger",
"type": "shell",
"command": "openocd",
"presentation": {
"echo": false,
"reveal": "always",
"panel": "dedicated",
"focus": true,
"group": "debug"
},
"problemMatcher": []
},
{
"label": "Open Terminal GDB",
"type": "shell",
"command": "arm-none-eabi-gdb ${workspaceFolder:Controls}/Objects/controls-leader.elf",
"presentation": {
"echo": false,
"reveal": "always",
"panel": "dedicated",
"focus": true,
"group": "debug"
},
"problemMatcher": []
},
{
"label": "Start Renode Tools",
"dependsOn": [
"Start Renode",
"Open UART2 Telnet"
],
"dependsOrder": "sequence",
"problemMatcher": []
},
{
"label": "Start Renode Tools & Terminal GDB",
"dependsOn": [
"Start Renode Tools",
"Open Terminal GDB"
],
"dependsOrder": "sequence",
"problemMatcher": []
},
{
"label": "Start Hardware Tools",
"dependsOn": [
"Start OpenOCD debugger",
"Open Terminal GDB"
],
"dependsOrder": "sequence",
"problemMatcher": []
},
{
"label": "Build Controls & Start OpenOCD",
"dependsOn": [
"Build Controls",
"Start OpenOCD debugger"
],
"dependsOrder": "sequence",
"problemMatcher": []
},
{
"label": "Build Controls & Start Hardware Tools",
"dependsOn": [
"Build Controls",
"Start Hardware Tools"
],
"dependsOrder": "sequence",
"problemMatcher": []
},
{
"label": "Build Controls & Start Renode Tools",
"dependsOn": [
"Build Controls",
"Start Renode Tools"
],
"dependsOrder": "sequence",
"problemMatcher": []
},
{
"label": "Kill Processes",
"type": "process",
"command": [
"${command:workbench.action.tasks.terminate}",
"${command:workbench.action.acceptSelectedQuickOpenItem}"
],
"problemMatcher": []
}
],
"inputs": [
{
"id": "target",
"type": "pickString",
"description": "Target to compile.",
"options": [
"leader",
"flash",
"clean"
]
},
{
"id": "test",
"type": "promptString",
"description": "Test file to compile and run.",
"default": ""
},
{
"id": "debug",
"type": "pickString",
"description": "Debug ",
"options": [
"1",
"0"
],
"default": "1"
}
],
},
"launch": {
"version": "2.0.0",
"configurations": [
{
"name": "Renode Build & Debug Controls",
"type": "cppdbg",
"request": "launch",
"cwd": "${workspaceFolder:Controls}",
"program": "${workspaceFolder:Controls}/Objects/controls-leader.elf",
"preLaunchTask": "Build Controls & Start Renode Tools",
"postDebugTask": "Kill Processes",

"stopAtEntry": true,
"stopAtConnect": true,

"customLaunchSetupCommands": [
{"text": "target extended-remote :3333", "ignoreFailures": false},
{"text": "file Objects/controls-leader.elf"}
],

"MIMode": "gdb",
"miDebuggerPath": "arm-none-eabi-gdb",
"miDebuggerServerAddress": "localhost:3333",
"miDebuggerArgs": "--cd=${workspaceFolder:Controls}",
"hardwareBreakpoints": {"require": true},

"targetArchitecture": "arm64",
"logging": {
"engineLogging": false,
"traceResponse": false
}
},
{
"name": "Hardware Build & Debug Controls",
"type": "cppdbg",
"request": "launch",
"cwd": "${workspaceFolder:Controls}",
"program": "${workspaceFolder:Controls}/Objects/controls-leader.elf",
"preLaunchTask": "Build Controls & Start OpenOCD",
"postDebugTask": "Kill Processes",

"stopAtEntry": true,
"stopAtConnect": true,

"customLaunchSetupCommands": [
{"text": "target extended-remote :3333", "ignoreFailures": false},
{"text": "file Objects/controls-leader.elf"}
],

"MIMode": "gdb",
"miDebuggerPath": "arm-none-eabi-gdb",
"miDebuggerServerAddress": "localhost:3333",
"miDebuggerArgs": "--cd=${workspaceFolder:Controls}",
"hardwareBreakpoints": {"require": true},

"targetArchitecture": "arm64",
"logging": {
"engineLogging": false,
"traceResponse": false
}
}

]
},
"extensions": {
"recommendations": [
"ms-vscode.cpptools-extension-pack", // For Controls C code
"GitHub.vscode-pull-request-github", // For reviewing pull requests directly from VSCode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TAKE THIS OUT

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

"xaver.clang-format", // For auto-formatting code on VSCode
"eamodio.gitlens", // For better github stuff
"ritwickdey.liveserver", // For quick viewing test reports
]
}

}
8 changes: 1 addition & 7 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,18 @@
"${workspaceFolder}/**",
"${workspaceFolder}/Apps/Inc",
"${workspaceFolder}/Apps/Src",

"${workspaceFolder}/Drivers/Inc",
"${workspaceFolder}/Drivers/Src",

"${workspaceFolder}/Config/Inc",

"${workspaceFolder}/BSP/STM32F413/Src",
"${workspaceFolder}/BSP/Inc",
"${workspaceFolder}/BSP/STM32F413/STM32F4xx_StdPeriph_Driver/Src",
"${workspaceFolder}/BSP/STM32F413/STM32F4xx_StdPeriph_Driver/Inc",
"${workspaceFolder}/BSP/Template/Src",

"${workspaceFolder}/RTOS/uCOS-III-STM32F4/uC-CPU",
"${workspaceFolder}/RTOS/uCOS-III-STM32F4/uC-CPU/ARM-Cortex-M4/GNU",
"${workspaceFolder}/RTOS/uCOS-III-STM32F4/uC-LIB",
"${workspaceFolder}/RTOS/uCOS-III-STM32F4/uCOS-III/Source",
"${workspaceFolder}/RTOS/uCOS-III-STM32F4/uCOS-III/Ports/ARM-Cortex-M4/Generic/GNU",

"${workspaceFolder}/CMSIS/Include",
"${workspaceFolder}/CMSIS/Device/ST/STM32F4xx/Include"
],
Expand All @@ -32,7 +27,6 @@
],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
Expand Down
5 changes: 4 additions & 1 deletion Apps/Inc/Tasks.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ void throwTaskError(error_code_t errorCode, callback_t errorCallback, error_sche
void _assertOSError (OS_ERR err); //TODO: This should be changed to enforce only enum usage

#if DEBUG == 1
#define assertOSError(err)
#define assertOSError(err) \
if (err != OS_ERR_NONE) { \
printf("Error asserted at %s, line %d: %d\n\r", __FILE__, __LINE__, err); \
} \
_assertOSError(err);
#else
#define assertOSError(err) _assertOSError(err);
NathanielDelgado marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
2 changes: 0 additions & 2 deletions Apps/Src/Tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ void throwTaskError(error_code_t errorCode, callback_t errorCallback, error_sche
while(1) {

#if DEBUG == 1

// Print the error that caused this fault
printf("\n\rCurrent Error Location: 0x%04x", OSErrLocBitmap);
printf("\n\rCurrent Error Code: 0x%04x\n\r", errorCode);

// Print the errors for each applications with error data
Expand Down
Loading
Loading