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

[BL602] Fix sve2 problems #22582

Merged
merged 10 commits into from Sep 16, 2022
Merged

Conversation

jczhang777
Copy link
Contributor

@jczhang777 jczhang777 commented Sep 13, 2022

Issue Being Resolved

  • Increase pbuf num
  • fix memory leak
  • reduce app task stack size
  • Fix Diagnostic info
  • Fxi wifi for update network
  • Update readme

fixes #22616

Change overview

  • Increase pbuf num, fix memory leak, reduce app task stack size, fix Diagnostic info, fix wifi for update network, update readme.

@github-actions
Copy link

github-actions bot commented Sep 13, 2022

PR #22582: Size comparison from 5caec5a to 41d39d5

Increases (3 builds for psoc6, qpg, telink)
platform target config section 5caec5a 41d39d5 change % change
psoc6 light cy8ckit_062s2_43012 .debug_info 21937789 21937790 1 0.0
qpg lock-app qpg6105+debug (read/write) 1101000 1101008 8 0.0
.text 548100 548108 8 0.0
telink ota-requestor-app tlsr9518adk80d text 598762 598764 2 0.0
Decreases (8 builds for bl602, esp32, k32w, nrfconnect, psoc6, telink)
platform target config section 5caec5a 41d39d5 change % change
bl602 lighting-app bl602 (read/write) 1411814 1382346 -29468 -2.1
.bss 121585 89337 -32248 -26.5
.data 9816 9808 -8 -0.1
.text 1067052 1064714 -2338 -0.2
bl602+rpc (read/write) 1457266 1427542 -29724 -2.0
.bss 129017 96769 -32248 -25.0
.data 10200 10192 -8 -0.1
.text 1098656 1096062 -2594 -0.2
esp32 all-clusters-app c3devkit (read/write) 1787662 1787654 -8 -0.0
.flash.rodata 257216 257208 -8 -0.0
k32w light k32w0+release (read/write) 648860 648844 -16 -0.0
.text 573352 573336 -16 -0.0
nrfconnect all-clusters-minimal-app nrf52840dk_nrf52840 text 804124 804120 -4 -0.0
psoc6 all-clusters cy8ckit_062s2_43012 .debug_info 26738997 26738996 -1 -0.0
lock cy8ckit_062s2_43012 .debug_info 22317575 22317574 -1 -0.0
telink lighting-app tlsr9518adk80d (read/write) 834896 834888 -8 -0.0
text 592502 592500 -2 -0.0
Full report (37 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
platform target config section 5caec5a 41d39d5 change % change
bl602 lighting-app bl602 (read/write) 1411814 1382346 -29468 -2.1
.bss 121585 89337 -32248 -26.5
.data 9816 9808 -8 -0.1
.text 1067052 1064714 -2338 -0.2
bl602+rpc (read/write) 1457266 1427542 -29724 -2.0
.bss 129017 96769 -32248 -25.0
.data 10200 10192 -8 -0.1
.text 1098656 1096062 -2594 -0.2
bl702 lighting-app bl702 (read only) 3262 3262 0 0.0
(read/write) 1187155 1187155 0 0.0
.bleromro 6296 6296 0 0.0
.bleromrw 124 124 0 0.0
.boot2 688 688 0 0.0
.bss 66958 66958 0 0.0
.bss_psram 29696 29696 0 0.0
.comment 48 48 0 0.0
.data 4272 4272 0 0.0
.debug_abbrev 1499760 1499760 0 0.0
.debug_aranges 133048 133048 0 0.0
.debug_frame 486288 486288 0 0.0
.debug_info 37815371 37815371 0 0.0
.debug_line 5245919 5245919 0 0.0
.debug_loc 3362384 3362384 0 0.0
.debug_ranges 360176 360176 0 0.0
.debug_str 3444963 3444963 0 0.0
.hbn 509 509 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 144 144 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 115944 115944 0 0.0
.rsvd 3188 3188 0 0.0
.shstrtab 293 293 0 0.0
.stack 2048 2048 0 0.0
.strtab 564298 564298 0 0.0
.symtab 171520 171520 0 0.0
.tcm_data 36 36 0 0.0
.tcmcode 3262 3262 0 0.0
.text 0 0 0 0.0
956470 956470 0 0.0
bl702+rpc (read only) 3262 3262 0 0.0
(read/write) 1282939 1282939 0 0.0
.bleromro 6296 6296 0 0.0
.bleromrw 124 124 0 0.0
.boot2 688 688 0 0.0
.bss 75006 75006 0 0.0
.bss_psram 29936 29936 0 0.0
.comment 48 48 0 0.0
.data 4792 4792 0 0.0
.debug_abbrev 1637329 1637329 0 0.0
.debug_aranges 140552 140552 0 0.0
.debug_frame 511664 511664 0 0.0
.debug_info 41718972 41718972 0 0.0
.debug_line 5620333 5620333 0 0.0
.debug_loc 3555115 3555115 0 0.0
.debug_ranges 382632 382632 0 0.0
.debug_str 3840930 3840930 0 0.0
.hbn 509 509 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 160 160 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 129336 129336 0 0.0
.rsvd 3188 3188 0 0.0
.shstrtab 293 293 0 0.0
.stack 2048 2048 0 0.0
.strtab 623471 623471 0 0.0
.symtab 189328 189328 0 0.0
.tcm_data 36 36 0 0.0
.tcmcode 3262 3262 0 0.0
.text 0 0 0 0.0
1030034 1030034 0 0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 676883 676883 0 0.0
(read/write) 174540 174540 0 0.0
.bss 74316 74316 0 0.0
.data 3380 3380 0 0.0
.rodata 89395 89395 0 0.0
.text 587176 587176 0 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 641603 641603 0 0.0
(read/write) 157884 157884 0 0.0
.bss 73588 73588 0 0.0
.data 3380 3380 0 0.0
.rodata 78547 78547 0 0.0
.text 562736 562736 0 0.0
lock-ftd LP_CC2652R7 (read only) 678015 678015 0 0.0
(read/write) 163720 163720 0 0.0
.bss 71516 71516 0 0.0
.data 3304 3304 0 0.0
.rodata 77247 77247 0 0.0
.text 600288 600288 0 0.0
lock-mtd LP_CC2652R7 (read only) 660999 660999 0 0.0
(read/write) 176424 176424 0 0.0
.bss 67204 67204 0 0.0
.data 3304 3304 0 0.0
.rodata 102527 102527 0 0.0
.text 557992 557992 0 0.0
pump-app LP_CC2652R7 (read only) 686851 686851 0 0.0
(read/write) 155588 155588 0 0.0
.bss 71452 71452 0 0.0
.data 3296 3296 0 0.0
.rodata 90275 90275 0 0.0
.text 596092 596092 0 0.0
pump-controller-app LP_CC2652R7 (read only) 671343 671343 0 0.0
(read/write) 171208 171208 0 0.0
.bss 71564 71564 0 0.0
.data 3292 3292 0 0.0
.rodata 85831 85831 0 0.0
.text 585032 585032 0 0.0
shell LP_CC2652R7 (read only) 667926 667926 0 0.0
(read/write) 179008 179008 0 0.0
.bss 76628 76628 0 0.0
.data 3376 3376 0 0.0
.rodata 86118 86118 0 0.0
.text 581492 581492 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 587410 587410 0 0.0
.app_xip_area 464068 464068 0 0.0
.bss 65776 65776 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) 593162 593162 0 0.0
.app_xip_area 465036 465036 0 0.0
.bss 70560 70560 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) 543730 543730 0 0.0
.app_xip_area 425412 425412 0 0.0
.bss 60784 60784 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) 1109992 1109992 0 0.0
.bss 136332 136332 0 0.0
.data 2072 2072 0 0.0
.text 971568 971568 0 0.0
BRD4161A+rpc (read/write) 973052 973052 0 0.0
.bss 150844 150844 0 0.0
.data 2252 2252 0 0.0
.text 819936 819936 0 0.0
BRD4161A+rs911x (read/write) 1003416 1003416 0 0.0
.bss 169168 169168 0 0.0
.data 2064 2064 0 0.0
.text 832164 832164 0 0.0
lock-app BRD4161A+wf200 (read/write) 1150916 1150916 0 0.0
.bss 152248 152248 0 0.0
.data 2072 2072 0 0.0
.text 996576 996576 0 0.0
window-app BRD4161A (read/write) 1101224 1101224 0 0.0
.bss 137772 137772 0 0.0
.data 2096 2096 0 0.0
.text 961336 961336 0 0.0
esp32 all-clusters-app c3devkit (read only) 1223530 1223530 0 0.0
(read/write) 1787662 1787654 -8 -0.0
.dram0.bss 76952 76952 0 0.0
.dram0.data 13840 13840 0 0.0
.flash.rodata 257216 257208 -8 -0.0
.flash.text 1223530 1223530 0 0.0
.iram0.text 65204 65204 0 0.0
m5stack (read only) 1233359 1233359 0 0.0
(read/write) 563596 563596 0 0.0
.dram0.bss 82312 82312 0 0.0
.dram0.data 34296 34296 0 0.0
.flash.rodata 314320 314320 0 0.0
.flash.text 1227975 1227975 0 0.0
.iram0.text 123939 123939 0 0.0
k32w light k32w0+release (read/write) 648860 648844 -16 -0.0
.bss 70712 70712 0 0.0
.data 2068 2068 0 0.0
.text 573352 573336 -16 -0.0
lock k32w0+release (read/write) 706048 706048 0 0.0
.bss 71160 71160 0 0.0
.data 2076 2076 0 0.0
.text 630084 630084 0 0.0
linux chip-tool-ipv6only arm64 (read only) 10343756 10343756 0 0.0
(read/write) 705649 705649 0 0.0
.bss 33937 33937 0 0.0
.data 2856 2856 0 0.0
.data.rel.ro 650024 650024 0 0.0
.dynamic 560 560 0 0.0
.got 13864 13864 0 0.0
.init 24 24 0 0.0
.init_array 200 200 0 0.0
.rodata 502972 502972 0 0.0
.text 8187716 8187716 0 0.0
thermostat-no-ble arm64 (read only) 2366020 2366020 0 0.0
(read/write) 141905 141905 0 0.0
.bss 55233 55233 0 0.0
.data 1680 1680 0 0.0
.data.rel.ro 76160 76160 0 0.0
.dynamic 560 560 0 0.0
.got 5056 5056 0 0.0
.init 24 24 0 0.0
.init_array 416 416 0 0.0
.rodata 141452 141452 0 0.0
.text 1986480 1986480 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2455288 2455288 0 0.0
.bss 215044 215044 0 0.0
.data 5872 5872 0 0.0
.text 1417932 1417932 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1182059 1182059 0 0.0
bss 143641 143641 0 0.0
rodata 143740 143740 0 0.0
text 815732 815732 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1161243 1161243 0 0.0
bss 142868 142868 0 0.0
rodata 135332 135332 0 0.0
text 804124 804120 -4 -0.0
psoc6 all-clusters cy8ckit_062s2_43012 (read only) 841960 841960 0 0.0
(read/write) 1744092 1744092 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 188720 188720 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2664 2664 0 0.0
.debug_abbrev 1221909 1221909 0 0.0
.debug_aranges 111776 111776 0 0.0
.debug_frame 373172 373172 0 0.0
.debug_info 26738997 26738996 -1 -0.0
.debug_line 3662756 3662756 0 0.0
.debug_loc 3581936 3581936 0 0.0
.debug_ranges 340544 340544 0 0.0
.debug_str 3428755 3428755 0 0.0
.heap 841960 841960 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 571099 571099 0 0.0
.symtab 421776 421776 0 0.0
.text 1544320 1544320 0 0.0
.zero.table 8 8 0 0.0
text 0 0 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 (read only) 842696 842696 0 0.0
(read/write) 1687300 1687300 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 187984 187984 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2664 2664 0 0.0
.debug_abbrev 1213748 1213748 0 0.0
.debug_aranges 111248 111248 0 0.0
.debug_frame 376252 376252 0 0.0
.debug_info 26475620 26475620 0 0.0
.debug_line 3683296 3683296 0 0.0
.debug_loc 3569573 3569573 0 0.0
.debug_ranges 339160 339160 0 0.0
.debug_str 3417760 3417760 0 0.0
.heap 842696 842696 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 535573 535573 0 0.0
.symtab 408368 408368 0 0.0
.text 1488264 1488264 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
light cy8ckit_062s2_43012 (read only) 850928 850928 0 0.0
(read/write) 1604548 1604548 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 179960 179960 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2456 2456 0 0.0
.debug_abbrev 1048567 1048567 0 0.0
.debug_aranges 103424 103424 0 0.0
.debug_frame 346520 346520 0 0.0
.debug_info 21937789 21937790 1 0.0
.debug_line 3253725 3253725 0 0.0
.debug_loc 3267867 3267867 0 0.0
.debug_ranges 304632 304632 0 0.0
.debug_str 3223026 3223026 0 0.0
.heap 850928 850928 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 468872 468872 0 0.0
.symtab 375456 375456 0 0.0
.text 1413744 1413744 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
lock cy8ckit_062s2_43012 (read only) 845896 845896 0 0.0
(read/write) 1642236 1642236 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 184976 184976 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2472 2472 0 0.0
.debug_abbrev 1056002 1056002 0 0.0
.debug_aranges 104096 104096 0 0.0
.debug_frame 349348 349348 0 0.0
.debug_info 22317575 22317574 -1 -0.0
.debug_line 3262534 3262534 0 0.0
.debug_loc 3307735 3307735 0 0.0
.debug_ranges 307976 307976 0 0.0
.debug_str 3250447 3250447 0 0.0
.heap 845896 845896 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 475075 475075 0 0.0
.symtab 378640 378640 0 0.0
.text 1446400 1446400 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
qpg lighting-app qpg6105+debug (read/write) 1130012 1130012 0 0.0
.bss 106112 106112 0 0.0
.data 1028 1028 0 0.0
.text 577108 577108 0 0.0
lock-app qpg6105+debug (read/write) 1101000 1101008 8 0.0
.bss 102344 102344 0 0.0
.data 1032 1032 0 0.0
.text 548100 548108 8 0.0
telink light-switch-app tlsr9518adk80d (read/write) 812984 812984 0 0.0
bss 71372 71372 0 0.0
noinit 43488 43488 0 0.0
text 574370 574370 0 0.0
lighting-app tlsr9518adk80d (read/write) 834896 834888 -8 -0.0
bss 72228 72228 0 0.0
noinit 43488 43488 0 0.0
text 592502 592500 -2 -0.0
ota-requestor-app tlsr9518adk80d (read/write) 843140 843140 0 0.0
bss 73136 73136 0 0.0
noinit 43488 43488 0 0.0
text 598762 598764 2 0.0

