You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by Jacob Rosenthal <ja...@gmail.com> on 2018/06/12 05:24:20 UTC
config id package usage
I dig the config id package for what it has available, but several things
puzzle me.
Obviously I can fork this and make all these changes for my project, but
just feeling out how people are using this.
I tend to think of the id package kind of replacing or being the source of
truth for Device Information service.
As such I feel like were missing a model/style and manufacturer name value
in here.
Also the serial puzzles me, Is anyone using this? It seems odd to me that
youd have user settable serial number.. Isnt it more likley wed burn a
serial into user registers on the micro? And on top of that its holding
64byte array by default empty.
What if we expose id/serial to the bsp definition like we do in say
nrf52_hw_id.c and let the user populate it however they like, most likely
from (in this nordic case) UICR->CUSTOMER
Re: config id package usage
Posted by Jacob Rosenthal <ja...@gmail.com>.
Or maybe sys/id is something like bsp you're supposed to be forking.
(though as discussed around here previously, not something most of us are
doing as it turns out)
On Sat, Jun 16, 2018 at 9:34 AM Jacob Rosenthal <ja...@gmail.com>
wrote:
> I think you're saying create a CONFIG_NVMC much like we have CONFIG_FCB
> and CONFIG_NFFS
>
> Looking more into the config system
> "Configuration items are stored as key-value pairs, where both the key and
> the value are expected to be strings"
>
> Im not sure strings and config are a good fit as at least on the nrf
> devices Im familiar with we have a total of 32 32bit registers.
>
> So I think its more likely well have to have custom functions at the
> bsp/mcu layer much like exsiting nrf52_hw_id.c and then something that
> registers those into strings dynamically into the id package (again like
> hw_id) rather than waste all the memory to duplicate the data as a string...
>
> Maybe the bsp/mcu itself can just register a config like "bsp/serial",
> "bsp/custom1" instead of us trying to infinitely extend the id package for
> custom nvmic functions
>
>
> On Tue, Jun 12, 2018 at 3:47 AM marko kiiskila <ma...@runtime.io> wrote:
>
>>
>>
>> > On Jun 12, 2018, at 8:24 AM, Jacob Rosenthal <ja...@gmail.com>
>> wrote:
>> >
>> > I dig the config id package for what it has available, but several
>> things
>> > puzzle me.
>> >
>> > Obviously I can fork this and make all these changes for my project, but
>> > just feeling out how people are using this.
>> >
>> > I tend to think of the id package kind of replacing or being the source
>> of
>> > truth for Device Information service.
>> >
>> > As such I feel like were missing a model/style and manufacturer name
>> value
>> > in here.
>>
>> I think that’s true, those are often used. It started with hwid, and as
>> people
>> don’t want to use that as device id for their stuff, then the serial
>> number.
>>
>> >
>> > Also the serial puzzles me, Is anyone using this? It seems odd to me
>> that
>> > youd have user settable serial number.. Isnt it more likley wed burn a
>> > serial into user registers on the micro? And on top of that its holding
>> > 64byte array by default empty.
>>
>> People are using it. Whether it takes space in RAM or not could be made
>> configurable though.
>>
>> What is missing is a more fine-grained access control,
>> which would allow people access to specific operations, e.g. allow
>> config read but prevent config writes. I would have needed this already,
>> but haven’t had time to think what it should look like :)
>>
>> Updating serial number makes no sense, but you need to be able to set
>> it at the factory.
>>
>> >
>> > What if we expose id/serial to the bsp definition like we do in say
>> > nrf52_hw_id.c and let the user populate it however they like, most
>> likely
>> > from (in this nordic case) UICR->CUSTOMER
>>
>> I would recommend writing a new backend to config, which reads data
>> from UICR. As you might’ve noticed, you can specify multiple sources
>> as a source of config. I have not verified that all the right APIs are
>> exposed
>> by the sys/config to allow config backend to live in a different package,
>> but the intent was that you’d be able to make part of config anywhere.
>> EEPROM has most often been brought up.
>>
>>
Re: config id package usage
Posted by Jacob Rosenthal <ja...@gmail.com>.
I hope were still saying the same thing, its going to be exactly
like hal_bsp_hw_id.
However in the default upstream BSPs how big 64 as it is now? 128 as most
uuids are. Is anyone using a serial generation platform of some kind that
uses a specific size serial and would weigh in here?
On Fri, Jun 22, 2018 at 10:30 AM marko kiiskila <ma...@runtime.io> wrote:
> I’m thinking maybe we’d just malloc() that thing, if it comes from
> sys/config. And allow it to be set by BSP, and add that model/mfg
> info. Following the same model with those ones.
>
> > On Jun 22, 2018, at 10:04 AM, Jacob Rosenthal <ja...@gmail.com>
> wrote:
> >
> > So now I think we just need to argue about the default serial size in the
> > upstream bsps. With something similar to chris's recent pr on hw_id_size
> > people can redefine size to whatever they want when they alter bsp, but
> > what should the default bsp size be? The existing id package is 64
> > chars. UUID's nowadays are 128bit, ie 4 of the 32bit uicr registers on a
> > nordic which I guess is what Id naively argue for. How are others doing
> > serials these days? Is there an existing proprietary/open backend for
> > serial generation that we could keep in mind? I saw that bitmark thing
> > recently.
> >
> >
> > On Mon, Jun 18, 2018 at 11:31 AM marko kiiskila <ma...@runtime.io>
> wrote:
> >
> >>
> >>
> >>> On Jun 16, 2018, at 9:34 AM, Jacob Rosenthal <ja...@gmail.com>
> >> wrote:
> >>>
> >>> I think you're saying create a CONFIG_NVMC much like we have CONFIG_FCB
> >> and
> >>> CONFIG_NFFS
> >>>
> >>> Looking more into the config system
> >>> "Configuration items are stored as key-value pairs, where both the key
> >> and
> >>> the value are expected to be strings"
> >>>
> >>> Im not sure strings and config are a good fit as at least on the nrf
> >>> devices Im familiar with we have a total of 32 32bit registers.
> >>
> >> You would not store the key as in it’s full there, just a short key
> (which
> >> then would be expanded), followed by value.
> >>
> >> However, that’s probably too custom of a thing to make a good fit here.
> >>
> >>> So I think its more likely well have to have custom functions at the
> >>> bsp/mcu layer much like exsiting nrf52_hw_id.c and then something that
> >>> registers those into strings dynamically into the id package (again
> like
> >>> hw_id) rather than waste all the memory to duplicate the data as a
> >> string…
> >>
> >> Yeah, I think that would be better. We could allow that data to be
> filled
> >> in
> >> from BSP code (or wherever). And we should add that model & mfg
> >> pointers as well. This would be an improvement.
> >>
> >>> Maybe the bsp/mcu itself can just register a config like "bsp/serial",
> >>> "bsp/custom1" instead of us trying to infinitely extend the id package
> >> for
> >>> custom nvmic functions
> >>
> >> That, while possible, I would not use. I want to find the identifying
> >> pieces
> >> of info from the same place, regardless of BSP/MCU combo.
> >>
> >>>
> >>>
> >>> On Tue, Jun 12, 2018 at 3:47 AM marko kiiskila <ma...@runtime.io>
> wrote:
> >>>
> >>>>
> >>>>
> >>>>> On Jun 12, 2018, at 8:24 AM, Jacob Rosenthal <
> jakerosenthal@gmail.com>
> >>>> wrote:
> >>>>>
> >>>>> I dig the config id package for what it has available, but several
> >> things
> >>>>> puzzle me.
> >>>>>
> >>>>> Obviously I can fork this and make all these changes for my project,
> >> but
> >>>>> just feeling out how people are using this.
> >>>>>
> >>>>> I tend to think of the id package kind of replacing or being the
> source
> >>>> of
> >>>>> truth for Device Information service.
> >>>>>
> >>>>> As such I feel like were missing a model/style and manufacturer name
> >>>> value
> >>>>> in here.
> >>>>
> >>>> I think that’s true, those are often used. It started with hwid, and
> as
> >>>> people
> >>>> don’t want to use that as device id for their stuff, then the serial
> >>>> number.
> >>>>
> >>>>>
> >>>>> Also the serial puzzles me, Is anyone using this? It seems odd to me
> >> that
> >>>>> youd have user settable serial number.. Isnt it more likley wed
> burn a
> >>>>> serial into user registers on the micro? And on top of that its
> holding
> >>>>> 64byte array by default empty.
> >>>>
> >>>> People are using it. Whether it takes space in RAM or not could be
> made
> >>>> configurable though.
> >>>>
> >>>> What is missing is a more fine-grained access control,
> >>>> which would allow people access to specific operations, e.g. allow
> >>>> config read but prevent config writes. I would have needed this
> already,
> >>>> but haven’t had time to think what it should look like :)
> >>>>
> >>>> Updating serial number makes no sense, but you need to be able to set
> >>>> it at the factory.
> >>>>
> >>>>>
> >>>>> What if we expose id/serial to the bsp definition like we do in say
> >>>>> nrf52_hw_id.c and let the user populate it however they like, most
> >> likely
> >>>>> from (in this nordic case) UICR->CUSTOMER
> >>>>
> >>>> I would recommend writing a new backend to config, which reads data
> >>>> from UICR. As you might’ve noticed, you can specify multiple sources
> >>>> as a source of config. I have not verified that all the right APIs are
> >>>> exposed
> >>>> by the sys/config to allow config backend to live in a different
> >> package,
> >>>> but the intent was that you’d be able to make part of config anywhere.
> >>>> EEPROM has most often been brought up.
> >>>>
> >>>>
> >>
> >>
>
>
Re: config id package usage
Posted by marko kiiskila <ma...@runtime.io>.
I’m thinking maybe we’d just malloc() that thing, if it comes from
sys/config. And allow it to be set by BSP, and add that model/mfg
info. Following the same model with those ones.
> On Jun 22, 2018, at 10:04 AM, Jacob Rosenthal <ja...@gmail.com> wrote:
>
> So now I think we just need to argue about the default serial size in the
> upstream bsps. With something similar to chris's recent pr on hw_id_size
> people can redefine size to whatever they want when they alter bsp, but
> what should the default bsp size be? The existing id package is 64
> chars. UUID's nowadays are 128bit, ie 4 of the 32bit uicr registers on a
> nordic which I guess is what Id naively argue for. How are others doing
> serials these days? Is there an existing proprietary/open backend for
> serial generation that we could keep in mind? I saw that bitmark thing
> recently.
>
>
> On Mon, Jun 18, 2018 at 11:31 AM marko kiiskila <ma...@runtime.io> wrote:
>
>>
>>
>>> On Jun 16, 2018, at 9:34 AM, Jacob Rosenthal <ja...@gmail.com>
>> wrote:
>>>
>>> I think you're saying create a CONFIG_NVMC much like we have CONFIG_FCB
>> and
>>> CONFIG_NFFS
>>>
>>> Looking more into the config system
>>> "Configuration items are stored as key-value pairs, where both the key
>> and
>>> the value are expected to be strings"
>>>
>>> Im not sure strings and config are a good fit as at least on the nrf
>>> devices Im familiar with we have a total of 32 32bit registers.
>>
>> You would not store the key as in it’s full there, just a short key (which
>> then would be expanded), followed by value.
>>
>> However, that’s probably too custom of a thing to make a good fit here.
>>
>>> So I think its more likely well have to have custom functions at the
>>> bsp/mcu layer much like exsiting nrf52_hw_id.c and then something that
>>> registers those into strings dynamically into the id package (again like
>>> hw_id) rather than waste all the memory to duplicate the data as a
>> string…
>>
>> Yeah, I think that would be better. We could allow that data to be filled
>> in
>> from BSP code (or wherever). And we should add that model & mfg
>> pointers as well. This would be an improvement.
>>
>>> Maybe the bsp/mcu itself can just register a config like "bsp/serial",
>>> "bsp/custom1" instead of us trying to infinitely extend the id package
>> for
>>> custom nvmic functions
>>
>> That, while possible, I would not use. I want to find the identifying
>> pieces
>> of info from the same place, regardless of BSP/MCU combo.
>>
>>>
>>>
>>> On Tue, Jun 12, 2018 at 3:47 AM marko kiiskila <ma...@runtime.io> wrote:
>>>
>>>>
>>>>
>>>>> On Jun 12, 2018, at 8:24 AM, Jacob Rosenthal <ja...@gmail.com>
>>>> wrote:
>>>>>
>>>>> I dig the config id package for what it has available, but several
>> things
>>>>> puzzle me.
>>>>>
>>>>> Obviously I can fork this and make all these changes for my project,
>> but
>>>>> just feeling out how people are using this.
>>>>>
>>>>> I tend to think of the id package kind of replacing or being the source
>>>> of
>>>>> truth for Device Information service.
>>>>>
>>>>> As such I feel like were missing a model/style and manufacturer name
>>>> value
>>>>> in here.
>>>>
>>>> I think that’s true, those are often used. It started with hwid, and as
>>>> people
>>>> don’t want to use that as device id for their stuff, then the serial
>>>> number.
>>>>
>>>>>
>>>>> Also the serial puzzles me, Is anyone using this? It seems odd to me
>> that
>>>>> youd have user settable serial number.. Isnt it more likley wed burn a
>>>>> serial into user registers on the micro? And on top of that its holding
>>>>> 64byte array by default empty.
>>>>
>>>> People are using it. Whether it takes space in RAM or not could be made
>>>> configurable though.
>>>>
>>>> What is missing is a more fine-grained access control,
>>>> which would allow people access to specific operations, e.g. allow
>>>> config read but prevent config writes. I would have needed this already,
>>>> but haven’t had time to think what it should look like :)
>>>>
>>>> Updating serial number makes no sense, but you need to be able to set
>>>> it at the factory.
>>>>
>>>>>
>>>>> What if we expose id/serial to the bsp definition like we do in say
>>>>> nrf52_hw_id.c and let the user populate it however they like, most
>> likely
>>>>> from (in this nordic case) UICR->CUSTOMER
>>>>
>>>> I would recommend writing a new backend to config, which reads data
>>>> from UICR. As you might’ve noticed, you can specify multiple sources
>>>> as a source of config. I have not verified that all the right APIs are
>>>> exposed
>>>> by the sys/config to allow config backend to live in a different
>> package,
>>>> but the intent was that you’d be able to make part of config anywhere.
>>>> EEPROM has most often been brought up.
>>>>
>>>>
>>
>>
Re: config id package usage
Posted by Jacob Rosenthal <ja...@gmail.com>.
So now I think we just need to argue about the default serial size in the
upstream bsps. With something similar to chris's recent pr on hw_id_size
people can redefine size to whatever they want when they alter bsp, but
what should the default bsp size be? The existing id package is 64
chars. UUID's nowadays are 128bit, ie 4 of the 32bit uicr registers on a
nordic which I guess is what Id naively argue for. How are others doing
serials these days? Is there an existing proprietary/open backend for
serial generation that we could keep in mind? I saw that bitmark thing
recently.
On Mon, Jun 18, 2018 at 11:31 AM marko kiiskila <ma...@runtime.io> wrote:
>
>
> > On Jun 16, 2018, at 9:34 AM, Jacob Rosenthal <ja...@gmail.com>
> wrote:
> >
> > I think you're saying create a CONFIG_NVMC much like we have CONFIG_FCB
> and
> > CONFIG_NFFS
> >
> > Looking more into the config system
> > "Configuration items are stored as key-value pairs, where both the key
> and
> > the value are expected to be strings"
> >
> > Im not sure strings and config are a good fit as at least on the nrf
> > devices Im familiar with we have a total of 32 32bit registers.
>
> You would not store the key as in it’s full there, just a short key (which
> then would be expanded), followed by value.
>
> However, that’s probably too custom of a thing to make a good fit here.
>
> > So I think its more likely well have to have custom functions at the
> > bsp/mcu layer much like exsiting nrf52_hw_id.c and then something that
> > registers those into strings dynamically into the id package (again like
> > hw_id) rather than waste all the memory to duplicate the data as a
> string…
>
> Yeah, I think that would be better. We could allow that data to be filled
> in
> from BSP code (or wherever). And we should add that model & mfg
> pointers as well. This would be an improvement.
>
> > Maybe the bsp/mcu itself can just register a config like "bsp/serial",
> > "bsp/custom1" instead of us trying to infinitely extend the id package
> for
> > custom nvmic functions
>
> That, while possible, I would not use. I want to find the identifying
> pieces
> of info from the same place, regardless of BSP/MCU combo.
>
> >
> >
> > On Tue, Jun 12, 2018 at 3:47 AM marko kiiskila <ma...@runtime.io> wrote:
> >
> >>
> >>
> >>> On Jun 12, 2018, at 8:24 AM, Jacob Rosenthal <ja...@gmail.com>
> >> wrote:
> >>>
> >>> I dig the config id package for what it has available, but several
> things
> >>> puzzle me.
> >>>
> >>> Obviously I can fork this and make all these changes for my project,
> but
> >>> just feeling out how people are using this.
> >>>
> >>> I tend to think of the id package kind of replacing or being the source
> >> of
> >>> truth for Device Information service.
> >>>
> >>> As such I feel like were missing a model/style and manufacturer name
> >> value
> >>> in here.
> >>
> >> I think that’s true, those are often used. It started with hwid, and as
> >> people
> >> don’t want to use that as device id for their stuff, then the serial
> >> number.
> >>
> >>>
> >>> Also the serial puzzles me, Is anyone using this? It seems odd to me
> that
> >>> youd have user settable serial number.. Isnt it more likley wed burn a
> >>> serial into user registers on the micro? And on top of that its holding
> >>> 64byte array by default empty.
> >>
> >> People are using it. Whether it takes space in RAM or not could be made
> >> configurable though.
> >>
> >> What is missing is a more fine-grained access control,
> >> which would allow people access to specific operations, e.g. allow
> >> config read but prevent config writes. I would have needed this already,
> >> but haven’t had time to think what it should look like :)
> >>
> >> Updating serial number makes no sense, but you need to be able to set
> >> it at the factory.
> >>
> >>>
> >>> What if we expose id/serial to the bsp definition like we do in say
> >>> nrf52_hw_id.c and let the user populate it however they like, most
> likely
> >>> from (in this nordic case) UICR->CUSTOMER
> >>
> >> I would recommend writing a new backend to config, which reads data
> >> from UICR. As you might’ve noticed, you can specify multiple sources
> >> as a source of config. I have not verified that all the right APIs are
> >> exposed
> >> by the sys/config to allow config backend to live in a different
> package,
> >> but the intent was that you’d be able to make part of config anywhere.
> >> EEPROM has most often been brought up.
> >>
> >>
>
>
Re: config id package usage
Posted by marko kiiskila <ma...@runtime.io>.
> On Jun 16, 2018, at 9:34 AM, Jacob Rosenthal <ja...@gmail.com> wrote:
>
> I think you're saying create a CONFIG_NVMC much like we have CONFIG_FCB and
> CONFIG_NFFS
>
> Looking more into the config system
> "Configuration items are stored as key-value pairs, where both the key and
> the value are expected to be strings"
>
> Im not sure strings and config are a good fit as at least on the nrf
> devices Im familiar with we have a total of 32 32bit registers.
You would not store the key as in it’s full there, just a short key (which
then would be expanded), followed by value.
However, that’s probably too custom of a thing to make a good fit here.
> So I think its more likely well have to have custom functions at the
> bsp/mcu layer much like exsiting nrf52_hw_id.c and then something that
> registers those into strings dynamically into the id package (again like
> hw_id) rather than waste all the memory to duplicate the data as a string…
Yeah, I think that would be better. We could allow that data to be filled in
from BSP code (or wherever). And we should add that model & mfg
pointers as well. This would be an improvement.
> Maybe the bsp/mcu itself can just register a config like "bsp/serial",
> "bsp/custom1" instead of us trying to infinitely extend the id package for
> custom nvmic functions
That, while possible, I would not use. I want to find the identifying pieces
of info from the same place, regardless of BSP/MCU combo.
>
>
> On Tue, Jun 12, 2018 at 3:47 AM marko kiiskila <ma...@runtime.io> wrote:
>
>>
>>
>>> On Jun 12, 2018, at 8:24 AM, Jacob Rosenthal <ja...@gmail.com>
>> wrote:
>>>
>>> I dig the config id package for what it has available, but several things
>>> puzzle me.
>>>
>>> Obviously I can fork this and make all these changes for my project, but
>>> just feeling out how people are using this.
>>>
>>> I tend to think of the id package kind of replacing or being the source
>> of
>>> truth for Device Information service.
>>>
>>> As such I feel like were missing a model/style and manufacturer name
>> value
>>> in here.
>>
>> I think that’s true, those are often used. It started with hwid, and as
>> people
>> don’t want to use that as device id for their stuff, then the serial
>> number.
>>
>>>
>>> Also the serial puzzles me, Is anyone using this? It seems odd to me that
>>> youd have user settable serial number.. Isnt it more likley wed burn a
>>> serial into user registers on the micro? And on top of that its holding
>>> 64byte array by default empty.
>>
>> People are using it. Whether it takes space in RAM or not could be made
>> configurable though.
>>
>> What is missing is a more fine-grained access control,
>> which would allow people access to specific operations, e.g. allow
>> config read but prevent config writes. I would have needed this already,
>> but haven’t had time to think what it should look like :)
>>
>> Updating serial number makes no sense, but you need to be able to set
>> it at the factory.
>>
>>>
>>> What if we expose id/serial to the bsp definition like we do in say
>>> nrf52_hw_id.c and let the user populate it however they like, most likely
>>> from (in this nordic case) UICR->CUSTOMER
>>
>> I would recommend writing a new backend to config, which reads data
>> from UICR. As you might’ve noticed, you can specify multiple sources
>> as a source of config. I have not verified that all the right APIs are
>> exposed
>> by the sys/config to allow config backend to live in a different package,
>> but the intent was that you’d be able to make part of config anywhere.
>> EEPROM has most often been brought up.
>>
>>
Re: nvic settings failing
Posted by Fabio Utzig <ut...@apache.org>.
Hi Jan,
We set all but a few IRQ handlers to "os_default_irq_asm" on initialization. What you have to do is to set your handler with:
NVIC_SetVector(DMA2_Stream0_IRQn, (uint32_t)DMA2_Stream0_IRQHandler);
NVIC_EnableVector(DMA2_Stream0_IRQn);
PS: No need to use the "HAL_" macros from STM32Cube for this...
Best,
Fabio
On Mon, Jun 18, 2018, at 5:04 AM, Jan Clement wrote:
> Hello to you All,
>
> I am new to mynewt and the ARM world as you would figure out by my
> question.. I have a strong background in the 8-bit world where problems
> tend to be easier..
>
> I am working on a STM32f756 were I need to enable quite a lot of DMA
> streams and also other peripheral functions (i.e. usb) I can't find yet
> in mynewt code.
>
> I really like the mynewt concept and would love to use it for my
> application, a multimedia device with a touch tft, eth and wlan module.
>
> So my question is, would it be able for me to use the mynewt kernel for
> the running system (tasks, console, fs, update) but configure and access
> the devices and the interrupts without using the API?
>
> I did this when i tried to configure DMA for use with ADC1, but when I
> write the NVIC register using HAL_NVIC_EnableIRQ(...) this crashes my
> code, printing an "Unhandled interrupt (72)" to the console. When I
> comment out the enable function, the system doesn't crash, but obviously
> DMA is not working either.
>
> I have the corresponding IRQ function in my code:
> void DMA2_Stream0_IRQHandler(void)
>
> but it never gets called, system crashes immediately after activating DMA.
>
>
> Any pointer in the right direction is highly appreciated!
>
> Thank you very much
>
> jan
>
>
nvic settings failing
Posted by Jan Clement <Ja...@cm-electronics.de>.
Hello to you All,
I am new to mynewt and the ARM world as you would figure out by my
question.. I have a strong background in the 8-bit world where problems
tend to be easier..
I am working on a STM32f756 were I need to enable quite a lot of DMA
streams and also other peripheral functions (i.e. usb) I can't find yet
in mynewt code.
I really like the mynewt concept and would love to use it for my
application, a multimedia device with a touch tft, eth and wlan module.
So my question is, would it be able for me to use the mynewt kernel for
the running system (tasks, console, fs, update) but configure and access
the devices and the interrupts without using the API?
I did this when i tried to configure DMA for use with ADC1, but when I
write the NVIC register using HAL_NVIC_EnableIRQ(...) this crashes my
code, printing an "Unhandled interrupt (72)" to the console. When I
comment out the enable function, the system doesn't crash, but obviously
DMA is not working either.
I have the corresponding IRQ function in my code:
void DMA2_Stream0_IRQHandler(void)
but it never gets called, system crashes immediately after activating DMA.
Any pointer in the right direction is highly appreciated!
Thank you very much
jan
Re: config id package usage
Posted by Jacob Rosenthal <ja...@gmail.com>.
I think you're saying create a CONFIG_NVMC much like we have CONFIG_FCB and
CONFIG_NFFS
Looking more into the config system
"Configuration items are stored as key-value pairs, where both the key and
the value are expected to be strings"
Im not sure strings and config are a good fit as at least on the nrf
devices Im familiar with we have a total of 32 32bit registers.
So I think its more likely well have to have custom functions at the
bsp/mcu layer much like exsiting nrf52_hw_id.c and then something that
registers those into strings dynamically into the id package (again like
hw_id) rather than waste all the memory to duplicate the data as a string...
Maybe the bsp/mcu itself can just register a config like "bsp/serial",
"bsp/custom1" instead of us trying to infinitely extend the id package for
custom nvmic functions
On Tue, Jun 12, 2018 at 3:47 AM marko kiiskila <ma...@runtime.io> wrote:
>
>
> > On Jun 12, 2018, at 8:24 AM, Jacob Rosenthal <ja...@gmail.com>
> wrote:
> >
> > I dig the config id package for what it has available, but several things
> > puzzle me.
> >
> > Obviously I can fork this and make all these changes for my project, but
> > just feeling out how people are using this.
> >
> > I tend to think of the id package kind of replacing or being the source
> of
> > truth for Device Information service.
> >
> > As such I feel like were missing a model/style and manufacturer name
> value
> > in here.
>
> I think that’s true, those are often used. It started with hwid, and as
> people
> don’t want to use that as device id for their stuff, then the serial
> number.
>
> >
> > Also the serial puzzles me, Is anyone using this? It seems odd to me that
> > youd have user settable serial number.. Isnt it more likley wed burn a
> > serial into user registers on the micro? And on top of that its holding
> > 64byte array by default empty.
>
> People are using it. Whether it takes space in RAM or not could be made
> configurable though.
>
> What is missing is a more fine-grained access control,
> which would allow people access to specific operations, e.g. allow
> config read but prevent config writes. I would have needed this already,
> but haven’t had time to think what it should look like :)
>
> Updating serial number makes no sense, but you need to be able to set
> it at the factory.
>
> >
> > What if we expose id/serial to the bsp definition like we do in say
> > nrf52_hw_id.c and let the user populate it however they like, most likely
> > from (in this nordic case) UICR->CUSTOMER
>
> I would recommend writing a new backend to config, which reads data
> from UICR. As you might’ve noticed, you can specify multiple sources
> as a source of config. I have not verified that all the right APIs are
> exposed
> by the sys/config to allow config backend to live in a different package,
> but the intent was that you’d be able to make part of config anywhere.
> EEPROM has most often been brought up.
>
>
Re: config id package usage
Posted by marko kiiskila <ma...@runtime.io>.
> On Jun 12, 2018, at 8:24 AM, Jacob Rosenthal <ja...@gmail.com> wrote:
>
> I dig the config id package for what it has available, but several things
> puzzle me.
>
> Obviously I can fork this and make all these changes for my project, but
> just feeling out how people are using this.
>
> I tend to think of the id package kind of replacing or being the source of
> truth for Device Information service.
>
> As such I feel like were missing a model/style and manufacturer name value
> in here.
I think that’s true, those are often used. It started with hwid, and as people
don’t want to use that as device id for their stuff, then the serial number.
>
> Also the serial puzzles me, Is anyone using this? It seems odd to me that
> youd have user settable serial number.. Isnt it more likley wed burn a
> serial into user registers on the micro? And on top of that its holding
> 64byte array by default empty.
People are using it. Whether it takes space in RAM or not could be made
configurable though.
What is missing is a more fine-grained access control,
which would allow people access to specific operations, e.g. allow
config read but prevent config writes. I would have needed this already,
but haven’t had time to think what it should look like :)
Updating serial number makes no sense, but you need to be able to set
it at the factory.
>
> What if we expose id/serial to the bsp definition like we do in say
> nrf52_hw_id.c and let the user populate it however they like, most likely
> from (in this nordic case) UICR->CUSTOMER
I would recommend writing a new backend to config, which reads data
from UICR. As you might’ve noticed, you can specify multiple sources
as a source of config. I have not verified that all the right APIs are exposed
by the sys/config to allow config backend to live in a different package,
but the intent was that you’d be able to make part of config anywhere.
EEPROM has most often been brought up.