Skip to content

[METADATA] Small correction - #158

Merged
luizvilla merged 4 commits into
owntech-foundation:mainfrom
luizvilla:metaData_PR
Jul 30, 2026
Merged

[METADATA] Small correction #158
luizvilla merged 4 commits into
owntech-foundation:mainfrom
luizvilla:metaData_PR

Conversation

@luizvilla

Copy link
Copy Markdown
Member

Context

The password of the previous version only had 3 characters. That was an oversight. They should have 10.

PR description

This PR adds surpport for 10 character long passwords. It also adds a password for the SPIN board, which was not available before.

Testing

The PR was tested and passed with a SPIN board. Here's the result:

Using board 423250070031003C on port /dev/ttyACM4
[1/8] Clearing all metadata fields...
  CLEAR=OK
[2/8] Reading back (expect all fields empty/ERR)...
[3/8] Attempting undersized writes/reads (expect all rejected)...
  FIELD                    EXPECTED  ACTUAL  RESULT
  SPIN_SERIAL_BADSIZE      -2        -2      OK
  SHIELD_SERIAL_BADSIZE    -2        -2      OK
  SPIN_PASSWORD_BADSIZE    -2        -2      OK
  SHIELD_PASSWORD_BADSIZE  -2        -2      OK
  EXTRA_BADSIZE            -2        -2      OK
[4/8] Reading back (expect fields still empty/ERR)...
[5/8] Checking free NVS space (baseline)...
  FREE_SPACE=2008
[6/8] Writing canned test values...
[7/8] Reading back immediately (same-boot sanity check)...
  FIELD            WRITTEN          READ             RESULT
  SPIN_SERIAL      'SPIN000000001'  'SPIN000000001'  OK
  SHIELD_SERIAL    'SHLD000000001'  'SHLD000000001'  OK
  SPIN_VERSION     '9.9.9'          '9.9.9'          OK
  SHIELD_VERSION   '8.8.8'          '8.8.8'          OK
  SPIN_PASSWORD    'SPINPASS01'     'SPINPASS01'     OK
  SHIELD_PASSWORD  'SHLDPASS01'     'SHLDPASS01'     OK
  EXTRA_0          'EXTRA0'         'EXTRA0'         OK
  EXTRA_1          'EXTRA1'         'EXTRA1'         OK
  EXTRA_2          'EXTRA2'         'EXTRA2'         OK
  EXTRA_3          'EXTRA3'         'EXTRA3'         OK
  EXTRA_4          'EXTRA4'         'EXTRA4'         OK
[8/8] Resetting board and re-reading (persistence check)...
Done
  FIELD            WRITTEN          READ             RESULT
  SPIN_SERIAL      'SPIN000000001'  'SPIN000000001'  OK
  SHIELD_SERIAL    'SHLD000000001'  'SHLD000000001'  OK
  SPIN_VERSION     '9.9.9'          '9.9.9'          OK
  SHIELD_VERSION   '8.8.8'          '8.8.8'          OK
  SPIN_PASSWORD    'SPINPASS01'     'SPINPASS01'     OK
  SHIELD_PASSWORD  'SHLDPASS01'     'SHLDPASS01'     OK
  EXTRA_0          'EXTRA0'         'EXTRA0'         OK
  EXTRA_1          'EXTRA1'         'EXTRA1'         OK
  EXTRA_2          'EXTRA2'         'EXTRA2'         OK
  EXTRA_3          'EXTRA3'         'EXTRA3'         OK
  EXTRA_4          'EXTRA4'         'EXTRA4'         OK
PASS: values survived a board reset
[final] Checking free NVS space (post)...
  FREE_SPACE=1800
ALL CHECKS PASSED

The test code can be found in the same repository and branch as before:

https://github.com/luizvilla/Core/tree/metaData

@luizvilla
luizvilla requested a review from Ayoub-Farah July 30, 2026 09:58
@luizvilla luizvilla self-assigned this Jul 30, 2026

