newtmgr OTA error: slice bounds out of range [:-62]

2022-09-15 Thread Mo Chen
Hi there,

I encountered errors when using mynewt to DFU OTA.

Environment:
Intel Macbook pro
MacOS: Monterey 12.5.1

newt version: 1.10.0
newtmgr version: tried with v1.10.0 and v1.9.0. Neither works with the same
error.

Any clues or help are highly appreciated!


error message:

mndrive@Mos-MBP-MnDRIVE ~ % newtmgr image upload -c testbrd
/Users/xxx/Documents/Mynewt/test/bin/targets/testbrd/app/apps/testbrd/testbrd.img

 0 / 163232 [--]
  0.00%panic:
runtime error: slice bounds out of range [:-62]


goroutine 1 [running]:

mynewt.apache.org/newtmgr/nmxact/xact.encodeUploadReq({0x451a240?,
0xc000304320?}, {0xc2e140?, 0x42bd8c6?, 0x5ba48ab08a0c882f?}, 0x98?,
{0xc00038?, 0x0?, 0x421300?}, 0x0, ...)

/Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/nmxact/xact/image.go:120
+0x146

mynewt.apache.org/newtmgr/nmxact/xact.findChunkLen({0x451a240,
0xc000304320}, {0xc2e140, 0x20, 0x20}, 0x0?, {0xc00038, 0x27da0,
0x27da1}, 0x0, ...)

/Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/nmxact/xact/image.go:139
+0x131

mynewt.apache.org/newtmgr/nmxact/xact.nextImageUploadReq({0x451a240,
0xc000304320}, 0x0?, {0xc00038, 0x27da0, 0x27da1}, 0x0, 0x0?)

/Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/nmxact/xact/image.go:177
+0x1eb

mynewt.apache.org/newtmgr/nmxact/xact.(*ImageUploadCmd).Run(0xc32200,
{0x451a240, 0xc000304320})

/Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/nmxact/xact/image.go:353
+0x24e

mynewt.apache.org/newtmgr/nmxact/xact.(*ImageUpgradeCmd).runUpload(0xc32100,
{0x451a240, 0xc000304320})

/Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/nmxact/xact/image.go:510
+0x1cb

mynewt.apache.org/newtmgr/nmxact/xact.(*ImageUpgradeCmd).Run(0x7ff7bfeffbe5?,
{0x451a240?, 0xc000304320?})

/Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/nmxact/xact/image.go:536
+0x6a

mynewt.apache.org/newtmgr/newtmgr/cli.imageUploadCmd(0xc0001f4c80?,
{0xc0001ad920?, 0x3?, 0x3?})

/Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/newtmgr/cli/image.go:212
+0x30b

github.com/spf13/cobra.(*Command).execute(0xc0001f4c80, {0xc0001ad830, 0x3,
0x3})

/Users/mndrive/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:830
+0x663

github.com/spf13/cobra.(*Command).ExecuteC(0xccaf00)

/Users/mndrive/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:914
+0x2ee

github.com/spf13/cobra.(*Command).Execute(...)

/Users/mndrive/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:864

main.main()

/Users/mndrive/Downloads/apache-mynewt-newtmgr-1.10.0/newtmgr/newtmgr.go:111
+0x16f



-- 
Mo Chen


Re: nrf5340 DK ADC driver

2022-07-05 Thread Mo Chen
Hi Szymon,

Thank you so much for the information.

I will try it out.

Thanks,

On Tue, Jul 5, 2022 at 9:17 AM Szymon Janc  wrote:

> Hello Mo,
>
> nRF5340 MCU is using adc_nrf52 driver (as it is nrfx based)
>
> See
> https://github.com/apache/mynewt-core/blob/master/hw/mcu/nordic/nrf5340/pkg.yml#L58
>
> On Tue, 24 May 2022 at 21:19, Mo Chen  wrote:
> >
> > Hi all,
> >
> > I am developing using the nrf5340DK pca10095.
> >
> > I noticed that in the @apache-mynewt-core/hw/drivers/adc/ folder, there
> is
> > no nrf53 series driver included.
> >
> > In this case, do I use the adc_nrf52 files instead? Are they compatible
> > with the nrf53?
> >
> > Thanks,
> >
> >
> > --
> > Mo Chen
>
>
>
> --
> pozdrawiam
> Szymon K. Janc
>


-- 
Mo Chen


Re: Upcoming Apache Mynewt 1.11

2022-07-05 Thread Mo Chen
Would you please include ADC drivers and examples for the nrf5340 chip?

Currently, it is announced that the nrf5340 is supported; however, no ADC
drivers can be found in the core repository.

Thanks,


On Tue, Jul 5, 2022 at 3:49 AM Szymon Janc  wrote:

> Dear Apache Mynewt Community,
>
> This email is to give you a heads up that we are going to make next
> release (1.11) soon.
> Tentative 1.11-rc1 release date is 29th July.
>
> If there are any features or bug fixes you are working on (and want them
> to be
> part of 1.11 release) do not hesitate to send pull requests!
>
> Please note that this will be coordinated with NimBLE 1.6 release.
>
> --
> pozdrawiam
> Szymon K. Janc
>


-- 
Mo Chen


Re: error using newt new command

2022-05-23 Thread Mo Chen
Thank you so much for your guidance.

I managed to download the latest Blinky code and did a newt upgrade and
these did the trick.

I will use newt new --shallow=0 myproj instead for future reference.

Thank you,

On Mon, May 23, 2022 at 5:28 AM Szymon Janc  wrote:

> Hello Chen,
>
>
> Yes,  this is unfortunately bug in 1.10 release
> Please use "shallow" option when creating new project:
> newt new --shallow=0 myproj
>
>
> On Thu, 19 May 2022 at 04:43, Mo Chen  wrote:
>
> > Hi all,
> >
> > I got the following error when trying the "newt new myproj" command.
> >
> > It seems like the version 1.10.0 is not recognized in git? Would you
> > please help fix this?
> >
> > Thanks,
> >
> > platform: MacOS 12.4
> > Mynewt version: 1.10.0
> >
> > *mndrive@Mos-MacBook-Pro Mynewt % newt new myproj*
> >
> > *Downloading project skeleton from apache/mynewt-blinky...*
> >
> > *Downloading repository mynewt-blinky (commit: master) from
> > https://github.com/apache/mynewt-blinky.git
> > <https://github.com/apache/mynewt-blinky.git>*
> >
> > *WARNING: Creating a shallow clone by default. To unshallow repository
> > later use "git fetch --unshallow".*
> >
> > *Error: error: pathspec 'mynewt_1_10_0_tag' did not match any file(s)
> known
> > to git*
> >
> > --
> > Mo Chen
> >
>
>
> --
> pozdrawiam
> Szymon K. Janc
>


-- 
Mo Chen


error using newt new command

2022-05-18 Thread Mo Chen
Hi all,

I got the following error when trying the "newt new myproj" command.

It seems like the version 1.10.0 is not recognized in git? Would you
please help fix this?

Thanks,

platform: MacOS 12.4
Mynewt version: 1.10.0

*mndrive@Mos-MacBook-Pro Mynewt % newt new myproj*

*Downloading project skeleton from apache/mynewt-blinky...*

