Re: MYNEWT_VAL(...) invalid syntax ?

2019-01-09 Thread markus
Hi Fabio,

that gets me a bit further - although I'm not too excited about the
duplication between syscfg.yml and the linker script.

Anyway, further down the road I ran into an undefined function in the
linker:
stm32f3_flash_dev()

'turns out that got replaced with a global structure stm32_flash_dev -
however, the global structure is not in any header file while the
device specific (now non-existing) function declarations are still in
the stm32f*_bsp.h

I've adapted my bsp implementation accordingly so I can build it
successfully again.

Thanks for all the help,
Markus


On Wed, 09 Jan 2019 07:13:42 -0200
Fabio Utzig  wrote:

> Hi Markus,
> 
> You may need to update your BSP's `syscfg.yml`, check one included
> BSPs that has the same MCU that you're using for a complete list.
> Your particular failure is that your `syscfg.yml` is missing a
> "STM32_FLASH_SIZE_KB" entry.
> 
> Best,
> Fabio
> 
> On Wed, Jan 9, 2019, at 4:30 AM, markus wrote:
> > Hi Lukasz,
> > 
> > did manually build newt and run into some build failures:
> > 
> > .
> > Compiling repos/apache-mynewt-core/hw/mcu/stm/stm32_common/src/
> > hal_gpio.c
> > Error: In file included from
> > repos/apache-mynewt-core/kernel/os/include/ os/mynewt.h:23:0,
> >  from
> > repos/apache-mynewt-core/hw/mcu/stm/stm32_common/
> > src/hal_flash.c:21:
> > bin/targets/spi/generated/include/syscfg/syscfg.h:15:49: error:
> > 'MYNEWT_VAL_STM32_FLASH_SIZE_KB' undeclared here (not in a
> > function); did you mean 'MYNEWT_VAL_STM32_FLASH_IS_LINEAR'? #define
> > MYNEWT_VAL(x)   MYNEWT_VAL_ ## x ^
> > repos/apache-mynewt-core/hw/mcu/stm/stm32_common/src/hal_flash.c:30:30: 
> > note: in expansion of macro 'MYNEWT_VAL'
> >  #define _FLASH_SIZE (MYNEWT_VAL(STM32_FLASH_SIZE_KB) *
> > 1024) ^~
> > repos/apache-mynewt-core/hw/mcu/stm/stm32_common/src/hal_flash.c:64:16: 
> > note: in expansion of macro '_FLASH_SIZE'
> >  .hf_size = _FLASH_SIZE,
> > ^~~
> > 
> > Anything else I should be doing?
> > I also updated master again - just in case
> > * master   cb9ece042 hw/drivers/lps33thw: Restore
> > read error stats
> > 
> > Thanks again,
> > Markus
> > 
> > 
> > 
> > On Tue, 8 Jan 2019 07:05:11 +0100
> > Łukasz Rymanowski  wrote:
> >   
> > > Hi Markus,
> > > 
> > > If master is used on mynewt-core then master branch of newt tool
> > > should be used. Please try this and let us know of it works for
> > > you
> > > 
> > > Best
> > > Lukasz
> > > 
> > > 
> > > On Tue, Jan 8, 2019, 06:18 markus  > >   
> > > > 'been away for a few months and I can't build my projects
> > > > anymore. I updated repos/apache-mynewt-core to the latest
> > > > master branch (59912fc02) and it seems I'm running the latest
> > > > newt tool, 1.5.0
> > > >
> > > > Executing `newt build ...` gives me an error for each package in
> > > > apache-mynewt-core:
> > > >
> > > > * Warning: Parsing pkg @apache-mynewt-core/boot/boot_serial
> > > > config: strconv.ParseInt: parsing
> > > >   "MYNEWT_VAL(BOOT_SERIAL_SYSINIT_STAGE_MAIN)": invalid syntax;
> > > >   ignoring package.
> > > >
> > > >
> > > > I couldn't find anything in the release notes - any clues as to
> > > > what I'm doing wrong would be much appreciated.
> > > >
> > > > Thanks,
> > > > Markus
> > > >
> >   



Re: MYNEWT_VAL(...) invalid syntax ?

2019-01-09 Thread Fabio Utzig
Hi Markus,

You may need to update your BSP's `syscfg.yml`, check one included BSPs that 
has the same MCU that you're using for a complete list. Your particular failure 
is that your `syscfg.yml` is missing a "STM32_FLASH_SIZE_KB" entry.

Best,
Fabio