@Ayoub-Farah Ayoub-Farah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I had a problem with the test file on windows, with mcumgr location not in the good format for windows.

Codex corrected the problem and generated the following python files :

test_metadata_nvs.py

PS C:\Users\afarahhass\Documents\Repo\CoreV2\Core_Luiz> & C:\Users\afarahhass\AppData\Local\Programs\Python\Python312\python.exe `
>>   .\src\test_metadata_nvs.py --port COM29
Using board 58435001004B001B on port COM29
[1/8] Clearing all metadata fields...
  CLEAR=OK
[2/8] Reading back (expect all fields empty/ERR)...
[3/8] Attempting undersized writes/reads (expect all rejected)...
  FIELD                    EXPECTED  ACTUAL  RESULT
  SPIN_SERIAL_BADSIZE      -2        -2      OK
  SHIELD_SERIAL_BADSIZE    -2        -2      OK
  SPIN_PASSWORD_BADSIZE    -2        -2      OK
  SHIELD_PASSWORD_BADSIZE  -2        -2      OK
  EXTRA_BADSIZE            -2        -2      OK
[4/8] Reading back (expect fields still empty/ERR)...
[5/8] Checking free NVS space (baseline)...
  FREE_SPACE=2008
[6/8] Writing canned test values...
[7/8] Reading back immediately (same-boot sanity check)...
  FIELD            WRITTEN          READ             RESULT
  SPIN_SERIAL      'SPIN000000001'  'SPIN000000001'  OK
  SHIELD_SERIAL    'SHLD000000001'  'SHLD000000001'  OK
  SPIN_VERSION     '9.9.9'          '9.9.9'          OK
  SHIELD_VERSION   '8.8.8'          '8.8.8'          OK
  SPIN_PASSWORD    'SPINPASS01'     'SPINPASS01'     OK
  SHIELD_PASSWORD  'SHLDPASS01'     'SHLDPASS01'     OK
  EXTRA_0          'EXTRA0'         'EXTRA0'         OK
  EXTRA_1          'EXTRA1'         'EXTRA1'         OK
  EXTRA_2          'EXTRA2'         'EXTRA2'         OK
  EXTRA_3          'EXTRA3'         'EXTRA3'         OK
  EXTRA_4          'EXTRA4'         'EXTRA4'         OK
[8/8] Resetting board and re-reading (persistence check)...
Done
  FIELD            WRITTEN          READ             RESULT
  SPIN_SERIAL      'SPIN000000001'  'SPIN000000001'  OK
  SHIELD_SERIAL    'SHLD000000001'  'SHLD000000001'  OK
  SPIN_VERSION     '9.9.9'          '9.9.9'          OK
  SHIELD_VERSION   '8.8.8'          '8.8.8'          OK
  SPIN_PASSWORD    'SPINPASS01'     'SPINPASS01'     OK
  SHIELD_PASSWORD  'SHLDPASS01'     'SHLDPASS01'     OK
  EXTRA_0          'EXTRA0'         'EXTRA0'         OK
  EXTRA_1          'EXTRA1'         'EXTRA1'         OK
  EXTRA_2          'EXTRA2'         'EXTRA2'         OK
  EXTRA_3          'EXTRA3'         'EXTRA3'         OK
  EXTRA_4          'EXTRA4'         'EXTRA4'         OK
PASS: values survived a board reset
[final] Checking free NVS space (post)...
  FREE_SPACE=1800
ALL CHECKS PASSED

The test passed.

Comment thread zephyr/modules/owntech_spin_api/zephyr/src/MetaDataAPI.cpp Outdated

@Ayoub-Farah Ayoub-Farah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's good for me

@Ayoub-Farah

Copy link
Copy Markdown
Member

Ok for me, we can merge.

@luizvilla
luizvilla merged commit 7cc9a29 into owntech-foundation:main Jul 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants