[riot-notifications] [RIOT-OS/RIOT] mtd: rename mtd_write_page() -> mtd_write_page_raw(), add high-level mtd_write_page() (#15843)

Dylan Laduranty notifications at github.com
Tue Jan 26 21:22:50 CET 2021


@dylad requested changes on this pull request.

There is something wrong for the new `mtd_write` function
On `SAME54-XPRO` with `tests/mtd_raw`, writing some data to page 1 will result to data write to page 0 + 16 bytes as offset (not 256)

See below log:
```
> 2021-01-26 21:17:21,418 #  main(): This is RIOT! (Version: 2021.04-devel-267-gaf606-mtd_write_page_hl)
2021-01-26 21:17:21,420 # Manual MTD test
2021-01-26 21:17:21,438 # init MTD_0… OK (32 MiB)
2021-01-26 21:17:21,455 # init MTD_1… OK (256 byte)
> erase_sector 0 0
2021-01-26 21:17:26,067 #  erase_sector 0 0
read_page 0 0 0 256
2021-01-26 21:17:30,381 #  read_page 0 0 0 256
2021-01-26 21:17:30,388 # 00000000  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:30,394 # 00000010  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:30,401 # 00000020  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:30,407 # 00000030  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:30,414 # 00000040  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:30,420 # 00000050  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:30,426 # 00000060  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:30,433 # 00000070  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:30,439 # 00000080  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:30,446 # 00000090  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:30,452 # 000000A0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:30,458 # 000000B0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:30,465 # 000000C0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:30,471 # 000000D0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:30,478 # 000000E0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:30,484 # 000000F0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
write_page 0 0 0 "HelloTest!"
2021-01-26 21:17:36,153 #  write_page 0 0 0 "HelloTest!"
read_page 0 0 0 256
2021-01-26 21:17:38,778 #  read_page 0 0 0 256
2021-01-26 21:17:38,785 # 00000000  48  65  6C  6C  6F  54  65  73  74  21  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:38,791 # 00000010  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:38,798 # 00000020  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:38,804 # 00000030  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:38,810 # 00000040  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:38,817 # 00000050  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:38,823 # 00000060  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:38,830 # 00000070  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:38,836 # 00000080  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:38,842 # 00000090  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:38,849 # 000000A0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:38,855 # 000000B0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:38,861 # 000000C0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:38,868 # 000000D0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:38,874 # 000000E0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:38,881 # 000000F0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
read_page 0 1 0 256
2021-01-26 21:17:44,212 #  read_page 0 1 0 256
2021-01-26 21:17:44,219 # 00000100  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:44,225 # 00000110  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:44,232 # 00000120  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:44,238 # 00000130  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:44,244 # 00000140  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:44,251 # 00000150  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:44,257 # 00000160  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:44,264 # 00000170  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:44,270 # 00000180  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:44,276 # 00000190  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:44,283 # 000001A0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:44,289 # 000001B0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:44,296 # 000001C0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:44,302 # 000001D0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:44,308 # 000001E0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:44,315 # 000001F0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
write_page 0 1 0 "HelloTest!"
2021-01-26 21:17:49,745 #  write_page 0 1 0 "HelloTest!"
read_page 0 1 0 256!"
2021-01-26 21:17:51,935 #  read_page 0 1 0 256
2021-01-26 21:17:51,943 # 00000100  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:51,948 # 00000110  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:51,955 # 00000120  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:51,961 # 00000130  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:51,968 # 00000140  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:51,974 # 00000150  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:51,980 # 00000160  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:51,987 # 00000170  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:51,993 # 00000180  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:52,000 # 00000190  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:52,006 # 000001A0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:52,012 # 000001B0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:52,019 # 000001C0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:52,025 # 000001D0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:52,032 # 000001E0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:17:52,038 # 000001F0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
> read_page 0  0 256
2021-01-26 21:18:20,315 #  read_page 0  0 256
2021-01-26 21:18:20,319 # usage: read_page <dev> <page> <offset> <len>
> read_page 0  0 256
2021-01-26 21:18:22,991 #  read_page 0  0 256
2021-01-26 21:18:22,995 # usage: read_page <dev> <page> <offset> <len>
> read_page 0  0 0 256
2021-01-26 21:18:29,348 #  read_page 0  0 0 256
2021-01-26 21:18:29,355 # 00000000  48  65  6C  6C  6F  54  65  73  74  21  FF  FF  FF  FF  FF  FF
2021-01-26 21:18:29,361 # 00000010  48  65  6C  6C  6F  54  65  73  74  21  FF  FF  FF  FF  FF  FF
2021-01-26 21:18:29,368 # 00000020  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:18:29,374 # 00000030  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:18:29,381 # 00000040  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:18:29,387 # 00000050  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:18:29,393 # 00000060  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:18:29,400 # 00000070  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:18:29,406 # 00000080  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:18:29,413 # 00000090  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:18:29,419 # 000000A0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:18:29,425 # 000000B0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:18:29,432 # 000000C0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:18:29,438 # 000000D0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:18:29,445 # 000000E0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF
2021-01-26 21:18:29,451 # 000000F0  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF  FF

```

See below log



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15843#pullrequestreview-576729743
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210126/31113d09/attachment-0001.htm>


More information about the notifications mailing list