Discussion:
[nuttx] code size for nuttx
Arjun Hary arjun@zglue.com [nuttx]
2017-03-15 18:00:30 UTC
Permalink
Hi,


I am working as a firmware engineer in a startup based on IoT. We are
evaluating nuttx as a choice for an RTOS. The main reason we want to use it
is the POSIX compliance and also support for grahics and networking
libraries. I have a question on code size


I have read that the smallest footprint is around 20KB. I am trying to
understand what the 20KB includes. Does it include only the core kernel,
threading, synchronization, memory management etc. I am asking this for a
reason to support arm m0 type processors with 32KB RAM.


Also i am looking at evaluation bluetooth stacks particularly nimBLE stack
from apache mynewt. Is there a port of this available on nuttx
--
Arjun Hary
________________________________________
: +1 (425) 381-7722
: zGlue Inc., Mountain View, CA
________________________________________
spudarnia@yahoo.com [nuttx]
2017-03-15 19:01:58 UTC
Permalink
NuttX, of course, links from libraries has no fixed size that you can use to characterize it. In the past, there have been some efforts to build and characterize minimal systems. But I am not sure if those numbers are really meaningful in a real work application.


But sure, you can create a small system in around 20Kb of FLASH, perhaps including a tiny shell and serial console. You will certainly want to do more than that, however. Enable or use additional features and the OS gets bigger gets bigger. Perhaps a size around 20Kb characterizes a minimal system; typical is probably more like 40-50Kb I would imagine.


That size usually refers to FLASH usage. You mention that you have 32Kb is RAM. There have been many successful projects with parts using 20-32Kb of SRAM, but with much more FLASH memory.


The static RAM usage of NuttX is very small. I don't know exactly, but probably around 1Kb (maybe a little more. I would have to check). But as soon as you start the system, more memory will be used dynamically. The primary memory usage is for stacks needed by each thread and for application usage. So small RAMs basically only limit the kinds of applications and number of threads that you can use.


At 32Kb of SRAM, you can comfortably support a small applications. There have been several successful projects using parts with 20-32Kb of SRAM. ARM projects. Other MCUs like AVR use much less stack.


There is at least one active ARM project out there with only 8Kb of SRAM (are your ears burning, David), but I don't recommend that at all. The owner of that project is constantly struggling to keep the code working within that limit.


As with all projects, there is code growth over time. NuttX just completed its 10th anniversary recently and so has had some creeping growth for 10 years. Much of that has been minimized by enabling each feature with a configuration options. The tradeoff is that NuttX configuration is extremely complex and not for the timid.


Greg
Arjun Hary arjun@zglue.com [nuttx]
2017-03-15 21:27:40 UTC
Permalink
I should have asked the question better my bad. The reason i ask about the
20KB flash size is because we are planning to support a chip which has no
flash in it ( in case u r curious, the DA14580 MCU from dialog
semiconductor). It has a total SRAM of 42KB. So the whole code + data has
to fit in 42KB. We also want to support the Nordic nRF52 chip which has
256KB flash and 64K RAM.

For lack of better way what features does the 20KB include. Does it support
like threading, synchronization. interrupts. We don't need the serial
console. I am also trying to build the nuttx on linux. Is there any project
that uses the minimal system for me to refer to or can you recommend the
build settings for getting to the minimal features.

