[GitHub] [mynewt-core] apache-mynewt-bot commented on issue #2259: ARM semihosting console on pinetime

2020-04-02 Thread GitBox
apache-mynewt-bot commented on issue #2259: ARM semihosting console on pinetime
URL: https://github.com/apache/mynewt-core/pull/2259#issuecomment-608018497
 
 
   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    hw/drivers/semihosting/include/semihosting/mbed_semihost_api.h
   
   
   ```diff
   @@ -1,4 +1,3 @@
   -
/* mbed Microcontroller Library
 * Copyright (c) 2006-2019 ARM Limited
 * SPDX-License-Identifier: Apache-2.0
   @@ -27,7 +26,8 @@
#if !defined(__ARMCC_VERSION)

#if defined(__ICCARM__)
   -static inline int __semihost(int reason, const void *arg)
   +static inline int
   +__semihost(int reason, const void *arg)
{
return __semihosting(reason, (void *)arg);
}
   @@ -43,19 +43,20 @@
#   define AngelSWIAsm  swi
#endif

   -static inline int __semihost(int reason, const void *arg)
   +static inline int
   +__semihost(int reason, const void *arg)
{
int value;

   -asm volatile(
   +asm volatile (
"mov r0, %1"  "\n\t"
"mov r1, %2"  "\n\t"
AngelSWIInsn " %a3"   "\n\t"
"mov %0, r0"
   -: "=r"(value)  /* output 
operands */
   -: "r"(reason), "r"(arg), "i"(AngelSWI) /* input 
operands  */
   +: "=r" (value)  /* output 
operands */
   +: "r" (reason), "r" (arg), "i" (AngelSWI) /* input 
operands  */
: "r0", "r1", "r2", "r3", "ip", "lr", "memory", "cc"   /* list of 
clobbered registers */
   -);
   +);

return value;
}
   ```
   
   
   
    hw/drivers/semihosting/src/mbed_semihost_api.c
   
   
   ```diff
   @@ -20,7 +20,7 @@
#include 
#include 

   -// ARM Semihosting Commands
   +/* ARM Semihosting Commands */
#define SYS_OPEN   (0x1)
#define SYS_CLOSE  (0x2)
#define SYS_WRITE  (0x5)
   @@ -33,7 +33,8 @@
#define SYS_RENAME (0xf)
#define SYS_EXIT   (0x18)

   -FILEHANDLE semihost_open(const char *name, int openmode)
   +FILEHANDLE
   +semihost_open(const char *name, int openmode)
{
uint32_t args[3];
args[0] = (uint32_t)name;
   @@ -42,12 +43,14 @@
return __semihost(SYS_OPEN, args);
}

   -int semihost_close(FILEHANDLE fh)
   +int
   +semihost_close(FILEHANDLE fh)
{
return __semihost(SYS_CLOSE, &fh);
}

   -int semihost_write(FILEHANDLE fh, const unsigned char *buffer, unsigned int 
length, int mode)
   +int
   +semihost_write(FILEHANDLE fh, const unsigned char *buffer, unsigned int 
length, int mode)
{
if (length == 0) {
return 0;
   @@ -60,7 +63,8 @@
return __semihost(SYS_WRITE, args);
}

   -int semihost_read(FILEHANDLE fh, unsigned char *buffer, unsigned int 
length, int mode)
   +int
   +semihost_read(FILEHANDLE fh, unsigned char *buffer, unsigned int length, 
int mode)
{
uint32_t args[3];
args[0] = (uint32_t)fh;
   @@ -69,12 +73,14 @@
return __semihost(SYS_READ, args);
}

   -int semihost_istty(FILEHANDLE fh)
   +int
   +semihost_istty(FILEHANDLE fh)
{
return __semihost(SYS_ISTTY, &fh);
}

   -int semihost_seek(FILEHANDLE fh, long position)
   +int
   +semihost_seek(FILEHANDLE fh, long position)
{
uint32_t args[2];
args[0] = (uint32_t)fh;
   @@ -82,17 +88,20 @@
return __semihost(SYS_SEEK, args);
}

   -int semihost_ensure(FILEHANDLE fh)
   +int
   +semihost_ensure(FILEHANDLE fh)
{
return __semihost(SYS_ENSURE, &fh);
}

   -long semihost_flen(FILEHANDLE fh)
   +long
   +semihost_flen(FILEHANDLE fh)
{
return __semihost(SYS_FLEN, &fh);
}

   -int semihost_remove(const char *name)
   +int
   +semihost_remove(const char *name)
{
uint32_t args[2];
args[0] = (uint32_t)name;
   @@ -100,7 +109,8 @@
return __semihost(SYS_REMOVE, args);
}

   -int semihost_rename(const char *old_name, const char *new_name)
   +int
   +semihost_rename(const char *old_name, const char *new_name)
{
uint32_t args[4];
args[0] = (uint32_t)old_name;
   @@ -110,13 +120,15 @@
return __semihost(SYS_RENAME, args);
}

   -int semihost_exit(void)
   +int
   +semihost_exit(void)
{
uint32_t args[4];
return __semihost(SYS_EXIT, args);
}

   -int semihost_connected(void)
   +int
   +semihost_connected(void)
{
return (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) ? 1 : 0;
}
   ```
   
   
   
    sys/console/full/src/semihosting_console.c
   
   
   ```diff
   @@ -25,7 +25,7 @@
static unsigned char 
semihosting_tx_buffer[MYNEWT_VAL(CONSOLE_SEMIHOSTING_TX_BUF_SIZE)];
s

[GitHub] [mynewt-core] caspermeijn opened a new pull request #2259: ARM semihosting console on pinetime

2020-04-02 Thread GitBox
caspermeijn opened a new pull request #2259: ARM semihosting console on pinetime
URL: https://github.com/apache/mynewt-core/pull/2259
 
 
   This adds ARM semihosting console support to mynewt. It is only the tx side. 
And it is enabled by default for PineTime BSP.
   
   This first commits adds the actual semihosting driver. It originates from 
mbed-os, with some modification to make it compatible with mynewt.
   
   The second commit adds semihosting to the full console implementation.
   
   The third commit adds support for the CFG_POST_INIT variable in the openocd 
script. This was needed to enable semihosting during debug sessions.
   
   The last commit edits the PineTime BSP to enable the semihosting console in 
syscfg and debug.sh.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[mynewt-newt] branch master updated (b8147e0 -> 316ca1d)

2020-04-02 Thread ccollins
This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git.


from b8147e0  Use rc-tag-inference in inter-repo dependencies
 new c5a8844  Update documentation for mfg create
 new 627d4d3  Removed create-image for bootloader, added link to file 
structure
 new 316ca1d  Removed unnecessary newt build

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 docs/command_list/newt_mfg.rst | 19 +++
 1 file changed, 15 insertions(+), 4 deletions(-)



[mynewt-newt] 02/03: Removed create-image for bootloader, added link to file structure

2020-04-02 Thread ccollins
This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git

commit 627d4d3e6db26c58eed6406de645463d630d5c35
Author: Stefan Diewald 
AuthorDate: Thu Apr 2 09:13:36 2020 +0200

Removed create-image for bootloader, added link to file structure

Removed create-image for the bootloader as commented by @ccollins476ad.
Added a link to the file structure overview in the mfg README.md
---
 docs/command_list/newt_mfg.rst | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/docs/command_list/newt_mfg.rst b/docs/command_list/newt_mfg.rst
index ee89005..8df2a68 100644
--- a/docs/command_list/newt_mfg.rst
+++ b/docs/command_list/newt_mfg.rst
@@ -104,7 +104,7 @@ Build the bootloader and app images.
 
 .. code-block:: console
 
-$ newt build rb_boot && newt create-image rb_boot 0.0.1
+$ newt build rb_boot
 $ newt build rb_blink && newt create-image rb_blinky 0.0.1
 
 Run the ``newt mfg create`` command to collect all the manufacturing snapshot 
files.
@@ -116,3 +116,5 @@ Run the ``newt mfg create`` command to collect all the 
manufacturing snapshot fi
 
 Generated the following files:
 
+
+A description of the generated files is available in the implementation's 
`readme 
`_



[GitHub] [mynewt-newt] ccollins476ad merged pull request #392: Update documentation for mfg create

2020-04-02 Thread GitBox
ccollins476ad merged pull request #392: Update documentation for mfg create
URL: https://github.com/apache/mynewt-newt/pull/392
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[mynewt-newt] 03/03: Removed unnecessary newt build

2020-04-02 Thread ccollins
This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git

commit 316ca1d40001450ed56cc1f1321a2cef54c0e6f1
Author: Stefan Diewald 
AuthorDate: Thu Apr 2 18:26:41 2020 +0200

Removed unnecessary newt build

Removed unnecessary newt build

Signed-off-by: Stefan Diewald 
---
 docs/command_list/newt_mfg.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/command_list/newt_mfg.rst b/docs/command_list/newt_mfg.rst
index 8df2a68..819a27e 100644
--- a/docs/command_list/newt_mfg.rst
+++ b/docs/command_list/newt_mfg.rst
@@ -105,7 +105,7 @@ Build the bootloader and app images.
 .. code-block:: console
 
 $ newt build rb_boot
-$ newt build rb_blink && newt create-image rb_blinky 0.0.1
+$ newt create-image rb_blinky 0.0.1
 
 Run the ``newt mfg create`` command to collect all the manufacturing snapshot 
files.
 



[mynewt-newt] 01/03: Update documentation for mfg create

2020-04-02 Thread ccollins
This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git

commit c5a8844fe2c59486768c5bf55384a64c47851e07
Author: Stefan Diewald 
AuthorDate: Wed Apr 1 15:40:57 2020 +0200

Update documentation for mfg create

Update for the documentation of mfg create command
to match the current implementation.

Signed-off-by: Stefan Diewald 
---
 docs/command_list/newt_mfg.rst | 21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/docs/command_list/newt_mfg.rst b/docs/command_list/newt_mfg.rst
index e614788..ee89005 100644
--- a/docs/command_list/newt_mfg.rst
+++ b/docs/command_list/newt_mfg.rst
@@ -73,7 +73,7 @@ Create the directory to hold the mfg packages.
 
 $ mkdir -p mfgs/rb_blinky_rsa
 
-The ``rb_blinky_rsa`` package needs a pkg.yml file. In addition it is needs a 
mfg.yml file to specify the two constituent targets. An example of each file is 
shown below.
+The ``rb_blinky_rsa`` package needs a pkg.yml file. In addition, it needs a 
mfg.yml file to specify the two constituent targets. An example of each file is 
shown below.
 
 .. code-block:: console
 
@@ -87,16 +87,25 @@ The ``rb_blinky_rsa`` package needs a pkg.yml file. In 
addition it is needs a mf
 .. code-block:: console
 
 $  more mfgs/rb_blinky_rsa/mfg.yml
-mfg.bootloader: 'targets/rb_boot'
-mfg.images:
-- 'targets/rb_blinky'
+mfg.bsp: "@apache-mynewt-core/hw/bsp/rb-nano2"
+mfg.targets:
+- rb_boot:
+  name: "targets/rb_boot"
+  area: FLASH_AREA_BOOTLOADER
+  offset: 0x0
+- rb_blinky:
+  name: "targets/rb_blinky"
+  area: FLASH_AREA_IMAGE_0
+  offset: 0x0
+mfg.meta:
+area: FLASH_AREA_BOOTLOADER
 
 Build the bootloader and app images.
 
 .. code-block:: console
 
-$ newt build rb_boot
-$ newt create-image rb_blinky 0.0.1
+$ newt build rb_boot && newt create-image rb_boot 0.0.1
+$ newt build rb_blink && newt create-image rb_blinky 0.0.1
 
 Run the ``newt mfg create`` command to collect all the manufacturing snapshot 
files.
 



[GitHub] [mynewt-newt] dwld commented on a change in pull request #392: Update documentation for mfg create

2020-04-02 Thread GitBox
dwld commented on a change in pull request #392: Update documentation for mfg 
create
URL: https://github.com/apache/mynewt-newt/pull/392#discussion_r402446438
 
 

 ##
 File path: docs/command_list/newt_mfg.rst
 ##
 @@ -87,16 +87,25 @@ The ``rb_blinky_rsa`` package needs a pkg.yml file. In 
addition it is needs a mf
 .. code-block:: console
 
 $  more mfgs/rb_blinky_rsa/mfg.yml
-mfg.bootloader: 'targets/rb_boot'
-mfg.images:
-- 'targets/rb_blinky'
+mfg.bsp: "@apache-mynewt-core/hw/bsp/rb-nano2"
+mfg.targets:
+- rb_boot:
+  name: "targets/rb_boot"
+  area: FLASH_AREA_BOOTLOADER
+  offset: 0x0
+- rb_blinky:
+  name: "targets/rb_blinky"
+  area: FLASH_AREA_IMAGE_0
+  offset: 0x0
+mfg.meta:
+area: FLASH_AREA_BOOTLOADER
 
 Build the bootloader and app images.
 
 .. code-block:: console
 
 $ newt build rb_boot
-$ newt create-image rb_blinky 0.0.1
+$ newt build rb_blink && newt create-image rb_blinky 0.0.1
 
 Review comment:
   Thanks, @ccollins476ad. You are right ;) I am a newbie to newt... Changed.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [mynewt-newt] ccollins476ad commented on a change in pull request #392: Update documentation for mfg create

2020-04-02 Thread GitBox
ccollins476ad commented on a change in pull request #392: Update documentation 
for mfg create
URL: https://github.com/apache/mynewt-newt/pull/392#discussion_r402433931
 
 

 ##
 File path: docs/command_list/newt_mfg.rst
 ##
 @@ -87,16 +87,25 @@ The ``rb_blinky_rsa`` package needs a pkg.yml file. In 
addition it is needs a mf
 .. code-block:: console
 
 $  more mfgs/rb_blinky_rsa/mfg.yml
-mfg.bootloader: 'targets/rb_boot'
-mfg.images:
-- 'targets/rb_blinky'
+mfg.bsp: "@apache-mynewt-core/hw/bsp/rb-nano2"
+mfg.targets:
+- rb_boot:
+  name: "targets/rb_boot"
+  area: FLASH_AREA_BOOTLOADER
+  offset: 0x0
+- rb_blinky:
+  name: "targets/rb_blinky"
+  area: FLASH_AREA_IMAGE_0
+  offset: 0x0
+mfg.meta:
+area: FLASH_AREA_BOOTLOADER
 
 Build the bootloader and app images.
 
 .. code-block:: console
 
 $ newt build rb_boot
-$ newt create-image rb_blinky 0.0.1
+$ newt build rb_blink && newt create-image rb_blinky 0.0.1
 
 Review comment:
   That should be `rb_boot` (not `rb_blink`), right? :)
   
   EDIT: Oh, rb_boot is already getting built in the line above.  In that case, 
this line can just be:
   ```
   newt create-image rb_blinky 0.0.1
   ```
   
   No need to run `build` prior to `create-image`.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [mynewt-newt] ccollins476ad commented on a change in pull request #392: Update documentation for mfg create

2020-04-02 Thread GitBox
ccollins476ad commented on a change in pull request #392: Update documentation 
for mfg create
URL: https://github.com/apache/mynewt-newt/pull/392#discussion_r402433931
 
 

 ##
 File path: docs/command_list/newt_mfg.rst
 ##
 @@ -87,16 +87,25 @@ The ``rb_blinky_rsa`` package needs a pkg.yml file. In 
addition it is needs a mf
 .. code-block:: console
 
 $  more mfgs/rb_blinky_rsa/mfg.yml
-mfg.bootloader: 'targets/rb_boot'
-mfg.images:
-- 'targets/rb_blinky'
+mfg.bsp: "@apache-mynewt-core/hw/bsp/rb-nano2"
+mfg.targets:
+- rb_boot:
+  name: "targets/rb_boot"
+  area: FLASH_AREA_BOOTLOADER
+  offset: 0x0
+- rb_blinky:
+  name: "targets/rb_blinky"
+  area: FLASH_AREA_IMAGE_0
+  offset: 0x0
+mfg.meta:
+area: FLASH_AREA_BOOTLOADER
 
 Build the bootloader and app images.
 
 .. code-block:: console
 
 $ newt build rb_boot
-$ newt create-image rb_blinky 0.0.1
+$ newt build rb_blink && newt create-image rb_blinky 0.0.1
 
 Review comment:
   That should be `rb_boot` (not `rb_blink`), right? :)


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [mynewt-newt] dwld commented on a change in pull request #392: Update documentation for mfg create

2020-04-02 Thread GitBox
dwld commented on a change in pull request #392: Update documentation for mfg 
create
URL: https://github.com/apache/mynewt-newt/pull/392#discussion_r402104325
 
 

 ##
 File path: docs/command_list/newt_mfg.rst
 ##
 @@ -87,16 +87,25 @@ The ``rb_blinky_rsa`` package needs a pkg.yml file. In 
addition it is needs a mf
 .. code-block:: console
 
 $  more mfgs/rb_blinky_rsa/mfg.yml
-mfg.bootloader: 'targets/rb_boot'
-mfg.images:
-- 'targets/rb_blinky'
+mfg.bsp: "@apache-mynewt-core/hw/bsp/rb-nano2"
+mfg.targets:
+- rb_boot:
+  name: "targets/rb_boot"
+  area: FLASH_AREA_BOOTLOADER
+  offset: 0x0
+- rb_blinky:
+  name: "targets/rb_blinky"
+  area: FLASH_AREA_IMAGE_0
+  offset: 0x0
+mfg.meta:
+area: FLASH_AREA_BOOTLOADER
 
 Build the bootloader and app images.
 
 .. code-block:: console
 
-$ newt build rb_boot
-$ newt create-image rb_blinky 0.0.1
+$ newt build rb_boot && newt create-image rb_boot 0.0.1
 
 Review comment:
   @ccollins476ad, thanks for your feedback. I removed it.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services