@andy31415
Copy link
Contributor

@jczhang777 please add and link an issue for this. The template explicitly asks for a text of the form fixes #..... to link the issue (other text can be used - see https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) however an issue is currently mandatory for PRs in ToT

{
if (!ip_addr_cmp(&netif->ip6_addr[i], IP6_ADDR_ANY))
{
memcpy(&if_ip6[addr_count++], &netif->ip6_addr[i], sizeof(ip6_addr_t));
Copy link
Contributor

Choose a reason for hiding this comment

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

how do you ensure that if_ip6 has sufficient space for addr_count ?

I think the size of input arrays should be passed in to methods. Currently nothing seems to guarantee that kMaxIPv6AddrCount >= LWIP_IPV6_NUM_ADDRESSES

Copy link
Contributor

Choose a reason for hiding this comment

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

what guarantees that if_ip6 has at least min(kMaxIPv6AddrCount, LWIP_IPV6_NUM_ADDRESSES) elements?

The size of if_ip6 should be passed in to this method as an argument, not assumed.

bl_efuse_read_mac(ifp->MacAddress);
ifp->hardwareAddress = ByteSpan(ifp->MacAddress, 6);

wifi_mgmr_sta_ip_get(&ip, &gw, &mask);
Copy link
Contributor

Choose a reason for hiding this comment

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

do these methods never fail? Like is there always an ip/gw/mask?

Copy link
Contributor

Choose a reason for hiding this comment

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

What was the resolution here? This was marked resolved yet I see no comment of "this never fails" nor do I see code changes that would check for a return value from the wifi_mgmr_sta_ip_get

memcpy(wifi_ssid, ssid, ssidLen);
memcpy(passwd, key, keyLen);
wifi_interface_t wifi_interface;
wifi_interface = wifi_mgmr_sta_enable();
wifi_mgmr_sta_connect(wifi_interface, ssid, passwd, NULL, NULL, 0, 0);
wifi_mgmr_sta_connect(wifi_interface, wifi_ssid, passwd, NULL, NULL, 0, 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do these methods return an error code we could check and log on failures?

Copy link
Contributor

Choose a reason for hiding this comment

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

These were marked resolved ... what was the resolution? I see no deltas.

An answer like "this never fails" or implementation change would make sense.

@andy31415
Copy link
Contributor

accepted for 1.0: platform fixes

@github-actions
Copy link

PR #22582: Size comparison from 5caec5a to a103829

Increases (1 build for mbed)
platform target config section 5caec5a a103829 change % change
mbed lock-app CY8CPROTO_062_4343W+release (read/write) 2455288 2455952 664 0.0
.text 1417932 1418596 664 0.0
Full report (1 build for mbed)
platform target config section 5caec5a a103829 change % change
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2455288 2455952 664 0.0
.bss 215044 215044 0 0.0
.data 5872 5872 0 0.0
.text 1417932 1418596 664 0.0

Copy link
Contributor

@andy31415 andy31415 left a comment

Choose a reason for hiding this comment

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

Changes requested: comments were marked resolved without any resolution it seems.

while (state != WIFI_STATE_IDLE)
{
wifi_mgmr_state_get(&state);
vTaskDelay(100);
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the 100 here? why is it ok to use ticks which depend on tick rate instead of computing a standard time. At least a comment of why we do not care is appropriate.

@@ -32,6 +32,8 @@
#include <string>
#include <utils_log.h>

#define WIFI_STA_DISCONNECT_DELAY (pdMS_TO_TICKS(200))
Copy link
Contributor

Choose a reason for hiding this comment

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

in C++ use static constexpr ... for type safety instead of macros.

@andy31415
Copy link
Contributor

@jczhang777 if you mark comments resolved, please do a code change (which would make it obvious why resolved) or add a comment reply saying why no change is needed. I do not have API documentation for the SDK calls you use and you are the expert in the platform, so I am providing suggestions but if you say not needed because... that is ok.

Want to make sure things were considered.

@andy31415
Copy link
Contributor

I am force-merging this due to 1.0 branch: this PR makes things better, it just seems to be missing some error condition handling and some slight style issues and inconsistencies. These can be made in a followup by the platform owner. As this is not core SDK, I will not block PR on them.

@andy31415 andy31415 merged commit 69551a1 into project-chip:master Sep 16, 2022
@andy31415
Copy link
Contributor

@jczhang777 - followup for more fixes would be appreciated/recommented.

@wy-hh wy-hh deleted the bl602_update_0913 branch July 17, 2023 03: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.

[Platform] BL602 fixes networkcommission and network diagnosis info.
4 participants