diff --git a/ARM.SDS.pdsc b/ARM.SDS.pdsc index 2eb5086..221b478 100644 --- a/ARM.SDS.pdsc +++ b/ARM.SDS.pdsc @@ -15,6 +15,8 @@ Active development ... + Template: + - Corestone-300/320: Fixed SDS I/O VSI driver to return correct error and status codes (SDSIO_ERROR, SDSIO_EOS) diff --git a/template/Board/Corstone-300/vsi/python/arm_vsi3.py b/template/Board/Corstone-300/vsi/python/arm_vsi3.py index b5ebfbd..5a45264 100644 --- a/template/Board/Corstone-300/vsi/python/arm_vsi3.py +++ b/template/Board/Corstone-300/vsi/python/arm_vsi3.py @@ -88,7 +88,7 @@ def app(self, message, *args, **kwargs): # 'No limit' for idx-end NO_LIMIT = 0x7FFFFFFF -# SDS I/O error/status codes (32-bit two's‑complement, used in the ARGUMENT register) +# SDS I/O error/status codes (32-bit two's-complement, used in the ARGUMENT register) SDSIO_ERROR = (-1 & 0xFFFFFFFF) # -1 SDSIO_EOS = (-6 & 0xFFFFFFFF) # -6 diff --git a/template/Board/Corstone-320/vsi/python/arm_vsi3.py b/template/Board/Corstone-320/vsi/python/arm_vsi3.py index 9d23c0d..5a45264 100644 --- a/template/Board/Corstone-320/vsi/python/arm_vsi3.py +++ b/template/Board/Corstone-320/vsi/python/arm_vsi3.py @@ -1,4 +1,4 @@ -# Copyright (c) 2025 Arm Limited. All rights reserved. +# Copyright (c) 2025-2026 Arm Limited. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 # @@ -88,6 +88,10 @@ def app(self, message, *args, **kwargs): # 'No limit' for idx-end NO_LIMIT = 0x7FFFFFFF +# SDS I/O error/status codes (32-bit two's-complement, used in the ARGUMENT register) +SDSIO_ERROR = (-1 & 0xFFFFFFFF) # -1 +SDSIO_EOS = (-6 & 0xFFFFFFFF) # -6 + class IndexAllocator: """ Hands out the next SDS index. @@ -415,12 +419,12 @@ def processCOMMAND(command): elif command == 3: # Write # Return data length or SDSIO_ERROR - ARGUMENT = len(Data) if Stream.write(STREAM_ID, Data) else -1 + ARGUMENT = len(Data) if Stream.write(STREAM_ID, Data) else SDSIO_ERROR elif command == 4: # Read # Return data length or SDSIO_EOS Data, eof = Stream.read(STREAM_ID, ARGUMENT) - ARGUMENT = len(Data) if not eof else -6 + ARGUMENT = len(Data) if not eof else SDSIO_EOS return command @@ -570,4 +574,3 @@ def wrRegs(index, value): ## @} -