Thanks for all the support and the answers.
Post by ***@yahoo.com [nuttx]
NuttX, of course, links from libraries has no fixed size that you can use
to characterize it. In the past, there have been some efforts to build and
characterize minimal systems. But I am not sure if those numbers are
really meaningful in a real work application.
But sure, you can create a small system in around 20Kb of FLASH, perhaps
including a tiny shell and serial console. You will certainly want to do
more than that, however. Enable or use additional features and the OS gets
bigger gets bigger. Perhaps a size around 20Kb characterizes a minimal
system; typical is probably more like 40-50Kb I would imagine.
That size usually refers to FLASH usage. You mention that you have 32Kb
is RAM. There have been many successful projects with parts using 20-32Kb
of SRAM, but with much more FLASH memory.
The static RAM usage of NuttX is very small. I don't know exactly, but
probably around 1Kb (maybe a little more. I would have to check). But as
soon as you start the system, more memory will be used dynamically. The
primary memory usage is for stacks needed by each thread and for
application usage. So small RAMs basically only limit the kinds of
applications and number of threads that you can use.
At 32Kb of SRAM, you can comfortably support a small applications. There
have been several successful projects using parts with 20-32Kb of SRAM.
ARM projects. Other MCUs like AVR use much less stack.
There is at least one active ARM project out there with only 8Kb of SRAM
(are your ears burning, David), but I don't recommend that at all. The
owner of that project is constantly struggling to keep the code working
within that limit.
As with all projects, there is code growth over time. NuttX just
completed its 10th anniversary recently and so has had some creeping growth
for 10 years. Much of that has been minimized by enabling each feature
with a configuration options. The tradeoff is that NuttX configuration is
extremely complex and not for the timid.
Greg
--
Arjun Hary
________________________________________
: +1 (425) 381-7722
: zGlue Inc., Mountain View, CA
________________________________________
spudarnia@yahoo.com [nuttx]
2017-03-15 22:20:03 UTC
Permalink
I should have asked the question better my bad. The reason i ask about the 20KB flash size is because we are planning to support a chip which has no flash in it ( in case u r curious, the DA14580 MCU from dialog semiconductor). It has a total SRAM of 42KB. So the whole code + data has to fit in 42KB. We also want to support the Nordic nRF52 chip which has 256KB flash and 64K RAM.
I would not use NuttX in that memory configuration, with some work you might be able to squeeze everything in. But basically you are wasting all of the extremely limited memory on an OS.. Use should be saving the memory for use by your application.

I would not recommend using any RTOS at all. You cannot really afford any kind of multi-threaded application in that amount of memory. You should consider something like Contiki.
For lack of better way what features does the 20KB include. Does it support like threading, synchronization. interrupts. We don't need the serial console. I am also trying to build the nuttx on linux. Is there any project that uses the minimal system for me to refer to or can you recommend the build settings for getting to the minimal features.
Alan has a minimal configuration. Although, it really isn't minimal, it is just small. He can tell you how much was OS and how much was application. I seem to recall that the minimal shell and serial support was around 4Kb. The whole size was around 20Kb. Was that right Alan? It should be possible to get the OS -- including threading, synchronization, interrupts, but no serial console -- in perhaps 16Kb.

But I suspect that you will be sorry down the road when you need more memory.

Greg
Alan Carvalho de Assis acassis@gmail.com [nuttx]
2017-03-15 22:54:12 UTC
Permalink
Hi Arjun,

Don't worry, too many information in the first email could be overkill :-)

The DA14580 supports booting from SPI NOR, are you planing to use it?
Or do you have some other option to load the code inside the internal
RAM?

I think Nordic nRF52 is a great option, because at end of day
customers/clients will ask for more features and DA14580 will not be
able to deliver. Even nRF51 is a better alternative the DA14580, but
note that nRF51 is a Cortex-M0 without SYSTICK.

Don't try to create the cheapest device, create a niche to develop the
market first. As volume scales the component price decreases abruptly.

Please find attached an example of a Minimum configuration for
STM32F103C8T6-Minimum board.

$ arm-none-eabi-size nuttx
text data bss dec hex filename
21545 80 1124 22749 58dd nuttx

Do you have a STM32F4Discovery board or other board supported by NuttX?

BR,

