Skip to content

Commit

Permalink
Validation: add validation for Network and USB (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiloradCvjetkovic authored Jan 28, 2025
1 parent 88b2d18 commit 5d0d4e2
Show file tree
Hide file tree
Showing 300 changed files with 42,316 additions and 0 deletions.
78 changes: 78 additions & 0 deletions Validation/Config/MW_CV_Config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*------------------------------------------------------------------------------
* MDK Middleware - Component Validation
* Copyright (c) 2018-2025 Arm Limited (or its affiliates). All rights reserved.
*------------------------------------------------------------------------------
* Name: MW_CV_Config.h
* Purpose: MDK Middleware - Component Validation - configuration definitions
*----------------------------------------------------------------------------*/

#ifndef MW_CV_CONFIG_H_
#define MW_CV_CONFIG_H_

//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
//------ With VS Code: Open Preview for Configuration Wizard -------------------

// <h> Network
// <i> Network Component Validation Settings
// <e0.0> BSD Socket
// <i> Enable/disable BSD socket validation
// <q1> Socket API
// <i> Enable/disable BSD socket API interface validation
// <q2> Socket operation
// <i> Enable/disable BSD sockets operation validation
// </e>
#define MW_CV_NET 0
#define MW_CV_NET_BSD_API 0
#define MW_CV_NET_BSD_OPERATION 0

// <s.15> SockServer address
// <i> Static IPv4 Address of SockServer in text representation
#define MW_CV_NET_SOCKSERVER_IP "192.168.0.100"
// </h>

// <h> USB
// <i> USB Components Validation Settings
// <e0.0> USB Device
// <i> Enable/disable USB Device validation
// <q1> Core
// <i> Enable/disable USB Device Core validation
// <q2> Communication Device Class - Abstract Control Model (CDC ACM)
// <i> Enable/disable USB Device Communication Device Class - Abstract Control Model validation
// <q3> Human Interface Device (HID)
// <i> Enable/disable USB Device Human Interface Device validation
// <q4> Mass Storage Class (MSC)
// <i> Enable/disable USB Device Mass Storage Class validation
// </e>
#define MW_CV_USBD 0
#define MW_CV_USBD_CORE 0
#define MW_CV_USBD_CDC_ACM 0
#define MW_CV_USBD_HID 0
#define MW_CV_USBD_MSC 0

// <e0.0> USB Host
// <i> Enable/disable USB Host validation
// <q1> Core
// <i> Enable/disable USB Host Core validation
// <q2> Communication Device Class - Abstract Control Model (CDC ACM)
// <i> Enable/disable USB Host Communication Device Class - Abstract Control Model validation
// <q3> Human Interface Device (HID) class
// <i> Enable/disable USB Host Human Interface Device validation
// <q4> Mass Storage Class (MSC)
// <i> Enable/disable USB Host Mass Storage Class validation
// <q5> Mass Storage Class (MSC) Performance
// <i> Enable/disable USB Host Mass Storage Class performance measurement
// </e>
#define MW_CV_USBH 0
#define MW_CV_USBH_CORE 0
#define MW_CV_USBH_CDC_ACM 0
#define MW_CV_USBH_HID 0
#define MW_CV_USBH_MSC 0
#define MW_CV_USBH_MSC_PERFORMANCE 0

// Time available for user operation of connect/disconnect (in seconds)
#define MW_CV_USB_TIMEOUT_IN_SEC 30

// Size of test file used for validation and performance tests (in MB)
#define MW_CV_USB_TEST_FILE_SIZE_IN_MB 10

#endif // MW_CV_CONFIG_H_
15 changes: 15 additions & 0 deletions Validation/Include/MW_CV.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*------------------------------------------------------------------------------
* MDK Middleware - Component Validation
* Copyright (c) 2018-2025 Arm Limited (or its affiliates). All rights reserved.
*------------------------------------------------------------------------------
* Name: MW_CV.h
* Purpose: MDK Middleware - Component Validation - Main module header
*----------------------------------------------------------------------------*/

#ifndef MW_CV_H_
#define MW_CV_H_

// MDK Middleware Component Validation global function prototype
extern void MW_CV (void);

#endif // MW_CV_H_
50 changes: 50 additions & 0 deletions Validation/Projects/Network/BSD_Sockets/BSD_Sockets.cproject.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
project:
description: Network BSD Sockets Validation

packs:
- pack: Keil::MDK-Middleware@^8.0.0-0
- pack: ARM::CMSIS@^6.1.0
- pack: ARM::CMSIS-Compiler@^2.1.0
- pack: ARM::CMSIS-RTX@^5.9.0
- pack: ARM::CMSIS-View@^1.2.0

connections:
- connect: BSD Sockets
provides:
- CMSIS-RTOS2
consumes:
- CMSIS_ETH
- STDOUT

groups:
- group: Documentation
files:
- file: README.md
- group: Source Files
add-path:
- ./
- ../../../Include
- ../../../Source
- ../../../Source/Network
files:
- file: ../../../Source/MW_CV_Main.c
- file: ../../../Source/MW_CV_Framework.c
- file: ../../../Source/MW_CV_TestReport.c
- file: ../../../Source/MW_CV_TestSuite.c
- file: ../../../Source/MW_CV_Timer.c
- file: ../../../Source/Network/MW_CV_BSD.c

components:
- component: CMSIS:OS Tick:SysTick
- component: CMSIS:RTOS2:Keil RTX5&Source
- component: CMSIS-View:Event Recorder&DAP
- component: Network&MDK:CORE
- component: Network&MDK:Interface:ETH
- component: Network&MDK:Service:DNS Client
- component: Network&MDK:Socket:BSD
- component: Network&MDK:Socket:TCP
- component: Network&MDK:Socket:UDP

layers:
- layer: $Board-Layer$
type: Board
78 changes: 78 additions & 0 deletions Validation/Projects/Network/BSD_Sockets/MW_CV_Config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*------------------------------------------------------------------------------
* MDK Middleware - Component Validation
* Copyright (c) 2018-2025 Arm Limited (or its affiliates). All rights reserved.
*------------------------------------------------------------------------------
* Name: MW_CV_Config.h
* Purpose: MDK Middleware - Component Validation - configuration definitions
*----------------------------------------------------------------------------*/

#ifndef MW_CV_CONFIG_H_
#define MW_CV_CONFIG_H_

//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
//------ With VS Code: Open Preview for Configuration Wizard -------------------

// <h> Network
// <i> Network Component Validation Settings
// <e0.0> BSD Socket
// <i> Enable/disable BSD socket validation
// <q1> Socket API
// <i> Enable/disable BSD socket API interface validation
// <q2> Socket operation
// <i> Enable/disable BSD sockets operation validation
// </e>
#define MW_CV_NET 1
#define MW_CV_NET_BSD_API 1
#define MW_CV_NET_BSD_OPERATION 1

// <s.15> SockServer address
// <i> Static IPv4 Address of SockServer in text representation
#define MW_CV_NET_SOCKSERVER_IP "192.168.0.100"
// </h>

// <h> USB
// <i> USB Components Validation Settings
// <e0.0> USB Device
// <i> Enable/disable USB Device validation
// <q1> Core
// <i> Enable/disable USB Device Core validation
// <q2> Communication Device Class - Abstract Control Model (CDC ACM)
// <i> Enable/disable USB Device Communication Device Class - Abstract Control Model validation
// <q3> Human Interface Device (HID)
// <i> Enable/disable USB Device Human Interface Device validation
// <q4> Mass Storage Class (MSC)
// <i> Enable/disable USB Device Mass Storage Class validation
// </e>
#define MW_CV_USBD 0
#define MW_CV_USBD_CORE 0
#define MW_CV_USBD_CDC_ACM 0
#define MW_CV_USBD_HID 0
#define MW_CV_USBD_MSC 0

// <e0.0> USB Host
// <i> Enable/disable USB Host validation
// <q1> Core
// <i> Enable/disable USB Host Core validation
// <q2> Communication Device Class - Abstract Control Model (CDC ACM)
// <i> Enable/disable USB Host Communication Device Class - Abstract Control Model validation
// <q3> Human Interface Device (HID) class
// <i> Enable/disable USB Host Human Interface Device validation
// <q4> Mass Storage Class (MSC)
// <i> Enable/disable USB Host Mass Storage Class validation
// <q5> Mass Storage Class (MSC) Performance
// <i> Enable/disable USB Host Mass Storage Class performance measurement
// </e>
#define MW_CV_USBH 0
#define MW_CV_USBH_CORE 0
#define MW_CV_USBH_CDC_ACM 0
#define MW_CV_USBH_HID 0
#define MW_CV_USBH_MSC 0
#define MW_CV_USBH_MSC_PERFORMANCE 0

// Time available for user operation of connect/disconnect (in seconds)
#define MW_CV_USB_TIMEOUT_IN_SEC 30

// Size of test file used for validation and performance tests (in MB)
#define MW_CV_USB_TEST_FILE_SIZE_IN_MB 10

#endif // MW_CV_CONFIG_H_
7 changes: 7 additions & 0 deletions Validation/Projects/Network/BSD_Sockets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# MDK-Middleware Validation

## Network - BSD Sockets Component Validation project

This is a validation project for testing API and functionality of the **Network BSD Sockets** Component.

For description on how to run the validation see the [documentation](../../../README.md#build-the-validation-project).
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright (c) 2016-2021 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Name: EventRecorderConf.h
* Purpose: Event Recorder software component configuration options
* Rev.: V1.1.0
*/

//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------

// <h>Event Recorder

// <o>Number of Records
// <8=>8 <16=>16 <32=>32 <64=>64 <128=>128 <256=>256 <512=>512 <1024=>1024
// <2048=>2048 <4096=>4096 <8192=>8192 <16384=>16384 <32768=>32768
// <65536=>65536
// <i>Configures size of Event Record Buffer (each record is 16 bytes)
// <i>Must be 2^n (min=8, max=65536)
#define EVENT_RECORD_COUNT 64U

// <o>Time Stamp Source
// <0=> DWT Cycle Counter <1=> SysTick <2=> CMSIS-RTOS2 System Timer
// <3=> User Timer (Normal Reset) <4=> User Timer (Power-On Reset)
// <i>Selects source for 32-bit time stamp
#define EVENT_TIMESTAMP_SOURCE 0

// <o>Time Stamp Clock Frequency [Hz] <0-1000000000>
// <i>Defines initial time stamp clock frequency (0 when not used)
#define EVENT_TIMESTAMP_FREQ 0U

// </h>

//------------- <<< end of configuration section >>> ---------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright (c) 2016-2021 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Name: EventRecorderConf.h
* Purpose: Event Recorder software component configuration options
* Rev.: V1.1.0
*/

//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------

// <h>Event Recorder

// <o>Number of Records
// <8=>8 <16=>16 <32=>32 <64=>64 <128=>128 <256=>256 <512=>512 <1024=>1024
// <2048=>2048 <4096=>4096 <8192=>8192 <16384=>16384 <32768=>32768
// <65536=>65536
// <i>Configures size of Event Record Buffer (each record is 16 bytes)
// <i>Must be 2^n (min=8, max=65536)
#define EVENT_RECORD_COUNT 64U

// <o>Time Stamp Source
// <0=> DWT Cycle Counter <1=> SysTick <2=> CMSIS-RTOS2 System Timer
// <3=> User Timer (Normal Reset) <4=> User Timer (Power-On Reset)
// <i>Selects source for 32-bit time stamp
#define EVENT_TIMESTAMP_SOURCE 0

// <o>Time Stamp Clock Frequency [Hz] <0-1000000000>
// <i>Defines initial time stamp clock frequency (0 when not used)
#define EVENT_TIMESTAMP_FREQ 0U

// </h>

//------------- <<< end of configuration section >>> ---------------------------
67 changes: 67 additions & 0 deletions Validation/Projects/Network/BSD_Sockets/RTE/CMSIS/RTX_Config.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright (c) 2013-2023 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* -----------------------------------------------------------------------------
*
* $Revision: V5.2.0
*
* Project: CMSIS-RTOS RTX
* Title: RTX Configuration
*
* -----------------------------------------------------------------------------
*/

#include "cmsis_compiler.h"
#include "rtx_os.h"

// OS Idle Thread
__WEAK __NO_RETURN void osRtxIdleThread (void *argument) {
(void)argument;

for (;;) {}
}

// OS Error Callback function
__WEAK uint32_t osRtxErrorNotify (uint32_t code, void *object_id) {
(void)object_id;

switch (code) {
case osRtxErrorStackOverflow:
// Stack overflow detected for thread (thread_id=object_id)
break;
case osRtxErrorISRQueueOverflow:
// ISR Queue overflow detected when inserting object (object_id)
break;
case osRtxErrorTimerQueueOverflow:
// User Timer Callback Queue overflow detected for timer (timer_id=object_id)
break;
case osRtxErrorClibSpace:
// Standard C/C++ library libspace not available: increase OS_THREAD_LIBSPACE_NUM
break;
case osRtxErrorClibMutex:
// Standard C/C++ library mutex initialization failed
break;
case osRtxErrorSVC:
// Invalid SVC function called (function=object_id)
break;
default:
// Reserved
break;
}
for (;;) {}
//return 0U;
}
Loading

0 comments on commit 5d0d4e2

Please sign in to comment.