On Wed, Jan 9, 2019, at 4:30 AM, markus wrote:
> Hi Lukasz,
> 
> did manually build newt and run into some build failures:
> 
> .
> Compiling repos/apache-mynewt-core/hw/mcu/stm/stm32_common/src/
> hal_gpio.c
> Error: In file included from repos/apache-mynewt-core/kernel/os/include/
> os/mynewt.h:23:0,
>  from repos/apache-mynewt-core/hw/mcu/stm/stm32_common/
> src/hal_flash.c:21:
> bin/targets/spi/generated/include/syscfg/syscfg.h:15:49: error: 
> 'MYNEWT_VAL_STM32_FLASH_SIZE_KB' undeclared here (not in a function); 
> did you mean 'MYNEWT_VAL_STM32_FLASH_IS_LINEAR'?
>  #define MYNEWT_VAL(x)   MYNEWT_VAL_ ## x
>  ^
> repos/apache-mynewt-core/hw/mcu/stm/stm32_common/src/hal_flash.c:30:30: 
> note: in expansion of macro 'MYNEWT_VAL'
>  #define _FLASH_SIZE (MYNEWT_VAL(STM32_FLASH_SIZE_KB) * 1024)
>   ^~
> repos/apache-mynewt-core/hw/mcu/stm/stm32_common/src/hal_flash.c:64:16: 
> note: in expansion of macro '_FLASH_SIZE'
>  .hf_size = _FLASH_SIZE,
> ^~~
> 
> Anything else I should be doing?
> I also updated master again - just in case
> * master   cb9ece042 hw/drivers/lps33thw: Restore read 
> error stats
> 
> Thanks again,
> Markus
> 
> 
> 
> On Tue, 8 Jan 2019 07:05:11 +0100
> Łukasz Rymanowski  wrote:
> 
> > Hi Markus,
> > 
> > If master is used on mynewt-core then master branch of newt tool
> > should be used. Please try this and let us know of it works for you
> > 
> > Best
> > Lukasz
> > 
> > 
> > On Tue, Jan 8, 2019, 06:18 markus  > 
> > > 'been away for a few months and I can't build my projects anymore. I
> > > updated repos/apache-mynewt-core to the latest master branch
> > > (59912fc02) and it seems I'm running the latest newt tool, 1.5.0
> > >
> > > Executing `newt build ...` gives me an error for each package in
> > > apache-mynewt-core:
> > >
> > > * Warning: Parsing pkg @apache-mynewt-core/boot/boot_serial config:
> > >   strconv.ParseInt: parsing
> > >   "MYNEWT_VAL(BOOT_SERIAL_SYSINIT_STAGE_MAIN)": invalid syntax;
> > >   ignoring package.
> > >
> > >
> > > I couldn't find anything in the release notes - any clues as to what
> > > I'm doing wrong would be much appreciated.
> > >
> > > Thanks,
> > > Markus
> > >  
> 


Re: MYNEWT_VAL(...) invalid syntax ?

2019-01-08 Thread markus
Hi Lukasz,

did manually build newt and run into some build failures:

.
Compiling repos/apache-mynewt-core/hw/mcu/stm/stm32_common/src/hal_gpio.c
Error: In file included from 
repos/apache-mynewt-core/kernel/os/include/os/mynewt.h:23:0,
 from 
repos/apache-mynewt-core/hw/mcu/stm/stm32_common/src/hal_flash.c:21:
bin/targets/spi/generated/include/syscfg/syscfg.h:15:49: error: 
'MYNEWT_VAL_STM32_FLASH_SIZE_KB' undeclared here (not in a function); did you 
mean 'MYNEWT_VAL_STM32_FLASH_IS_LINEAR'?
 #define MYNEWT_VAL(x)   MYNEWT_VAL_ ## x
 ^
repos/apache-mynewt-core/hw/mcu/stm/stm32_common/src/hal_flash.c:30:30: note: 
in expansion of macro 'MYNEWT_VAL'
 #define _FLASH_SIZE (MYNEWT_VAL(STM32_FLASH_SIZE_KB) * 1024)
  ^~
repos/apache-mynewt-core/hw/mcu/stm/stm32_common/src/hal_flash.c:64:16: note: 
in expansion of macro '_FLASH_SIZE'
 .hf_size = _FLASH_SIZE,
^~~

Anything else I should be doing?
I also updated master again - just in case
* master   cb9ece042 hw/drivers/lps33thw: Restore read error 
stats

Thanks again,
Markus



On Tue, 8 Jan 2019 07:05:11 +0100
Łukasz Rymanowski  wrote:

> Hi Markus,
> 
> If master is used on mynewt-core then master branch of newt tool
> should be used. Please try this and let us know of it works for you
> 
> Best
> Lukasz
> 
> 
> On Tue, Jan 8, 2019, 06:18 markus  
> > 'been away for a few months and I can't build my projects anymore. I
> > updated repos/apache-mynewt-core to the latest master branch
> > (59912fc02) and it seems I'm running the latest newt tool, 1.5.0
> >
> > Executing `newt build ...` gives me an error for each package in
> > apache-mynewt-core:
> >
> > * Warning: Parsing pkg @apache-mynewt-core/boot/boot_serial config:
> >   strconv.ParseInt: parsing
> >   "MYNEWT_VAL(BOOT_SERIAL_SYSINIT_STAGE_MAIN)": invalid syntax;
> >   ignoring package.
> >
> >
> > I couldn't find anything in the release notes - any clues as to what
> > I'm doing wrong would be much appreciated.
> >
> > Thanks,
> > Markus
> >  



Re: MYNEWT_VAL(...) invalid syntax ?

2019-01-08 Thread markus
Great - thanks for the clarification, that makes sense.

Have fun,
Markus

On Tue, 8 Jan 2019 13:11:29 -0800
Christopher Collins  wrote:

> The next version of the newt tool will be backwards compatible with
> older Mynewt repos.  The latest versions of the Mynewt repos are
> taking advantage of a new newt feature (syscfg values in `pkg.yml`),
> so they do not work with older versions of newt.  If a repo does not
> use this new feature, then it will be compatible with both old and
> new versions of the newt tool.
> 
> Backwards compatiblity is important, and it is always bad when an
> upgrade breaks something.  This particular feature seemed important
> enough to introduce such breakage because it will actually help to
> maintain backwards compatibility in the future.  The feature allows
> Mynewt YAML files to switch their configuration based on the version
> of newt being used.  For example:
> 
> pkg.item.NEWT_FEATURE_FOO
> - ...
> 
> That item only gets processed if the newt tool injects the
> `NEWT_FEATURE_FOO` setting.  The item does not get processed with
> older versions of newt which do not support the `FOO` feature.  Older
> versions of newt could not process conditional items in most of the
> YAML files, so would always process the above item.
> 
> Chris
> 
> On Tue, Jan 08, 2019 at 11:23:58AM -0800, markus wrote:
> > Hey Chris,
> > 
> > that is understood and fine, the question and to some degree
> > concern is the other way around. Will the next version of the newt
> > tool be incompatible with all existing repositories?
> > 
> > I understand that apache-mynewt-core and all other mynewt managed
> > repositories don't have a problem with such a change. But what about
> > all the other repositories?
> > 
> > Thanks,
> > Markus
> > 
> > 
> > 
> > On Tue, 8 Jan 2019 10:29:24 -0800
> > Christopher Collins  wrote:
> >   
> > > Hi Markus,
> > > 
> > > On Tue, Jan 08, 2019 at 10:15:22AM -0800, markus wrote:  
> > > > Hi Lukasz,
> > > > 
> > > > got it, I guess I have to start building newt.
> > > > 
> > > > Follow up question: Does this mean the next release will break
> > > > all repositories out there or is backwards compatibility still
> > > > on the roadmap for this release?
> > > 
> > > The next mynewt release will only be compatible with the version
> > > of newt that is released at the same time.  An attempt to use an
> > > older newt with the newt repos will fail with instructions to
> > > upgrade newt.
> > > 
> > > Chris  
> >   



Re: MYNEWT_VAL(...) invalid syntax ?

2019-01-08 Thread Christopher Collins
The next version of the newt tool will be backwards compatible with
older Mynewt repos.  The latest versions of the Mynewt repos are taking
advantage of a new newt feature (syscfg values in `pkg.yml`), so they do
not work with older versions of newt.  If a repo does not use this new
feature, then it will be compatible with both old and new versions of
the newt tool.

Backwards compatiblity is important, and it is always bad when an
upgrade breaks something.  This particular feature seemed important
enough to introduce such breakage because it will actually help to
maintain backwards compatibility in the future.  The feature allows
Mynewt YAML files to switch their configuration based on the version of
newt being used.  For example:

pkg.item.NEWT_FEATURE_FOO
- ...

That item only gets processed if the newt tool injects the
`NEWT_FEATURE_FOO` setting.  The item does not get processed with older
versions of newt which do not support the `FOO` feature.  Older versions
of newt could not process conditional items in most of the YAML files,
so would always process the above item.

Chris