Alan
Post by Arjun Hary ***@zglue.com [nuttx]
I should have asked the question better my bad. The reason i ask about the
20KB flash size is because we are planning to support a chip which has no
flash in it ( in case u r curious, the DA14580 MCU from dialog
semiconductor). It has a total SRAM of 42KB. So the whole code + data has
to fit in 42KB. We also want to support the Nordic nRF52 chip which has
256KB flash and 64K RAM.
For lack of better way what features does the 20KB include. Does it support
like threading, synchronization. interrupts. We don't need the serial
console. I am also trying to build the nuttx on linux. Is there any project
that uses the minimal system for me to refer to or can you recommend the
build settings for getting to the minimal features.
Thanks for all the support and the answers.
Post by ***@yahoo.com [nuttx]
NuttX, of course, links from libraries has no fixed size that you can use
to characterize it. In the past, there have been some efforts to build and
characterize minimal systems. But I am not sure if those numbers are
really meaningful in a real work application.
But sure, you can create a small system in around 20Kb of FLASH, perhaps
including a tiny shell and serial console. You will certainly want to do
more than that, however. Enable or use additional features and the OS gets
bigger gets bigger. Perhaps a size around 20Kb characterizes a minimal
system; typical is probably more like 40-50Kb I would imagine.
That size usually refers to FLASH usage. You mention that you have 32Kb
is RAM. There have been many successful projects with parts using 20-32Kb
of SRAM, but with much more FLASH memory.
The static RAM usage of NuttX is very small. I don't know exactly, but
probably around 1Kb (maybe a little more. I would have to check). But as
soon as you start the system, more memory will be used dynamically. The
primary memory usage is for stacks needed by each thread and for
application usage. So small RAMs basically only limit the kinds of
applications and number of threads that you can use.
At 32Kb of SRAM, you can comfortably support a small applications. There
have been several successful projects using parts with 20-32Kb of SRAM.
ARM projects. Other MCUs like AVR use much less stack.
There is at least one active ARM project out there with only 8Kb of SRAM
(are your ears burning, David), but I don't recommend that at all. The
owner of that project is constantly struggling to keep the code working
within that limit.
As with all projects, there is code growth over time. NuttX just
completed its 10th anniversary recently and so has had some creeping growth
for 10 years. Much of that has been minimized by enabling each feature
with a configuration options. The tradeoff is that NuttX configuration is
extremely complex and not for the timid.
Greg
--
Arjun Hary
________________________________________
: +1 (425) 381-7722
: zGlue Inc., Mountain View, CA
________________________________________
Arjun Hary arjun@zglue.com [nuttx]
2017-03-15 23:01:16 UTC
Permalink
We are booting from SPI NOR. But still the limitation of the 42KB RAM does
not help. Are you thinking about loading modules from the NOR flash? We
will try your config file and ask more questions if needed. Please add any
more info that might help me in case i cannot ask the right questions.

Thanks a lot for the tips.
[Attachment(s) <#m_5486715370773467826_TopText> from Alan Carvalho de
Assis included below]
Hi Arjun,
Don't worry, too many information in the first email could be overkill :-)
The DA14580 supports booting from SPI NOR, are you planing to use it?
Or do you have some other option to load the code inside the internal
RAM?
I think Nordic nRF52 is a great option, because at end of day
customers/clients will ask for more features and DA14580 will not be
able to deliver. Even nRF51 is a better alternative the DA14580, but
note that nRF51 is a Cortex-M0 without SYSTICK.
Don't try to create the cheapest device, create a niche to develop the
market first. As volume scales the component price decreases abruptly.
Please find attached an example of a Minimum configuration for
STM32F103C8T6-Minimum board.
$ arm-none-eabi-size nuttx
text data bss dec hex filename
21545 80 1124 22749 58dd nuttx
Do you have a STM32F4Discovery board or other board supported by NuttX?
BR,
Alan
Post by Arjun Hary ***@zglue.com [nuttx]
I should have asked the question better my bad. The reason i ask about
the
Post by Arjun Hary ***@zglue.com [nuttx]
20KB flash size is because we are planning to support a chip which has no
flash in it ( in case u r curious, the DA14580 MCU from dialog
semiconductor). It has a total SRAM of 42KB. So the whole code + data has
to fit in 42KB. We also want to support the Nordic nRF52 chip which has
256KB flash and 64K RAM.
For lack of better way what features does the 20KB include. Does it
support
Post by Arjun Hary ***@zglue.com [nuttx]
like threading, synchronization. interrupts. We don't need the serial
console. I am also trying to build the nuttx on linux. Is there any
project
Post by Arjun Hary ***@zglue.com [nuttx]
that uses the minimal system for me to refer to or can you recommend the
build settings for getting to the minimal features.
Thanks for all the support and the answers.
Post by ***@yahoo.com [nuttx]
NuttX, of course, links from libraries has no fixed size that you can
use
Post by Arjun Hary ***@zglue.com [nuttx]
Post by ***@yahoo.com [nuttx]
to characterize it. In the past, there have been some efforts to build
and
characterize minimal systems. But I am not sure if those numbers are
really meaningful in a real work application.
But sure, you can create a small system in around 20Kb of FLASH, perhaps
including a tiny shell and serial console. You will certainly want to do
more than that, however. Enable or use additional features and the OS
gets
bigger gets bigger. Perhaps a size around 20Kb characterizes a minimal
system; typical is probably more like 40-50Kb I would imagine.
That size usually refers to FLASH usage. You mention that you have 32Kb
is RAM. There have been many successful projects with parts using
20-32Kb
of SRAM, but with much more FLASH memory.
The static RAM usage of NuttX is very small. I don't know exactly, but
probably around 1Kb (maybe a little more. I would have to check). But
as
soon as you start the system, more memory will be used dynamically. The
primary memory usage is for stacks needed by each thread and for
application usage. So small RAMs basically only limit the kinds of
applications and number of threads that you can use.
At 32Kb of SRAM, you can comfortably support a small applications. There
have been several successful projects using parts with 20-32Kb of SRAM.
ARM projects. Other MCUs like AVR use much less stack.
There is at least one active ARM project out there with only 8Kb of SRAM
(are your ears burning, David), but I don't recommend that at all. The
owner of that project is constantly struggling to keep the code working
within that limit.
As with all projects, there is code growth over time. NuttX just
completed its 10th anniversary recently and so has had some creeping growth
for 10 years. Much of that has been minimized by enabling each feature
with a configuration options. The tradeoff is that NuttX configuration
is
extremely complex and not for the timid.
Greg
--
Arjun Hary
________________________________________
: +1 (425) 381-7722 <(425)%20381-7722>
: zGlue Inc., Mountain View, CA
________________________________________
--
Arjun Hary
________________________________________
: +1 (425) 381-7722
: zGlue Inc., Mountain View, CA
________________________________________
Alan Carvalho de Assis acassis@gmail.com [nuttx]
2017-03-15 23:55:17 UTC
Permalink
Hi Arjun,

