spoerk / contiki

BLEach: Exploiting the Full Potential of IPv6 over BLE in Constrained Embedded IoT Devices
Other
14 stars 12 forks source link

How to collect the ROM and RAM size of cc26xx-ble-client/server-demo ? #9

Open desword opened 5 years ago

desword commented 5 years ago

I have the way in https://github.com/contiki-ng/contiki-ng/wiki/Tutorial:-RAM-and-ROM-usage to calculate the ROM and RAM usage, however, the size seems too large. Besides, I also calculate the ROM and RAM usage cooresponding to different modules based on the xx.map and the *.o files in obj_cc26xx_cc13x0, here is the overall results of client-demo:

   text    data     bss     dec     hex filename
  51900     483   14352   66735   104af client.elf
ROM=text (bytes), RAM=data+bss(bytes) 
----------RAM module
uip-udp-packet.o    2
packetbuf.o 1330
tcpip.o 842
ThisIsAPP   119
uip-ds6.o   127
queuebuf.o  1358
ip64-addr.o 4
nbr-table.o 352
process.o   7
sicslowpan.o    36
lpm.o   393
button-sensor.o 48
resolv.o    1476
framer-802154.o 1
cc26xx-uart.o   24
launchpad-sensors.o 15
ctimer.o    26
uip-icmp6.o 48
ieee-mode.o 28
leds.o  1
rf-ble-cmd.o    32
rf-core.o   1
contikimac.o    255
adc-sensor.o    165
soc-trng.o  77
rtimer.o    4
sys_ctrl.o  8
sensors.o   10
uip-split.o 4
ble-cc2650.o    30
board.o 20
ble-hal-cc26xx.o    2099
uip-ds6-route.o 1298
etimer.o    8
dbg-printf.o    8
ble-l2cap.o 2628
dhcpc.o 8
ccfg.o  88
uip6.o  56
gpio-interrupt.o    128
aux-ctrl.o  4
uip-ds6-nbr.o   836
uip-nd6.o   53
contiki-main.o  72
serial-line.o   285
frame802154.o   3
leds-arch.o 4
psock.o 8
link-stats.o    288
----------ROM module
setup_rom.o 280
packetbuf.o 52
putchar.o   92
soc-rtc.o   136
tcpip.o 6416
csma.o  234
ThisIsAPP   6364
uip-ds6.o   1314
board-spi.o 472
uip-debug.o 176
nbr-table.o 534
udp-socket.o    64
contikimac-framer.o 226
adc-sensor.o    152
process.o   316
sicslowpan.o    620
lpm.o   1056
stimer.o    62
chipinfo.o  320
dbg-sprintf.o   52
adi.o   60
uiplib.o    216
mmem.o  198
arg.o   398
resolv.o    230
list.o  64
ddi.o   200
framer-802154.o 324
cc26xx-uart.o   496
clock.o 296
button-sensor.o 660
ble-null-par.o  108
frame802154.o   1098
uip-icmp6.o 1102
aon_batmon.o    48
ieee-mode.o 242
ble-addr.o  132
rf-core.o   656
setup.o 1432
contikimac.o    46
contiki-watchdog.o  68
osc.o   116
soc-trng.o  284
rtimer.o    140
rom_crypto.o    1352
sensors.o   248
uip-split.o 88
ble-cc2650.o    1650
ringbuf.o   52
board.o 190
ble-hal-cc26xx.o    6612
uip-ds6-route.o 368
strformat.o 92
leds-arch.o 96
dbg-printf.o    2480
uip6.o  388
ble-l2cap.o 3056
autostart.o 100
dhcpc.o 128
dbg-snprintf.o  22
aon_rtc.o   36
assert.o    36
gpio-interrupt.o    48
aux-ctrl.o  410
rtimer-arch.o   10
uip-ds6-nbr.o   482
uip-nd6.o   2276
contiki-main.o  2140
ctimer.o    442
aes-128.o   236
interrupt.o 2
ext-flash.o 320
etimer.o    396
random.o    236
serial-line.o   172
link-stats.o    906

I found that the ROM is nearly 52KB, and the RAM is nearly 15KB. It is very different from the size reported in the paper: https://wwwpub.zih.tu-dresden.de/~mzimmerl/pubs/spoerk17bleach.pdf

Anyone can help me ?

desword commented 5 years ago

romram

Here is the ram and rom usage reported.

spoerk commented 5 years ago

The RAM and ROM reported in our paper states the usage of BLEach (the BLE link and PHY layer, the Parametrization layer, and the L2CAP layer) when it is configured of with a maximum IPv6 packet length of 512 bytes.

Per default, the BLEach uses a max. IPv6 packet length of 1024 bytes. To lower the max. length, you need to configure: #define PACKETBUF_CONF_SIZE 512 #define SICSLOWPAN_CONF_MAC_MAX_PAYLOAD 512 #define UIP_CONF_BUFFER_SIZE 512 in your project-conf.h and set #define CONN_TX_BUFFERS_NUM 12 in the /cpu/cc26xx-cc13xx/rf-core/ble-hal/ble-hal-cc26xx.c.

This should get you RAM and ROM usage comparable to the ones presented by our paper.

desword commented 5 years ago

Thanks for your reply. I use the command size client.elf or the size client.srf06-cc26xx

size client.srf06-cc26xx 
   text    data     bss     dec     hex filename
  51900     483   12048   64431    fbaf client.srf06-cc26xx

The bss section is lowered. Therefore, I need to collect the BLEach (the BLE link and PHY layer, the Parametrization layer, and the L2CAP layer) , then get the results shown in Table? But not directly the results from size command? The results of size actually contains all of modules including the contiki-os. So I need to extract the BLeach modules mannually from the *.o files in obj_srf06-cc26xx. Am I correct?