*Downloading repository mynewt-blinky (commit: master) from
https://github.com/apache/mynewt-blinky.git
<https://github.com/apache/mynewt-blinky.git>*

*WARNING: Creating a shallow clone by default. To unshallow repository
later use "git fetch --unshallow".*

*Error: error: pathspec 'mynewt_1_10_0_tag' did not match any file(s) known
to git*

-- 
Mo Chen


Re: Errors in installing v1.10.0

2022-05-17 Thread Mo Chen
Hi all,

It seems like the error is caused by the deprecation of the "go get"
command. In the website: https://go.dev/doc/go-get-install-deprecation

It says that: "Starting in Go 1.17, installing executables with go get is
deprecated. go install may be used instead. In Go 1.18, go get will no
longer build packages; it will only be used to add, update, or remove
dependencies in go.mod. Specifically, go get will always act as if the -d
flag were enabled."

Would you please update the installation script to reflect this so that
there is no such an error. Also please make the default version 1.10.0
instead of 1.9.0.

Thanks,



On Tue, May 17, 2022 at 8:47 AM Mo Chen  wrote:

> Hi all,
>
> I encountered the following errors in installing v1.10.0. Would you please
> help with this?
>
> Platform: MacOS Monterey v12.3.1
>
> 1. Using the command "brew install mynewt-newt" installs v1.9.0 instead of
> 1.10.0.
>
> 2. The following error message shows up:
>
> # golang.org/x/sys/unix
>
>
> /private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
> golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:28:3:
> //go:linkname must refer to declared function or variable
>
>
> /private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
> golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:43:3:
> //go:linkname must refer to declared function or variable
>
>
> /private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
> golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:59:3:
> //go:linkname must refer to declared function or variable
>
>
> /private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
> golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:75:3:
> //go:linkname must refer to declared function or variable
>
>
> /private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
> golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:90:3:
> //go:linkname must refer to declared function or variable
>
>
> /private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
> golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:105:3:
> //go:linkname must refer to declared function or variable
>
>
> /private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
> golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:121:3:
> //go:linkname must refer to declared function or variable
>
>
> /private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
> golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:136:3:
> //go:linkname must refer to declared function or variable
>
>
> /private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
> golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:151:3:
> //go:linkname must refer to declared function or variable
>
>
> /private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
> golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:166:3:
> //go:linkname must refer to declared function or variable
>
>
> /private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
> golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:166:3:
> too many errors
>
>
>
>
>
>
> --
> Mo Chen
>


-- 
Mo Chen


Errors in installing v1.10.0

2022-05-17 Thread Mo Chen
Hi all,

I encountered the following errors in installing v1.10.0. Would you please
help with this?

Platform: MacOS Monterey v12.3.1

1. Using the command "brew install mynewt-newt" installs v1.9.0 instead of
1.10.0.

2. The following error message shows up:

# golang.org/x/sys/unix

/private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:28:3:
//go:linkname must refer to declared function or variable

/private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:43:3:
//go:linkname must refer to declared function or variable

/private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:59:3:
//go:linkname must refer to declared function or variable

/private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:75:3:
//go:linkname must refer to declared function or variable

/private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:90:3:
//go:linkname must refer to declared function or variable

/private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:105:3:
//go:linkname must refer to declared function or variable

/private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:121:3:
//go:linkname must refer to declared function or variable

/private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:136:3:
//go:linkname must refer to declared function or variable

/private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:151:3:
//go:linkname must refer to declared function or variable

/private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:166:3:
//go:linkname must refer to declared function or variable

/private/tmp/mynewt-newt-20220517-42078-yasjnk/mynewt-newt-mynewt_1_9_0_tag/.brew_home/go/pkg/mod/
golang.org/x/sys@v0.0.0-20190916202348-b4ddaad3f8a3/unix/zsyscall_darwin_amd64.go:166:3:
too many errors






-- 
Mo Chen


Examples won't build on MacOS Monterey 12.2.1

2022-02-26 Thread Mo Chen
Hi all,

I installed the latest version of Mynewt, 1.9.0 and the environment needed
following the guidance on the website. However, the examples wont' build on
MacOS Monterey 12.2.1.

It shows the following error:

Error: ld: warning: The i386 architecture is deprecated for macOS (remove
from the Xcode build setting: ARCHS)



I tried to uninstall gcc-11 and installed GCC-6 (gcc-5 is no long supported
by MacOS later than v11) and changed the Compilier.yml settings to:


compiler.path.cc.DARWIN.OVERWRITE:
"gcc-6"compiler.path.as.DARWIN.OVERWRITE: "gcc-6”


The same error still shows up.

Any suggestions?

Thanks,

-- 
Mo Chen


Re: About mynewt support for nRF5340-dk board.

2021-04-20 Thread Mo Chen
Hi Ujjval,

It is supported. I have been using it in my development.

[image: IMG_20210420_112037.jpg]


On Tue, Apr 20, 2021 at 8:24 AM ujjval rathod 
wrote:

> Hi,
>
> I want to aks that the board nRF5340-PDK is supported but is the
> board nRF5340-dk supported?
>
> Best regards,
> Ujjval Rathod.
>


-- 
Mo Chen


Re: Reviews for New product

2020-11-07 Thread Mo Chen
Hi Adityaraj,

I am interested in giving this a try. Please let me know how to proceed.

Thanks & Regards


Mo

On Sat, Nov 7, 2020, 23:31 Aditya Raj Bhatt 
wrote:

> Hello Zephyr Project Group,
>
>
>
> I'm writing this mail to let you know about the new product that our
> startup has created that goes by the name of Vicara Creation Engine, it
> helps in initialising nRF52832 based projects much faster with Vicara's
> code generator. There's a simple GUI to configure pins, peripherals and
> project files without writing a single line of code. We currently support
> GPIO, PWM, UART SPI & TWIM with Segger Embedded Studio project file
> generation.
>
>
>
> I'm requesting you to please pass on this mail to relevant community in
> your mailing list, as the product is in development stage and we would love
> to get all the feedback that we can get.
>
>
> Regards
> Adityaraj Bhatt
> Vicara
>
> +91 6379100398


How does Mynewt manage priority of different event queues

2020-08-16 Thread Mo Chen
Hi all,

I have a question on the management of different event queues.

What happens if there are events in two different event queues? Which one
gets processed first?

If it is processed by the order of the priority of the corresponding tasks,
why bother to have multiple event queues then? Just one can do the same
thing, right?

I think I did not fully understand the strategy here. Can anyone help me
understand more?

Also, does Mynewt have the ability to handle multi-core of a CPU to run
tasks/events parallelly? I was thinking this would be realized by using
multiple event queues, but not sure if that is the case.

Thanks,



-- 
Mo Chen


Re: Include all ADC ports in drivers and core code for nrf52

2020-06-28 Thread Mo Chen
Great. I will give it a try and let you know how it goes.

Thank you for your response. It helps.

Mo

On Sun, Jun 28, 2020, 04:20 Casper Meijn  wrote:

