Skip to content

IOTSTOR-1044 - SPIFBlockDevice is broken in Mbed OS master(6), #12981

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

Merged
merged 1 commit into from
May 18, 2020

Conversation

mtomczykmobica
Copy link

@mtomczykmobica mtomczykmobica commented May 15, 2020

Removed incorrect spi.deselect at constructor.

Summary of changes

Removed incorrect spi.deselect at constructor.

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

[] 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

@VeijoPesonen
@AnttiKauppila
@SeppoTakalo


@0xc0170
Copy link
Contributor

0xc0170 commented May 15, 2020

CI started

@yogpan01
Copy link
Contributor

@VeijoPesonen can you use this patch to verify the fix?

@bulislaw
Copy link
Member

bulislaw commented May 15, 2020

I'm still seeing a crash on K64F:

[1589559232.79][CONN][RXD] >>> Running case #1: 'SPIF Testing Init block device'...
[1589559232.85][CONN][RXD]
[1589559232.85][CONN][INF] found KV pair in stream: {{__testcase_start;SPIF Testing Init block device}}, queued...
[1589559232.88][CONN][RXD] Test Init block device.
mbedgt: :261::FAIL: Expected 0 Was -4002
[1589559232.91][CONN][RXD] :261::FAIL: Expected 0 Was -4002
[1589559232.97][CONN][INF] found KV pair in stream: {{__testcase_finish;SPIF Testing Init block device;0;1}}, queued...
[1589559233.07][CONN][RXD] >>> 'SPIF Testing Init block device': 0 passed, 1 failed with reason 'Test Cases Failed'
[1589559233.07][CONN][RXD]
[1589559233.14][CONN][RXD] >>> Running case #2: 'SPIF Testing write -> deinit -> init -> read'...
[1589559233.21][CONN][RXD]
[1589559233.21][CONN][INF] found KV pair in stream: {{__testcase_start;SPIF Testing write -> deinit -> init -> read}}, queued...
[1589559233.23][CONN][RXD] ++ MbedOS Fault Handler ++
[1589559233.25][CONN][RXD]
[1589559233.27][CONN][RXD] FaultType: HardFault
[1589559233.27][CONN][RXD]
[1589559233.28][CONN][RXD] Context:
[1589559233.29][CONN][RXD] R0: 20001220
[1589559233.30][CONN][RXD] R1: 200002B0
[1589559233.32][CONN][RXD] R2: 200014C0
[1589559233.33][CONN][RXD] R3: 5851F42D
[1589559233.35][CONN][RXD] R4: 200014BC
[1589559233.37][CONN][RXD] R5: 20000044
[1589559233.37][CONN][RXD] R6: 0
[1589559233.39][CONN][RXD] R7: 20000048
[1589559233.40][CONN][RXD] R8: 2000114C
[1589559233.41][CONN][RXD] R9: 10
[1589559233.43][CONN][RXD] R10: 1FFF07FC
[1589559233.44][CONN][RXD] R11: 1FFF0508
[1589559233.46][CONN][RXD] R12: FFFFFFFF
[1589559233.47][CONN][RXD] SP   : 20003950
[1589559233.49][CONN][RXD] LR   : 5C03
[1589559233.50][CONN][RXD] PC   : 5C12
[1589559233.51][CONN][RXD] xPSR : 10E0000
[1589559233.54][CONN][RXD] PSP  : 200038E8
[1589559233.56][CONN][RXD] MSP  : 2002FFC0
[1589559233.57][CONN][RXD] CPUID: 410FC241
[1589559233.59][CONN][RXD] HFSR : 40000000
[1589559233.60][CONN][RXD] MMFSR: 0
[1589559233.61][CONN][RXD] BFSR : 82
[1589559233.62][CONN][RXD] UFSR : 0
[1589559233.63][CONN][RXD] DFSR : 8
[1589559233.64][CONN][RXD] AFSR : 0
[1589559233.66][CONN][RXD] BFAR : 8147E574
[1589559233.68][CONN][RXD] Mode : Thread
[1589559233.70][CONN][RXD] Priv : Privileged
[1589559233.71][CONN][RXD] Stack: PSP
[1589559233.71][CONN][RXD]
[1589559233.74][CONN][RXD] -- MbedOS Fault Handler --
[1589559233.74][CONN][RXD]
[1589559233.74][CONN][RXD]
[1589559233.74][CONN][RXD]
[1589559233.77][CONN][RXD] ++ MbedOS Error Info ++
[1589559233.82][CONN][RXD] Error Status: 0x80FF013D Code: 317 Module: 255
[1589559233.85][CONN][RXD] Error Message: Fault exception
[1589559233.87][CONN][RXD] Location: 0x5C12
[1589559233.90][CONN][RXD] Error Value: 0x1FFF0400
[1589559234.01][CONN][RXD] Current Thread: main Id: 0x20001960 Entry: 0x9081 StackSize: 0x1000 StackMem: 0x20002B00 SP: 0x20003950
[1589559234.08][CONN][RXD] For more info, visit: https://mbed.com/s/error?error=0x80FF013D&tgt=K64F
[1589559234.12][CONN][RXD] -- MbedOS Error Info --
[1589559234.12][CONN][RXD]
[1589559234.17][CONN][RXD] = System will be rebooted due to a fatal error =