On Tue, Jan 08, 2019 at 11:23:58AM -0800, markus wrote:
> Hey Chris,
> 
> that is understood and fine, the question and to some degree concern is
> the other way around. Will the next version of the newt tool be
> incompatible with all existing repositories?
> 
> I understand that apache-mynewt-core and all other mynewt managed
> repositories don't have a problem with such a change. But what about
> all the other repositories?
> 
> Thanks,
> Markus
> 
> 
> 
> On Tue, 8 Jan 2019 10:29:24 -0800
> Christopher Collins  wrote:
> 
> > Hi Markus,
> > 
> > On Tue, Jan 08, 2019 at 10:15:22AM -0800, markus wrote:
> > > Hi Lukasz,
> > > 
> > > got it, I guess I have to start building newt.
> > > 
> > > Follow up question: Does this mean the next release will break all
> > > repositories out there or is backwards compatibility still on the
> > > roadmap for this release?  
> > 
> > The next mynewt release will only be compatible with the version of
> > newt that is released at the same time.  An attempt to use an older
> > newt with the newt repos will fail with instructions to upgrade newt.
> > 
> > Chris
> 


Re: MYNEWT_VAL(...) invalid syntax ?

2019-01-08 Thread markus
Hey Chris,

that is understood and fine, the question and to some degree concern is
the other way around. Will the next version of the newt tool be
incompatible with all existing repositories?

I understand that apache-mynewt-core and all other mynewt managed
repositories don't have a problem with such a change. But what about
all the other repositories?

Thanks,
Markus



On Tue, 8 Jan 2019 10:29:24 -0800
Christopher Collins  wrote:

> Hi Markus,
> 
> On Tue, Jan 08, 2019 at 10:15:22AM -0800, markus wrote:
> > Hi Lukasz,
> > 
> > got it, I guess I have to start building newt.
> > 
> > Follow up question: Does this mean the next release will break all
> > repositories out there or is backwards compatibility still on the
> > roadmap for this release?  
> 
> The next mynewt release will only be compatible with the version of
> newt that is released at the same time.  An attempt to use an older
> newt with the newt repos will fail with instructions to upgrade newt.
> 
> Chris



Re: MYNEWT_VAL(...) invalid syntax ?

2019-01-08 Thread Christopher Collins
Hi Markus,

On Tue, Jan 08, 2019 at 10:15:22AM -0800, markus wrote:
> Hi Lukasz,
> 
> got it, I guess I have to start building newt.
> 
> Follow up question: Does this mean the next release will break all
> repositories out there or is backwards compatibility still on the
> roadmap for this release?

The next mynewt release will only be compatible with the version of newt
that is released at the same time.  An attempt to use an older newt with
the newt repos will fail with instructions to upgrade newt.

Chris


Re: MYNEWT_VAL(...) invalid syntax ?

2019-01-08 Thread markus
Hi Lukasz,

got it, I guess I have to start building newt.

Follow up question: Does this mean the next release will break all
repositories out there or is backwards compatibility still on the
roadmap for this release?

Thanks,
Markus

On Tue, 8 Jan 2019 07:05:11 +0100
Łukasz Rymanowski  wrote:

> Hi Markus,
> 
> If master is used on mynewt-core then master branch of newt tool
> should be used. Please try this and let us know of it works for you
> 
> Best
> Lukasz
> 
> 
> On Tue, Jan 8, 2019, 06:18 markus  
> > 'been away for a few months and I can't build my projects anymore. I
> > updated repos/apache-mynewt-core to the latest master branch
> > (59912fc02) and it seems I'm running the latest newt tool, 1.5.0
> >
> > Executing `newt build ...` gives me an error for each package in
> > apache-mynewt-core:
> >
> > * Warning: Parsing pkg @apache-mynewt-core/boot/boot_serial config:
> >   strconv.ParseInt: parsing
> >   "MYNEWT_VAL(BOOT_SERIAL_SYSINIT_STAGE_MAIN)": invalid syntax;
> >   ignoring package.
> >
> >
> > I couldn't find anything in the release notes - any clues as to what
> > I'm doing wrong would be much appreciated.
> >
> > Thanks,
> > Markus
> >  



Re: MYNEWT_VAL(...) invalid syntax ?

2019-01-07 Thread Łukasz Rymanowski
Hi Markus,

If master is used on mynewt-core then master branch of newt tool should be
used. Please try this and let us know of it works for you

Best
Lukasz


On Tue, Jan 8, 2019, 06:18 markus  'been away for a few months and I can't build my projects anymore. I
> updated repos/apache-mynewt-core to the latest master branch (59912fc02)
> and it seems I'm running the latest newt tool, 1.5.0
>
> Executing `newt build ...` gives me an error for each package in
> apache-mynewt-core:
>
> * Warning: Parsing pkg @apache-mynewt-core/boot/boot_serial config:
>   strconv.ParseInt: parsing
>   "MYNEWT_VAL(BOOT_SERIAL_SYSINIT_STAGE_MAIN)": invalid syntax;
>   ignoring package.
>
>
> I couldn't find anything in the release notes - any clues as to what
> I'm doing wrong would be much appreciated.
>
> Thanks,
> Markus
>