I think all information you need is already in the config file. Just
change the host from Windows to Linux and compile.

If you want to reduce further the size, then disable UART Device, UART
Driver, NSH Application and enable "Hello World" Application.

You will need to define the new Application entry point:

-> RTOS Features
-> Tasks and Scheduling
-> Application entry point = hello_main

That is it, any issue just ask.

BR,

Alan
Post by Arjun Hary ***@zglue.com [nuttx]
We are booting from SPI NOR. But still the limitation of the 42KB RAM does
not help. Are you thinking about loading modules from the NOR flash? We
will try your config file and ask more questions if needed. Please add any
more info that might help me in case i cannot ask the right questions.
Thanks a lot for the tips.
[Attachment(s) <#m_5486715370773467826_TopText> from Alan Carvalho de
Assis included below]
Hi Arjun,
Don't worry, too many information in the first email could be overkill :-)
The DA14580 supports booting from SPI NOR, are you planing to use it?
Or do you have some other option to load the code inside the internal
RAM?
I think Nordic nRF52 is a great option, because at end of day
customers/clients will ask for more features and DA14580 will not be
able to deliver. Even nRF51 is a better alternative the DA14580, but
note that nRF51 is a Cortex-M0 without SYSTICK.
Don't try to create the cheapest device, create a niche to develop the
market first. As volume scales the component price decreases abruptly.
Please find attached an example of a Minimum configuration for
STM32F103C8T6-Minimum board.
$ arm-none-eabi-size nuttx
text data bss dec hex filename
21545 80 1124 22749 58dd nuttx
Do you have a STM32F4Discovery board or other board supported by NuttX?
BR,
Alan
Post by Arjun Hary ***@zglue.com [nuttx]
I should have asked the question better my bad. The reason i ask about
the
Post by Arjun Hary ***@zglue.com [nuttx]
20KB flash size is because we are planning to support a chip which has no
flash in it ( in case u r curious, the DA14580 MCU from dialog
semiconductor). It has a total SRAM of 42KB. So the whole code + data has
to fit in 42KB. We also want to support the Nordic nRF52 chip which has
256KB flash and 64K RAM.
For lack of better way what features does the 20KB include. Does it
support
Post by Arjun Hary ***@zglue.com [nuttx]
like threading, synchronization. interrupts. We don't need the serial
console. I am also trying to build the nuttx on linux. Is there any
project
Post by Arjun Hary ***@zglue.com [nuttx]
that uses the minimal system for me to refer to or can you recommend the
build settings for getting to the minimal features.
Thanks for all the support and the answers.
Post by ***@yahoo.com [nuttx]
NuttX, of course, links from libraries has no fixed size that you can
use
Post by Arjun Hary ***@zglue.com [nuttx]
Post by ***@yahoo.com [nuttx]
to characterize it. In the past, there have been some efforts to build
and
characterize minimal systems. But I am not sure if those numbers are
really meaningful in a real work application.
But sure, you can create a small system in around 20Kb of FLASH, perhaps
including a tiny shell and serial console. You will certainly want to do
more than that, however. Enable or use additional features and the OS
gets
bigger gets bigger. Perhaps a size around 20Kb characterizes a minimal
system; typical is probably more like 40-50Kb I would imagine.
That size usually refers to FLASH usage. You mention that you have 32Kb
is RAM. There have been many successful projects with parts using
20-32Kb
of SRAM, but with much more FLASH memory.
The static RAM usage of NuttX is very small. I don't know exactly, but
probably around 1Kb (maybe a little more. I would have to check). But
as
soon as you start the system, more memory will be used dynamically. The
primary memory usage is for stacks needed by each thread and for
application usage. So small RAMs basically only limit the kinds of
applications and number of threads that you can use.
At 32Kb of SRAM, you can comfortably support a small applications. There
have been several successful projects using parts with 20-32Kb of SRAM.
ARM projects. Other MCUs like AVR use much less stack.
There is at least one active ARM project out there with only 8Kb of SRAM
(are your ears burning, David), but I don't recommend that at all. The
owner of that project is constantly struggling to keep the code working
within that limit.
As with all projects, there is code growth over time. NuttX just
completed its 10th anniversary recently and so has had some creeping growth
for 10 years. Much of that has been minimized by enabling each feature
with a configuration options. The tradeoff is that NuttX configuration
is
extremely complex and not for the timid.
Greg
--
Arjun Hary
________________________________________
: +1 (425) 381-7722 <(425)%20381-7722>
: zGlue Inc., Mountain View, CA
________________________________________
--
Arjun Hary
________________________________________
: +1 (425) 381-7722
: zGlue Inc., Mountain View, CA
________________________________________
spudarnia@yahoo.com [nuttx]
2017-03-15 23:05:04 UTC
Permalink
Please find attached an example of a Minimum configuration for STM32F103C8T6-Minimum board.
$ arm-none-eabi-size nuttx
text data bss dec hex filename
21545 80 1124 22749 58dd nuttx
That does include a serial console and the NSH shell application. I think that Alan found that shrinks by about 4Kb if you remove NSH (and replace it with the NULL application). Is that right Alan?