The difference is that initially the crash was in the first test, now first test fails and it crashes in the second.

@mergify mergify bot added the needs: CI label May 15, 2020
Copy link
Contributor

@kjbracey kjbracey left a comment

Choose a reason for hiding this comment

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

I spotted this error during review of #12681 for two SDBlockDevice constructors, but missed it for this one :(

If you're still seeing problems I suggest going through and checking the select/deselect balance throughout the entire class - those calls went in to replace a bunch of _cs = 0 and _cs = 1, but they never needed to be balanced before.

@mbed-ci
Copy link

mbed-ci commented May 15, 2020

Test run: SUCCESS

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

@0xc0170 0xc0170 merged commit f50b35f into ARMmbed:master May 18, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented May 18, 2020

@VeijoPesonen Please verify and possibly create a new PR if anything else found

@mergify mergify bot removed the ready for merge label May 18, 2020
@VeijoPesonen
Copy link
Contributor

Looks good to me.

mbedgt: test case report:
| target       | platform_name | test suite                                                                           | test case                                                                            | passed | failed | result | elapsed_time (sec) |
|--------------|---------------|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|--------|--------|--------|--------------------|
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-dirs                           | Directory creation                                                                   | 1      | 0      | OK     | 0.18               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-dirs                           | Directory failures                                                                   | 1      | 0      | OK     | 0.06               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-dirs                           | Directory iteration                                                                  | 1      | 0      | OK     | 0.05               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-dirs                           | Directory remove                                                                     | 1      | 0      | OK     | 8.0                |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-dirs                           | Directory rename                                                                     | 1      | 0      | OK     | 29.27              |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-dirs                           | Directory tests                                                                      | 1      | 0      | OK     | 0.22               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-dirs                           | File creation                                                                        | 1      | 0      | OK     | 0.15               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-dirs                           | Multi-block directory                                                                | 1      | 0      | OK     | 22.08              |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-dirs                           | Nested directories                                                                   | 1      | 0      | OK     | 0.34               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-dirs                           | Root directory                                                                       | 1      | 0      | OK     | 0.05               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-files                          | Dir check                                                                            | 1      | 0      | OK     | 0.04               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-files                          | File tests                                                                           | 1      | 0      | OK     | 0.21               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-files                          | Large file test                                                                      | 1      | 0      | OK     | 13.89              |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-files                          | Medium file test                                                                     | 1      | 0      | OK     | 0.72               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-files                          | Non-overlap check                                                                    | 1      | 0      | OK     | 3.09               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-files                          | Simple file test                                                                     | 1      | 0      | OK     | 0.27               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-files                          | Small file test                                                                      | 1      | 0      | OK     | 0.29               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-interspersed                   | Parallel file test                                                                   | 1      | 0      | OK     | 0.98               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-interspersed                   | Parallel remove file test                                                            | 1      | 0      | OK     | 0.65               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-interspersed                   | Parallel tests                                                                       | 1      | 0      | OK     | 0.22               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-interspersed                   | Remove inconveniently test                                                           | 1      | 0      | OK     | 0.64               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-seek                           | Boundary seek and write                                                              | 1      | 0      | OK     | 2.05               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-seek                           | Large dir seek                                                                       | 1      | 0      | OK     | 0.2                |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-seek                           | Large file seek                                                                      | 1      | 0      | OK     | 0.11               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-seek                           | Large file seek and write                                                            | 1      | 0      | OK     | 0.63               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-seek                           | Out-of-bounds seek                                                                   | 1      | 0      | OK     | 0.52               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-seek                           | Seek tests                                                                           | 1      | 0      | OK     | 43.42              |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-seek                           | Simple dir seek                                                                      | 1      | 0      | OK     | 0.18               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-seek                           | Simple file seek                                                                     | 1      | 0      | OK     | 0.09               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem-seek                           | Simple file seek and write                                                           | 1      | 0      | OK     | 0.52               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_integration-format             | Test bad mount                                                                       | 1      | 0      | OK     | 16.59              |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_integration-format             | Test bad mount than reformat                                                         | 1      | 0      | OK     | 0.3                |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_integration-format             | Test format                                                                          | 1      | 0      | OK     | 0.22               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_integration-format             | Test good mount than reformat                                                        | 1      | 0      | OK     | 0.23               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_integration-format             | Test mount                                                                           | 1      | 0      | OK     | 0.03               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_recovery-resilience            | test resilience                                                                      | 1      | 0      | OK     | 15.81              |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_recovery-resilience_functional | features-storage-filesystem-littlefs-tests-filesystem_recovery-resilience_functional | 1      | 0      | OK     | 66.97              |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_recovery-wear_leveling         | test wear leveling                                                                   | 1      | 0      | OK     | 251.78             |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-dirs                  | Directory creation                                                                   | 1      | 0      | OK     | 0.2                |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-dirs                  | Directory failures                                                                   | 1      | 0      | OK     | 0.07               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-dirs                  | Directory iteration                                                                  | 1      | 0      | OK     | 0.05               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-dirs                  | Directory remove                                                                     | 1      | 0      | OK     | 8.07               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-dirs                  | Directory rename                                                                     | 1      | 0      | OK     | 29.51              |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-dirs                  | Directory tests                                                                      | 1      | 0      | OK     | 0.22               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-dirs                  | File creation                                                                        | 1      | 0      | OK     | 0.14               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-dirs                  | Multi-block directory                                                                | 1      | 0      | OK     | 22.28              |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-dirs                  | Nested directories                                                                   | 1      | 0      | OK     | 0.34               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-dirs                  | Root directory                                                                       | 1      | 0      | OK     | 0.05               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-files                 | Dir check                                                                            | 1      | 0      | OK     | 0.04               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-files                 | File tests                                                                           | 1      | 0      | OK     | 0.21               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-files                 | Large file test                                                                      | 1      | 0      | OK     | 13.0               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-files                 | Medium file test                                                                     | 1      | 0      | OK     | 0.66               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-files                 | Non-overlap check                                                                    | 1      | 0      | OK     | 2.88               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-files                 | Simple file test                                                                     | 1      | 0      | OK     | 0.28               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-files                 | Small file test                                                                      | 1      | 0      | OK     | 0.28               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-interspersed          | Parallel file test                                                                   | 1      | 0      | OK     | 0.97               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-interspersed          | Parallel remove file test                                                            | 1      | 0      | OK     | 0.67               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-interspersed          | Parallel tests                                                                       | 1      | 0      | OK     | 0.21               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-interspersed          | Remove inconveniently test                                                           | 1      | 0      | OK     | 0.64               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-seek                  | Boundary seek and write                                                              | 1      | 0      | OK     | 1.13               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-seek                  | Large dir seek                                                                       | 1      | 0      | OK     | 0.19               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-seek                  | Large file seek                                                                      | 1      | 0      | OK     | 0.12               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-seek                  | Large file seek and write                                                            | 1      | 0      | OK     | 0.62               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-seek                  | Out-of-bounds seek                                                                   | 1      | 0      | OK     | 0.58               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-seek                  | Seek tests                                                                           | 1      | 0      | OK     | 53.22              |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-seek                  | Simple dir seek                                                                      | 1      | 0      | OK     | 0.18               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-seek                  | Simple file seek                                                                     | 1      | 0      | OK     | 0.14               |
| K82F-GCC_ARM | K82F          | features-storage-filesystem-littlefs-tests-filesystem_retarget-seek                  | Simple file seek and write                                                           | 1      | 0      | OK     | 0.54               |
| K82F-GCC_ARM | K82F          | features-storage-tests-blockdevice-general_block_device                              | DEFAULT Testing get type functionality                                               | 1      | 0      | OK     | 0.1                |
| K82F-GCC_ARM | K82F          | features-storage-tests-blockdevice-general_block_device                              | FLASHIAP Testing BlockDevice erase functionality                                     | 1      | 0      | OK     | 0.47               |
| K82F-GCC_ARM | K82F          | features-storage-tests-blockdevice-general_block_device                              | FLASHIAP Testing Deinit block device                                                 | 1      | 0      | OK     | 0.1                |
| K82F-GCC_ARM | K82F          | features-storage-tests-blockdevice-general_block_device                              | FLASHIAP Testing Init block device                                                   | 1      | 0      | OK     | 0.09               |
| K82F-GCC_ARM | K82F          | features-storage-tests-blockdevice-general_block_device                              | FLASHIAP Testing contiguous erase, write and read                                    | 1      | 0      | OK     | 0.8                |
| K82F-GCC_ARM | K82F          | features-storage-tests-blockdevice-general_block_device                              | FLASHIAP Testing multi threads erase program read                                    | 1      | 0      | OK     | 4.8                |
| K82F-GCC_ARM | K82F          | features-storage-tests-blockdevice-general_block_device                              | FLASHIAP Testing program read small data sizes                                       | 1      | 0      | OK     | 0.18               |
| K82F-GCC_ARM | K82F          | features-storage-tests-blockdevice-general_block_device                              | FLASHIAP Testing read write random blocks                                            | 1      | 0      | OK     | 1.36               |
| K82F-GCC_ARM | K82F          | features-storage-tests-blockdevice-general_block_device                              | FLASHIAP Testing unaligned erase blocks                                              | 1      | 0      | OK     | 0.12               |
| K82F-GCC_ARM | K82F          | features-storage-tests-blockdevice-general_block_device                              | FLASHIAP Testing write -> deinit -> init -> read                                     | 1      | 0      | OK     | 0.08               |
| K82F-GCC_ARM | K82F          | features-storage-tests-blockdevice-general_block_device                              | SPIF Testing BlockDevice erase functionality                                         | 1      | 0      | OK     | 0.55               |
| K82F-GCC_ARM | K82F          | features-storage-tests-blockdevice-general_block_device                              | SPIF Testing Deinit block device                                                     | 1      | 0      | OK     | 0.09               |
| K82F-GCC_ARM | K82F          | features-storage-tests-blockdevice-general_block_device                              | SPIF Testing Init block device                                                       | 1      | 0      | OK     | 0.08               |
| K82F-GCC_ARM | K82F          | features-storage-tests-blockdevice-general_block_device                              | SPIF Testing contiguous erase, write and read                                        | 1      | 0      | OK     | 4.57               |
| K82F-GCC_ARM | K82F          | features-storage-tests-blockdevice-general_block_device                              | SPIF Testing multi threads erase program read                                        | 1      | 0      | OK     | 7.32               |
| K82F-GCC_ARM | K82F          | features-storage-tests-blockdevice-general_block_device                              | SPIF Testing program read small data sizes                                           | 1      | 0      | OK     | 0.41               |
| K82F-GCC_ARM | K82F          | features-storage-tests-blockdevice-general_block_device                              | SPIF Testing read write random blocks                                                | 1      | 0      | OK     | 1.75               |
| K82F-GCC_ARM | K82F          | features-storage-tests-blockdevice-general_block_device                              | SPIF Testing unaligned erase blocks                                                  | 1      | 0      | OK     | 0.16               |
| K82F-GCC_ARM | K82F          | features-storage-tests-blockdevice-general_block_device                              | SPIF Testing write -> deinit -> init -> read                                         | 1      | 0      | OK     | 0.19               |
mbedgt: test case results: 87 OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants