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

Added an initial attempt of having the IM support (U)INT24 types #11256

Conversation

tlykkeberg-grundfos
Copy link
Contributor

@tlykkeberg-grundfos tlykkeberg-grundfos commented Nov 1, 2021

Problem

  • The IM does not currently support reading and writing of types not being sized 2^n.
  • UINT24 support is needed for the PCC cluster to be fully testable

Change overview

  • Add support in the IM for UINT24 attribute read/write support
  • Added support for the ZCL_INT24U_ and ZCL_INT24S_ types in the ember-compatibility-functions.cpp module
  • Enabled the support for INT24U and INT24S types in the Accessory.js helper JavaScript
  • Enabled the Power and the LifetimeRunningHours 24-bit attributes in the PCC cluster in the controller-clusters.zap and the all-clusters-app.zap files
  • Regenerated all ZAP files using

Testing

  • Regenerated ZAP files using ./scripts/tools/zap_regen_all.py
  • Build the chip-tool and all-clusters-app and tested on Darwin platform
  • Build the Darwin TestFramework and tested
  • Verified that these new attributes could be read and written within their boundaries

@CLAassistant
Copy link

CLAassistant commented Nov 1, 2021

CLA assistant check
All committers have signed the CLA.

@tlykkeberg-grundfos tlykkeberg-grundfos force-pushed the feature/extend-im-with-uint24-support branch from b0e3145 to 3d38e00 Compare November 1, 2021 13:53
@github-actions
Copy link

github-actions bot commented Nov 1, 2021

PR #11256: Size comparison from 3947eba to 7bfb306

Increases (7 builds for linux, mbed, p6)
platform target config section 3947eba 7bfb306 change % change
linux chip-tool debug (read only) 4314925 4315613 688 0.0
.text 3831621 3832629 1008 0.0
ota-requestor-app debug (read/write) 76360 76392 32 0.0
.data.rel.ro 25528 25576 48 0.2
tv-app debug .text 1477682 1478178 496 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release .heap 851400 851432 32 0.0
lighting-app CY8CPROTO_062_4343W+release .heap 859008 859040 32 0.0
lock-app CY8CPROTO_062_4343W+release .heap 860120 860152 32 0.0
p6 lock-app default .heap 964712 964744 32 0.0
Decreases (29 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 3947eba 7bfb306 change % change
efr32 lighting-app BRD4161A (read only) 736636 735656 -980 -0.1
(read/write) 114476 114444 -32 -0.0
.bss 112724 112692 -32 -0.0
.text 736628 735648 -980 -0.1
BRD4161A+rpc (read only) 724076 723096 -980 -0.1
(read/write) 131080 131052 -28 -0.0
.bss 129228 129196 -32 -0.0
.text 724068 723088 -980 -0.1
lock-app BRD4161A (read only) 715932 714952 -980 -0.1
(read/write) 112292 112260 -32 -0.0
.bss 110580 110548 -32 -0.0
.text 715924 714944 -980 -0.1
window-app BRD4161A (read only) 716836 715856 -980 -0.1
(read/write) 112616 112588 -28 -0.0
.bss 110900 110868 -32 -0.0
.text 716828 715848 -980 -0.1
esp32 all-clusters-app c3devkit (read only) 880562 880302 -260 -0.0
(read/write) 1307800 1307184 -616 -0.0
.dram0.bss 58456 58424 -32 -0.1
.flash.rodata 199640 199056 -584 -0.3
.flash.text 880562 880302 -260 -0.0
m5stack (read only) 911375 911219 -156 -0.0
(read/write) 427560 426968 -592 -0.1
.dram0.bss 60952 60920 -32 -0.1
.flash.rodata 208344 207784 -560 -0.3
.flash.text 911375 911219 -156 -0.0
k32w lighting-app k32w061+se05x+release (read/write) 699128 698368 -760 -0.1
.bss 77720 77688 -32 -0.0
.text 613708 612980 -728 -0.1
lock-app k32w061+debug (read/write) 591432 590672 -760 -0.1
.bss 68220 68188 -32 -0.0
.text 515548 514820 -728 -0.1
linux all-clusters-app debug (read only) 1687001 1686105 -896 -0.1
(read/write) 119024 118992 -32 -0.0
.bss 50640 50608 -32 -0.1
.rodata 138069 137493 -576 -0.4
.text 1415874 1415554 -320 -0.0
bridge-app debug+rpc (read only) 1281957 1281029 -928 -0.1
(read/write) 84136 84104 -32 -0.0
.bss 50800 50768 -32 -0.1
.rodata 110020 109412 -608 -0.6
.text 1076693 1076373 -320 -0.0
chip-tool debug (read/write) 123648 123552 -96 -0.1
.bss 17712 17680 -32 -0.2
.data.rel.ro 98928 98880 -48 -0.0
.rodata 217360 217328 -32 -0.0
lighting-app debug+rpc (read only) 1540865 1539985 -880 -0.1
(read/write) 101008 100976 -32 -0.0
.bss 40184 40152 -32 -0.1
.rodata 128113 127537 -576 -0.4
.text 1280370 1280066 -304 -0.0
ota-provider-app debug (read only) 1239033 1238025 -1008 -0.1
(read/write) 67104 67072 -32 -0.0
.bss 36640 36608 -32 -0.1
.rodata 110408 109800 -608 -0.6
.text 1032498 1032098 -400 -0.0
ota-requestor-app debug (read only) 1302033 1295505 -6528 -0.5
.bss 44896 44864 -32 -0.1
.rodata 127072 121120 -5952 -4.7
.text 1077170 1076594 -576 -0.1
tv-app debug (read only) 1773337 1772905 -432 -0.0
(read/write) 288600 288536 -64 -0.0
.bss 222224 222192 -32 -0.0
.data.rel.ro 58704 58672 -32 -0.1
.rodata 153464 152824 -640 -0.4
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2294952 2294192 -760 -0.0
.bss 179828 179796 -32 -0.0
.text 1257552 1256792 -760 -0.1
lighting-app CY8CPROTO_062_4343W+release (read/write) 2274336 2273576 -760 -0.0
.bss 171868 171836 -32 -0.0
.text 1236936 1236176 -760 -0.1
lock-app CY8CPROTO_062_4343W+release (read/write) 2252056 2251296 -760 -0.0
.bss 170772 170740 -32 -0.0
.text 1214656 1213896 -760 -0.1
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 861267 860535 -732 -0.1
bss 111180 111148 -32 -0.0
rodata 96860 96304 -556 -0.6
text 577612 577468 -144 -0.0
nrf52840dk_nrf52840+rpc (read/write) 822095 821359 -736 -0.1
bss 107424 107392 -32 -0.0
rodata 87640 87080 -560 -0.6
text 550784 550640 -144 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 786306 785578 -728 -0.1
bss 112556 112524 -32 -0.0
rodata 92100 91548 -552 -0.6
text 507080 506936 -144 -0.0
lock-app nrf52840dk_nrf52840 (read/write) 837975 837243 -732 -0.1
bss 110216 110184 -32 -0.0
rodata 93216 92660 -556 -0.6
text 559092 558948 -144 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 763270 762538 -732 -0.1
bss 111628 111596 -32 -0.0
rodata 88520 87964 -556 -0.6
text 488652 488508 -144 -0.0
pump-app nrf52840dk_nrf52840 (read/write) 842643 841915 -728 -0.1
bss 110352 110320 -32 -0.0
rodata 94460 93908 -552 -0.6
text 562300 562156 -144 -0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 837947 837219 -728 -0.1
bss 110252 110220 -32 -0.0
rodata 93236 92684 -552 -0.6
text 558932 558788 -144 -0.0
p6 lock-app default (read/write) 2167872 2166880 -992 -0.0
.bss 66216 66184 -32 -0.0
.text 1126136 1125144 -992 -0.1
qpg lighting-app qpg6100+debug (read only) 490500 489756 -744 -0.2
.bss 50336 50320 -16 -0.0
.text 485180 484436 -744 -0.2
lock-app qpg6100+debug (read only) 466844 466112 -732 -0.2
.bss 49288 49272 -16 -0.0
.text 461524 460792 -732 -0.2
telink lighting-app tlsr9518adk80d (read/write) 662890 662058 -832 -0.1
bss 68992 68960 -32 -0.0
text 458036 457664 -372 -0.1
Full report (37 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 3947eba 7bfb306 change % change
efr32 lighting-app BRD4161A (read only) 736636 735656 -980 -0.1
(read/write) 114476 114444 -32 -0.0
.bss 112724 112692 -32 -0.0
.data 1752 1752 0 0.0
.text 736628 735648 -980 -0.1
BRD4161A+rpc (read only) 724076 723096 -980 -0.1
(read/write) 131080 131052 -28 -0.0
.bss 129228 129196 -32 -0.0
.data 1852 1852 0 0.0
.text 724068 723088 -980 -0.1
lock-app BRD4161A (read only) 715932 714952 -980 -0.1
(read/write) 112292 112260 -32 -0.0
.bss 110580 110548 -32 -0.0
.data 1712 1712 0 0.0
.text 715924 714944 -980 -0.1
window-app BRD4161A (read only) 716836 715856 -980 -0.1
(read/write) 112616 112588 -28 -0.0
.bss 110900 110868 -32 -0.0
.data 1716 1716 0 0.0
.text 716828 715848 -980 -0.1
esp32 all-clusters-app c3devkit (read only) 880562 880302 -260 -0.0
(read/write) 1307800 1307184 -616 -0.0
.dram0.bss 58456 58424 -32 -0.1
.dram0.data 16464 16464 0 0.0
.flash.rodata 199640 199056 -584 -0.3
.flash.text 880562 880302 -260 -0.0
.iram0.text 57554 57554 0 0.0
m5stack (read only) 911375 911219 -156 -0.0
(read/write) 427560 426968 -592 -0.1
.dram0.bss 60952 60920 -32 -0.1
.dram0.data 32100 32100 0 0.0
.flash.rodata 208344 207784 -560 -0.3
.flash.text 911375 911219 -156 -0.0
.iram0.text 125115 125115 0 0.0
k32w lighting-app k32w061+se05x+release (read/write) 699128 698368 -760 -0.1
.bss 77720 77688 -32 -0.0
.data 1900 1900 0 0.0
.text 613708 612980 -728 -0.1
lock-app k32w061+debug (read/write) 591432 590672 -760 -0.1
.bss 68220 68188 -32 -0.0
.data 1864 1864 0 0.0
.text 515548 514820 -728 -0.1
shell k32w061+debug (read/write) 424988 424988 0 0.0
.bss 63280 63280 0 0.0
.data 672 672 0 0.0
.text 359332 359332 0 0.0
linux all-clusters-app debug (read only) 1687001 1686105 -896 -0.1
(read/write) 119024 118992 -32 -0.0
.bss 50640 50608 -32 -0.1
.data 1010 1010 0 0.0
.data.rel.ro 62112 62112 0 0.0
.dynamic 592 592 0 0.0
.got 4088 4088 0 0.0
.init 27 27 0 0.0
.init_array 536 536 0 0.0
.rodata 138069 137493 -576 -0.4
.text 1415874 1415554 -320 -0.0
bridge-app debug+rpc (read only) 1281957 1281029 -928 -0.1
(read/write) 84136 84104 -32 -0.0
.bss 50800 50768 -32 -0.1
.data 976 976 0 0.0
.data.rel.ro 27368 27368 0 0.0
.dynamic 592 592 0 0.0
.got 3952 3952 0 0.0
.init 27 27 0 0.0
.init_array 400 400 0 0.0
.rodata 110020 109412 -608 -0.6
.text 1076693 1076373 -320 -0.0
chip-tool debug (read only) 4314925 4315613 688 0.0
(read/write) 123648 123552 -96 -0.1
.bss 17712 17680 -32 -0.2
.data 1584 1584 0 0.0
.data.rel.ro 98928 98880 -48 -0.0
.dynamic 592 592 0 0.0
.got 4368 4368 0 0.0
.init 27 27 0 0.0
.init_array 424 424 0 0.0
.rodata 217360 217328 -32 -0.0
.text 3831621 3832629 1008 0.0
lighting-app debug+rpc (read only) 1540865 1539985 -880 -0.1
(read/write) 101008 100976 -32 -0.0
.bss 40184 40152 -32 -0.1
.data 1106 1106 0 0.0
.data.rel.ro 54448 54448 0 0.0
.dynamic 608 608 0 0.0
.got 4112 4112 0 0.0
.init 27 27 0 0.0
.init_array 528 528 0 0.0
.rodata 128113 127537 -576 -0.4
.text 1280370 1280066 -304 -0.0
ota-provider-app debug (read only) 1239033 1238025 -1008 -0.1
(read/write) 67104 67072 -32 -0.0
.bss 36640 36608 -32 -0.1
.data 752 752 0 0.0
.data.rel.ro 24616 24616 0 0.0
.dynamic 592 592 0 0.0
.got 4016 4016 0 0.0
.init 27 27 0 0.0
.init_array 440 440 0 0.0
.rodata 110408 109800 -608 -0.6
.text 1032498 1032098 -400 -0.0
ota-requestor-app debug (read only) 1302033 1295505 -6528 -0.5
(read/write) 76360 76392 32 0.0
.bss 44896 44864 -32 -0.1
.data 816 816 0 0.0
.data.rel.ro 25528 25576 48 0.2
.dynamic 592 592 0 0.0
.got 3984 3984 0 0.0
.init 27 27 0 0.0
.init_array 512 512 0 0.0
.rodata 127072 121120 -5952 -4.7
.text 1077170 1076594 -576 -0.1
shell debug (read only) 786145 786145 0 0.0
(read/write) 57664 57664 0 0.0
.bss 16072 16072 0 0.0
.data 242 242 0 0.0
.data.rel.ro 36848 36848 0 0.0
.dynamic 592 592 0 0.0
.got 3528 3528 0 0.0
.init 27 27 0 0.0
.init_array 336 336 0 0.0
.rodata 77423 77423 0 0.0
.text 607186 607186 0 0.0
tv-app debug (read only) 1773337 1772905 -432 -0.0
(read/write) 288600 288536 -64 -0.0
.bss 222224 222192 -32 -0.0
.data 2032 2032 0 0.0
.data.rel.ro 58704 58672 -32 -0.1
.dynamic 592 592 0 0.0
.got 4408 4408 0 0.0
.init 27 27 0 0.0
.init_array 608 608 0 0.0
.rodata 153464 152824 -640 -0.4
.text 1477682 1478178 496 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2294952 2294192 -760 -0.0
.bss 179828 179796 -32 -0.0
.data 5216 5216 0 0.0
.heap 851400 851432 32 0.0
.text 1257552 1256792 -760 -0.1
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2274336 2273576 -760 -0.0
.bss 171868 171836 -32 -0.0
.data 5568 5568 0 0.0
.heap 859008 859040 32 0.0
.text 1236936 1236176 -760 -0.1
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2252056 2251296 -760 -0.0
.bss 170772 170740 -32 -0.0
.data 5552 5552 0 0.0
.heap 860120 860152 32 0.0
.text 1214656 1213896 -760 -0.1
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139744 1139744 0 0.0
.bss 11752 11752 0 0.0
.data 4368 4368 0 0.0
.heap 1020328 1020328 0 0.0
.text 103128 103128 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2048656 2048656 0 0.0
.bss 156232 156232 0 0.0
.data 4968 4968 0 0.0
.heap 875248 875248 0 0.0
.text 1011256 1011256 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 861267 860535 -732 -0.1
bss 111180 111148 -32 -0.0
rodata 96860 96304 -556 -0.6
text 577612 577468 -144 -0.0
nrf52840dk_nrf52840+rpc (read/write) 822095 821359 -736 -0.1
bss 107424 107392 -32 -0.0
rodata 87640 87080 -560 -0.6
text 550784 550640 -144 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 786306 785578 -728 -0.1
bss 112556 112524 -32 -0.0
rodata 92100 91548 -552 -0.6
text 507080 506936 -144 -0.0
lock-app nrf52840dk_nrf52840 (read/write) 837975 837243 -732 -0.1
bss 110216 110184 -32 -0.0
rodata 93216 92660 -556 -0.6
text 559092 558948 -144 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 763270 762538 -732 -0.1
bss 111628 111596 -32 -0.0
rodata 88520 87964 -556 -0.6
text 488652 488508 -144 -0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 497323 497323 0 0.0
bss 51824 51824 0 0.0
rodata 45776 45776 0 0.0
text 339436 339436 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 842643 841915 -728 -0.1
bss 110352 110320 -32 -0.0
rodata 94460 93908 -552 -0.6
text 562300 562156 -144 -0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 837947 837219 -728 -0.1
bss 110252 110220 -32 -0.0
rodata 93236 92684 -552 -0.6
text 558932 558788 -144 -0.0
shell nrf52840dk_nrf52840 (read/write) 776179 776179 0 0.0
bss 109096 109096 0 0.0
rodata 72536 72536 0 0.0
text 519936 519936 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 691202 691202 0 0.0
bss 110080 110080 0 0.0
rodata 67180 67180 0 0.0
text 440548 440548 0 0.0
p6 lock-app default (read/write) 2167872 2166880 -992 -0.0
.bss 66216 66184 -32 -0.0
.data 2416 2416 0 0.0
.heap 964712 964744 32 0.0
.text 1126136 1125144 -992 -0.1
qpg lighting-app qpg6100+debug (read only) 490500 489756 -744 -0.2
(read/write) 114144 114144 0 0.0
.bss 50336 50320 -16 -0.0
.data 1000 1000 0 0.0
.text 485180 484436 -744 -0.2
lock-app qpg6100+debug (read only) 466844 466112 -732 -0.2
(read/write) 114140 114140 0 0.0
.bss 49288 49272 -16 -0.0
.data 956 956 0 0.0
.text 461524 460792 -732 -0.2
persistent-storage-app qpg6100+debug (read only) 155820 155820 0 0.0
(read/write) 114140 114140 0 0.0
.bss 27752 27752 0 0.0
.data 372 372 0 0.0
.text 150500 150500 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 662890 662058 -832 -0.1
bss 68992 68960 -32 -0.0
noinit 33216 33216 0 0.0
text 458036 457664 -372 -0.1

Copy link
Contributor

@bzbarsky-apple bzbarsky-apple left a comment

Choose a reason for hiding this comment

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

I think it would be better to not make any sort of changes to the TLV bits at all and instead do all the conversion as needed inside ember-compatibility-functions and Accessors.h/cpp. That would allow us to reasonably represent int24 as int32_t in most code, with only the code that needs to worry about the attribute store needing to deal with the actually-narrower range and 3-byte representation....

case ZCL_INT24U_ATTRIBUTE_TYPE: // Unsigned 24-bit integer
{
TLV::uint24_t uint24_data;
memcpy(static_cast<void *>(&uint24_data), attributeData, sizeof(uint24_data));
Copy link
Contributor

Choose a reason for hiding this comment

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

Have we double-checked that the actual space in the attribute store that is allocated for this type is 3 bytes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have found the default size in the array GENERATED_DEFAULTS in the autogenerated file: endpoint_config.h to be 3 bytes for both the Power and the LifetimeRunningHours attributes, which are both UINT24.

            /* Endpoint: 1, Cluster: Pump Configuration and Control (server), big-endian */                                        \
                                                                                                                                   \
            /* 2351 - LifetimeRunningHours, */                                                                                     \
            0x00, 0x00, 0x00,                                                                                                      \
                                                                                                                                   \
            /* 2354 - Power, */                                                                                                    \
            0x00, 0x00, 0x00,                                                                                                      \

And in the same file, I found the Attribute size, in the GENERATED_ATTRIBUTES array, to be 3 for those attributes as well.

            { 0x0015, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE),                                                           \
              ZAP_LONG_DEFAULTS_INDEX(2351) }, /* LifetimeRunningHours */                                                          \
            { 0x0016, ZAP_TYPE(INT24U), 3, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2354) }, /* Power */              \

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And if these values are the foundation for the attribute store, then I take it that they are actually 3 bytes long. But perhaps I'm not looking the correct places?

src/lib/core/CHIPTLV.h Outdated Show resolved Hide resolved
src/lib/core/CHIPTLV.h Outdated Show resolved Hide resolved
src/lib/core/CHIPTLV.h Outdated Show resolved Hide resolved
src/lib/core/CHIPTLV.h Outdated Show resolved Hide resolved
src/lib/core/CHIPTLV.h Outdated Show resolved Hide resolved
@tlykkeberg-grundfos
Copy link
Contributor Author

I think you are right Boris. The changes should only go into the ember-compatibility-functions.cpp file and then have a clean machine type interface (8, 16, 32 and 64 bit integers) towards the TLV module. I was just not capable. I have been looking further into this, and the Accessorrs.cpp/.h files are they not autogenerated from the .zapt file templates?

@tlykkeberg-grundfos
Copy link
Contributor Author

tlykkeberg-grundfos commented Nov 2, 2021

But looking into the Accessors.js Java helper script in the src/app/zap-templates/common/attributes/ directory, I see the method canHaveSimpleAccessors() which is used in the Accessors.zapt and the Accessors-src.zapt files. This means that the UINT24 types are to be implemented here as well.

I took a look at the Get() and Set() methods for the LifetimeEnergyConsumed attribute (of type INT32U) in the Accessors.cpp file.

namespace LifetimeEnergyConsumed {

EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value)
{
    return emberAfReadServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) value, sizeof(*value));
}
EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value)
{
    return emberAfWriteServerAttribute(endpoint, Clusters::PumpConfigurationAndControl::Id, Id, (uint8_t *) &value,
                                       ZCL_INT32U_ATTRIBUTE_TYPE);
}

Here we notice, that the autogenrated code produces a ZCL type specific call to the emberAfWriteServerAttribute() method, but simply transfers the size of the value in the call to emberAfReadServerAttribute(). But this could easily be the same type of call here, with the ZCL_INT32U_ATTRIBUTE_TYPE specified?

There is no issue when trying to read a 24bit attribute using a 32bit value, since the length of the value parameter, actually ends up all the way down in the typeSensitiveMemCopy() method, which discards the read, if the size to be copied into is too small.

@github-actions
Copy link

github-actions bot commented Nov 2, 2021

PR #11256: Size comparison from 787b7ec to b9a2a5f

Increases above 0.2%:

platform target config section 787b7ec b9a2a5f change % change
linux chip-tool debug .data.rel.ro 98880 99168 288 0.3
Increases (29 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 787b7ec b9a2a5f change % change
efr32 lighting-app BRD4161A (read only) 735416 735624 208 0.0
.text 735408 735616 208 0.0
BRD4161A+rpc (read only) 722840 723064 224 0.0
.text 722832 723056 224 0.0
lock-app BRD4161A (read only) 714700 714908 208 0.0
.text 714692 714900 208 0.0
window-app BRD4161A (read only) 715612 715820 208 0.0
.text 715604 715812 208 0.0
esp32 all-clusters-app c3devkit (read only) 880322 880526 204 0.0
(read/write) 1307552 1307584 32 0.0
.dram0.bss 58424 58432 8 0.0
.flash.rodata 199424 199456 32 0.0
.flash.text 880322 880526 204 0.0
m5stack (read only) 911303 911459 156 0.0
(read/write) 427312 427360 48 0.0
.dram0.bss 60920 60928 8 0.0
.flash.rodata 208128 208168 40 0.0
.flash.text 911303 911459 156 0.0
k32w lighting-app k32w061+se05x+release (read/write) 698232 698456 224 0.0
.text 612844 613068 224 0.0
lock-app k32w061+debug (read/write) 590524 590748 224 0.0
.text 514672 514896 224 0.0
linux all-clusters-app debug (read only) 1685113 1686169 1056 0.1
(read/write) 118992 119024 32 0.0
.data.rel.ro 62112 62144 32 0.1
.text 1414050 1415058 1008 0.1
bridge-app debug+rpc (read only) 1278549 1279557 1008 0.1
.text 1073701 1074709 1008 0.1
chip-tool debug (read only) 4313725 4319629 5904 0.1
(read/write) 123552 123840 288 0.2
.data.rel.ro 98880 99168 288 0.3
.rodata 217488 217520 32 0.0
.text 3830581 3835781 5200 0.1
lighting-app debug+rpc (read only) 1537521 1538529 1008 0.1
.text 1277378 1278386 1008 0.1
ota-provider-app debug (read only) 1239417 1240441 1024 0.1
.text 1032690 1033714 1024 0.1
ota-requestor-app debug (read only) 1293777 1294785 1008 0.1
.text 1074418 1075426 1008 0.1
tv-app debug (read only) 1772393 1773401 1008 0.1
.text 1477186 1478194 1008 0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2293736 2294024 288 0.0
.text 1256336 1256624 288 0.0
lighting-app CY8CPROTO_062_4343W+release (read/write) 2272736 2272928 192 0.0
.text 1235336 1235528 192 0.0
lock-app CY8CPROTO_062_4343W+release (read/write) 2250392 2250648 256 0.0
.text 1212992 1213248 256 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 860191 860399 208 0.0
text 577060 577272 212 0.0
nrf52840dk_nrf52840+rpc (read/write) 821015 821223 208 0.0
text 550236 550448 212 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 785218 785426 208 0.0
text 506528 506740 212 0.0
lock-app nrf52840dk_nrf52840 (read/write) 836883 837091 208 0.0
text 558540 558752 212 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 762194 762402 208 0.0
text 488100 488312 212 0.0
pump-app nrf52840dk_nrf52840 (read/write) 842879 843087 208 0.0
text 562600 562812 212 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 836739 836963 224 0.0
text 558276 558488 212 0.0
p6 lock-app default (read/write) 2166560 2166768 208 0.0
.text 1124824 1125032 208 0.0
qpg lighting-app qpg6100+debug (read only) 489688 489880 192 0.0
.text 484368 484560 192 0.0
lock-app qpg6100+debug (read only) 466016 466224 208 0.0
.text 460696 460904 208 0.0
telink lighting-app tlsr9518adk80d (read/write) 661614 661898 284 0.0
text 457334 457472 138 0.0
Full report (37 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 787b7ec b9a2a5f change % change
efr32 lighting-app BRD4161A (read only) 735416 735624 208 0.0
(read/write) 114444 114444 0 0.0
.bss 112692 112692 0 0.0
.data 1752 1752 0 0.0
.text 735408 735616 208 0.0
BRD4161A+rpc (read only) 722840 723064 224 0.0
(read/write) 131052 131052 0 0.0
.bss 129196 129196 0 0.0
.data 1852 1852 0 0.0
.text 722832 723056 224 0.0
lock-app BRD4161A (read only) 714700 714908 208 0.0
(read/write) 112260 112260 0 0.0
.bss 110548 110548 0 0.0
.data 1712 1712 0 0.0
.text 714692 714900 208 0.0
window-app BRD4161A (read only) 715612 715820 208 0.0
(read/write) 112584 112584 0 0.0
.bss 110868 110868 0 0.0
.data 1716 1716 0 0.0
.text 715604 715812 208 0.0
esp32 all-clusters-app c3devkit (read only) 880322 880526 204 0.0
(read/write) 1307552 1307584 32 0.0
.dram0.bss 58424 58432 8 0.0
.dram0.data 16464 16464 0 0.0
.flash.rodata 199424 199456 32 0.0
.flash.text 880322 880526 204 0.0
.iram0.text 57554 57554 0 0.0
m5stack (read only) 911303 911459 156 0.0
(read/write) 427312 427360 48 0.0
.dram0.bss 60920 60928 8 0.0
.dram0.data 32100 32100 0 0.0
.flash.rodata 208128 208168 40 0.0
.flash.text 911303 911459 156 0.0
.iram0.text 125115 125115 0 0.0
k32w lighting-app k32w061+se05x+release (read/write) 698232 698456 224 0.0
.bss 77688 77688 0 0.0
.data 1900 1900 0 0.0
.text 612844 613068 224 0.0
lock-app k32w061+debug (read/write) 590524 590748 224 0.0
.bss 68188 68188 0 0.0
.data 1864 1864 0 0.0
.text 514672 514896 224 0.0
shell k32w061+debug (read/write) 424772 424772 0 0.0
.bss 63280 63280 0 0.0
.data 672 672 0 0.0
.text 359116 359116 0 0.0
linux all-clusters-app debug (read only) 1685113 1686169 1056 0.1
(read/write) 118992 119024 32 0.0
.bss 50608 50608 0 0.0
.data 1010 1010 0 0.0
.data.rel.ro 62112 62144 32 0.1
.dynamic 592 592 0 0.0
.got 4088 4088 0 0.0
.init 27 27 0 0.0
.init_array 536 536 0 0.0
.rodata 138005 138005 0 0.0
.text 1414050 1415058 1008 0.1
bridge-app debug+rpc (read only) 1278549 1279557 1008 0.1
(read/write) 84104 84104 0 0.0
.bss 50768 50768 0 0.0
.data 976 976 0 0.0
.data.rel.ro 27368 27368 0 0.0
.dynamic 592 592 0 0.0
.got 3952 3952 0 0.0
.init 27 27 0 0.0
.init_array 400 400 0 0.0
.rodata 109604 109604 0 0.0
.text 1073701 1074709 1008 0.1
chip-tool debug (read only) 4313725 4319629 5904 0.1
(read/write) 123552 123840 288 0.2
.bss 17680 17680 0 0.0
.data 1584 1584 0 0.0
.data.rel.ro 98880 99168 288 0.3
.dynamic 592 592 0 0.0
.got 4368 4368 0 0.0
.init 27 27 0 0.0
.init_array 424 424 0 0.0
.rodata 217488 217520 32 0.0
.text 3830581 3835781 5200 0.1
lighting-app debug+rpc (read only) 1537521 1538529 1008 0.1
(read/write) 100976 100976 0 0.0
.bss 40152 40152 0 0.0
.data 1106 1106 0 0.0
.data.rel.ro 54448 54448 0 0.0
.dynamic 608 608 0 0.0
.got 4112 4112 0 0.0
.init 27 27 0 0.0
.init_array 528 528 0 0.0
.rodata 127761 127761 0 0.0
.text 1277378 1278386 1008 0.1
ota-provider-app debug (read only) 1239417 1240441 1024 0.1
(read/write) 67072 67072 0 0.0
.bss 36608 36608 0 0.0
.data 752 752 0 0.0
.data.rel.ro 24616 24616 0 0.0
.dynamic 592 592 0 0.0
.got 4016 4016 0 0.0
.init 27 27 0 0.0
.init_array 440 440 0 0.0
.rodata 110600 110600 0 0.0
.text 1032690 1033714 1024 0.1
ota-requestor-app debug (read only) 1293777 1294785 1008 0.1
(read/write) 76392 76392 0 0.0
.bss 44864 44864 0 0.0
.data 816 816 0 0.0
.data.rel.ro 25576 25576 0 0.0
.dynamic 592 592 0 0.0
.got 3984 3984 0 0.0
.init 27 27 0 0.0
.init_array 512 512 0 0.0
.rodata 121568 121568 0 0.0
.text 1074418 1075426 1008 0.1
shell debug (read only) 785041 785041 0 0.0
(read/write) 57664 57664 0 0.0
.bss 16072 16072 0 0.0
.data 242 242 0 0.0
.data.rel.ro 36848 36848 0 0.0
.dynamic 592 592 0 0.0
.got 3528 3528 0 0.0
.init 27 27 0 0.0
.init_array 336 336 0 0.0
.rodata 77295 77295 0 0.0
.text 606210 606210 0 0.0
tv-app debug (read only) 1772393 1773401 1008 0.1
(read/write) 288536 288536 0 0.0
.bss 222192 222192 0 0.0
.data 2032 2032 0 0.0
.data.rel.ro 58672 58672 0 0.0
.dynamic 592 592 0 0.0
.got 4408 4408 0 0.0
.init 27 27 0 0.0
.init_array 608 608 0 0.0
.rodata 153304 153304 0 0.0
.text 1477186 1478194 1008 0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2293736 2294024 288 0.0
.bss 179796 179796 0 0.0
.data 5216 5216 0 0.0
.heap 851432 851432 0 0.0
.text 1256336 1256624 288 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2272736 2272928 192 0.0
.bss 171836 171836 0 0.0
.data 5568 5568 0 0.0
.heap 859040 859040 0 0.0
.text 1235336 1235528 192 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2250392 2250648 256 0.0
.bss 170740 170740 0 0.0
.data 5552 5552 0 0.0
.heap 860152 860152 0 0.0
.text 1212992 1213248 256 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139744 1139744 0 0.0
.bss 11752 11752 0 0.0
.data 4368 4368 0 0.0
.heap 1020328 1020328 0 0.0
.text 103128 103128 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2048328 2048328 0 0.0
.bss 156232 156232 0 0.0
.data 4968 4968 0 0.0
.heap 875248 875248 0 0.0
.text 1010928 1010928 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 860191 860399 208 0.0
bss 111148 111148 0 0.0
rodata 96360 96360 0 0.0
text 577060 577272 212 0.0
nrf52840dk_nrf52840+rpc (read/write) 821015 821223 208 0.0
bss 107392 107392 0 0.0
rodata 87136 87136 0 0.0
text 550236 550448 212 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 785218 785426 208 0.0
bss 112524 112524 0 0.0
rodata 91604 91604 0 0.0
text 506528 506740 212 0.0
lock-app nrf52840dk_nrf52840 (read/write) 836883 837091 208 0.0
bss 110184 110184 0 0.0
rodata 92716 92716 0 0.0
text 558540 558752 212 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 762194 762402 208 0.0
bss 111596 111596 0 0.0
rodata 88020 88020 0 0.0
text 488100 488312 212 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 497323 497323 0 0.0
bss 51824 51824 0 0.0
rodata 45776 45776 0 0.0
text 339436 339436 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 842879 843087 208 0.0
bss 110320 110320 0 0.0
rodata 94424 94424 0 0.0
text 562600 562812 212 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 836739 836963 224 0.0
bss 110220 110220 0 0.0
rodata 92716 92716 0 0.0
text 558276 558488 212 0.0
shell nrf52840dk_nrf52840 (read/write) 775903 775903 0 0.0
bss 109096 109096 0 0.0
rodata 72404 72404 0 0.0
text 519792 519792 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 690906 690906 0 0.0
bss 110080 110080 0 0.0
rodata 67044 67044 0 0.0
text 440400 440400 0 0.0
p6 lock-app default (read/write) 2166560 2166768 208 0.0
.bss 66184 66184 0 0.0
.data 2416 2416 0 0.0
.heap 964744 964744 0 0.0
.text 1124824 1125032 208 0.0
qpg lighting-app qpg6100+debug (read only) 489688 489880 192 0.0
(read/write) 114144 114144 0 0.0
.bss 50320 50320 0 0.0
.data 1000 1000 0 0.0
.text 484368 484560 192 0.0
lock-app qpg6100+debug (read only) 466016 466224 208 0.0
(read/write) 114140 114140 0 0.0
.bss 49272 49272 0 0.0
.data 956 956 0 0.0
.text 460696 460904 208 0.0
persistent-storage-app qpg6100+debug (read only) 155820 155820 0 0.0
(read/write) 114140 114140 0 0.0
.bss 27752 27752 0 0.0
.data 372 372 0 0.0
.text 150500 150500 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 661614 661898 284 0.0
bss 68960 68960 0 0.0
noinit 33216 33216 0 0.0
text 457334 457472 138 0.0

@electrocucaracha
Copy link
Collaborator

Given that this PR is in progress maybe it should be better to change it to draft

@tlykkeberg-grundfos tlykkeberg-grundfos marked this pull request as draft November 3, 2021 07:28
@tlykkeberg-grundfos tlykkeberg-grundfos changed the title [DO NOT MERGE] Added an initial attempt of having the IM support (U)INT24 types Added an initial attempt of having the IM support (U)INT24 types Nov 3, 2021
@github-actions
Copy link

github-actions bot commented Nov 3, 2021

PR #11256: Size comparison from 4947759 to d241b5f

Increases above 0.2%:

platform target config section 4947759 d241b5f change % change
linux chip-tool debug .data.rel.ro 99040 99328 288 0.3
Increases (30 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 4947759 d241b5f change % change
efr32 lighting-app BRD4161A (read only) 737248 737456 208 0.0
.text 737240 737448 208 0.0
BRD4161A+rpc (read only) 726428 726652 224 0.0
.text 726420 726644 224 0.0
lock-app BRD4161A (read only) 716528 716736 208 0.0
.text 716520 716728 208 0.0
window-app BRD4161A (read only) 717428 717620 192 0.0
.text 717420 717612 192 0.0
esp32 all-clusters-app c3devkit (read only) 880742 880934 192 0.0
(read/write) 1308096 1308136 40 0.0
.dram0.bss 58616 58624 8 0.0
.flash.rodata 199776 199816 40 0.0
.flash.text 880742 880934 192 0.0
m5stack (read only) 911831 912131 300 0.0
(read/write) 427860 427908 48 0.0
.dram0.bss 61120 61128 8 0.0
.flash.rodata 208476 208516 40 0.0
.flash.text 911831 912131 300 0.0
k32w lighting-app k32w061+se05x+release (read/write) 699528 699720 192 0.0
.text 613968 614160 192 0.0
lock-app k32w061+debug (read/write) 591836 592028 192 0.0
.text 515796 515988 192 0.0
linux all-clusters-app debug (read only) 1690937 1691929 992 0.1
(read/write) 119760 119824 64 0.1
.data.rel.ro 62272 62336 64 0.1
.text 1417714 1418658 944 0.1
bridge-app debug+rpc (read only) 1287325 1288253 928 0.1
.text 1079973 1080901 928 0.1
chip-tool debug (read only) 4351269 4357093 5824 0.1
(read/write) 124896 125184 288 0.2
.data.rel.ro 99040 99328 288 0.3
.rodata 219560 219592 32 0.0
.text 3865669 3870789 5120 0.1
lighting-app debug+rpc (read only) 1548297 1549225 928 0.1
.text 1284610 1285538 928 0.1
ota-provider-app debug (read only) 1243689 1244617 928 0.1
.text 1035250 1036178 928 0.1
ota-requestor-app debug (read only) 1311049 1311977 928 0.1
.text 1089954 1090882 928 0.1
tv-app debug (read only) 1810545 1811473 928 0.1
.text 1512642 1513570 928 0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2293224 2293448 224 0.0
.text 1255824 1256048 224 0.0
lighting-app CY8CPROTO_062_4343W+release (read/write) 2272792 2272984 192 0.0
.text 1235392 1235584 192 0.0
lock-app CY8CPROTO_062_4343W+release (read/write) 2250512 2250704 192 0.0
.text 1213112 1213304 192 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 861395 861587 192 0.0
text 577692 577888 196 0.0
nrf52840dk_nrf52840+rpc (read/write) 823771 823963 192 0.0
text 551876 552072 196 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 786434 786626 192 0.0
text 507152 507348 196 0.0
lock-app nrf52840dk_nrf52840 (read/write) 838099 838291 192 0.0
text 559168 559364 196 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 763398 763590 192 0.0
text 488720 488916 196 0.0
pump-app nrf52840dk_nrf52840 (read/write) 844211 844403 192 0.0
text 563348 563544 196 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 837955 838163 208 0.0
text 558904 559100 196 0.0
p6 all-clusters-app default (read/write) 2300752 2300984 232 0.0
.bss 107912 107920 8 0.0
.text 1259016 1259248 232 0.0
lock-app default (read/write) 2213744 2213952 208 0.0
.text 1172008 1172216 208 0.0
qpg lighting-app qpg6100+debug (read only) 490784 490976 192 0.0
.text 485464 485656 192 0.0
lock-app qpg6100+debug (read only) 467120 467296 176 0.0
.text 461800 461976 176 0.0
telink lighting-app tlsr9518adk80d (read/write) 662894 663170 276 0.0
text 458028 458154 126 0.0
Decreases (1 build for p6)
platform target config section 4947759 d241b5f change % change
p6 all-clusters-app default .heap 922912 922904 -8 -0.0
Full report (38 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 4947759 d241b5f change % change
efr32 lighting-app BRD4161A (read only) 737248 737456 208 0.0
(read/write) 114620 114620 0 0.0
.bss 112860 112860 0 0.0
.data 1756 1756 0 0.0
.text 737240 737448 208 0.0
BRD4161A+rpc (read only) 726428 726652 224 0.0
(read/write) 131236 131236 0 0.0
.bss 129364 129364 0 0.0
.data 1872 1872 0 0.0
.text 726420 726644 224 0.0
lock-app BRD4161A (read only) 716528 716736 208 0.0
(read/write) 112436 112436 0 0.0
.bss 110716 110716 0 0.0
.data 1716 1716 0 0.0
.text 716520 716728 208 0.0
window-app BRD4161A (read only) 717428 717620 192 0.0
(read/write) 112756 112756 0 0.0
.bss 111036 111036 0 0.0
.data 1720 1720 0 0.0
.text 717420 717612 192 0.0
esp32 all-clusters-app c3devkit (read only) 880742 880934 192 0.0
(read/write) 1308096 1308136 40 0.0
.dram0.bss 58616 58624 8 0.0
.dram0.data 16464 16464 0 0.0
.flash.rodata 199776 199816 40 0.0
.flash.text 880742 880934 192 0.0
.iram0.text 57554 57554 0 0.0
m5stack (read only) 911831 912131 300 0.0
(read/write) 427860 427908 48 0.0
.dram0.bss 61120 61128 8 0.0
.dram0.data 32100 32100 0 0.0
.flash.rodata 208476 208516 40 0.0
.flash.text 911831 912131 300 0.0
.iram0.text 125115 125115 0 0.0
k32w lighting-app k32w061+se05x+release (read/write) 699528 699720 192 0.0
.bss 77856 77856 0 0.0
.data 1904 1904 0 0.0
.text 613968 614160 192 0.0
lock-app k32w061+debug (read/write) 591836 592028 192 0.0
.bss 68372 68372 0 0.0
.data 1868 1868 0 0.0
.text 515796 515988 192 0.0
shell k32w061+debug (read/write) 424916 424916 0 0.0
.bss 63296 63296 0 0.0
.data 668 668 0 0.0
.text 359248 359248 0 0.0
linux all-clusters-app debug (read only) 1690937 1691929 992 0.1
(read/write) 119760 119824 64 0.1
.bss 51184 51184 0 0.0
.data 1042 1042 0 0.0
.data.rel.ro 62272 62336 64 0.1
.dynamic 592 592 0 0.0
.got 4088 4088 0 0.0
.init 27 27 0 0.0
.init_array 536 536 0 0.0
.rodata 139829 139829 0 0.0
.text 1417714 1418658 944 0.1
bridge-app debug+rpc (read only) 1287325 1288253 928 0.1
(read/write) 69384 69384 0 0.0
.bss 35088 35088 0 0.0
.data 1568 1568 0 0.0
.data.rel.ro 27768 27768 0 0.0
.dynamic 592 592 0 0.0
.got 3952 3952 0 0.0
.init 27 27 0 0.0
.init_array 400 400 0 0.0
.rodata 111460 111460 0 0.0
.text 1079973 1080901 928 0.1
chip-tool debug (read only) 4351269 4357093 5824 0.1
(read/write) 124896 125184 288 0.2
.bss 18224 18224 0 0.0
.data 2224 2224 0 0.0
.data.rel.ro 99040 99328 288 0.3
.dynamic 592 592 0 0.0
.got 4368 4368 0 0.0
.init 27 27 0 0.0
.init_array 424 424 0 0.0
.rodata 219560 219592 32 0.0
.text 3865669 3870789 5120 0.1
lighting-app debug+rpc (read only) 1548297 1549225 928 0.1
(read/write) 102352 102352 0 0.0
.bss 40728 40728 0 0.0
.data 1170 1170 0 0.0
.data.rel.ro 55168 55168 0 0.0
.dynamic 608 608 0 0.0
.got 4112 4112 0 0.0
.init 27 27 0 0.0
.init_array 528 528 0 0.0
.rodata 130129 130129 0 0.0
.text 1284610 1285538 928 0.1
ota-provider-app debug (read only) 1243689 1244617 928 0.1
(read/write) 67552 67552 0 0.0
.bss 37152 37152 0 0.0
.data 752 752 0 0.0
.data.rel.ro 24568 24568 0 0.0
.dynamic 592 592 0 0.0
.got 4016 4016 0 0.0
.init 27 27 0 0.0
.init_array 440 440 0 0.0
.rodata 112360 112360 0 0.0
.text 1035250 1036178 928 0.1
ota-requestor-app debug (read only) 1311049 1311977 928 0.1
(read/write) 76872 76872 0 0.0
.bss 45408 45408 0 0.0
.data 816 816 0 0.0
.data.rel.ro 25512 25512 0 0.0
.dynamic 592 592 0 0.0
.got 3984 3984 0 0.0
.init 27 27 0 0.0
.init_array 512 512 0 0.0
.rodata 123328 123328 0 0.0
.text 1089954 1090882 928 0.1
shell debug (read only) 786593 786593 0 0.0
(read/write) 57664 57664 0 0.0
.bss 16104 16104 0 0.0
.data 242 242 0 0.0
.data.rel.ro 36816 36816 0 0.0
.dynamic 592 592 0 0.0
.got 3528 3528 0 0.0
.init 27 27 0 0.0
.init_array 336 336 0 0.0
.rodata 77839 77839 0 0.0
.text 607266 607266 0 0.0
tv-app debug (read only) 1810545 1811473 928 0.1
(read/write) 289944 289944 0 0.0
.bss 222768 222768 0 0.0
.data 2704 2704 0 0.0
.data.rel.ro 58824 58824 0 0.0
.dynamic 592 592 0 0.0
.got 4408 4408 0 0.0
.init 27 27 0 0.0
.init_array 608 608 0 0.0
.rodata 155640 155640 0 0.0
.text 1512642 1513570 928 0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2293224 2293448 224 0.0
.bss 179972 179972 0 0.0
.data 5216 5216 0 0.0
.heap 851256 851256 0 0.0
.text 1255824 1256048 224 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2272792 2272984 192 0.0
.bss 172012 172012 0 0.0
.data 5568 5568 0 0.0
.heap 858864 858864 0 0.0
.text 1235392 1235584 192 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2250512 2250704 192 0.0
.bss 170908 170908 0 0.0
.data 5560 5560 0 0.0
.heap 859976 859976 0 0.0
.text 1213112 1213304 192 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139744 1139744 0 0.0
.bss 11752 11752 0 0.0
.data 4368 4368 0 0.0
.heap 1020328 1020328 0 0.0
.text 103128 103128 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2048496 2048496 0 0.0
.bss 156256 156256 0 0.0
.data 4960 4960 0 0.0
.heap 875232 875232 0 0.0
.text 1011096 1011096 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 861395 861587 192 0.0
bss 111320 111320 0 0.0
rodata 96772 96772 0 0.0
text 577692 577888 196 0.0
nrf52840dk_nrf52840+rpc (read/write) 823771 823963 192 0.0
bss 107672 107672 0 0.0
rodata 87948 87948 0 0.0
text 551876 552072 196 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 786434 786626 192 0.0
bss 112696 112696 0 0.0
rodata 92028 92028 0 0.0
text 507152 507348 196 0.0
lock-app nrf52840dk_nrf52840 (read/write) 838099 838291 192 0.0
bss 110356 110356 0 0.0
rodata 93140 93140 0 0.0
text 559168 559364 196 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 763398 763590 192 0.0
bss 111764 111764 0 0.0
rodata 88448 88448 0 0.0
text 488720 488916 196 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 497323 497323 0 0.0
bss 51824 51824 0 0.0
rodata 45776 45776 0 0.0
text 339436 339436 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 844211 844403 192 0.0
bss 110492 110492 0 0.0
rodata 94852 94852 0 0.0
text 563348 563544 196 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 837955 838163 208 0.0
bss 110392 110392 0 0.0
rodata 93140 93140 0 0.0
text 558904 559100 196 0.0
shell nrf52840dk_nrf52840 (read/write) 775991 775991 0 0.0
bss 109112 109112 0 0.0
rodata 72412 72412 0 0.0
text 519884 519884 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 691026 691026 0 0.0
bss 110092 110092 0 0.0
rodata 67052 67052 0 0.0
text 440480 440480 0 0.0
p6 all-clusters-app default (read/write) 2300752 2300984 232 0.0
.bss 107912 107920 8 0.0
.data 2520 2520 0 0.0
.heap 922912 922904 -8 -0.0
.text 1259016 1259248 232 0.0
lock-app default (read/write) 2213744 2213952 208 0.0
.bss 95712 95712 0 0.0
.data 2392 2392 0 0.0
.heap 935240 935240 0 0.0
.text 1172008 1172216 208 0.0
qpg lighting-app qpg6100+debug (read only) 490784 490976 192 0.0
(read/write) 114140 114140 0 0.0
.bss 50416 50416 0 0.0
.data 1004 1004 0 0.0
.text 485464 485656 192 0.0
lock-app qpg6100+debug (read only) 467120 467296 176 0.0
(read/write) 114144 114144 0 0.0
.bss 49360 49360 0 0.0
.data 960 960 0 0.0
.text 461800 461976 176 0.0
persistent-storage-app qpg6100+debug (read only) 153212 153212 0 0.0
(read/write) 114140 114140 0 0.0
.bss 18336 18336 0 0.0
.data 356 356 0 0.0
.text 147892 147892 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 662894 663170 276 0.0
bss 69132 69132 0 0.0
noinit 33216 33216 0 0.0
text 458028 458154 126 0.0

case ZCL_INT24U_ATTRIBUTE_TYPE: // Unsigned 24-bit integer
{
uint32_t uint32_data;
uint32_data = emberAfGetInt24u(attributeData, 0, 3);
Copy link
Contributor

Choose a reason for hiding this comment

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

So this is assuming attributeData is little-endian, not native-endian, right? Is that a correct assumption for the way the values are stored, especially the default values?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is only copying 3 bytes which are to be in the machine endianness (little or big). I believe that the attribute-data in the attribute store is always stored in machine (CPU) endianness.

Copy link
Contributor

Choose a reason for hiding this comment

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

emberAfGetInt24u always reads little-endian data, no?

Comment on lines +295 to +297
// Trigger the sign extension
int32_data <<= 8;
int32_data >>= 8;
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't that happen inside emberAfGetInt24s? It sounds like that's not implemented correctly....

And again, the endianness question.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think it should happen inside the method, but it does not - and I was currently forced to use this special construction "to grab the sign". Perhaps it should go into the emberAfGetUnt24s() method is self?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally yes. Followup for that is fine. But in general, I suspect we don't want to use emberAfGetUnt24s here anyway because of the endianness problem: it always reads little-endian data.

return CHIP_ERROR_INVALID_INTEGER_VALUE;
}
dataLen = emberAfGetDataSize(baseType);
emberAfCopyInt24u(attributeData, 0, value);
Copy link
Contributor

Choose a reason for hiding this comment

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

OK, so this is in fact storing as little-endian, so I guess the question is just around default values.

Well, that and the oddity of storing these as little-endian while all other integers are stored native-endian...

int32_t value;
static_assert(3 <= sizeof(attributeData), "Value cannot fit into attribute data");
ReturnErrorOnFailure(aReader.Get(value));
if (value > static_cast<int32_t>((1UL << ((3 * 8) - 1)) - 1) || value < static_cast<int32_t>(-(1UL << ((3 * 8) - 1))))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (value > static_cast<int32_t>((1UL << ((3 * 8) - 1)) - 1) || value < static_cast<int32_t>(-(1UL << ((3 * 8) - 1))))
if (value > static_cast<int32_t>((1UL << ((3 * 8) - 1)) - 1) || value < static_cast<int32_t>(-(1UL << ((3 * 8) - 1) ) + 1))

The most-negative value representable in 24 bits is not an allowed value, right?

Copy link
Contributor Author

@tlykkeberg-grundfos tlykkeberg-grundfos Nov 4, 2021

Choose a reason for hiding this comment

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

The 2. complement values of a 24-bit signed value are:

$$-2^(24-1) to +(2^(24-1)-1)$$

Which is -8388608 to 8388607
Just like the 8-bit version is:

$$-2^(8-1) to +(2^(8-1)-1) ==> -128 to 127$$

At least to the best of my knowlegde. So the expression is all wrong either way ;-)

Copy link
Contributor

Choose a reason for hiding this comment

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

The point is, -2^(24-1) is not a valid uint24 value in the spec.

@@ -595,20 +595,26 @@
\
/* Endpoint: 1, Cluster: Pump Configuration and Control (server), big-endian */ \
\
/* 4574 - LifetimeEnergyConsumed, */ \
/* 4574 - LifetimeRunningHours, */ \
0x00, 0x00, 0x00, \
Copy link
Contributor

Choose a reason for hiding this comment

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

So the good news is that the default is in fact 3 bytes. If the default were a value where we could see the byte ordering, that would be helpful in terms of seeing whether reading as always-little-endian makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll try to make a test with other default values.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are two DEFAULT tables in the endpoint_config.h fiel. One for big-endian CPU's and one for little-endian CPU's. So I think this is taken care of when compiling. So the typeSensitiveMemCopy() will work correctly, since all data are stored locally on the device according to it's endianess - at least that is what I can conclude from the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But the zap tool does not generate it correctly. I can see the following in the endpoint_config.h file after setting the LifetimeRunningHours default value to 0x123456 in the zap tool UI and regenrating the files using ./scripts/tools/zap_regen_all.py.

            /* Endpoint: 1, Cluster: Pump Configuration and Control (server), big-endian */                                        \
                                                                                                                                   \
            /* 1377 - LifetimeRunningHours, */                                                                                     \
            0x12, 0x34, 0x56,                                                                                                      \

and

            /* Endpoint: 1, Cluster: Pump Configuration and Control (server), little-endian */                                     \
                                                                                                                                   \
            /* 1377 - LifetimeRunningHours, */                                                                                     \
            0x12, 0x34, 0x56,                                                                                                      \

This is not expected, since these are encapsulated in an if-else:

// Default values for the attributes longer than a pointer,
// in a form of a binary blob
// Separate block is generated for big-endian and little-endian cases.
#if BIGENDIAN_CPU
#define GENERATED_DEFAULTS                                                                                                         \
    {         
......
    }
#else // !BIGENDIAN_CPU
#define GENERATED_DEFAULTS                                                                                                         \
    {                                                                                                                              \
......
    }
#endif // BIGENDIAN_CPU
``

Copy link
Contributor

Choose a reason for hiding this comment

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

Should be fixed now, with #11451 merged.

Comment on lines +979 to +980
return emberAfReadServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) value,
sizeof(*value));
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not going to do the right thing.... It's reading as native-endian, and reading 4 bytes, not 3. We clearly need better tests here somehow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You might be right. The call to emberAfReadServerAttribute() ends up in the typeSensitiveMemCopy() method, where the argument readLength is the value passed in the call to emberAfReadServerAttribute as the sizeof(*value). In the case of INT24U this value is 3. But in the actual memmove() we see this:

        if (!ignoreReadLength && readLength < am->size)
        {
            return EMBER_ZCL_STATUS_INSUFFICIENT_SPACE;
        }
        if (src == NULL)
        {
            memset(dest, 0, am->size);
        }
        else
        {
            memmove(dest, src, am->size);
        }

This is the part of the code which we end up, when handling these types, which is not Strings, LongStrings or Lists.

The readLength is not used in this case, but just the attribute size it self am->size

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm. OK, that is a good point: the callee will only copy 3 bytes, and put them into our 4-byte space... where? Unless there's some endianness-checking, it will put them in the "first 3 bytes", which will behave correctly for little-endian (but only if we make sure to zero out the uint32_t first) and not behave correctly for big-endian....

It might be clearer to read into an on-stack 3-byte buffer and then build the 32-bit int from that...

Comment on lines +984 to +985
return emberAfWriteServerAttribute(endpoint, Clusters::DeviceTemperatureConfiguration::Id, Id, (uint8_t *) &value,
ZCL_INT24U_ATTRIBUTE_TYPE);
Copy link
Contributor

Choose a reason for hiding this comment

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

And this is writing native-endian, and the first 3 bytes, which might be the three high bytes or the three low bytes, depending on endianness.

@stale
Copy link

stale bot commented Nov 12, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale Stale issue or PR label Nov 12, 2021
@stale
Copy link

stale bot commented Nov 19, 2021

This stale pull request has been automatically closed. Thank you for your contributions.

@stale stale bot closed this Nov 19, 2021
@tlykkeberg-grundfos tlykkeberg-grundfos deleted the feature/extend-im-with-uint24-support branch March 2, 2022 07:21
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.

5 participants