Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: SFDP Sector Map Table Parameter ID LSB is 0x81 #12270

Merged
merged 8 commits into from
Feb 6, 2020
Merged

BUGFIX: SFDP Sector Map Table Parameter ID LSB is 0x81 #12270

merged 8 commits into from
Feb 6, 2020

Conversation

VeijoPesonen
Copy link
Contributor

@VeijoPesonen VeijoPesonen commented Jan 16, 2020

Summary of changes

Fixes #11722. Value of the SFDP Sector Map Table Parameter ID LSB is 0x81, not 81 in decimal.

Starts also the work where SFDP specific functionality is split from the SPIF and QSPIF Blockdevices to a separate file. At the moment it means retrieval and parsing of the SFDP- and SFDP Parameter-headers.

Impact of changes

Migration actions required

Documentation


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

SPIF compilation

mbed test --compile -t ARM -m NRF52840_DK -n features-storage-filesystem-littlefs-* --app-config tools/test_configs/SPIFBlockDeviceAndHeapBlockDevice.json

QSPIF compilation

mbed test --compile -t GCC_ARM -m NRF52840_DK -n features-storage-filesystem-littlefs-* --app-config tools/test_configs/QSPIFBlockDeviceAndHeapBlockDevice.json


| target              | platform_name | test suite                                                                           | result | elapsed_time (sec) | copy_method |
|---------------------|---------------|--------------------------------------------------------------------------------------|--------|--------------------|-------------|
| NRF52840_DK-ARMC6   | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem-dirs                           | OK     | 156.3              | default     |
| NRF52840_DK-ARMC6   | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem-files                          | OK     | 69.58              | default     |
| NRF52840_DK-ARMC6   | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem-interspersed                   | OK     | 22.98              | default     |
| NRF52840_DK-ARMC6   | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem-seek                           | OK     | 132.63             | default     |
| NRF52840_DK-ARMC6   | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_integration-format             | OK     | 36.4               | default     |
| NRF52840_DK-ARMC6   | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_recovery-resilience            | OK     | 46.25              | default     |
| NRF52840_DK-ARMC6   | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_recovery-resilience_functional | OK     | 72.35              | default     |
| NRF52840_DK-ARMC6   | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_recovery-wear_leveling         | OK     | 91.87              | default     |
| NRF52840_DK-ARMC6   | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_retarget-dirs                  | OK     | 151.3              | default     |
| NRF52840_DK-ARMC6   | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_retarget-files                 | OK     | 57.79              | default     |
| NRF52840_DK-ARMC6   | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_retarget-interspersed          | OK     | 22.54              | default     |
| NRF52840_DK-ARMC6   | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_retarget-seek                  | OK     | 119.92             | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem-dirs                           | OK     | 56.22              | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem-files                          | OK     | 36.87              | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem-interspersed                   | OK     | 23.01              | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem-seek                           | OK     | 64.11              | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_integration-format             | OK     | 24.94              | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_recovery-resilience            | OK     | 48.27              | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_recovery-resilience_functional | OK     | 72.97              | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_recovery-wear_leveling         | OK     | 92.72              | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_retarget-dirs                  | OK     | 65.92              | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_retarget-files                 | OK     | 32.92              | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_retarget-interspersed          | OK     | 22.8               | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_retarget-seek                  | OK     | 79.63              | default     |
mbedgt: test suite results: 24 OK
[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@SeppoTakalo


Veijo Pesonen added 2 commits January 16, 2020 13:00
The Sector Map Function Specific Table is assigned the ID LSB of 81
in hexadecimal, not in decimal[1].

[1] JESD216.01 p. 53
@ciarmcom ciarmcom requested review from SeppoTakalo and a team January 16, 2020 16:00
@ciarmcom
Copy link
Member

@VeijoPesonen, thank you for your changes.
@SeppoTakalo @ARMmbed/mbed-os-core @ARMmbed/mbed-os-storage @ARMmbed/mbed-os-maintainers please review.

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 17, 2020

@VeijoPesonen Please review Travis failures

Veijo Pesonen added 2 commits January 17, 2020 14:43
@VeijoPesonen
Copy link
Contributor Author

@0xc0170 , @SeppoTakalo astyle and doxygen issues has been fixed now.

0xc0170
0xc0170 previously approved these changes Jan 20, 2020
Veijo Pesonen added 3 commits January 20, 2020 12:53
Separates SFDP header retrieval and moves it as a part of the earlier
introduced SFDP file.

Purpose is to abstract away differences between SPIF and QSPIF devices
when it comes to fetching the SFDP headers from a device.
@adbridge
Copy link
Contributor

@0xc0170 @SeppoTakalo could you please confirm you are happy with the latest changes ?

@mergify mergify bot added needs: CI and removed needs: review labels Jan 20, 2020
SeppoTakalo
SeppoTakalo previously approved these changes Jan 21, 2020
@adbridge
Copy link
Contributor

CI started

@adbridge adbridge added the release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0 label Jan 21, 2020
@mergify mergify bot added needs: work and removed needs: CI labels Jan 21, 2020
@mbed-ci
Copy link

mbed-ci commented Jan 21, 2020

Test run: FAILED

Summary: 3 of 4 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_build-GCC_ARM
  • jenkins-ci/mbed-os-ci_build-IAR

@VeijoPesonen
Copy link
Contributor Author

VeijoPesonen commented Jan 22, 2020

@adbridge I need some help here because I'm unable to decipher from the logs what is going wrong in this case. Scratch that, I should have checked from the most obvious place first...

One of the issues

The issues don't seem to be caused by the changes I made.


[DEBUG] Return: 1
[DEBUG] Output: In file included from ./source/borderrouter_tasklet.c:32:
[DEBUG] Output: ./source/static_6lowpan_config.h:11:33: error: use of undeclared identifier 'MBED_CONF_APP_PSK_KEY'
[DEBUG] Output: static const char psk_key[16] = MBED_CONF_APP_PSK_KEY;
[DEBUG] Output:                                 ^
[DEBUG] Output: ./source/static_6lowpan_config.h:12:37: error: use of undeclared identifier 'MBED_CONF_APP_TLS_PSK_KEY'
[DEBUG] Output: static const char tls_psk_key[16] = MBED_CONF_APP_TLS_PSK_KEY;
[DEBUG] Output:                                     ^
[DEBUG] Output: ./source/static_6lowpan_config.h:19:26: error: use of undeclared identifier 'MBED_CONF_APP_PSK_KEY_ID'
[DEBUG] Output:     {"PSK_KEY_ID", NULL, MBED_CONF_APP_PSK_KEY_ID},
[DEBUG] Output:                          ^
[DEBUG] Output: ./source/static_6lowpan_config.h:20:22: error: use of undeclared identifier 'MBED_CONF_APP_PAN_ID'
[DEBUG] Output:     {"PAN_ID", NULL, MBED_CONF_APP_PAN_ID},
[DEBUG] Output:                      ^
[DEBUG] Output: ./source/static_6lowpan_config.h:26:26: error: use of undeclared identifier 'MBED_CONF_APP_RF_CHANNEL'
[DEBUG] Output:     {"RF_CHANNEL", NULL, MBED_CONF_APP_RF_CHANNEL},
[DEBUG] Output:                          ^
[DEBUG] Output: ./source/static_6lowpan_config.h:27:31: error: use of undeclared identifier 'MBED_CONF_APP_RF_CHANNEL_PAGE'
[DEBUG] Output:     {"RF_CHANNEL_PAGE", NULL, MBED_CONF_APP_RF_CHANNEL_PAGE},
[DEBUG] Output:                               ^
[DEBUG] Output: ./source/static_6lowpan_config.h:28:31: error: use of undeclared identifier 'MBED_CONF_APP_RF_CHANNEL_MASK'
[DEBUG] Output:     {"RF_CHANNEL_MASK", NULL, MBED_CONF_APP_RF_CHANNEL_MASK},
[DEBUG] Output:                               ^
[DEBUG] Output: ./source/static_6lowpan_config.h:29:31: error: use of undeclared identifier 'MBED_CONF_APP_RPL_INSTANCE_ID'
[DEBUG] Output:     {"RPL_INSTANCE_ID", NULL, MBED_CONF_APP_RPL_INSTANCE_ID},
[DEBUG] Output:                               ^
[DEBUG] Output: ./source/static_6lowpan_config.h:30:30: error: use of undeclared identifier 'MBED_CONF_APP_RPL_IDOUBLINGS'
[DEBUG] Output:     {"RPL_IDOUBLINGS", NULL, MBED_CONF_APP_RPL_IDOUBLINGS},
[DEBUG] Output:                              ^
[DEBUG] Output: ./source/static_6lowpan_config.h:31:21: error: use of undeclared identifier 'MBED_CONF_APP_RPL_K'
[DEBUG] Output:     {"RPL_K", NULL, MBED_CONF_APP_RPL_K},
[DEBUG] Output:                     ^
[DEBUG] Output: ./source/static_6lowpan_config.h:32:32: error: use of undeclared identifier 'MBED_CONF_APP_RPL_MAX_RANK_INC'
[DEBUG] Output:     {"RPL_MAX_RANK_INC", NULL, MBED_CONF_APP_RPL_MAX_RANK_INC},
[DEBUG] Output:                                ^
[DEBUG] Output: ./source/static_6lowpan_config.h:33:36: error: use of undeclared identifier 'MBED_CONF_APP_RPL_MIN_HOP_RANK_INC'
[DEBUG] Output:     {"RPL_MIN_HOP_RANK_INC", NULL, MBED_CONF_APP_RPL_MIN_HOP_RANK_INC},
[DEBUG] Output:                                    ^
[DEBUG] Output: ./source/static_6lowpan_config.h:34:24: error: use of undeclared identifier 'MBED_CONF_APP_RPL_IMIN'
[DEBUG] Output:     {"RPL_IMIN", NULL, MBED_CONF_APP_RPL_IMIN},
[DEBUG] Output:                        ^
[DEBUG] Output: ./source/static_6lowpan_config.h:35:36: error: use of undeclared identifier 'MBED_CONF_APP_RPL_DEFAULT_LIFETIME'
[DEBUG] Output:     {"RPL_DEFAULT_LIFETIME", NULL, MBED_CONF_APP_RPL_DEFAULT_LIFETIME},
[DEBUG] Output:                                    ^
[DEBUG] Output: ./source/static_6lowpan_config.h:36:33: error: use of undeclared identifier 'MBED_CONF_APP_RPL_LIFETIME_UNIT'
[DEBUG] Output:     {"RPL_LIFETIME_UNIT", NULL, MBED_CONF_APP_RPL_LIFETIME_UNIT},
[DEBUG] Output:                                 ^
[DEBUG] Output: ./source/static_6lowpan_config.h:37:23: error: use of undeclared identifier 'MBED_CONF_APP_RPL_PCS'
[DEBUG] Output:     {"RPL_PCS", NULL, MBED_CONF_APP_RPL_PCS},
[DEBUG] Output:                       ^
[DEBUG] Output: ./source/static_6lowpan_config.h:38:23: error: use of undeclared identifier 'MBED_CONF_APP_RPL_OCP'
[DEBUG] Output:     {"RPL_OCP", NULL, MBED_CONF_APP_RPL_OCP},
[DEBUG] Output:                       ^
[DEBUG] Output: ./source/static_6lowpan_config.h:39:34: error: use of undeclared identifier 'MBED_CONF_APP_RA_ROUTER_LIFETIME'
[DEBUG] Output:     {"RA_ROUTER_LIFETIME", NULL, MBED_CONF_APP_RA_ROUTER_LIFETIME},
[DEBUG] Output:                                  ^
[DEBUG] Output: ./source/static_6lowpan_config.h:40:34: error: use of undeclared identifier 'MBED_CONF_APP_BEACON_PROTOCOL_ID'
[DEBUG] Output:     {"BEACON_PROTOCOL_ID", NULL, MBED_CONF_APP_BEACON_PROTOCOL_ID},
[DEBUG] Output:                                  ^
[DEBUG] Output: fatal error: too many errors emitted, stopping now [-ferror-limit=]

@mergify mergify bot dismissed stale reviews from 0xc0170 and SeppoTakalo January 24, 2020 11:41

Pull request has been modified.

@VeijoPesonen
Copy link
Contributor Author

I'm not sure are these related but I'm seeing following things in the logs:

K66F failure

log URL:

[Fatal Error] SFDP.cpp@25,10: mbed_trace.h: No such file or directory
[ERROR] ./mbed-os/drivers/source/SFDP.cpp:25:10: fatal error: mbed_trace.h: No such file or directory
   25 | #include "mbed_trace.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.
Passed Example Compilation:
+--------------------------------+--------+-----------+----------+--------------+
| EXAMPLE NAME                   | TARGET | TOOLCHAIN | TEST GEN | BUILD RESULT |
+--------------------------------+--------+-----------+----------+--------------+
| mbed-os-example-blinky         |  K66F  |  GCC_ARM  | TEST_OFF |    PASSED    |
| mbed-os-example-tls/benchmark  |  K66F  |  GCC_ARM  | TEST_ON  |    PASSED    |
| mbed-os-example-tls/tls-client |  K66F  |  GCC_ARM  | TEST_ON  |    PASSED    |
| mbed-os-example-tls/hashing    |  K66F  |  GCC_ARM  | TEST_ON  |    PASSED    |
| mbed-os-example-tls/authcrypt  |  K66F  |  GCC_ARM  | TEST_ON  |    PASSED    |
| mbed-os-example-sockets        |  K66F  |  GCC_ARM  | TEST_ON  |    PASSED    |
| nanostack-border-router        |  K66F  |  GCC_ARM  | TEST_OFF |    PASSED    |
| mbed-os-example-mesh-minimal   |  K66F  |  GCC_ARM  | TEST_OFF |    PASSED    |
| mbed-os-example-attestation    |  K66F  |  GCC_ARM  | TEST_ON  |    PASSED    |
+--------------------------------+--------+-----------+----------+--------------+


Failed Example Compilation:
+----------------------------------+--------+-----------+----------+--------------+
| EXAMPLE NAME                     | TARGET | TOOLCHAIN | TEST GEN | BUILD RESULT |
+----------------------------------+--------+-----------+----------+--------------+
| mbed-os-example-blinky-baremetal |  K66F  |  GCC_ARM  |  UNSET   |    FAILED    |
+----------------------------------+--------+-----------+----------+--------------+
Passed Example Compilation:
+----------------------------------+--------+-----------+----------+--------------+
| EXAMPLE NAME                     | TARGET | TOOLCHAIN | TEST GEN | BUILD RESULT |
+----------------------------------+--------+-----------+----------+--------------+
| mbed-os-example-blinky           |  K66F  |  GCC_ARM  | TEST_OFF |    PASSED    |
| mbed-os-example-blinky-baremetal |  K66F  |  GCC_ARM  | TEST_OFF |    PASSED    |
| mbed-os-example-tls/benchmark    |  K66F  |  GCC_ARM  | NO_IMAGE |    PASSED    |
| mbed-os-example-tls/tls-client   |  K66F  |  GCC_ARM  | NO_IMAGE |    PASSED    |
| mbed-os-example-tls/hashing      |  K66F  |  GCC_ARM  | NO_IMAGE |    PASSED    |
| mbed-os-example-tls/authcrypt    |  K66F  |  GCC_ARM  | NO_IMAGE |    PASSED    |
| mbed-os-example-sockets          |  K66F  |  GCC_ARM  | NO_IMAGE |    PASSED    |
| mbed-os-example-attestation      |  K66F  |  GCC_ARM  | NO_IMAGE |    PASSED    |
+----------------------------------+--------+-----------+----------+--------------+


Failed Example Compilation:
+------------------------------+--------+-----------+----------+--------------+
| EXAMPLE NAME                 | TARGET | TOOLCHAIN | TEST GEN | BUILD RESULT |
+------------------------------+--------+-----------+----------+--------------+
| nanostack-border-router      |  K66F  |  GCC_ARM  |  UNSET   |    FAILED    |
| mbed-os-example-mesh-minimal |  K66F  |  GCC_ARM  |  UNSET   |    FAILED    |
+------------------------------+--------+-----------+----------+--------------+

@adbridge would you please restart the tests to see if compilation error with mbed-os-example-blinky-baremetal has some kind of trickle-down effect which causes failures elsewhere.

@adbridge
Copy link
Contributor

Re starting ci to see if there is a real issue

@mbed-ci
Copy link

mbed-ci commented Jan 24, 2020

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

@kjbracey
Copy link
Contributor

Examples test appears to be running twice - first with

python -u ../mbed-os/tools/test/examples/examples.py compile GCC_ARM --mcu K66F --profiles develop mbed-os/tools/profiles/extensions/minimal-printf.json

then a second time exactly the same command but with -v at the end. Because there was a failure the first time?

Here, and also in my PR #12142 (run 3), the re-run with -v fails with the missing MBED_CONF errors. The first run shows the real error.

Reason unknown - the -v flag doesn't seem like it should be triggering it. Maybe it's just the second run in the same workspace?

@VeijoPesonen
Copy link
Contributor Author

@adbridge, @kjbracey-arm, @SeppoTakalo From my point of view this PR is ready and could be merged in.

Copy link
Contributor

@michalpasztamobica michalpasztamobica left a comment

Choose a reason for hiding this comment

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

Aside from tiny documentation improvement request I have one larger question. @VeijoPesonen , have you considered adding the header parsing to BlockDevice class, so that both subclasses can inherit it, instead of adding separate global functions which need to be befriended with the modules using them?

drivers/internal/SFDP.h Show resolved Hide resolved
@VeijoPesonen
Copy link
Contributor Author

Aside from tiny documentation improvement request I have one larger question. @VeijoPesonen , have you considered adding the header parsing to BlockDevice class, so that both subclasses can inherit it, instead of adding separate global functions which need to be befriended with the modules using them?

Haven't really thought about it but is SFDP even logically part of BlockDevice class? I would say it isn't because not all BlockDevices do use SFDP.

Copy link
Contributor

@michalpasztamobica michalpasztamobica left a comment

Choose a reason for hiding this comment

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

From my point of view this is OK. Doxygen changes to be added in another PR and I accept the logical explanation of why we can't embed SPDF parser into BlockDevice class.

@VeijoPesonen
Copy link
Contributor Author

@kjbracey-arm, @SeppoTakalo This PR is ready and should be merged.

@VeijoPesonen
Copy link
Contributor Author

@0xc0170 This one should be ready to go in.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 5, 2020

@VeijoPesonen Thanks for the reminder. I restarted CI to get the latest run, will be merged asap it completes

@mbed-ci
Copy link

mbed-ci commented Feb 5, 2020

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 3
Build artifacts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issues with SFDP parsing of the Sector Map Parameter Header and Table parsing
8 participants