Page MenuHomePhabricator

Latest code can not run at MPS3(AN524)
Closed, ResolvedPublic

Description

Build the tf-m with same command below:

mkdir -p build_def
pushd build_def
cmake -G"Unix Makefiles" -DPROJ_CONFIG=`readlink -f ../tfm-github/configs/ConfigRegression.cmake` -DTARGET_PLATFORM=AN524 -DCOMPILER=ARMCLANG ../tfm-github -DCMAKE_BUILD_TYPE=Debug
cmake --build ./ -- install
popd

with the hash tag 0a14211f9792d749ebb5ff321eb52cc8cf60a790 tf-m can run success at MSP3 an524 board.
But with the latest code(2e7d2964836e365d9b5e0259021ed2fa5b9ef759), the tf-m can not run success, here is the log:

[INF] Starting bootloader
[INF] Image 0: version=0.0.0+2, magic= good, image_ok=0x3
[INF] Image 1: No valid image
[INF] Booting image from slot 0
[INF] Bootloader chainload address offset: 0x40000
[INF] Jumping to the first image slot
[Sec Thread] Secure image initializing!
TFM level is: 1

The expect logs should be:

[INF] Starting bootloader
[INF] Image 0: version=0.0.0+2, magic= good, image_ok=0x3
[INF] Image 1: No valid image
[INF] Booting image from slot 0
[INF] Bootloader chainload address offset: 0x40000
[INF] Jumping to the first image slot
[Sec Thread] Secure image initializing!

#### Execute test suites for the Secure area ####
Running Test Suite PSA protected storage S interface tests (TFM_SST_TEST_2XXX)...
> Executing 'TFM_SST_TEST_2001'
  Description: 'Set interface'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2002'
  Description: 'Set interface with create flags'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2003'
  Description: 'Set interface with NULL data pointer'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2004'
  Description: 'Set interface with invalid data length'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2005'
  Description: 'Set interface with write once UID'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2006'
  Description: 'Get interface with valid data'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2007'
  Description: 'Get interface with zero data length'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2008'
  Description: 'Get interface with invalid UIDs'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2009'
  Description: 'Get interface with invalid data lengths and offsets'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2010'
  Description: 'Get interface with NULL data pointer'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2011'
  Description: 'Get info interface with write once UID'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2012'
  Description: 'Get info interface with valid UID'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2013'
  Description: 'Get info interface with invalid UIDs'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2014'
  Description: 'Get info interface with NULL info pointer'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2015'
  Description: 'Remove interface with valid UID'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2016'
  Description: 'Remove interface with write once UID'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2017'
  Description: 'Remove interface with invalid UID'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2018'
  Description: 'Block compaction after remove'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2019'
  Description: 'Multiple partial gets'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2020'
  Description: 'Multiple sets to same UID from same thread'
  TEST PASSED!
> Executing 'TFM_SST_TEST_2021'
  Description: 'Get support interface'
  TEST PASSED!
TESTSUITE PASSED!
Running Test Suite SST reliability tests (TFM_SST_TEST_3XXX)...
> Executing 'TFM_SST_TEST_3001'
  Description: 'repetitive sets and gets in/from an asset'
  > Iteration 15 of 15
  TEST PASSED!
> Executing 'TFM_SST_TEST_3002'
  Description: 'repetitive sets, gets and removes'
  > Iteration 15 of 15
  TEST PASSED!
TESTSUITE PASSED!
Running Test Suite SST rollback protection tests (TFM_SST_TEST_4XXX)...
> Executing 'TFM_SST_TEST_4001'
  Description: 'Check SST area version when NV counters 1/2/3 have the same value'
  TEST PASSED!
> Executing 'TFM_SST_TEST_4002'
  Description: 'Check SST area version when it is different from NV counters 1/2/3'
  TEST PASSED!
> Executing 'TFM_SST_TEST_4003'
  Description: 'Check SST area version when NV counters 1 and 2 are equals, 3 is different, and SST area version match NV counters 1 and 2'
  TEST PASSED!
> Executing 'TFM_SST_TEST_4004'
  Description: 'Check SST area version when NV counters 2 and 3 are equals, 1 is different and SST area version match NV counter 2 and 3'
  TEST PASSED!
> Executing 'TFM_SST_TEST_4005'
  Description: 'Check SST area version when NV counters 2 and 3 are equals, 1 is different and SST area version match NV counter 1'
  TEST PASSED!
