Re: newt upgrade (install, sync) fails on mcuboot repo

2019-10-17 Thread Christopher Collins
On Thu, Oct 17, 2019 at 10:16:22AM -0700, Christopher Collins wrote:
> I couldn't think of a good general solution to this problem (if anyone
> else can, please share!).  Unless I'm missing something, I think I would
> call this a git bug, so I am going to report it to the git maintainers
> if it hasn't already been reported. 

I reported the bug here:
https://public-inbox.org/git/20191017230751.gc4...@pseudoephedrine.nightmare-heaven.no-ip.biz/T/#u

Chris


Re: newt upgrade (install, sync) fails on mcuboot repo

2019-10-17 Thread Christopher Collins
On Thu, Oct 17, 2019 at 07:51:07AM +0200, Szymon Janc wrote:
> Hello,
> 
> Due to recent changes in mcuboot git (use of submodules) you may hit issues 
> with newt upgrade|install|sync commands. There is a short term hotfix merged 
> into newt master to workaround this.
> 
> Since this is also affecting new users we may need to release newt
> 1.7.1 (only newt tool) in next few days to address this issue.

Thanks Szymon.  This is indeed a bummer.

To add a few details, mcuboot replaced a regular directory with a
submodule (ext/mbedtls).  This was done with two separate commits:
1. Rename (regular directory) `ext/mbedtls` --> `ext/mbedtls-asn1`
2. Add submodule `ext/mbedtls`

Git reports an error when you use `git checkout` to "jump over" these
two commits.  If you try going from post- to pre-, git reports the
following error and aborts the operation:

The following untracked working tree files would be overwritten by
checkout:
ext/mbedtls/include/mbedtls/asn1.h
ext/mbedtls/include/mbedtls/bignum.h
ext/mbedtls/include/mbedtls/check_config.h
ext/mbedtls/include/mbedtls/config.h
ext/mbedtls/include/mbedtls/ecdsa.h
ext/mbedtls/include/mbedtls/ecp.h
ext/mbedtls/include/mbedtls/md.h
ext/mbedtls/include/mbedtls/oid.h
ext/mbedtls/include/mbedtls/pk.h
ext/mbedtls/include/mbedtls/platform.h
ext/mbedtls/include/mbedtls/platform_util.h
ext/mbedtls/include/mbedtls/threading.h
Please move or remove them before you switch branches.
Aborting

If you attempt the reverse (pre- to post-), the operation succeeds, but
git reports a warning and leaves an orphaned directory behind (making
the repo state dirty).

These issues cause `newt upgrade` to fail in most cases.

This problem was addressed in the newt tool with an mcuboot-specific
hack: https://github.com/apache/mynewt-newt/pull/343

I couldn't think of a good general solution to this problem (if anyone
else can, please share!).  Unless I'm missing something, I think I would
call this a git bug, so I am going to report it to the git maintainers
if it hasn't already been reported. 

Chris


Re: Removed SUCCESS and FAIL #define statements in LoRa Node's utilities.h

2019-10-17 Thread marko kiiskila
Hi Frank,

It’s all good. Thanks for the PR.

> On 16 Oct 2019, at 23.08, Frank  wrote:
> 
> Hi all,
> 
> following Marko's advice, I just created a PR
> 
>  https://github.com/apache/mynewt-core/pull/2047
> 
> to remove the SUCCESS and FAIL #define statements in 
> net/lora/node/include/node/utilities.h. They are not used within the 
> (Semtech) net/lora code, however, they conflict with the CMSIS ErrorStatus 
> enum type definitions of several STM32 MCUs.
> 
> Example:
> 
> Error: In file included from 
> repos/apache-mynewt-core/net/lora/node/include/node/mac/LoRaMac.h:52:0,
> from 
> repos/apache-mynewt-core/net/lora/node/src/mac/region/Region.c:31:
> repos/apache-mynewt-core/net/lora/node/include/node/utilities.h:35:53: error: 
> expected identifier before numeric constant
> #define SUCCESS 1
> ^
> repos/apache-mynewt-core/hw/mcu/stm/stm32f0xx/src/ext/Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f0xx.h:191:3:
>  note: in expansion of macro 'SUCCESS'
>   SUCCESS = !ERROR
>   ^~~
> 
> However, I am not sure, whether this is the way to do it.
> 
> Best,
> Frank