[FUN] Preliminary results
- DeusExMachina
- Posts: 223
- Joined: Tue Apr 03, 2012 5:08 am
- Location: South Korea
- Has thanked: 3 times
- Been thanked: 3 times
- DeusExMachina
- Posts: 223
- Joined: Tue Apr 03, 2012 5:08 am
- Location: South Korea
- Has thanked: 3 times
- Been thanked: 3 times
Re: [FUN] Preliminary results
I tried NIL demo for F051
RAM footprint should be bss+data, right?
So, for 4k Cortex M0 Nil will occupy 2444 bytes, or 60% of RAM? There are only 3 threads, 2 blinking and one writing to serial driver.
RAM footprint should be bss+data, right?
Code: Select all
Creating build/ch.dmp
text data bss dec hex filename
3068 192 2252 5512 1588 build/ch.elff
So, for 4k Cortex M0 Nil will occupy 2444 bytes, or 60% of RAM? There are only 3 threads, 2 blinking and one writing to serial driver.
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: [FUN] Preliminary results
Hi,
From the map file:
The BSS is just 968 bytes, the whole RAM used is 2248 including the two stacks and data. You may trim stacks down for sure.
Of the above, you would have main and process stacks with or without operating system, same for the space used by device drivers.
Giovanni
From the map file:
Code: Select all
.stacks 0x20000000 0x500
0x20000000 . = ALIGN (0x8)
0x20000000 __main_stack_base__ = .
0x20000400 . = (. + __main_stack_size__)
*fill* 0x20000000 0x400 00
0x20000400 . = ALIGN (0x8)
0x20000400 __main_stack_end__ = .
0x20000400 __process_stack_base__ = .
0x20000400 __main_thread_stack_base__ = .
0x20000500 . = (. + __process_stack_size__)
*fill* 0x20000400 0x100 00
0x20000500 . = ALIGN (0x8)
0x20000500 __process_stack_end__ = .
0x20000500 __main_thread_stack_end__ = .
.data 0x20000500 0x0 load address 0x08000e60
0x20000500 . = ALIGN (0x4)
0x20000500 PROVIDE (_data, .)
*(.data)
0x20000500 . = ALIGN (0x4)
*(.data.*)
0x20000500 . = ALIGN (0x4)
*(.ramtext)
0x20000500 . = ALIGN (0x4)
0x20000500 PROVIDE (_edata, .)
.igot.plt 0x20000500 0x0 load address 0x08000e60
.igot.plt 0x00000000 0x0 build/obj/nilcoreasm_v6m.o
.bss 0x20000500 0x3c8 load address 0x08000e60
0x20000500 . = ALIGN (0x4)
0x20000500 PROVIDE (_bss_start, .)
*(.bss)
0x20000500 . = ALIGN (0x4)
*(.bss.*)
.bss.waThread3.4505
0x20000500 0xf8 C:\Users\disiriog\AppData\Local\Temp\cc3mKP2N.ltrans0.ltrans.o
.bss.SD1.4451 0x200005f8 0x7c C:\Users\disiriog\AppData\Local\Temp\cc3mKP2N.ltrans0.ltrans.o
*fill* 0x20000674 0x4 00
.bss.waThread2.4504
0x20000678 0xf8 C:\Users\disiriog\AppData\Local\Temp\cc3mKP2N.ltrans0.ltrans.o
.bss.waThread1.4499
0x20000770 0xf8 C:\Users\disiriog\AppData\Local\Temp\cc3mKP2N.ltrans0.ltrans.o
.bss.nil.4465 0x20000868 0x60 C:\Users\disiriog\AppData\Local\Temp\cc3mKP2N.ltrans0.ltrans.o
0x200008c8 . = ALIGN (0x4)
*(COMMON)
0x200008c8 . = ALIGN (0x4)
0x200008c8 PROVIDE (_bss_end, .)
The BSS is just 968 bytes, the whole RAM used is 2248 including the two stacks and data. You may trim stacks down for sure.
Of the above, you would have main and process stacks with or without operating system, same for the space used by device drivers.
Giovanni
- DeusExMachina
- Posts: 223
- Joined: Tue Apr 03, 2012 5:08 am
- Location: South Korea
- Has thanked: 3 times
- Been thanked: 3 times
Re: [FUN] Preliminary results
But in test report from chibios demo for same MCU we get
Total we get 628 bytes for Chibios kernel. The difference is not so dramatic? I just want to figure out what I should use with Cortex M0 4k of RAM.
Code: Select all
--- Test Case 11.13 (Benchmark, RAM footprint)
--- System: 404 bytes
--- Thread: 72 bytes
--- Timer : 20 bytes
--- Semaph: 12 bytes
--- EventS: 4 bytes
--- EventL: 16 bytes
--- Mutex : 16 bytes
--- CondV.: 8 bytes
--- Queue : 36 bytes
--- MailB.: 40 bytes
--- Result: SUCCESS
Total we get 628 bytes for Chibios kernel. The difference is not so dramatic? I just want to figure out what I should use with Cortex M0 4k of RAM.
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: [FUN] Preliminary results
The Nil numbers include also the HAL and the space for threads, the ChibiOS report only shows object sizes.
For example a Thread is 64+bytes in ChibiOS and 20bytes in Nil, a semaphore 12 vs 4 etc. It is much smaller.
Giovanni
For example a Thread is 64+bytes in ChibiOS and 20bytes in Nil, a semaphore 12 vs 4 etc. It is much smaller.
Giovanni
Re: [FUN] Preliminary results
Giovani,
Thankyou for your great work, I have used your RTOS on atmega 328 with great succes memory was not issue . But now I have compiled the latest svn version (kernel_3_dev) on an attiny44... now memory usage is an issue... In your previous post you state "For example a Thread is 64+bytes in ChibiOS and 20bytes in Nil, a semaphore 12 vs 4 etc. It is much smaller." I am getting diiferent results, here is the map file:
Running one thread 8 bytes allocated for the working area..... I am getting much higher ram usage than what I expected. Do you have an idea what is going on? Runing two threads is thus out of the question!
Allocating common symbols
Common symbol size file
isRunning 0x1 ./src/display_clock.o
r_value 0x1 ./src/softpwm.o
digit_array 0x5 ./src/display_clock.o
waAnimate_led 0x55 ./src/main.o
nil 0x1e ./src/NilRTOS/nil.o
current_vfd__brigthness
0x1 ./src/display_clock.o
prev_m_led 0x2 ./src/display_clock.o
current_m_led 0x2 ./src/display_clock.o
g_value 0x1 ./src/softpwm.o
b_value 0x1 ./src/softpwm.o
millis 0x2 ./src/swRTC.o
Thankyou for your great work, I have used your RTOS on atmega 328 with great succes memory was not issue . But now I have compiled the latest svn version (kernel_3_dev) on an attiny44... now memory usage is an issue... In your previous post you state "For example a Thread is 64+bytes in ChibiOS and 20bytes in Nil, a semaphore 12 vs 4 etc. It is much smaller." I am getting diiferent results, here is the map file:
Running one thread 8 bytes allocated for the working area..... I am getting much higher ram usage than what I expected. Do you have an idea what is going on? Runing two threads is thus out of the question!
Allocating common symbols
Common symbol size file
isRunning 0x1 ./src/display_clock.o
r_value 0x1 ./src/softpwm.o
digit_array 0x5 ./src/display_clock.o
waAnimate_led 0x55 ./src/main.o
nil 0x1e ./src/NilRTOS/nil.o
current_vfd__brigthness
0x1 ./src/display_clock.o
prev_m_led 0x2 ./src/display_clock.o
current_m_led 0x2 ./src/display_clock.o
g_value 0x1 ./src/softpwm.o
b_value 0x1 ./src/softpwm.o
millis 0x2 ./src/swRTC.o
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: [FUN] Preliminary results
There are new feature in nil. If you need to minimize space then disable NIL_CFG_USE_EVENTS and NIL_CFG_ENABLE_STACK_CHECK.
You may also reduce PORT_INT_REQUIRED_STACK if your ISRs don't use much stack.
Giovanni
You may also reduce PORT_INT_REQUIRED_STACK if your ISRs don't use much stack.
Giovanni
Who is online
Users browsing this forum: No registered users and 14 guests