If you don't need serial, you can disable that in the configuration and would probably save a couple more Kb. I think that with no shell and no serial console it could bet down to about 16Kb.

Greg
Alan Carvalho de Assis acassis@gmail.com [nuttx]
2017-03-15 23:42:26 UTC
Permalink
Hi Greg,

Disabling UART, Console and NSH and enabling the "hello world" example
it is even smaller:

$ arm-none-eabi-size nuttx
text data bss dec hex filename
12239 0 1084 13323 340b nuttx

Note that this small configuration disables important features, like pthreads.

Be aware that with pthreads enabled it increases almost 200 bytes, OMG!!! See:

$ arm-none-eabi-size nuttx
text data bss dec hex filename
12423 0 1084 13507 34c3 nuttx

With pthreads and signal:

$ arm-none-eabi-size nuttx
text data bss dec hex filename
14685 0 1180 15865 3df9 nuttx

With pthreads, signal and message queue:

$ arm-none-eabi-size nuttx
text data bss dec hex filename
15285 0 1232 16517 4085 nuttx

So that is it, NuttX still small.

BR,

Alan
Post by ***@yahoo.com [nuttx]
Post by Alan Carvalho de Assis ***@gmail.com [nuttx]
Please find attached an example of a Minimum configuration for
STM32F103C8T6-Minimum board.
$ arm-none-eabi-size nuttx
text data bss dec hex filename
21545 80 1124 22749 58dd nuttx
That does include a serial console and the NSH shell application. I think
that Alan found that shrinks by about 4Kb if you remove NSH (and replace it
with the NULL application). Is that right Alan?
If you don't need serial, you can disable that in the configuration and
would probably save a couple more Kb. I think that with no shell and no
serial console it could bet down to about 16Kb.
Greg
webbbn@gmail.com [nuttx]
2017-03-16 15:29:40 UTC
Permalink
Not to drag the conversation too off topic, but has anyone tried porting Nuttx to an STM32L0? The one I'm looking at has 192k flash and 20k RAM:

http://www.murata.com/en-us/about/newsroom/news/product/wireless/2016/0719 http://www.murata.com/en-us/about/newsroom/news/product/wireless/2016/0719
Alan Carvalho de Assis acassis@gmail.com [nuttx]
2017-03-18 16:06:18 UTC
Permalink
Hi Brian,

I have three MCUs STM32L072RBT6 here waiting for tests.

I don't know yet how it differs from STM32F0 family, hopefully I
suppose the peripheral should be the same from STM32L4 that was ported
to NuttX mainline.

BR,

Alan
Post by ***@gmail.com [nuttx]
Not to drag the conversation too off topic, but has anyone tried porting
http://www.murata.com/en-us/about/newsroom/news/product/wireless/2016/0719
http://www.murata.com/en-us/about/newsroom/news/product/wireless/2016/0719
spudarnia@yahoo.com [nuttx]
2017-03-18 17:33:27 UTC
Permalink
Post by Alan Carvalho de Assis ***@gmail.com [nuttx]
I have three MCUs STM32L072RBT6 here waiting for tests.
I don't know yet how it differs from STM32F0 family, hopefully I
suppose the peripheral should be the same from STM32L4 that was ported
to NuttX mainline.


Note that there is no STM32F0 support in the NuttX repository now wither. That and the STM32L0 are Cortex-M0+ parts. They cannot go in any existing Cortex-M3,4,7 architecture directories because all of the basic CPU operations are different (should should easily be clone-able from one of the Cortex-M0 parts). The F0/L0 will need a new arch/arm/src/stm32f0 and probably stm32l0, depending on finding a better directory name (stm32F0L0?) and depending of the compatibility of the parts.


Greg
Alan Carvalho de Assis acassis@gmail.com [nuttx]
2017-03-20 15:35:21 UTC
Permalink
Hi Greg,

I have a STM32F0-Discovery board (STM32F051R8T6), I could to start
with this board until design a small board with STM32L072.

The migration guide from STM32F1 to STM32F0 says there are some
differences on ADC, RTC, RCC, I2C, SPI. At least the USART peripheral
is the same:

http://www.st.com/content/ccc/resource/technical/document/application_note/19/dc/60/19/9b/8b/45/ce/DM00052530.pdf/files/DM00052530.pdf/jcr:content/translations/en.DM00052530.pdf

BR,

Alan
Post by Alan Carvalho de Assis ***@gmail.com [nuttx]
Post by Alan Carvalho de Assis ***@gmail.com [nuttx]
I have three MCUs STM32L072RBT6 here waiting for tests.
I don't know yet how it differs from STM32F0 family, hopefully I
suppose the peripheral should be the same from STM32L4 that was ported
to NuttX mainline.
Note that there is no STM32F0 support in the NuttX repository now wither.
That and the STM32L0 are Cortex-M0+ parts. They cannot go in any existing
Cortex-M3,4,7 architecture directories because all of the basic CPU
operations are different (should should easily be clone-able from one of the
Cortex-M0 parts). The F0/L0 will need a new arch/arm/src/stm32f0 and
probably stm32l0, depending on finding a better directory name (stm32F0L0?)
and depending of the compatibility of the parts.
Greg
spudarnia@yahoo.com [nuttx]
2017-03-20 17:29:42 UTC
Permalink
Just a reminder... this will need to go its own architecture directly since it is a Cortex-M0+. You can get the interrupt and other initialization code from kl/, lpc11xx/, nuc1xx/, or samdl. You can take compatible drivers from stm32, but the stm32f0 cannot live in the stm32/ directory.


Greg
Alan Carvalho de Assis acassis@gmail.com [nuttx]
2017-03-20 19:34:08 UTC
Permalink
Hi Greg,

Sure, it will put it at stm32f0.

BR,