> Hi Mo Chen,
>
> I am not part of the core team. I have used the ADC on the nRF52832. As
> I understood it, it has a single ADC for actual measurement and this
> could be connected to 8 different inputs. This would mean that you only
> need ADC0 and you configure multiple channels using struct adc_chan_cfg.
>
> I have not done this myself, as I only have one pin to measure, but I
> believe this is how you should do it.
>
> Hope this helps,
> Casper
>
> On di, jun 23, 2020 at 15:47, Mo Chen  wrote:
> > Hi dear team,
> >
> > As we know that there are 8 ADC ports on nrf52832. And looks like in
> > the
> > apache-mynewt-core source and cfg files, only ADC0 is enabled by
> > default.
> >
> > I have searched the entire core, there are 6 files, 8 locations that
> > need
> > to be modified to enable other ADC ports.
> >
> > I wonder if there is a simple way to enable more ADC ports without
> > modifying the core code, so that it won't warn me those files are
> > dirty
> > when I try to do a "newt upgrade".
> >
> > Or include all ADC ports in the core code as what I had done and
> > users can
> > config the ADC_X = 1 in their own target syscfg.yml file without
> > modifying
> > the core code to keep everything clean.
> >
> > Or am I doing it in a wrong way? Any guidance?
> >
> >
> > Thanks,
> >
> > Those files and locations are:
> >
> > 1. apache-mynewt-core/hw/mcu/nordic/nrf52xxx/pkg.yml
> > 2. apache-mynewt-core/hw/mcu/nordic/nrf52xxx/syscfg.yml
> > 3. apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/nrf52_periph.c
> > 4. apache-mynewt-core/hw/mcu/nordic/nrf52xxx/include/nrfx52_config.h
> > 5. apache-mynewt-nimble/porting/nimble/include/syscfg/syscfg.h
> > 6. apache-mynewt-nimble/porting//npl/riot/include/syscfg/syscfg.h
> >
> > example of changes I made:
> >
> > in order to use ADC_1 and ADC_6, I have to add the corresponding code
> > to
> > the core src file:
> > apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/nrf52_periph.c shown as
> > below:
> > (also other file mentioned above need modified)
> >
> > #if MYNEWT_VAL(ADC_0)
> > rc = os_dev_create(_bsp_adc0.ad_dev, "adc0",
> > OS_DEV_INIT_KERNEL, OS_DEV_INIT_PRIO_DEFAULT,
> > nrf52_adc_dev_init, _bsp_adc0_config);
> > assert(rc == 0);
> > #endif
> >
> > #if MYNEWT_VAL(ADC_1)
> > rc = os_dev_create(_bsp_adc1.ad_dev, "adc1",
> > OS_DEV_INIT_KERNEL, OS_DEV_INIT_PRIO_DEFAULT,
> > nrf52_adc_dev_init, _bsp_adc1_config);
> > assert(rc == 0);
> > #endif
> >
> > #if MYNEWT_VAL(ADC_6)
> > rc = os_dev_create(_bsp_adc6.ad_dev, "adc6",
> > OS_DEV_INIT_KERNEL, OS_DEV_INIT_PRIO_DEFAULT,
> > nrf52_adc_dev_init, _bsp_adc6_config);
> > assert(rc == 0);
> > #endif
> > }
> >
> >
> >
> > --
> > Mo Chen
>
>


Re: Include all ADC ports in drivers and core code for nrf52

2020-06-23 Thread Mo Chen
Hi dear team,

As we know that there are 8 ADC ports on nrf52832. And looks like in the
apache-mynewt-core source and cfg files, only ADC0 is enabled by default.

I have searched the entire core, there are 6 files, 8 locations that need
to be modified to enable other ADC ports.

I wonder if there is a simple way to enable more ADC ports without
modifying the core code, so that it won't warn me those files are dirty
when I try to do a "newt upgrade".

Or include all ADC ports in the core code as what I had done and users can
config the ADC_X = 1 in their own target syscfg.yml file without modifying
the core code to keep everything clean.

Or am I doing it in a wrong way? Any guidance?


Thanks,

Those files and locations are:

1. apache-mynewt-core/hw/mcu/nordic/nrf52xxx/pkg.yml
2. apache-mynewt-core/hw/mcu/nordic/nrf52xxx/syscfg.yml
3. apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/nrf52_periph.c
4. apache-mynewt-core/hw/mcu/nordic/nrf52xxx/include/nrfx52_config.h
5. apache-mynewt-nimble/porting/nimble/include/syscfg/syscfg.h
6. apache-mynewt-nimble/porting//npl/riot/include/syscfg/syscfg.h

example of changes I made:

in order to use ADC_1 and ADC_6, I have to add the corresponding code to
the core src file:
apache-mynewt-core/hw/mcu/nordic/nrf52xxx/src/nrf52_periph.c shown as below:
(also other file mentioned above need modified)

#if MYNEWT_VAL(ADC_0)
rc = os_dev_create(_bsp_adc0.ad_dev, "adc0",
OS_DEV_INIT_KERNEL, OS_DEV_INIT_PRIO_DEFAULT,
nrf52_adc_dev_init, _bsp_adc0_config);
assert(rc == 0);
#endif

#if MYNEWT_VAL(ADC_1)
rc = os_dev_create(_bsp_adc1.ad_dev, "adc1",
OS_DEV_INIT_KERNEL, OS_DEV_INIT_PRIO_DEFAULT,
nrf52_adc_dev_init, _bsp_adc1_config);
assert(rc == 0);
#endif

#if MYNEWT_VAL(ADC_6)
rc = os_dev_create(_bsp_adc6.ad_dev, "adc6",
OS_DEV_INIT_KERNEL, OS_DEV_INIT_PRIO_DEFAULT,
nrf52_adc_dev_init, _bsp_adc6_config);
assert(rc == 0);
#endif
}



--
Mo Chen


Re: Nimble on NRF52 : connectivity issue with Android, stack seems to freeze

2020-06-15 Thread Mo Chen
Maybe I should direct my question to JF then.

Thanks for your reply.

Mo Chen

On Mon, Jun 15, 2020, 10:18 Mo Chen  wrote:

> Hi Lukasz,
>
> We are also trying FreeRTOS + Nimble on nrf52. Have you realized DFU OTA
> via BLE with FreeRTOS? We are not sure if this is something doable.
>
> Thanks,
>
> On Sun, Jun 14, 2020 at 4:19 PM Łukasz Rymanowski <
> lukasz.rymanow...@codecoup.pl> wrote:
>
>> Hi,
>>
>> so indeed your logs show that after trying to read include services from
>> GATT service, something bad happened. Controller was able to ACK 2
>> following master packets then it stopped to send ACKs.
>> Do you have a console available? If so, does it show anything interesting?
>>
>> For further debugging I suggest to look at BLE_MONITOR_RTT to grab hci
>> logs
>> (https://www.codecoup.pl/blog/support-for-btmon-in-mynewt/)
>> With this we will know if response is still in the host or is in the
>> controller.
>>
>> Then we could check some stats e.g. ble_ll_stats - maybe that could show
>> us
>> something interesting - but first let us see where it stuck.
>>
>> Best
>> Łukasz
>>
>> On Sun, 14 Jun 2020 at 21:06,  wrote:
>>
>> > Hi,
>> >
>> > It looks like the attachements were dropped somewhere... You can
>> > download them on my seafile instance :
>> > https://seafile.codingfield.com/d/64d53a6ca6b44ae6b5d7/
>> >
>> > It seems to fail during the discovery of the characteristics on the
>> > device. From what I understand, it happens during the discovery of
>> > Generic Access Profile and Generic Attributes Profile, which are handled
>> > by nimble.
>> > I may be wrong, I'm a beginner with BLE and nimble!
>> > Maybe the captures will make more sens to you?
>> >
>> > Yeah, it's very strange that it works when the code is supposed to run
>> > slower... It makes me think of a timing or memory issue, but I couldn't
>> > find it...
>> >
>> > Thanks,
>> > JF
>> >
>> > Le 14/06/2020 20:46, Łukasz Rymanowski a écrit :
>> > > Hi,
>> > >
>> > > Thanks for the report, however looks like attachments are missing.
>> > >
>> > > First of all you need to understand what read fails i.e check handle
>> > > and
>> > > make sure that your application responds correctly.
>> > > It is very suspicious that read works with -Og, but still I would
>> focus
>> > > on
>> > > that failing read first.
>> > >
>> > > Thanks
>> > > Lukasz
>> > >
>> > >
>> > > On Sun, Jun 14, 2020, 20:25  wrote:
>> > >
>> > >> Hello,
>> > >>
>> > >> I'm working on a firmware for the Pinetime, a smartwatch based on the
>> > >> NRF52832. The code is written in C/C++ and uses FreeRTOS.
>> > >> I've recently switched from the Nordic Softdevice to NimBLE as BLE
>> > >> stack. I used the freertos port from the 'porting' folder of the
>> > >> source
>> > >> code of nimble.
>> > >>
>> > >> I did many test using my PC on Linux : it can connect and communicate
>> > >> with the NRF52 without issue.
>> > >> However, things are not that easy when I try to connect using Android
>> > >> phone (I tried with a Huawei Psomething and my old Nexus5) : the
>> > >> connection fails most of the time.
>> > >>
>> > >> I did a lot of debugging, logging, sniffing,.. and I still cannot
>> > >> understand why it's not working as expected. Here are some of my
>> > >> observations:
>> > >>
>> > >>   - When Android successfully connects, I receive the following GAP
>> > >> events : BLE_GAP_EVENT_CONNECT and then BLE_GAP_EVENT_CONN_UPDATE 2
>> > >> times. The first update sets the connection interval to 6, the second
>> > >> one to 40.
>> > >>   - When it fails, I receive only the BLE_GAP_EVENT_CONNECT event and
>> > >> the
>> > >> 1st BLE_GAP_EVENT_CONN_UPDATE.
>> > >>   - Using the sniffer, I noticed that the last packet is a read
>> > >> request
>> > >> from the phone. It looks like the NRF52 never respond to this last
>> > >> read.
>> > >>   - It fails in the discovery steps (when the android phone discover
>> > >> all
>> > >> the services, characteristics and attributes) but not always at the
>> > >> same
>> > >> place.
>> > >>   - I noticed that the tasks (ll task and host task are not in
>> > >> deadlock
>> > >> BUT it looks like the radio ISR (ble_phy_isr() in ble_phy.c) is not
>> > >> called anymore.
>> > >>   - When I build the very same code in DEBUG (-Og instead of -O3), it
>> > >> works perfectly!
>> > >>
>> > >> You'll find in attachements 2 captures I did with Wireshark and the
>> > >> NRF
>> > >> Sniffer (running on a NRF52-DK), one failed and one successful
>> attempt
>> > >> to connect.
>> > >>
>> > >> I'm running out of idea to debug this further. Is there a
>> > >> configuration
>> > >> issue (there are so many parameters in syscfg.h)? What could I try?
>> > >> Where should  I search ? Do you need more info to understand the
>> > >> issue?
>> > >>
>> > >> Could you help me fix this issue?
>> > >>
>> > >> Thanks,
>> > >>
>> > >> JF
>> >
>>
>
>
> --
> Mo Chen
>


Re: Nimble on NRF52 : connectivity issue with Android, stack seems to freeze

2020-06-15 Thread Mo Chen
Hi Lukasz,

We are also trying FreeRTOS + Nimble on nrf52. Have you realized DFU OTA
via BLE with FreeRTOS? We are not sure if this is something doable.

Thanks,

On Sun, Jun 14, 2020 at 4:19 PM Łukasz Rymanowski <
lukasz.rymanow...@codecoup.pl> wrote:

> Hi,
>
> so indeed your logs show that after trying to read include services from
> GATT service, something bad happened. Controller was able to ACK 2
> following master packets then it stopped to send ACKs.
> Do you have a console available? If so, does it show anything interesting?
>
> For further debugging I suggest to look at BLE_MONITOR_RTT to grab hci logs
> (https://www.codecoup.pl/blog/support-for-btmon-in-mynewt/)
> With this we will know if response is still in the host or is in the
> controller.
>
> Then we could check some stats e.g. ble_ll_stats - maybe that could show us
> something interesting - but first let us see where it stuck.
>
> Best
> Łukasz
>
> On Sun, 14 Jun 2020 at 21:06,  wrote:
>
> > Hi,
> >
> > It looks like the attachements were dropped somewhere... You can
> > download them on my seafile instance :
> > https://seafile.codingfield.com/d/64d53a6ca6b44ae6b5d7/
> >
> > It seems to fail during the discovery of the characteristics on the
> > device. From what I understand, it happens during the discovery of
> > Generic Access Profile and Generic Attributes Profile, which are handled
> > by nimble.
> > I may be wrong, I'm a beginner with BLE and nimble!
> > Maybe the captures will make more sens to you?
> >
> > Yeah, it's very strange that it works when the code is supposed to run
> > slower... It makes me think of a timing or memory issue, but I couldn't
> > find it...
> >
> > Thanks,
> > JF
> >
> > Le 14/06/2020 20:46, Łukasz Rymanowski a écrit :
> > > Hi,
> > >
> > > Thanks for the report, however looks like attachments are missing.
> > >
> > > First of all you need to understand what read fails i.e check handle
> > > and
> > > make sure that your application responds correctly.
> > > It is very suspicious that read works with -Og, but still I would focus
> > > on
> > > that failing read first.
> > >
> > > Thanks
> > > Lukasz
> > >
> > >
> > > On Sun, Jun 14, 2020, 20:25  wrote:
> > >
> > >> Hello,
> > >>
> > >> I'm working on a firmware for the Pinetime, a smartwatch based on the
> > >> NRF52832. The code is written in C/C++ and uses FreeRTOS.
> > >> I've recently switched from the Nordic Softdevice to NimBLE as BLE
> > >> stack. I used the freertos port from the 'porting' folder of the
> > >> source
> > >> code of nimble.
> > >>
> > >> I did many test using my PC on Linux : it can connect and communicate
> > >> with the NRF52 without issue.
> > >> However, things are not that easy when I try to connect using Android
> > >> phone (I tried with a Huawei Psomething and my old Nexus5) : the
> > >> connection fails most of the time.
> > >>
> > >> I did a lot of debugging, logging, sniffing,.. and I still cannot
> > >> understand why it's not working as expected. Here are some of my
> > >> observations:
> > >>
> > >>   - When Android successfully connects, I receive the following GAP
> > >> events : BLE_GAP_EVENT_CONNECT and then BLE_GAP_EVENT_CONN_UPDATE 2
> > >> times. The first update sets the connection interval to 6, the second
> > >> one to 40.
> > >>   - When it fails, I receive only the BLE_GAP_EVENT_CONNECT event and
> > >> the
> > >> 1st BLE_GAP_EVENT_CONN_UPDATE.
> > >>   - Using the sniffer, I noticed that the last packet is a read
> > >> request
> > >> from the phone. It looks like the NRF52 never respond to this last
> > >> read.
> > >>   - It fails in the discovery steps (when the android phone discover
> > >> all
> > >> the services, characteristics and attributes) but not always at the
> > >> same
> > >> place.
> > >>   - I noticed that the tasks (ll task and host task are not in
> > >> deadlock
> > >> BUT it looks like the radio ISR (ble_phy_isr() in ble_phy.c) is not
> > >> called anymore.
> > >>   - When I build the very same code in DEBUG (-Og instead of -O3), it
> > >> works perfectly!
> > >>
> > >> You'll find in attachements 2 captures I did with Wireshark and the
> > >> NRF
> > >> Sniffer (running on a NRF52-DK), one failed and one successful attempt
> > >> to connect.
> > >>
> > >> I'm running out of idea to debug this further. Is there a
> > >> configuration
> > >> issue (there are so many parameters in syscfg.h)? What could I try?
> > >> Where should  I search ? Do you need more info to understand the
> > >> issue?
> > >>
> > >> Could you help me fix this issue?
> > >>
> > >> Thanks,
> > >>
> > >> JF
> >
>


-- 
Mo Chen


ADC function on nrf52 with version 1.8.0

2020-06-10 Thread Mo Chen
Hi all,

Since the 1.8.0 adopted a new version of the nrfx driver. The old ADC code
is not working.

I wonder if there is a tested working ADC example available for nrf52 with
version 1.8.0?

I have been working on this for almost two weeks to get it work but with no
success. The ADC always gives a value of 0.

Can anyone help update the example code in the tutorial on the official
website https://mynewt.apache.org/latest/tutorials/sensors/nrf52_adc.html

Or share a working code with me?

Regarding
nrf52 adc, my specific question is: in the following configuration
structure, what should I input for cc.pin ? I input NRF_SAADC_INPUT_AIN1,
but it won't work.

struct adc_chan_cfg cc = {
.pin = NRF_SAADC_INPUT_AIN1,
.differential = false,
.pin_negative = NRF_SAADC_INPUT_DISABLED,
.gain = ADC_GAIN1_6,
.reference = ADC_REFERENCE_INTERNAL
};

Thank you very much!







-- 
Mo


Re: Backport nrf52 driver nrfx 2.1.0 to nrfx 1.8.x.

2020-06-10 Thread Mo Chen
Hi Miguel,

I guess the problem is I am not sure what to input to the following
structure:

for "cc.pin", is my input correct? I tried  NRF_SAADC_INPUT_AIN1 and (
nrf_saadc_input_t)(NRF_SAADC_INPUT_AIN1).  No luck. For nrf52, what should
I input to it?

also the same for "cc.pin_negative"

Thanks,

struct adc_chan_cfg cc = {
.pin = (nrf_saadc_input_t)(NRF_SAADC_INPUT_AIN1),
.differential = false,
.pin_negative = (nrf_saadc_input_t)(NRF_SAADC_INPUT_DISABLED),
.gain = ADC_GAIN1_6,
.reference = ADC_REFERENCE_INTERNAL
};

On Wed, Jun 10, 2020 at 2:42 PM Mo Chen  wrote:

> Hi Miguel,
>
> Yes, I understand that the code you sent doesn't include BLE functions.
>
> I modified the code on the Mynewt official website by adopting the ADC
> configuration.
>
> The switch (etype) structure stuck the execution. So I removed the switch
> structure and just did the same as the example shown in the link:
>
> https://mynewt.apache.org/latest/tutorials/sensors/nrf52_adc.html
>
> Still, the ADC give a value a 0 volt.
>
> The code on the official Website runs normally with 1.7.0.
>
> I think there must be something wrong with the ADC configuration.
>
> My goal is to have the example code on the official website run with 1.8.0.
>
> https://mynewt.apache.org/latest/tutorials/sensors/nrf52_adc.html
>
> Would you please help look into this?
>
> Thanks for your help!
>
>
>
> On Wed, Jun 10, 2020, 13:22 Miguel Azevedo  wrote:
>
>> Hi Mo,
>>
>> I am currently away from my computer but the example app supposedly
>> doesn't
>> have any Bluetooth features enabled. I'll give a closer look on your issue
>> tomorrow, by the way keep in mind that the code I posted the link for
>> belongs to a branch which is slightly different from master.
>>
>> On Wed, 10 Jun 2020, 17:31 Andrew Stevenson,  wrote:
>>
>> >
>> >
>> > > On 10. Jun 2020, at 17:26, Mo Chen  wrote:
>> > >
>> > > Hi Andrew,
>> > >
>> > > Would you please attach the blog post you mentioned?
>> >
>> > It was attached so I guess the mailing list software strips
>> attachments. I
>> > have CCed you on this message so you should have two copies, one with
>> the
>> > attachment.
>> >
>> > Andrew
>> >
>> >
>> >
>> >
>>
> Mo Chen
>


-- 
Mo Chen


Re: Backport nrf52 driver nrfx 2.1.0 to nrfx 1.8.x.

2020-06-10 Thread Mo Chen
Hi Miguel,

Yes, I understand that the code you sent doesn't include BLE functions.

I modified the code on the Mynewt official website by adopting the ADC
configuration.

The switch (etype) structure stuck the execution. So I removed the switch
structure and just did the same as the example shown in the link:

https://mynewt.apache.org/latest/tutorials/sensors/nrf52_adc.html

Still, the ADC give a value a 0 volt.

The code on the official Website runs normally with 1.7.0.

I think there must be something wrong with the ADC configuration.

My goal is to have the example code on the official website run with 1.8.0.

https://mynewt.apache.org/latest/tutorials/sensors/nrf52_adc.html

Would you please help look into this?

Thanks for your help!



On Wed, Jun 10, 2020, 13:22 Miguel Azevedo  wrote:

> Hi Mo,
>
> I am currently away from my computer but the example app supposedly doesn't
> have any Bluetooth features enabled. I'll give a closer look on your issue
> tomorrow, by the way keep in mind that the code I posted the link for
> belongs to a branch which is slightly different from master.
>
> On Wed, 10 Jun 2020, 17:31 Andrew Stevenson,  wrote:
>
> >
> >
> > > On 10. Jun 2020, at 17:26, Mo Chen  wrote:
> > >
> > > Hi Andrew,
> > >
> > > Would you please attach the blog post you mentioned?
> >
> > It was attached so I guess the mailing list software strips attachments.
> I
> > have CCed you on this message so you should have two copies, one with the
> > attachment.
> >
> > Andrew
> >
> >
> >
> >
>
Mo Chen


Re: Backport nrf52 driver nrfx 2.1.0 to nrfx 1.8.x.

2020-06-10 Thread Mo Chen
Hi Andrew,

Would you please attach the blog post you mentioned?

Thanks,

On Wed, Jun 10, 2020 at 10:23 AM Andrew Stevenson  wrote:

>
>
> > On 10. Jun 2020, at 16:51, Mo Chen  wrote:
> >
> > BTW: I am using 1.9.0 dev. I could not figure out how to install 1.8.0 on
> > MacOS. If I use brew install mynewt-newt, it will install 1.7.0, although
> > 1.8.0 has been released a while ago. Can you please guide me on this as
> > well?
>
> You don’t have to use brew to install the mynewt tools. I attach a blog
> post (as I don’t have anywhere to post it yet) covering the steps I did.
> They compile pretty easily.
>
> HTH,
>
> Andrew



-- 
Mo Chen


Re: Backport nrf52 driver nrfx 2.1.0 to nrfx 1.8.x.

2020-06-03 Thread Mo Chen
ress or through mynewt's slack (my handle
> is mlaz).
>
> Thanks,
>
> Miguel
>
> On Wed, 3 Jun 2020, 16:42 Mo Chen,  wrote:
>
> > Hi dear development team,
> >
> > The newly released Mynewt (1.8.0) adopted a new version of nrf52 driver
> > which is nrfx 2.1.0 (the last version was 1.7.0).
> >
> > However, the APIs have changed a lot. And the working code with nrfx
> 1.7.0
> > totally doesn't work anymore.
> >
> > I searched online and found no supported documents.
> >
> > I then reached out to Nordic for tech support and got the following
> answer:
> >
> > Basically, they said the support document is not available and they are
> > planning to backport the driver to 1.8.x in their own next version of
> SDK.
> >
> > It looks like there are a lot of issues with the newer driver. If they
> are
> > backporting their own SDK, I suggest we do the same. So that the code
> still
> > works and will be well supported.
> >
> > Maybe we can upgrade the driver after the official support document is
> > available and updated in their own SDK.
> >
> > Please seriously consider my suggestion, since this significantly affects
> > our development progress and shown no benefits.
> >
> > Thanks,
> >
> > Below is the response by their tech support staff:
> >
> > 
> >
> > Hi,
> >
> > As you figured, the nrfx 2.x API is not supported in the nRF5 SDK exactly
> > because of the large changes in the SPI of the new nrfx_saadc driver. The
> > driver have been completely rewritten to fix some issues seen with the
> old
> > driver. The new driver will be backported to nrfx v1.8.x in the next
> > release of nRF5 SDK, but the legacy driver will still be available. The
> > example code needs to be completely rewritten to support the new driver.
> > Unfortunately, for now, we do not have any examples available for the new
> > driver. I would recommend you to stick with the driver from nrfx v1.8.x
> for
> > now.
> >
> > Best regards,
> > Jørgen
> >
> > -
> >
> >
> >
> > Mo Chen
> >
>


-- 
Mo Chen


Backport nrf52 driver nrfx 2.1.0 to nrfx 1.8.x.

2020-06-03 Thread Mo Chen
Hi dear development team,

The newly released Mynewt (1.8.0) adopted a new version of nrf52 driver
which is nrfx 2.1.0 (the last version was 1.7.0).

However, the APIs have changed a lot. And the working code with nrfx 1.7.0
totally doesn't work anymore.

I searched online and found no supported documents.

I then reached out to Nordic for tech support and got the following answer:

Basically, they said the support document is not available and they are
planning to backport the driver to 1.8.x in their own next version of SDK.

It looks like there are a lot of issues with the newer driver. If they are
backporting their own SDK, I suggest we do the same. So that the code still
works and will be well supported.

Maybe we can upgrade the driver after the official support document is
available and updated in their own SDK.

Please seriously consider my suggestion, since this significantly affects
our development progress and shown no benefits.

Thanks,

Below is the response by their tech support staff:



Hi,

As you figured, the nrfx 2.x API is not supported in the nRF5 SDK exactly
because of the large changes in the SPI of the new nrfx_saadc driver. The
driver have been completely rewritten to fix some issues seen with the old
driver. The new driver will be backported to nrfx v1.8.x in the next
release of nRF5 SDK, but the legacy driver will still be available. The
example code needs to be completely rewritten to support the new driver.
Unfortunately, for now, we do not have any examples available for the new
driver. I would recommend you to stick with the driver from nrfx v1.8.x for
now.

Best regards,
Jørgen

-



Mo Chen


Re: How to upgrade to 1.8.0 for both newt and newtmgr?

2020-05-17 Thread Mo Chen
hi all,

I managed to install 1.8.0. On Linux and the BLE OTA seems working fine.
Just one thing, the bluetooth can be randomly turned off right after the
OTA or the Confirm of the image.

Also, be careful, the nrfx saadc drivers has been changed in version 1.8.0.
Previously working adc drivers is not working. Needs to be modified. I am
working on it now.

Thanks,



On Sat, May 16, 2020 at 12:03 PM Mo Chen  wrote:

> Great.
>
> Two more questions:
>
> Version 1.8.0 has already been released, why when we try to install the
> latest version, it still installs 1.7.0? Can we fix that?
>
>
> On Ubuntu Linux, under version 1.7.0, with Nordic-pca10040, the IRS works
> fine. However, with the adafruit feather nrf52, the OTA disconnects at
> 99.92% and shows error: disconnected. Any clue?
>
> I was trying to get rid of it by upgrading to a newer version. But on
> Linux, it doesn't seem there is such an instruction on how to install 1.9.0
> dev. Would you please guide me on this?
>
>
> Many thanks!
>
>
>
>
> Mo Chen
>
> On Sat, May 16, 2020, 10:43 Christopher Collins 
> wrote:
>
>> Thanks Mo.  Someone else reported the same issue with Catalina.  Their
>> `-ldebug` log looked identical to yours.  I'll upgrade to catalina and
>> let you know what I find out.
>>
>> Chris
>>
>> On Sat, May 16, 2020 at 10:10:34AM -0500, Mo Chen wrote:
>> > Hi Chris,
>> >
>> > thanks for the clarification.
>> >
>> > I tried with the following debug info returned:
>> >
>> > newtmgr image upload -c mybleprph -ldebug
>> >
>> /Users/NNL/dev/myproj/bin/targets/myperiph/app/@apache-mynewt-nimble/apps/bleprph/bleprph.img
>> >
>> > DEBU[2020-05-16 10:03:28.615] Using connection profile: name=mybleprph
>> > type=ble connstring=peer_name=nimble-bleprph
>> > DEBU[2020-05-16 10:03:28.621] CentralManagerDidUpdateState:
>> cmgr=0x5804b50
>> >
>> > No further responses shown. No signs of connection. Under this status, I
>> > checked the BLE advertise using my phone, the device is still
>> advertising,
>> > meaning the connection is not established.
>> >
>> > Would you please help interpret what the message code means?
>> >
>> > other details:
>> >
>> > newt version: 1.9.0
>> > newtmgr version: 1.9.0
>> > Device: nordic pca10040
>> >
>> > The same method works under version 1.7.0 on Ubuntu Linux. So we can
>> > confirm the device works.
>> >
>> > Thanks,
>> >
>> >
>> > On Fri, May 15, 2020 at 9:15 PM Christopher Collins <
>> ccollins47...@gmail.com>
>> > wrote:
>> >
>> > > On Fri, May 15, 2020 at 07:47:22PM -0500, Mo Chen wrote:
>> > > > Hi Chris,
>> > > >
>> > > > Thank you for your timely response.
>> > > >
>> > > > Under v1.7.0, the error message is:
>> > > > *Unhandled event: xpc.Dict{"kCBMsgId":4,
>> > > > "kCBMsgArgs":xpc.Dict{"kCBMsgArgState":5}}*
>> > > >
>> > > > Under v1.9.0 dev, without '--ldebug':
>> > > > Nothing happens. No message, no response.
>> > > >
>> > > > Under v1.9.0 with '--ldebug':
>> > > > I guess I did not get what you meant by "with the '--ldebug'
>> switch". I
>> > > > tried the following but with an error telling me unknown flag.
>> > > >
>> > > > newtmgr image upload -c mybleprph '--ldebug'
>> > > >
>> > >
>> /Users/NNL/dev/myproj/bin/targets/myperiph/app/@apache-mynewt-nimble/apps/bleprph/bleprph.img
>> > > > Error: unknown flag: --ldebug
>> > > >
>> > > > Would you please guide me on how to implement the --ldebug switch?
>> > >
>> > > Ah, sorry,  I meant `-ldebug` (one dash only)!
>> > >
>> > > Thanks,
>> > > Chris
>> > >
>> >
>> >
>> > --
>> > Mo Chen
>>
>

-- 
Mo Chen


OpenOCD error: libhidapi-hidraw.so.0

2020-05-16 Thread Mo Chen
I am using Ubuntu 20.04.

After successfully installed OpenOCD, I tried  command: openocd -v.

And it showed the following message:
*openocd: error while loading shared libraries: libhidapi-hidraw.so.0:
cannot open shared object file: No such file or directory*

According to the Mynewt tutorial, one needs to try to install the missing
library: libhidapi-dev:i386

I then tried: sudo apt-get install libhidapi-dev:i386at gave the following
error:

*E: Unable to locate package libhidapi-dev:i386*

I then tried: udo apt-get install libhidapi-dev. It seemed some libraries
were installed. However, when tired: openocd -v, it showed the same error
message.

Did anyone meet the same issue? Is there a solution?

Any guidance is appreciated!

Thanks,


On Sat, May 16, 2020 at 12:03 PM Mo Chen  wrote:

> Great.
>
> Two more questions:
>
> Version 1.8.0 has already been released, why when we try to install the
> latest version, it still installs 1.7.0? Can we fix that?
>
>
> On Ubuntu Linux, under version 1.7.0, with Nordic-pca10040, the IRS works
> fine. However, with the adafruit feather nrf52, the OTA disconnects at
> 99.92% and shows error: disconnected. Any clue?
>
> I was trying to get rid of it by upgrading to a newer version. But on
> Linux, it doesn't seem there is such an instruction on how to install 1.9.0
> dev. Would you please guide me on this?
>
>
> Many thanks!
>
>
>
>
> Mo Chen
>
> On Sat, May 16, 2020, 10:43 Christopher Collins 
> wrote:
>
>> Thanks Mo.  Someone else reported the same issue with Catalina.  Their
>> `-ldebug` log looked identical to yours.  I'll upgrade to catalina and
>> let you know what I find out.
>>
>> Chris
>>
>> On Sat, May 16, 2020 at 10:10:34AM -0500, Mo Chen wrote:
>> > Hi Chris,
>> >
>> > thanks for the clarification.
>> >
>> > I tried with the following debug info returned:
>> >
>> > newtmgr image upload -c mybleprph -ldebug
>> >
>> /Users/NNL/dev/myproj/bin/targets/myperiph/app/@apache-mynewt-nimble/apps/bleprph/bleprph.img
>> >
>> > DEBU[2020-05-16 10:03:28.615] Using connection profile: name=mybleprph
>> > type=ble connstring=peer_name=nimble-bleprph
>> > DEBU[2020-05-16 10:03:28.621] CentralManagerDidUpdateState:
>> cmgr=0x5804b50
>> >
>> > No further responses shown. No signs of connection. Under this status, I
>> > checked the BLE advertise using my phone, the device is still
>> advertising,
>> > meaning the connection is not established.
>> >
>> > Would you please help interpret what the message code means?
>> >
>> > other details:
>> >
>> > newt version: 1.9.0
>> > newtmgr version: 1.9.0
>> > Device: nordic pca10040
>> >
>> > The same method works under version 1.7.0 on Ubuntu Linux. So we can
>> > confirm the device works.
>> >
>> > Thanks,
>> >
>> >
>> > On Fri, May 15, 2020 at 9:15 PM Christopher Collins <
>> ccollins47...@gmail.com>
>> > wrote:
>> >
>> > > On Fri, May 15, 2020 at 07:47:22PM -0500, Mo Chen wrote:
>> > > > Hi Chris,
>> > > >
>> > > > Thank you for your timely response.
>> > > >
>> > > > Under v1.7.0, the error message is:
>> > > > *Unhandled event: xpc.Dict{"kCBMsgId":4,
>> > > > "kCBMsgArgs":xpc.Dict{"kCBMsgArgState":5}}*
>> > > >
>> > > > Under v1.9.0 dev, without '--ldebug':
>> > > > Nothing happens. No message, no response.
>> > > >
>> > > > Under v1.9.0 with '--ldebug':
>> > > > I guess I did not get what you meant by "with the '--ldebug'
>> switch". I
>> > > > tried the following but with an error telling me unknown flag.
>> > > >
>> > > > newtmgr image upload -c mybleprph '--ldebug'
>> > > >
>> > >
>> /Users/NNL/dev/myproj/bin/targets/myperiph/app/@apache-mynewt-nimble/apps/bleprph/bleprph.img
>> > > > Error: unknown flag: --ldebug
>> > > >
>> > > > Would you please guide me on how to implement the --ldebug switch?
>> > >
>> > > Ah, sorry,  I meant `-ldebug` (one dash only)!
>> > >
>> > > Thanks,
>> > > Chris
>> > >
>> >
>> >
>> > --
>> > Mo Chen
>>
>

-- 
Mo Chen


Re: How to upgrade to 1.8.0 for both newt and newtmgr?

2020-05-16 Thread Mo Chen
Great.

Two more questions:

Version 1.8.0 has already been released, why when we try to install the
latest version, it still installs 1.7.0? Can we fix that?


On Ubuntu Linux, under version 1.7.0, with Nordic-pca10040, the IRS works
fine. However, with the adafruit feather nrf52, the OTA disconnects at
99.92% and shows error: disconnected. Any clue?

I was trying to get rid of it by upgrading to a newer version. But on
Linux, it doesn't seem there is such an instruction on how to install 1.9.0
dev. Would you please guide me on this?


Many thanks!




Mo Chen

On Sat, May 16, 2020, 10:43 Christopher Collins 
wrote:

> Thanks Mo.  Someone else reported the same issue with Catalina.  Their
> `-ldebug` log looked identical to yours.  I'll upgrade to catalina and
> let you know what I find out.
>
> Chris
>
> On Sat, May 16, 2020 at 10:10:34AM -0500, Mo Chen wrote:
> > Hi Chris,
> >
> > thanks for the clarification.
> >
> > I tried with the following debug info returned:
> >
> > newtmgr image upload -c mybleprph -ldebug
> >
> /Users/NNL/dev/myproj/bin/targets/myperiph/app/@apache-mynewt-nimble/apps/bleprph/bleprph.img
> >
> > DEBU[2020-05-16 10:03:28.615] Using connection profile: name=mybleprph
> > type=ble connstring=peer_name=nimble-bleprph
> > DEBU[2020-05-16 10:03:28.621] CentralManagerDidUpdateState:
> cmgr=0x5804b50
> >
> > No further responses shown. No signs of connection. Under this status, I
> > checked the BLE advertise using my phone, the device is still
> advertising,
> > meaning the connection is not established.
> >
> > Would you please help interpret what the message code means?
> >
> > other details:
> >
> > newt version: 1.9.0
> > newtmgr version: 1.9.0
> > Device: nordic pca10040
> >
> > The same method works under version 1.7.0 on Ubuntu Linux. So we can
> > confirm the device works.
> >
> > Thanks,
> >
> >
> > On Fri, May 15, 2020 at 9:15 PM Christopher Collins <
> ccollins47...@gmail.com>
> > wrote:
> >
> > > On Fri, May 15, 2020 at 07:47:22PM -0500, Mo Chen wrote:
> > > > Hi Chris,
> > > >
> > > > Thank you for your timely response.
> > > >
> > > > Under v1.7.0, the error message is:
> > > > *Unhandled event: xpc.Dict{"kCBMsgId":4,
> > > > "kCBMsgArgs":xpc.Dict{"kCBMsgArgState":5}}*
> > > >
> > > > Under v1.9.0 dev, without '--ldebug':
> > > > Nothing happens. No message, no response.
> > > >
> > > > Under v1.9.0 with '--ldebug':
> > > > I guess I did not get what you meant by "with the '--ldebug'
> switch". I
> > > > tried the following but with an error telling me unknown flag.
> > > >
> > > > newtmgr image upload -c mybleprph '--ldebug'
> > > >
> > >
> /Users/NNL/dev/myproj/bin/targets/myperiph/app/@apache-mynewt-nimble/apps/bleprph/bleprph.img
> > > > Error: unknown flag: --ldebug
> > > >
> > > > Would you please guide me on how to implement the --ldebug switch?
> > >
> > > Ah, sorry,  I meant `-ldebug` (one dash only)!
> > >
> > > Thanks,
> > > Chris
> > >
> >
> >
> > --
> > Mo Chen
>


Re: How to upgrade to 1.8.0 for both newt and newtmgr?

2020-05-16 Thread Mo Chen
Hi Chris,

thanks for the clarification.

I tried with the following debug info returned:

newtmgr image upload -c mybleprph -ldebug
/Users/NNL/dev/myproj/bin/targets/myperiph/app/@apache-mynewt-nimble/apps/bleprph/bleprph.img

DEBU[2020-05-16 10:03:28.615] Using connection profile: name=mybleprph
type=ble connstring=peer_name=nimble-bleprph
DEBU[2020-05-16 10:03:28.621] CentralManagerDidUpdateState: cmgr=0x5804b50

No further responses shown. No signs of connection. Under this status, I
checked the BLE advertise using my phone, the device is still advertising,
meaning the connection is not established.

Would you please help interpret what the message code means?

other details:

newt version: 1.9.0
newtmgr version: 1.9.0
Device: nordic pca10040

The same method works under version 1.7.0 on Ubuntu Linux. So we can
confirm the device works.

Thanks,


On Fri, May 15, 2020 at 9:15 PM Christopher Collins 
wrote:

> On Fri, May 15, 2020 at 07:47:22PM -0500, Mo Chen wrote:
> > Hi Chris,
> >
> > Thank you for your timely response.
> >
> > Under v1.7.0, the error message is:
> > *Unhandled event: xpc.Dict{"kCBMsgId":4,
> > "kCBMsgArgs":xpc.Dict{"kCBMsgArgState":5}}*
> >
> > Under v1.9.0 dev, without '--ldebug':
> > Nothing happens. No message, no response.
> >
> > Under v1.9.0 with '--ldebug':
> > I guess I did not get what you meant by "with the '--ldebug' switch". I
> > tried the following but with an error telling me unknown flag.
> >
> > newtmgr image upload -c mybleprph '--ldebug'
> >
> /Users/NNL/dev/myproj/bin/targets/myperiph/app/@apache-mynewt-nimble/apps/bleprph/bleprph.img
> > Error: unknown flag: --ldebug
> >
> > Would you please guide me on how to implement the --ldebug switch?
>
> Ah, sorry,  I meant `-ldebug` (one dash only)!
>
> Thanks,
> Chris
>


-- 
Mo Chen


Re: How to upgrade to 1.8.0 for both newt and newtmgr?

2020-05-15 Thread Mo Chen
Hi Chris,

Thank you for your timely response.

Under v1.7.0, the error message is:
*Unhandled event: xpc.Dict{"kCBMsgId":4,
"kCBMsgArgs":xpc.Dict{"kCBMsgArgState":5}}*

Under v1.9.0 dev, without '--ldebug':
Nothing happens. No message, no response.

Under v1.9.0 with '--ldebug':
I guess I did not get what you meant by "with the '--ldebug' switch". I
tried the following but with an error telling me unknown flag.

newtmgr image upload -c mybleprph '--ldebug'
/Users/NNL/dev/myproj/bin/targets/myperiph/app/@apache-mynewt-nimble/apps/bleprph/bleprph.img
Error: unknown flag: --ldebug

Would you please guide me on how to implement the --ldebug switch?

Thanks,

On Fri, May 15, 2020 at 5:45 PM Christopher Collins 
wrote:

> Hi Mo,
>
> On Fri, May 15, 2020 at 05:11:36PM -0500, Mo Chen wrote:
> > I am currently using 1.7.0 on MacOS Catalina.
> >
> > There is a BLE connection issue. I cannot upload img via OTA.
> >
> > I searched online, it seems in verison 1.8.0, this problem has been
> solved?
> >
> > I tried to use install mynewt-newtmgr --HEAD. The 1.9.0 dev version did
> not
> > solve the BLE connection issue.
> >
> > Any clue?
>
> The 1.9.0 dev version of newtmgr should work with Catalina.  Can you
> please try the upload again with the `--ldebug` switch?  Then please
> paste the output in a response.
>
> Chris
>


-- 
Mo Chen


How to upgrade to 1.8.0 for both newt and newtmgr?

2020-05-15 Thread Mo Chen
I am currently using 1.7.0 on MacOS Catalina.

There is a BLE connection issue. I cannot upload img via OTA.

I searched online, it seems in verison 1.8.0, this problem has been solved?

I tried to use install mynewt-newtmgr --HEAD. The 1.9.0 dev version did not
solve the BLE connection issue.

Any clue?

many thanks.

-- 
Mo