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

[Infineon][SVE] Fix CYW30739 KVS read/write methods. #21742

Merged
merged 1 commit into from
Aug 9, 2022

Conversation

hsusid
Copy link
Contributor

@hsusid hsusid commented Aug 9, 2022

Problem

  • The platform NVRAM write API doesn't support writing data from the flash.
  • The platform NVRAM read API always fails if the given buffer size is zero.

Change overview

  • Write methods should copy data to RAM before calling the platform API which doesn't support writing data from the flash.
  • Read methods should return CHIP_ERROR_BUFFER_TOO_SMALL if the specified entry exists but the given buffer size is zero.

Testing

  • Run some TC-SU-XXX cases

@github-actions
Copy link

github-actions bot commented Aug 9, 2022

PR #21742: Size comparison from 7a981fd to 9330e29

Increases (2 builds for cc13x2_26x2)
platform target config section 7a981fd 9330e29 change % change
cc13x2_26x2 lock-mtd LP_CC2652R7 (read/write) 181988 181996 8 0.0
pump-app LP_CC2652R7 (read only) 682935 682943 8 0.0
.text 593140 593148 8 0.0
Decreases (7 builds for cc13x2_26x2, cyw30739, efr32, telink)
platform target config section 7a981fd 9330e29 change % change
cc13x2_26x2 lock-mtd LP_CC2652R7 (read only) 655267 655259 -8 -0.0
.text 553432 553424 -8 -0.0
pump-app LP_CC2652R7 (read/write) 159440 159432 -8 -0.0
cyw30739 light cyw930739m2evb_01 (read/write) 584478 584438 -40 -0.0
.app_xip_area 461280 461240 -40 -0.0
lock cyw930739m2evb_01 (read/write) 590406 590366 -40 -0.0
.app_xip_area 462424 462384 -40 -0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 596914 596898 -16 -0.0
.app_xip_area 474436 474420 -16 -0.0
efr32 lock-app BRD4161A+wf200 (read/write) 1136368 1136352 -16 -0.0
.text 989460 989444 -16 -0.0
telink lighting-app tlsr9518adk80d text 587708 587704 -4 -0.0
Full report (32 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 7a981fd 9330e29 change % change
bl602 lighting-app bl602 (read/write) 1379826 1379826 0 0.0
.bss 119746 119746 0 0.0
.data 4480 4480 0 0.0
.text 1048008 1048008 0 0.0
bl602+rpc (read/write) 1425074 1425074 0 0.0
.bss 127186 127186 0 0.0
.data 4600 4600 0 0.0
.text 1079508 1079508 0 0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 670863 670863 0 0.0
(read/write) 180520 180520 0 0.0
.bss 74276 74276 0 0.0
.data 3372 3372 0 0.0
.rodata 88471 88471 0 0.0
.text 582076 582076 0 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 636399 636399 0 0.0
(read/write) 157844 157844 0 0.0
.bss 73556 73556 0 0.0
.data 3372 3372 0 0.0
.rodata 77727 77727 0 0.0
.text 558348 558348 0 0.0
lock-ftd LP_CC2652R7 (read only) 672715 672715 0 0.0
(read/write) 168852 168852 0 0.0
.bss 71348 71348 0 0.0
.data 3296 3296 0 0.0
.rodata 76411 76411 0 0.0
.text 595824 595824 0 0.0
lock-mtd LP_CC2652R7 (read only) 655267 655259 -8 -0.0
(read/write) 181988 181996 8 0.0
.bss 67036 67036 0 0.0
.data 3296 3296 0 0.0
.rodata 101355 101355 0 0.0
.text 553432 553424 -8 -0.0
pump-app LP_CC2652R7 (read only) 682935 682943 8 0.0
(read/write) 159440 159432 -8 -0.0
.bss 71388 71388 0 0.0
.data 3296 3296 0 0.0
.rodata 89311 89311 0 0.0
.text 593140 593148 8 0.0
pump-controller-app LP_CC2652R7 (read only) 667407 667407 0 0.0
(read/write) 175104 175104 0 0.0
.bss 71524 71524 0 0.0
.data 3292 3292 0 0.0
.rodata 84855 84855 0 0.0
.text 582072 582072 0 0.0
shell LP_CC2652R7 (read only) 663546 663546 0 0.0
(read/write) 183356 183356 0 0.0
.bss 76596 76596 0 0.0
.data 3376 3376 0 0.0
.rodata 85418 85418 0 0.0
.text 577812 577812 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 584478 584438 -40 -0.0
.app_xip_area 461280 461240 -40 -0.0
.bss 65640 65640 0 0.0
.data 744 744 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 590406 590366 -40 -0.0
.app_xip_area 462424 462384 -40 -0.0
.bss 70424 70424 0 0.0
.data 748 748 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 596914 596898 -16 -0.0
.app_xip_area 474436 474420 -16 -0.0
.bss 64952 64952 0 0.0
.data 716 716 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read/write) 1096300 1096300 0 0.0
.bss 132844 132844 0 0.0
.data 2068 2068 0 0.0
.text 961364 961364 0 0.0
BRD4161A+rpc (read/write) 1150564 1150564 0 0.0
.bss 149532 149532 0 0.0
.data 2280 2280 0 0.0
.text 998732 998732 0 0.0
BRD4161A+rs911x (read/write) 985836 985836 0 0.0
.bss 162184 162184 0 0.0
.data 2056 2056 0 0.0
.text 821576 821576 0 0.0
lock-app BRD4161A+wf200 (read/write) 1136368 1136352 -16 -0.0
.bss 144824 144824 0 0.0
.data 2064 2064 0 0.0
.text 989460 989444 -16 -0.0
window-app BRD4161A (read/write) 1088032 1088032 0 0.0
.bss 134292 134292 0 0.0
.data 2096 2096 0 0.0
.text 951624 951624 0 0.0
esp32 all-clusters-app c3devkit (read only) 1025948 1025948 0 0.0
(read/write) 1487410 1487410 0 0.0
.dram0.bss 70336 70336 0 0.0
.dram0.data 14600 14600 0 0.0
.flash.rodata 217040 217040 0 0.0
.flash.text 1025948 1025948 0 0.0
.iram0.text 62902 62902 0 0.0
m5stack (read only) 1079231 1079231 0 0.0
(read/write) 489384 489384 0 0.0
.dram0.bss 75840 75840 0 0.0
.dram0.data 34144 34144 0 0.0
.flash.rodata 247404 247404 0 0.0
.flash.text 1073847 1073847 0 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w0+release (read/write) 643564 643564 0 0.0
.bss 69712 69712 0 0.0
.data 2044 2044 0 0.0
.text 569080 569080 0 0.0
lock k32w0+release (read/write) 700972 700972 0 0.0
.bss 70184 70184 0 0.0
.data 2052 2052 0 0.0
.text 626008 626008 0 0.0
linux chip-tool-ipv6only arm64 (read only) 9885276 9885276 0 0.0
(read/write) 694177 694177 0 0.0
.bss 32897 32897 0 0.0
.data 3272 3272 0 0.0
.data.rel.ro 639384 639384 0 0.0
.dynamic 560 560 0 0.0
.got 13648 13648 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 466796 466796 0 0.0
.text 7791140 7791140 0 0.0
thermostat-no-ble arm64 (read only) 2349916 2349916 0 0.0
(read/write) 141681 141681 0 0.0
.bss 55313 55313 0 0.0
.data 1672 1672 0 0.0
.data.rel.ro 75880 75880 0 0.0
.dynamic 560 560 0 0.0
.got 5040 5040 0 0.0
.init 24 24 0 0.0
.init_array 408 408 0 0.0
.rodata 139716 139716 0 0.0
.text 1972672 1972672 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2452584 2452584 0 0.0
.bss 214556 214556 0 0.0
.data 5872 5872 0 0.0
.text 1415228 1415228 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1177839 1177839 0 0.0
bss 143222 143222 0 0.0
rodata 142768 142768 0 0.0
text 813004 813004 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1157895 1157895 0 0.0
bss 142460 142460 0 0.0
rodata 134464 134464 0 0.0
text 802160 802160 0 0.0
p6 all-clusters-app default (read only) 881528 881528 0 0.0
(read/write) 1691052 1691052 0 0.0
.bss 149168 149168 0 0.0
.data 2648 2648 0 0.0
.text 1530848 1530848 0 0.0
all-clusters-minimal-app default (read only) 882248 882248 0 0.0
(read/write) 1635268 1635268 0 0.0
.bss 148448 148448 0 0.0
.data 2648 2648 0 0.0
.text 1475784 1475784 0 0.0
light-app default (read only) 890568 890568 0 0.0
(read/write) 1553980 1553980 0 0.0
.bss 140336 140336 0 0.0
.data 2440 2440 0 0.0
.text 1402816 1402816 0 0.0
lock-app default (read only) 886072 886072 0 0.0
(read/write) 1591260 1591260 0 0.0
.bss 144816 144816 0 0.0
.data 2456 2456 0 0.0
.text 1435600 1435600 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 806016 806016 0 0.0
bss 70976 70976 0 0.0
noinit 43488 43488 0 0.0
text 569732 569732 0 0.0
lighting-app tlsr9518adk80d (read/write) 827824 827824 0 0.0
bss 71820 71820 0 0.0
noinit 43488 43488 0 0.0
text 587708 587704 -4 -0.0