Alan
Post by ***@yahoo.com [nuttx]
Just a reminder... this will need to go its own architecture directly since
it is a Cortex-M0+. You can get the interrupt and other initialization code
from kl/, lpc11xx/, nuc1xx/, or samdl. You can take compatible drivers
from stm32, but the stm32f0 cannot live in the stm32/ directory.
Greg
Arjun Hary arjun@zglue.com [nuttx]
2017-03-16 16:30:48 UTC
Permalink
Can you tell us the options in the config file to disable the serial
console and NSH. We tried the options but still could not get it below 20K.
Post by Alan Carvalho de Assis ***@gmail.com [nuttx]
Hi Greg,
Disabling UART, Console and NSH and enabling the "hello world" example
$ arm-none-eabi-size nuttx
text data bss dec hex filename
12239 0 1084 13323 340b nuttx
Note that this small configuration disables important features, like pthreads.
$ arm-none-eabi-size nuttx
text data bss dec hex filename
12423 0 1084 13507 34c3 nuttx
$ arm-none-eabi-size nuttx
text data bss dec hex filename
14685 0 1180 15865 3df9 nuttx
$ arm-none-eabi-size nuttx
text data bss dec hex filename
15285 0 1232 16517 4085 nuttx
So that is it, NuttX still small.
BR,
Alan
Post by Alan Carvalho de Assis ***@gmail.com [nuttx]
Please find attached an example of a Minimum configuration for
STM32F103C8T6-Minimum board.
$ arm-none-eabi-size nuttx
text data bss dec hex filename
21545 80 1124 22749 58dd nuttx
That does include a serial console and the NSH shell application. I think
that Alan found that shrinks by about 4Kb if you remove NSH (and replace
it
with the NULL application). Is that right Alan?
If you don't need serial, you can disable that in the configuration and
would probably save a couple more Kb. I think that with no shell and no
serial console it could bet down to about 16Kb.
Greg
--
Arjun Hary
________________________________________
: +1 (425) 381-7722
: zGlue Inc., Mountain View, CA
________________________________________
Alan Carvalho de Assis acassis@gmail.com [nuttx]
2017-03-16 17:04:20 UTC
Permalink
Hi Arjun,

Basically you need to select/deselect these options:

System Type --->
STM32 Peripheral Support --->
[ ] USART1

[ ] Serial Driver Support ---

Application Configuration --->
[ ] NuttShell (NSH) example

Application Configuration --->
[*] "Hello, World!" example

Because the serial is disabled you will not see its output, you will
need to test it using a debugger or use a sample application to blink
a LED.

BR,

Alan
Post by Arjun Hary ***@zglue.com [nuttx]
Can you tell us the options in the config file to disable the serial
console and NSH. We tried the options but still could not get it below 20K.
Post by Alan Carvalho de Assis ***@gmail.com [nuttx]
Hi Greg,
Disabling UART, Console and NSH and enabling the "hello world" example
$ arm-none-eabi-size nuttx
text data bss dec hex filename
12239 0 1084 13323 340b nuttx
Note that this small configuration disables important features, like pthreads.
$ arm-none-eabi-size nuttx
text data bss dec hex filename
12423 0 1084 13507 34c3 nuttx
$ arm-none-eabi-size nuttx
text data bss dec hex filename
14685 0 1180 15865 3df9 nuttx
$ arm-none-eabi-size nuttx
text data bss dec hex filename
15285 0 1232 16517 4085 nuttx
So that is it, NuttX still small.
BR,
Alan
Post by Alan Carvalho de Assis ***@gmail.com [nuttx]
Please find attached an example of a Minimum configuration for
STM32F103C8T6-Minimum board.
$ arm-none-eabi-size nuttx
text data bss dec hex filename
21545 80 1124 22749 58dd nuttx
That does include a serial console and the NSH shell application. I think
that Alan found that shrinks by about 4Kb if you remove NSH (and replace
it
with the NULL application). Is that right Alan?
If you don't need serial, you can disable that in the configuration and
would probably save a couple more Kb. I think that with no shell and no
serial console it could bet down to about 16Kb.
Greg
--
Arjun Hary
________________________________________
: +1 (425) 381-7722
: zGlue Inc., Mountain View, CA
________________________________________
Brennan Ashton bashton@brennanashton.com [nuttx]
2017-03-15 23:38:30 UTC
Permalink
As much as I would like to see NuttX on this chip, I think you are going to
be fighting an uphill battle to get it working. I have made a couple
products with this chip, and the real benefit was the crazy low power usage
and how small of a package I could get the whole design in (entire product
was on a circular 8mm PCB). They do have a newer version of this chip
with integrated flash and more SRAM that would be a better target for NuttX
I think. Their SDK for that chip is based around FreeRTOS.