> Executing 'TFM_SST_TEST_4006'
  Description: 'Check SST area version when NV counters 1, 2 and 3 have different values and SST area version match NV counter 1 value'
  TEST PASSED!
> Executing 'TFM_SST_TEST_4007'
  Description: 'Check SST area version when NV counters 1, 2 and 3 have different values and SST area version match NV counter 2 value'
  TEST PASSED!
> Executing 'TFM_SST_TEST_4008'
  Description: 'Check SST area version when NV counters 1, 2 and 3 have different values and SST area version match NV counter 3 value'
  TEST PASSED!
> Executing 'TFM_SST_TEST_4009'
  Description: 'Check SST area version when NV counter 1 cannot be incremented'
  TEST PASSED!
TESTSUITE PASSED!
Running Test Suite Crypto secure interface tests (TFM_CRYPTO_TEST_5XXX)...
> Executing 'TFM_CRYPTO_TEST_5001'
  Description: 'Secure Key management interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5002'
  Description: 'Secure Symmetric encryption (AES-128-CBC) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5003'
  Description: 'Secure Symmetric encryption (AES-128-CFB) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5005'
  Description: 'Secure Symmetric encryption (AES-128-CTR) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5007'
  Description: 'Secure Symmetric encryption invalid cipher (AES-128-GCM)'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5008'
  Description: 'Secure Symmetric encryption invalid cipher (AES-152-CBC)'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5009'
  Description: 'Secure Symmetric encryption invalid cipher (HMAC-128-CFB)'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5010'
  Description: 'Secure Hash (SHA-1) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5011'
  Description: 'Secure Hash (SHA-224) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5012'
  Description: 'Secure Hash (SHA-256) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5013'
  Description: 'Secure Hash (SHA-384) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5014'
  Description: 'Secure Hash (SHA-512) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5019'
  Description: 'Secure HMAC (SHA-1) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5020'
  Description: 'Secure HMAC (SHA-256) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5021'
  Description: 'Secure HMAC (SHA-384) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5022'
  Description: 'Secure HMAC (SHA-512) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5024'
  Description: 'Secure HMAC with long key (SHA-1) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5030'
  Description: 'Secure AEAD (AES-128-CCM) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5031'
  Description: 'Secure AEAD (AES-128-GCM) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5032'
  Description: 'Secure key policy interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_5033'
  Description: 'Secure key policy check permissions'
  TEST PASSED!
TESTSUITE PASSED!
Running Test Suite Initial Attestation Service secure interface tests(TFM_ATTEST_TEST_1XXX)...
> Executing 'TFM_ATTEST_TEST_1001'
  Description: 'Minimal token test of attest token'
  TEST PASSED!
> Executing 'TFM_ATTEST_TEST_1002'
  Description: 'Minimal token size test of attest token'
  TEST PASSED!
> Executing 'TFM_ATTEST_TEST_1003'
  Description: 'Short circuit signature test of attest token'
  TEST PASSED!
> Executing 'TFM_ATTEST_TEST_1004'
  Description: 'ECDSA signature test of attest token'
  TEST PASSED!
> Executing 'TFM_ATTEST_TEST_1005'
  Description: 'Negative test cases for initial attestation service'
  TEST PASSED!
TESTSUITE PASSED!
Running Test Suite Audit Logging secure interface test (TFM_AUDIT_TEST_1XXX)...
> Executing 'TFM_AUDIT_TEST_1001'
  Description: 'Secure functional'
  TEST PASSED!
TESTSUITE PASSED!

*** Secure test suites summary ***
Test suite 'PSA protected storage S interface tests (TFM_SST_TEST_2XXX)' has  PASSED
Test suite 'SST reliability tests (TFM_SST_TEST_3XXX)' has  PASSED
Test suite 'SST rollback protection tests (TFM_SST_TEST_4XXX)' has  PASSED
Test suite 'Crypto secure interface tests (TFM_CRYPTO_TEST_5XXX)' has  PASSED
Test suite 'Initial Attestation Service secure interface tests(TFM_ATTEST_TEST_1XXX)' has  PASSED
Test suite 'Audit Logging secure interface test (TFM_AUDIT_TEST_1XXX)' has  PASSED

*** End of Secure test suites ***

