It seems really strange to me that the output file of a code generator tool is 
something that would be within the scope of a license of the SVD file itself. 
If I were to write that same output myself by hand what would be different? 
Anyway, we can look further into the validity of that licensing restriction 
before using it.

Regarding bitfields, it is indeed possible since they are part of the SVD 
files. I just haven't worked on that yet. I will look into it.

Best,
Matias

On Fri, Jul 3, 2020, at 19:35, Adam Feuer wrote:
> Brennan,
> 
> Ah, I see. The data files all have their own individual licenses, yes, some
> are not open source. Ugh.
> 
> Yeah, I wouldn't use a tool to generate it unless the data file was using a
> compatible license...
> 
> -adam
> 
> On Fri, Jul 3, 2020 at 3:30 PM Brennan Ashton <bash...@brennanashton.com>
> wrote:
> 
> > They are not all Apache 2.0. The NXP ones are a mixed bag, some call
> > out BSD, some just liability disclaimer, looks like the example I gave
> > was not the best one.
> >
> > For STM this file is restricted in a way that is not compatible.
> > Personally I think that is a mistake on the part of STM, but here we
> > are...
> >
> > https://raw.githubusercontent.com/posborne/cmsis-svd/master/data/STMicro/License.html
> >
> > TI is another example with further restrictions.
> >
> > https://github.com/posborne/cmsis-svd/blob/master/data/TexasInstruments/TM4C123GH6ZRB.svd
> >
> > --Brennan
> >
> > On Fri, Jul 3, 2020 at 3:19 PM Adam Feuer <a...@starcat.io> wrote:
> > >
> > > Brennan,
> > >
> > > All the files in this repo are Apache 2.0 licensed:
> > >
> > > https://github.com/posborne/cmsis-svd/blob/master/LICENSE-APACHE
> > >
> > > Doesn't that cover the license issue? The header is only a liability
> > > disclaimer.
> > >
> > > -adam
> > >
> > >
> > >
> > > On Fri, Jul 3, 2020 at 2:25 PM Brennan Ashton <bash...@brennanashton.com
> > >
> > > wrote:
> > >
> > > > Just a warning on generating code from these files. Many of the have
> > > > explicit restrictions on using them which may not be compatible with
> > BSD or
> > > > Apache. For example NXP
> > > >
> > https://github.com/posborne/cmsis-svd/blob/master/data/NXP/LPC1102_4_v4.svd
> > > >
> > > > I'm not sure on the legal side about this but it is why I have avoiding
> > > > using them to generate headers. Maybe Apache Legal could give us
> > guidance.
> > > >
> > > > --Brennan
> > > >
> > > > On Fri, Jul 3, 2020, 1:45 PM Matias N. <mat...@imap.cc> wrote:
> > > >
> > > > > Hi,
> > > > > I thought about doing this for a long time and I just did it, wasn't
> > > > > really hard.
> > > > > If you're not aware, CMSIS-SVD file format is an XML based
> > definitions of
> > > > > peripherals and registers available in a given MCU. This is typically
> > > > used
> > > > > for debugging but it is quite useful for generating header
> > definitions. I
> > > > > wrote a quick python script that is able to generate register
> > definitions
> > > > > and base addresses of peripherals. It is based on
> > > > > https://github.com/posborne/cmsis-svd which includes both the SVD
> > python
> > > > > parser and a really complete database of SVD files.
> > > > > The tool is available here: https://gitlab.com/nuttx_projects/svdgen
> > (be
> > > > > sure to check the README on how to use)
> > > > >
> > > > > Example output (the console output properly tabulates data, format
> > may
> > > > > look broken in the email):
> > > > >
> > > > > Generate memory map:
> > > > > $ ./gen.py -v Nordic -d nrf51 -p map -x NRF51
> > > > >
> > > > > #define NRF51_POWER_BASE 0x40000000 /* Power Control.*/
> > > > > #define NRF51_CLOCK_BASE 0x40000000 /* Clock control.*/
> > > > > #define NRF51_MPU_BASE 0x40000000 /* Memory Protection Unit.*/
> > > > > #define NRF51_AMLI_BASE 0x40000000 /* AHB Multi-Layer Interface.*/
> > > > > ... etc
> > > > >
> > > > > Register definitions:
> > > > > $ ./gen.py -v Nordic -d nrf51 -p RADIO -x NRF51
> > > > >
> > > > > /* Register offsets
> > > > > *********************************************************/
> > > > >
> > > > > #define NRF51_RADIO_TASKS_TXEN_OFFSET 0x000000 /* Enable radio in TX
> > > > > mode.*/
> > > > > #define NRF51_RADIO_TASKS_RXEN_OFFSET 0x000004 /* Enable radio in RX
> > > > > mode.*/
> > > > > #define NRF51_RADIO_TASKS_START_OFFSET 0x000008 /* Start radio.*/
> > > > > #define NRF51_RADIO_TASKS_STOP_OFFSET 0x00000c /* Stop radio.*/
> > > > > #define NRF51_RADIO_TASKS_DISABLE_OFFSET 0x000010 /* Disable radio.*/
> > > > > ... etc
> > > > >
> > > > > /* Register definitions
> > > > > *****************************************************/
> > > > >
> > > > > #define NRF51_RADIO_TASKS_TXEN (NRF51_RADIO_BASE +
> > > > > NRF51_RADIO_TASKS_TXEN_OFFSET)
> > > > > #define NRF51_RADIO_TASKS_RXEN (NRF51_RADIO_BASE +
> > > > > NRF51_RADIO_TASKS_RXEN_OFFSET)
> > > > > #define NRF51_RADIO_TASKS_START (NRF51_RADIO_BASE +
> > > > > NRF51_RADIO_TASKS_START_OFFSET)
> > > > > #define NRF51_RADIO_TASKS_STOP (NRF51_RADIO_BASE +
> > > > > NRF51_RADIO_TASKS_STOP_OFFSET)
> > > > > #define NRF51_RADIO_TASKS_DISABLE (NRF51_RADIO_BASE +
> > > > > NRF51_RADIO_TASKS_DISABLE_OFFSET)
> > > > > #define NRF51_RADIO_TASKS_RSSISTART (NRF51_RADIO_BASE +
> > > > > NRF51_RADIO_TASKS_RSSISTART_OFFSET)
> > > > > #define NRF51_RADIO_TASKS_RSSISTOP (NRF51_RADIO_BASE +
> > > > > NRF51_RADIO_TASKS_RSSISTOP_OFFSET)
> > > > > ... etc
> > > > >
> > > > > Best,
> > > > > Matias
> > > >
> > >
> > >
> > > --
> > > Adam Feuer <a...@starcat.io>
> >
> 
> 
> -- 
> Adam Feuer <a...@starcat.io>
> 

Reply via email to