--Brennan
Post by Alan Carvalho de Assis ***@gmail.com [nuttx]
Post by Alan Carvalho de Assis ***@gmail.com [nuttx]
Please find attached an example of a Minimum configuration for
STM32F103C8T6-Minimum board.
Post by Alan Carvalho de Assis ***@gmail.com [nuttx]
$ arm-none-eabi-size nuttx
text data bss dec hex filename
21545 80 1124 22749 58dd nuttx
That does include a serial console and the NSH shell application. I think
that Alan found that shrinks by about 4Kb if you remove NSH (and replace it
with the NULL application). Is that right Alan?
If you don't need serial, you can disable that in the configuration and
would probably save a couple more Kb. I think that with no shell and no
serial console it could bet down to about 16Kb.
Greg
Alan Carvalho de Assis acassis@gmail.com [nuttx]
2017-03-18 15:59:46 UTC
Permalink
Hi Brennan,

Nice to hear from you again!

Do you have the Part-Number of this new device?

BR,

Alan
Post by Brennan Ashton ***@brennanashton.com [nuttx]
As much as I would like to see NuttX on this chip, I think you are going to
be fighting an uphill battle to get it working. I have made a couple
products with this chip, and the real benefit was the crazy low power usage
and how small of a package I could get the whole design in (entire product
was on a circular 8mm PCB). They do have a newer version of this chip
with integrated flash and more SRAM that would be a better target for NuttX
I think. Their SDK for that chip is based around FreeRTOS.
--Brennan
Post by Alan Carvalho de Assis ***@gmail.com [nuttx]
Post by Alan Carvalho de Assis ***@gmail.com [nuttx]
Please find attached an example of a Minimum configuration for
STM32F103C8T6-Minimum board.
Post by Alan Carvalho de Assis ***@gmail.com [nuttx]
$ arm-none-eabi-size nuttx
text data bss dec hex filename
21545 80 1124 22749 58dd nuttx
That does include a serial console and the NSH shell application. I think
that Alan found that shrinks by about 4Kb if you remove NSH (and replace it
with the NULL application). Is that right Alan?
If you don't need serial, you can disable that in the configuration and
would probably save a couple more Kb. I think that with no shell and no
serial console it could bet down to about 16Kb.
Greg
Alan Carvalho de Assis acassis@gmail.com [nuttx]
2017-03-15 19:53:37 UTC
Permalink
Hi Arjun,

As Mr. Greg said NuttX is very flexible, just like Linux. Then you can
configure it to have exactly what you want!

The complexity of configuration that Greg cited is because you can
disable some features that are needed by other subsystems or drivers.
Fortunately after the introduction of Kconfig frontend this issue was
reduced because when you select a subsystem or driver it automatically
will select other features it needs.

But something this dependence was not defined on Kconfig, then you
need to discover why some functions is missing and then enable the
resource that activates its compilation.

I don't know the footprint of nimBLE stack but 32KB of RAM is enough
for many "advanced" features of NuttX. For instance, in the video
tutorials on NuttX Channel I'm using the STM32F103 that has only 20KB
of RAM and even using SDCard support and FAT32 it used less than half
of it.

BR,

Alan
Post by Arjun Hary ***@zglue.com [nuttx]
Hi,
I am working as a firmware engineer in a startup based on IoT. We are
evaluating nuttx as a choice for an RTOS. The main reason we want to use it
is the POSIX compliance and also support for grahics and networking
libraries. I have a question on code size
I have read that the smallest footprint is around 20KB. I am trying to
understand what the 20KB includes. Does it include only the core kernel,
threading, synchronization, memory management etc. I am asking this for a
reason to support arm m0 type processors with 32KB RAM.
Also i am looking at evaluation bluetooth stacks particularly nimBLE stack
from apache mynewt. Is there a port of this available on nuttx
--
Arjun Hary
________________________________________
: +1 (425) 381-7722
: zGlue Inc., Mountain View, CA
________________________________________
yisrimark@gmail.com [nuttx]
2017-04-03 13:20:12 UTC
Permalink
No, there is no nimBLE port for NuttX, but it can be easily ported.
yisrimark@gmail.com [nuttx]
2017-04-03 13:20:58 UTC
Permalink
The memory footprint (20KB) includes both flash and RAM (I think). if you have 32KB ram, you likely have more flash. I use a MCU with 64KB ram and 128KB flash.
Loading...