This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
We saw that you recently updated smbus module in the latest SDK. However, it increases ~700B code size. Since we are very size constraint, we want to know if there is a way to optimize it.
Can we eliminate any unused features by specifying build flag upon local build of SDK?
Also, currently, we only use I2C_SMBUS controller on our project, I don't understand why "smbus target" related code is involved here.
Attachment: Code size diff (only show majority difference, coming from smbus.a)
Old | New | Diff (new-old) | ||||
size (hex) | module | func name | size (hex) | module | func name | |
00000020 | smbus_nwk.o | (.text.SMBus_NWK_controllerProcessNACK) | 00000020 | smbus_nwk.o | (.text.SMBus_NWK_controllerProcessNACK) | 0 |
000000b6 | smbus_nwk.o | (.text.SMBus_NWK_controllerProcessRx) | 000000b6 | smbus_nwk.o | (.text.SMBus_NWK_controllerProcessRx) | 0 |
0000003c | smbus_nwk.o | (.text.SMBus_NWK_controllerProcessStop) | 00000050 | smbus_nwk.o | (.text.SMBus_NWK_controllerProcessStop) | 20 |
00000028 | smbus_nwk.o | (.text.SMBus_NWK_controllerProcessTimeout) | 00000028 | smbus_nwk.o | (.text.SMBus_NWK_controllerProcessTimeout) | 0 |
0000006a | smbus_nwk.o | (.text.SMBus_NWK_controllerProcessTx) | 0000007e | smbus_nwk.o | (.text.SMBus_NWK_controllerProcessTx) | 20 |
00000014 | smbus_nwk.o | (.text.SMBus_NWK_controllerReset) | 00000014 | smbus_nwk.o | (.text.SMBus_NWK_controllerReset) | 0 |
0000006a | smbus_nwk.o | (.text.SMBus_NWK_controllerTxDone) | 0000006a | smbus_nwk.o | (.text.SMBus_NWK_controllerTxDone) | 0 |
00000010 | smbus_nwk.o | (.text.SMBus_NWK_getRxPayloadSize) | 00000010 | smbus_nwk.o | (.text.SMBus_NWK_getRxPayloadSize) | 0 |
00000066 | smbus_nwk.o | (.text.SMBus_NWK_startRxTransfer) | 00000066 | smbus_nwk.o | (.text.SMBus_NWK_startRxTransfer) | 0 |
0000003e | smbus_nwk.o | (.text.SMBus_NWK_startTxTransfer) | 00000048 | smbus_nwk.o | (.text.SMBus_NWK_startTxTransfer) | 10 |
000000d4 | smbus_nwk.o | (.text.SMBus_NWK_targetProcessRx) | 212 | |||
0000006c | smbus_nwk.o | (.text.SMBus_NWK_targetProcessStart) | 108 | |||
00000058 | smbus_nwk.o | (.text.SMBus_NWK_targetProcessStop) | 88 | |||
00000040 | smbus_phy.o | (.text.SMBus_PHY_controllerEnable) | 00000034 | smbus_phy.o | (.text.SMBus_PHY_controllerEnable) | -12 |
00000028 | smbus_phy.o | (.text.SMBus_PHY_controllerEnableInt) | -40 | |||
0000000a | smbus_phy.o | (.text.SMBus_PHY_controllerInit) | 0000004c | smbus_phy.o | (.text.SMBus_PHY_controllerInit) | 66 |
000000b4 | smbus_phy.o | (.text.SMBus_PHY_controllerProcessInt) | 00000100 | smbus_phy.o | (.text.SMBus_PHY_controllerProcessInt) | 76 |
00000028 | smbus_phy.o | (.text.SMBus_PHY_controllerSendStop) | 00000028 | smbus_phy.o | (.text.SMBus_PHY_controllerSendStop) | 0 |
000000b4 | smbus_phy.o | (.text.SMBus_PHY_controllerStartRx) | 000000cc | smbus_phy.o | (.text.SMBus_PHY_controllerStartRx) | 24 |
000000e0 | smbus_phy.o | (.text.SMBus_PHY_controllerStartTx) | 000000e0 | smbus_phy.o | (.text.SMBus_PHY_controllerStartTx) | 0 |
00000020 | smbus_phy.o | (.text.SMBus_PHY_disable) | 00000024 | smbus_phy.o | (.text.SMBus_PHY_disable) | 4 |
00000024 | smbus_phy.o | (.text.SMBus_PHY_targetManualACK) | 36 | |||
Sum | 612 |
Hi Tiger,
Which version of SDK did you use before?
From my side, I think it is ok to remove the unused code. But typically unused code will not be built by complier.
Let me know if you need more suggestions.
Thanks,
Yuhao
Hi Tiger,
Here is the update feature for newer SDK's SMBUS. You can find it in the path below.
Thanks,
Yuhao
Can I exclude any feature that I am not using?
Also, I am only using controller, but why SMBus_NWK_targetProcess* is included in the code build?
Yes, you can modify the code to save the room.
I am not sure why targetProcess included. Let me check it.