* Write methods should copy data to RAM before calling the platform API
  which doesn't support writing data from the flash.
* Read methods should return CHIP_ERROR_BUFFER_TOO_SMALL if the
  specified entry exists but the given buffer size is zero.
@hsusid hsusid force-pushed the cyw30739-fix-kvs branch from 9330e29 to 0f99d8c Compare August 9, 2022 13:47
@hsusid
Copy link
Contributor Author

hsusid commented Aug 9, 2022

rebase to retrigger CI

@github-actions
Copy link

github-actions bot commented Aug 9, 2022

PR #21742: Size comparison from aec3d1d to 0f99d8c

Increases (1 build for cc13x2_26x2)
platform target config section aec3d1d 0f99d8c change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read/write) 180520 180528 8 0.0
Decreases (6 builds for cc13x2_26x2, cyw30739, esp32, nrfconnect)
platform target config section aec3d1d 0f99d8c change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 670863 670855 -8 -0.0
.text 582076 582068 -8 -0.0
cyw30739 light cyw930739m2evb_01 (read/write) 584478 584438 -40 -0.0
.app_xip_area 461280 461240 -40 -0.0
lock cyw930739m2evb_01 (read/write) 590406 590366 -40 -0.0
.app_xip_area 462424 462384 -40 -0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 596922 596898 -24 -0.0
.app_xip_area 474444 474420 -24 -0.0
esp32 all-clusters-app c3devkit (read only) 1025950 1025948 -2 -0.0
.flash.text 1025950 1025948 -2 -0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 text 813008 813004 -4 -0.0
Full report (32 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section aec3d1d 0f99d8c change % change
bl602 lighting-app bl602 (read/write) 1379834 1379834 0 0.0
.bss 119746 119746 0 0.0
.data 4480 4480 0 0.0
.text 1048012 1048012 0 0.0
bl602+rpc (read/write) 1425090 1425090 0 0.0
.bss 127186 127186 0 0.0
.data 4600 4600 0 0.0
.text 1079512 1079512 0 0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 670863 670855 -8 -0.0
(read/write) 180520 180528 8 0.0
.bss 74276 74276 0 0.0
.data 3372 3372 0 0.0
.rodata 88471 88471 0 0.0
.text 582076 582068 -8 -0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 636399 636399 0 0.0
(read/write) 157844 157844 0 0.0
.bss 73556 73556 0 0.0
.data 3372 3372 0 0.0
.rodata 77727 77727 0 0.0
.text 558348 558348 0 0.0
lock-ftd LP_CC2652R7 (read only) 672715 672715 0 0.0
(read/write) 168852 168852 0 0.0
.bss 71348 71348 0 0.0
.data 3296 3296 0 0.0
.rodata 76411 76411 0 0.0
.text 595824 595824 0 0.0
lock-mtd LP_CC2652R7 (read only) 655275 655275 0 0.0
(read/write) 181980 181980 0 0.0
.bss 67036 67036 0 0.0
.data 3296 3296 0 0.0
.rodata 101363 101363 0 0.0
.text 553432 553432 0 0.0
pump-app LP_CC2652R7 (read only) 682947 682947 0 0.0
(read/write) 159428 159428 0 0.0
.bss 71388 71388 0 0.0
.data 3296 3296 0 0.0
.rodata 89315 89315 0 0.0
.text 593148 593148 0 0.0
pump-controller-app LP_CC2652R7 (read only) 667415 667415 0 0.0
(read/write) 175096 175096 0 0.0
.bss 71524 71524 0 0.0
.data 3292 3292 0 0.0
.rodata 84863 84863 0 0.0
.text 582072 582072 0 0.0
shell LP_CC2652R7 (read only) 663546 663546 0 0.0
(read/write) 183356 183356 0 0.0
.bss 76596 76596 0 0.0
.data 3376 3376 0 0.0
.rodata 85418 85418 0 0.0
.text 577812 577812 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 584478 584438 -40 -0.0
.app_xip_area 461280 461240 -40 -0.0
.bss 65640 65640 0 0.0
.data 744 744 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 590406 590366 -40 -0.0
.app_xip_area 462424 462384 -40 -0.0
.bss 70424 70424 0 0.0
.data 748 748 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 596922 596898 -24 -0.0
.app_xip_area 474444 474420 -24 -0.0
.bss 64952 64952 0 0.0
.data 716 716 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read/write) 1096324 1096324 0 0.0
.bss 132844 132844 0 0.0
.data 2068 2068 0 0.0
.text 961388 961388 0 0.0
BRD4161A+rpc (read/write) 1150588 1150588 0 0.0
.bss 149532 149532 0 0.0
.data 2280 2280 0 0.0
.text 998756 998756 0 0.0
BRD4161A+rs911x (read/write) 985844 985844 0 0.0
.bss 162184 162184 0 0.0
.data 2056 2056 0 0.0
.text 821584 821584 0 0.0
lock-app BRD4161A+wf200 (read/write) 1136372 1136372 0 0.0
.bss 144824 144824 0 0.0
.data 2064 2064 0 0.0
.text 989464 989464 0 0.0
window-app BRD4161A (read/write) 1088056 1088056 0 0.0
.bss 134292 134292 0 0.0
.data 2096 2096 0 0.0
.text 951648 951648 0 0.0
esp32 all-clusters-app c3devkit (read only) 1025950 1025948 -2 -0.0
(read/write) 1487418 1487418 0 0.0
.dram0.bss 70336 70336 0 0.0
.dram0.data 14600 14600 0 0.0
.flash.rodata 217048 217048 0 0.0
.flash.text 1025950 1025948 -2 -0.0
.iram0.text 62902 62902 0 0.0
m5stack (read only) 1079235 1079235 0 0.0
(read/write) 489392 489392 0 0.0
.dram0.bss 75840 75840 0 0.0
.dram0.data 34144 34144 0 0.0
.flash.rodata 247412 247412 0 0.0
.flash.text 1073851 1073851 0 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w0+release (read/write) 643580 643580 0 0.0
.bss 69712 69712 0 0.0
.data 2044 2044 0 0.0
.text 569096 569096 0 0.0
lock k32w0+release (read/write) 700980 700980 0 0.0
.bss 70184 70184 0 0.0
.data 2052 2052 0 0.0
.text 626016 626016 0 0.0
linux chip-tool-ipv6only arm64 (read only) 9885340 9885340 0 0.0
(read/write) 694177 694177 0 0.0
.bss 32897 32897 0 0.0
.data 3272 3272 0 0.0
.data.rel.ro 639384 639384 0 0.0
.dynamic 560 560 0 0.0
.got 13648 13648 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 466812 466812 0 0.0
.text 7791188 7791188 0 0.0
thermostat-no-ble arm64 (read only) 2349964 2349964 0 0.0
(read/write) 141681 141681 0 0.0
.bss 55313 55313 0 0.0
.data 1672 1672 0 0.0
.data.rel.ro 75880 75880 0 0.0
.dynamic 560 560 0 0.0
.got 5040 5040 0 0.0
.init 24 24 0 0.0
.init_array 408 408 0 0.0
.rodata 139716 139716 0 0.0
.text 1972720 1972720 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2452592 2452592 0 0.0
.bss 214556 214556 0 0.0
.data 5872 5872 0 0.0
.text 1415236 1415236 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1177847 1177847 0 0.0
bss 143222 143222 0 0.0
rodata 142776 142776 0 0.0
text 813008 813004 -4 -0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1157919 1157919 0 0.0
bss 142460 142460 0 0.0
rodata 134472 134472 0 0.0
text 802164 802164 0 0.0
p6 all-clusters-app default (read only) 881528 881528 0 0.0
(read/write) 1691076 1691076 0 0.0
.bss 149168 149168 0 0.0
.data 2648 2648 0 0.0
.text 1530872 1530872 0 0.0
all-clusters-minimal-app default (read only) 882248 882248 0 0.0
(read/write) 1635276 1635276 0 0.0
.bss 148448 148448 0 0.0
.data 2648 2648 0 0.0
.text 1475792 1475792 0 0.0
light-app default (read only) 890568 890568 0 0.0
(read/write) 1553988 1553988 0 0.0
.bss 140336 140336 0 0.0
.data 2440 2440 0 0.0
.text 1402824 1402824 0 0.0
lock-app default (read only) 886072 886072 0 0.0
(read/write) 1591268 1591268 0 0.0
.bss 144816 144816 0 0.0
.data 2456 2456 0 0.0
.text 1435608 1435608 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 806032 806032 0 0.0
bss 70976 70976 0 0.0
noinit 43488 43488 0 0.0
text 569734 569734 0 0.0
lighting-app tlsr9518adk80d (read/write) 827840 827840 0 0.0
bss 71820 71820 0 0.0
noinit 43488 43488 0 0.0
text 587710 587710 0 0.0

@woody-apple woody-apple enabled auto-merge (squash) August 9, 2022 14:56
@woody-apple woody-apple merged commit 93d72d2 into project-chip:master Aug 9, 2022
@hsusid hsusid deleted the cyw30739-fix-kvs branch August 10, 2022 02:35
isiu-apple pushed a commit to isiu-apple/connectedhomeip that referenced this pull request Sep 16, 2022
)

* Write methods should copy data to RAM before calling the platform API
  which doesn't support writing data from the flash.
* Read methods should return CHIP_ERROR_BUFFER_TOO_SMALL if the
  specified entry exists but the given buffer size is zero.
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.

3 participants