This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM2632-Q1: otfaecc_structs.py is not found

Part Number: AM2632-Q1

Tool/software:

I tried using SDK "mcu_plus_sdk_am263x_10_01_00_31" to build a sample project. But I got errors as below. I checked my folder "C:\ti\mcu_plus_sdk_am263x_10_01_00_31\tools\boot\multicore-elf\modules\, but didn't find the file otfaecc_structs.py. Is this a known issue for this SDK? And how do I solve it?

108] Boot multi-core ELF image: am263x:r5fss0-0:nortos:ti-arm-clang C:/Users/morri/workspace_ccstheia/adc_soc_software_am263x-cc_r5fss0-0_nortos_ti-arm-clang/Release/adc_soc_software_am263x-cc_r5fss0-0_nortos_ti-arm-clang.mcelf ...
[109]python C:/ti/mcu_plus_sdk_am263x_10_01_00_31/tools/boot/multicore-elf/genimage.py --core-img=0:Release/adc_soc_software_am263x-cc_r5fss0-0_nortos_ti-arm-clang.out --output=C:/Users/morri/workspace_ccstheia/adc_soc_software_am263x-cc_r5fss0-0_nortos_ti-arm-clang/Release/adc_soc_software_am263x-cc_r5fss0-0_nortos_ti-arm-clang.mcelf --merge-segments=true --tolerance-limit=0 --ignore-context=false --xip=0x60000000:0x68000000 --xlat="" --max_segment_size=8192
[110]makefile_ccs_bootimage_gen:87: recipe for target 'all' failed
[111]Traceback (most recent call last):
[112] File "C:\ti\mcu_plus_sdk_am263x_10_01_00_31\tools\boot\multicore-elf\genimage.py", line 37, in <module>
[113] from modules.otfaecc_structs import *
[114] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[115] File "C:\ti\mcu_plus_sdk_am263x_10_01_00_31\tools\boot\multicore-elf\modules\otfaecc_structs.py", line 35, in <module>
[116] from construct import Struct, Int16ul, Int16ub, \
[117]ModuleNotFoundError: No module named 'construct'
[118]gmake[3]: *** [all] Error 1
[119]makefile:167: recipe for target 'post-build' failed
[120]gmake[2]: [post-build] Error 2 (ignored)

 

  • Hi Morris,

    I tried using SDK "mcu_plus_sdk_am263x_10_01_00_31" to build a sample project. But I got errors as below. I checked my folder "C:\ti\mcu_plus_sdk_am263x_10_01_00_31\tools\boot\multicore-elf\modules\, but didn't find the file otfaecc_structs.py. Is this a known issue for this SDK? And how do I solve it?

    I checked and otfaecc_structs.py is present in the path (C:\ti\mcu_plus_sdk_am263x_10_01_00_31\tools\boot\multicore-elf\modules\otfaecc_structs.py), Can you once try to install the SDK again and check, my suspicion is the file might have got misplaced due to some reason on the local setup.

    Incase you still need it, i am also attaching it here.

    '''
    Copyright (C) 2024 Texas Instruments Incorporated
    
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
    
      Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    
      Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the
      distribution.
    
      Neither the name of Texas Instruments Incorporated nor the names of
      its contributors may be used to endorse or promote products derived
      from this software without specific prior written permission.
    
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    '''
    '''Basic structs of OTFA & ECCM module'''
    
    from enum import Enum
    from construct import Struct, Int16ul, Int16ub, \
    Int32ul, Int32ub, Int64ul, Int64ub, Bytes, IfThenElse, If
    from struct import pack, unpack
    
    OTFA_MODE_AUTH = 'auth'
    OTFA_MODE_ENCRYPT= 'encrypt'
    OTFA_MODE_GCM = 'gcm'
    OTFA_MODE_ENCRYPT_AUTH = 'both'
    OTFA_MODE_NO_ENCRYPT = 'na'
    
    OTFA_MAC_SIZE_4B = 1
    OTFA_MAC_SIZE_8B = 2
    OTFA_MAC_SIZE_12B = 3
    OTFA_MAC_SIZE_16B = 4
    
    OTFA_AES_KEY_SIZE_128BIT = 1
    OTFA_AES_KEY_SIZE_256BIT = 2
    
    class otfaRegionConfig:
        def __init__(self) -> None:
            self.size:int = 0
            self.start:int = 0
            self.authKey:bytearray = bytearray(8)
            self.encKey:bytearray = bytearray(8)
            self.iv:bytearray = bytearray(8)
            self.cryptoMode:int = OTFA_MODE_NO_ENCRYPT
            self.eccEnable:bool = False 
    
        def packBytes(self):
            _frm = "<IIII32s32s32s"
            c = 0
            if(self.cryptoMode == OTFA_MODE_AUTH):
                c = 0
            elif(self.cryptoMode == OTFA_MODE_ENCRYPT):
                c = 1
            elif(self.cryptoMode == OTFA_MODE_GCM):
                c = 2
            elif(self.cryptoMode == OTFA_MODE_NO_ENCRYPT):
                c = 3
            else:
                c = 4
            return pack(_frm, int(self.size), int(self.start), c, 0 if self.eccEnable == False else 1, bytes(self.authKey), bytes(self.encKey), bytes(self.iv))
    
    class OTFAConfig:
        def __init__(self) -> None:
            self.regionConfigList:list[otfaRegionConfig] = list()
            self.mac_align: bool = True
            self.mac_size:int = OTFA_MAC_SIZE_4B
            self.aes_key_size:int =  OTFA_AES_KEY_SIZE_128BIT
            self.isEnabled: bool = False 
    
        def packBytes(self):
            rgnBytes = bytes()
            for rgn in self.regionConfigList:
                rgnBytes = rgnBytes + rgn.packBytes()
            _frm = ">bbbbbxxx" + str(len(rgnBytes)) + "s"
            return pack(_frm, self.isEnabled, self.mac_align, self.mac_size, 1 if self.aes_key_size == OTFA_AES_KEY_SIZE_128BIT else 0, len(self.regionConfigList),rgnBytes)
    
    
    

    [117]ModuleNotFoundError: No module named 'construct'
    [118]gmake[3]: *** [all] Error 1
    [119]makefile:167: recipe for target 'post-build' failed
    [120]gmake[2]: [post-build] Error 2 (ignored)

    Other than that, I also see some build errors in your logs. These are due to the required python modules not installed. I recommend installing the modules mentioned in the "requirements.txt" in the SDK.

    You can run "pip install -r requirements.txt" to install the 12 python modules that are required for Post build steps. The same is documented here: https://software-dl.ti.com/mcu-plus-sdk/esd/AM263X/latest/exports/docs/api_guide_am263x/SDK_DOWNLOAD_PAGE.html#INSTALL_PYTHON3

    Regards,
    Shaunak

  • Thank you. I got the file.