#### Execute test suites for the Non-secure area ####
Running Test Suite PSA protected storage NS interface tests (TFM_SST_TEST_1XXX)...
> Executing 'TFM_SST_TEST_1001'
  Description: 'Set interface'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1002'
  Description: 'Set interface with create flags'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1003'
  Description: 'Set interface with NULL data pointer'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1004'
  Description: 'Set interface with invalid data length (DEPRECATED)'
This test is DEPRECATED and the test execution was SKIPPED
  TEST PASSED!
> Executing 'TFM_SST_TEST_1005'
  Description: 'Set interface with write once UID'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1006'
  Description: 'Get interface with valid data'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1007'
  Description: 'Get interface with zero data length'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1008'
  Description: 'Get interface with invalid UIDs'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1009'
  Description: 'Get interface with invalid data lengths and offsets'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1010'
  Description: 'Get interface with NULL data pointer'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1011'
  Description: 'Get info interface with write once UID'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1012'
  Description: 'Get info interface with valid UID'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1013'
  Description: 'Get info interface with invalid UIDs'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1014'
  Description: 'Get info interface with NULL info pointer (DEPRECATED)'
This test is DEPRECATED and the test execution was SKIPPED
  TEST PASSED!
> Executing 'TFM_SST_TEST_1015'
  Description: 'Remove interface with valid UID'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1016'
  Description: 'Remove interface with write once UID'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1017'
  Description: 'Remove interface with invalid UID'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1018'
  Description: 'Get interface with invalid thread name'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1019'
  Description: 'Get info interface with invalid thread name'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1020'
  Description: 'Remove interface with invalid thread name'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1021'
  Description: 'Attempt to access UID belonging to another thread'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1022'
  Description: 'Set UID alternately from two threads'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1023'
  Description: 'Block compaction after remove'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1024'
  Description: 'Multiple partial gets'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1025'
  Description: 'Multiple sets to same UID from same thread'
  TEST PASSED!
> Executing 'TFM_SST_TEST_1026'
  Description: 'Get support interface'
  TEST PASSED!
TESTSUITE PASSED!
Running Test Suite Crypto non-secure interface test (TFM_CRYPTO_TEST_6XXX)...
> Executing 'TFM_CRYPTO_TEST_6001'
  Description: 'Non Secure Key management interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6002'
  Description: 'Non Secure Symmetric encryption (AES-128-CBC) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6003'
  Description: 'Non Secure Symmetric encryption (AES-128-CFB) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6005'
  Description: 'Non Secure Symmetric encryption (AES-128-CTR) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6007'
  Description: 'Non Secure Symmetric encryption invalid cipher (AES-128-GCM)'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6008'
  Description: 'Non Secure Symmetric encryption invalid cipher (AES-152-CBC)'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6009'
  Description: 'Non Secure Symmetric encryption invalid cipher (HMAC-128-CFB)'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6010'
  Description: 'Non Secure Hash (SHA-1) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6011'
  Description: 'Non Secure Hash (SHA-224) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6012'
  Description: 'Non Secure Hash (SHA-256) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6013'
  Description: 'Non Secure Hash (SHA-384) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6014'
  Description: 'Non Secure Hash (SHA-512) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6019'
  Description: 'Non Secure HMAC (SHA-1) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6020'
  Description: 'Non Secure HMAC (SHA-256) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6021'
  Description: 'Non Secure HMAC (SHA-384) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6022'
  Description: 'Non Secure HMAC (SHA-512) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6024'
  Description: 'Non Secure HMAC with long key (SHA-1) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6030'
  Description: 'Non Secure AEAD (AES-128-CCM) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6031'
  Description: 'Non Secure AEAD (AES-128-GCM) interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6032'
  Description: 'Non Secure key policy interface'
  TEST PASSED!
> Executing 'TFM_CRYPTO_TEST_6033'
  Description: 'Non Secure key policy check permissions'
  TEST PASSED!
TESTSUITE PASSED!

Event Timeline

qixiang created this task.Jul 23 2019, 2:12 AM
qixiang added a project: Restricted Project.Jul 24 2019, 2:04 AM

Hi @qixiang , could you help debugging? Most probably the faulty commit is blocked in an fault handler, it would be good to know which instruction causes the fault to be triggered to speed up analysis from developer's point of view.

qixiang closed this task as Resolved.Aug 26 2019, 7:58 AM
qixiang claimed this task.

After upgrade the mbedcrypto-1.1.0, the issue has gone.