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

arm/tlsr82: bugfix, tlsr82_flash_ioctl() return wrong value. #6424

Merged
merged 1 commit into from Jun 13, 2022

Conversation

CV-Bowen
Copy link
Contributor

@CV-Bowen CV-Bowen commented Jun 13, 2022

Summary

  1. correct the tlsr82_flash_ioctl() return value;
  2. tlsr82_flash_test() using api tlsr82_flash_ioctl();

Impact

tlsr82 flash

Testing

local test with tlsr82_flash_test();
Test log with config:
CONFIG_TLSR82_FLASH_FS_OFFSET=0x00060000
CONFIG_TLSR82_FLASH_FS_SIZE=0x20000

NuttShell (NSH) NuttX-10.3.0
nsh> [    0.007000] tlsr82_flash_test: ======== Flash test start ========
[    0.013000] tlsr82_flash_test: Flash information print:
[    0.018000] tlsr82_flash_test:     Flash MID: 0x001460c8
[    0.027000] tlsr82_flash_test:     Flash UID: 0x50 0x31 0x44 0x33 0x32 0x38 0x13 0x0 0x8a 0x0 0x52 0xff 0xa6 0xff 0xff 
[    0.037000] tlsr82_flash_test:     Flash Start Address: 0x00060000
[    0.043000] tlsr82_flash_test:     Flash Size         : 0x00020000
[    0.049000] tlsr82_flash_test:     Flash Sector Size  : 4096
[    0.055000] tlsr82_flash_test:     Flash Page Size    : 256
[    0.060000] tlsr82_flash_test:     Flash Sector       : 32
[    0.066000] tlsr82_flash_test:     Flash Page         : 512
[    0.071000] tlsr82_flash_test: Flash chip erase test start:
[    0.238000] tlsr82_flash_test: Flach chip erase test Success.
[    0.243000] tlsr82_flash_test: Flash page write/read test start:
[    0.249000] tlsr82_flash_print: Write buffer data:
[    0.258000] tlsr82_flash_print: 0x00000000:0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f 
[    0.273000] tlsr82_flash_print: 0x00000010:0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 
[    0.288000] tlsr82_flash_print: 0x00000020:0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f 
[    0.303000] tlsr82_flash_print: 0x00000030:0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3a 0x3b 0x3c 0x3d 0x3e 0x3f 
[    0.318000] tlsr82_flash_print: 0x00000040:0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 
[    0.333000] tlsr82_flash_print: 0x00000050:0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5f 
[    0.348000] tlsr82_flash_print: 0x00000060:0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f 
[    0.363000] tlsr82_flash_print: 0x00000070:0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f 
[    0.378000] tlsr82_flash_print: 0x00000080:0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f 0x10 
[    0.393000] tlsr82_flash_print: 0x00000090:0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x20 
[    0.408000] tlsr82_flash_print: 0x000000a0:0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f 0x30 
[    0.423000] tlsr82_flash_print: 0x000000b0:0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3a 0x3b 0x3c 0x3d 0x3e 0x3f 0x40 
[    0.438000] tlsr82_flash_print: 0x000000c0:0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 
[    0.453000] tlsr82_flash_print: 0x000000d0:0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5f 0x60 
[    0.468000] tlsr82_flash_print: 0x000000e0:0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f 0x70 
[    0.483000] tlsr82_flash_print: 0x000000f0:0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f 0x80 
[    1.017000] tlsr82_flash_test: Flash page write/read test Success.
[    1.023000] tlsr82_flash_test: Erase chip for byte write test
[    1.060000] tlsr82_flash_test: Erase chip finished
[    1.065000] tlsr82_flash_test: Flash byte read/write test start
[    1.848000] tlsr82_flash_test: Flash byte read/write test Success
[    1.853000] tlsr82_flash_test: Erase chip for protect/unprotect test
[    1.892000] tlsr82_flash_test: Erase chip finished
[    1.896000] tlsr82_flash_print: Write buffer data:
[    1.905000] tlsr82_flash_print: 0x00000000:0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f 
[    1.920000] tlsr82_flash_print: 0x00000010:0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 
[    1.935000] tlsr82_flash_print: 0x00000020:0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f 
[    1.950000] tlsr82_flash_print: 0x00000030:0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3a 0x3b 0x3c 0x3d 0x3e 0x3f 
[    1.965000] tlsr82_flash_print: 0x00000040:0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 
[    1.980000] tlsr82_flash_print: 0x00000050:0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5f 
[    1.995000] tlsr82_flash_print: 0x00000060:0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f 
[    2.010000] tlsr82_flash_print: 0x00000070:0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f 
[    2.025000] tlsr82_flash_print: 0x00000080:0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f 0x10 
[    2.040000] tlsr82_flash_print: 0x00000090:0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x20 
[    2.055000] tlsr82_flash_print: 0x000000a0:0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2a 0x2b 0x2c 0x2d 0x2e 0x2f 0x30 
[    2.070000] tlsr82_flash_print: 0x000000b0:0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3a 0x3b 0x3c 0x3d 0x3e 0x3f 0x40 
[    2.085000] tlsr82_flash_print: 0x000000c0:0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 
[    2.100000] tlsr82_flash_print: 0x000000d0:0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5f 0x60 
[    2.115000] tlsr82_flash_print: 0x000000e0:0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f 0x70 
[    2.130000] tlsr82_flash_print: 0x000000f0:0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f 0x80 
[    2.501000] tlsr82_flash_test: Current flash status: 0x1c
[    2.674000] tlsr82_flash_test: ======== Flash test Success ========

arch/arm/src/tlsr82/tlsr82_flash_mtd.c Outdated Show resolved Hide resolved
arch/arm/src/tlsr82/tlsr82_flash_mtd.c Outdated Show resolved Hide resolved
arch/arm/src/tlsr82/tlsr82_flash_mtd.c Outdated Show resolved Hide resolved
arch/arm/src/tlsr82/tlsr82_flash_mtd.c Outdated Show resolved Hide resolved
arch/arm/src/tlsr82/tlsr82_flash_mtd.c Outdated Show resolved Hide resolved
Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
@xiaoxiang781216 xiaoxiang781216 merged commit 9985e0a into apache:master Jun 13, 2022
@jerpelea jerpelea added this to To-Add in Release Notes - 11.0.0 Aug 30, 2022
@jerpelea jerpelea moved this from To-Add to Added in Release Notes - 11.0.0 Sep 1, 2022
@CV-Bowen CV-Bowen deleted the tlsr82_flash_bugfix_pr branch November 21, 2022 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants