henrykotze commented on issue #17809:
URL: https://github.com/apache/nuttx/issues/17809#issuecomment-3752961367
Hi @fdcavalcanti Thank you for your response. I have made the
MTD_BLKSIZE=64, but with the same issue.
Here is the output from PX4 on Nuttx 10.3
```
param save
bchdev_register: blkdev="/fs/mtd_params" chardev="/dev/tmpc000002" readonly=F
find_blockdriver: pathname="/fs/mtd_params"
find_blockdriver: /fs/mtd_params is a MTD
ftl_initialize_by_path: path="/dev/tmpb000002"
find_blockdriver: pathname="/dev/tmpb000002"
ftl_geometry: Entry
ftl_geometry: available: true mediachanged: false writeenabled: true
ftl_geometry: nsectors: 256 sectorsize: 256
ftl_read: sector: 0 nsectors: 1
esp32_bread: esp32_bread(0x3ffb7ee4, 0x3300, 0, 0x1)
esp32_read: esp32_read(0x3ffb7ee4, 0x330000, 0, 0x100)
esp32_read: esp32_read()=256
esp32_bread: esp32_bread()=1
ftl_write: sector: 0 nsectors: 1
esp32_bread: esp32_bread(0x3ffb7ee4, 0x3300, 0, 0x10)
esp32_read: esp32_read(0x3ffb7ee4, 0x330000, 0, 0x1000)
esp32_read: esp32_read()=4096
esp32_bread: esp32_bread()=16
esp32_erase: esp32_erase(0x3ffb7ee4, 816, 0)
esp32_erase: esp32_erase()=1
ftl_flush: Copy 256 bytes into erase block=0 at offset=0
esp32_bwrite: esp32_bwrite(0x3ffb7ee4, 0x3300, 0, 0x10)
esp32_write: esp32_write(0x3ffb7ee4, 0x330000, 0, 0x1000)
esp32_write: esp32_write()=4096
esp32_bwrite: esp32_bwrite()=16
bchdev_register: blkdev="/fs/mtd_params" chardev="/dev/tmpc000003" readonly=T
find_blockdriver: pathname="/fs/mtd_params"
find_blockdriver: /fs/mtd_params is a MTD
ftl_initialize_by_path: path="/dev/tmpb000003"
find_blockdriver: pathname="/dev/tmpb000003"
ftl_geometry: Entry
ftl_geometry: available: true mediachanged: false writeenabled: true
ftl_geometry: nsectors: 256 sectorsize: 256
ftl_read: sector: 0 nsectors: 1
esp32_bread: esp32_bread(0x3ffb7ee4, 0x3300, 0, 0x1)
esp32_read: esp32_read(0x3ffb7ee4, 0x330000, 0, 0x100)
esp32_read: esp32_read()=256
esp32_bread: esp32_bread()=1
```
Here is the output from PX4 on Nuttx 12.12
```
Entry
ESP SPI Flash information:
ID = 0x204017
Status mask = 0xffff
Chip size = 4096 KB
Page size = 256 B
Sector size = 4 KB
Block size = 64 KB
MTD offset = 0x330000
MTD size = 0x10000
esp_ioctl: 1537
blocksize: 64 erasesize: 4096 neraseblocks: 1024
return 0
NuttShell (NSH) NuttX-11.0.0
nsh> [Kparam select /fs/mtd_params
INFO [param] selected parameter default file /fs/mtd_params
nsh> [Kparam save
blkdev="/fs/mtd_params" chardev="/dev/tmpc000001" oflags=0x26
pathname="/fs/mtd_params"
/fs/mtd_params is a MTD
path="/dev/tmpb000001"
pathname="/dev/tmpb000001"
Entry
available: true mediachanged: false writeenabled: true
nsectors: 1024 sectorsize: 64
Entry
esp_ioctl: 778
return -25
sector: 0 nsectors: 1
esp_flash_read failed 24579
ERROR: Read 1 blocks starting at block 0 failed: -1
Read failed: -1
ERROR [tinybson] killed: write error
ERROR [parameters] BSON encoder finalize failed
ERROR [parameters] parameter export to /fs/mtdblkdev="/fs/mtd_params"
chardev="/dev/tmpc000002" oflags=0x26
pathname="/fs/mtd_params"
/fs/mtd_params is a MTD
path="/dev/tmpb000002"
pathname="/dev/tmpb000002"
Entry
available: true mediachanged: false writeenabled: true
nsectors: 1024 sectorsize: 64
Entry
esp_ioctl: 778
return -25
sector: 0 nsectors: 1
esp_flash_read failed 24579
ERROR: Read 1 blocks starting at block 0 failed: -1
Read failed: -1
_params failed (-1) attempt 1
ERROR [tinybson] killed: write error
ERROR [parameters] BSON encoder finalize failed
ERROR [parblkdev="/fs/mtd_params" chardev="/dev/tmpc000003" oflags=0x26
pathname="/fs/mtd_params"
/fs/mtd_params is a MTD
path="/dev/tmpb000003"
pathname="/dev/tmpb000003"
Entry
available: true mediachanged: false writeenabled: true
nsectors: 1024 sectorsize: 64
Entry
esp_ioctl: 778
return -25
sector: 0 nsectors: 1
esp_flash_read failed 24579
ERROR: Read 1 blocks starting at block 0 failed: -1
Read failed: -1
ameters] parameter export to /fs/mtd_params failed (-1) attempt 2
ERROR [tinybson] killed: write error
ERROR [parameters] BSON encoder finalize failed
ERROR [parameters] parameter export to /fs/mtd_params failed (-1) attempt 3
ERROR [parameters] param export failed (-1)
ERROR [param] Param save failed (-1)
nsh> [K
```
It seems in 12.12 the ftl_ioctl is called whereas in 10.3 its not.
Any suggestion would be of help. Thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]