[PR] ext/libsamplerate: adjust config.h to be package exclusive [mynewt-nimble]

2024-03-04 Thread via GitHub


KKopyscinski opened a new pull request, #1720:
URL: https://github.com/apache/mynewt-nimble/pull/1720

   `config.h` being in `include` directory meant that it was included globally. 
It may cause it being indluded into other package (as global include)
   
   Added prefixes to libsamplerate syscfg settings.


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Add common startup for cortex mcu's [mynewt-core]

2024-03-04 Thread via GitHub


kasjer merged PR #3129:
URL: https://github.com/apache/mynewt-core/pull/3129


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



(mynewt-core) branch master updated: Add cortex common startup and linker scripts

2024-03-04 Thread jerzy
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new f3c0117c8 Add cortex common startup and linker scripts
f3c0117c8 is described below

commit f3c0117c83e20546f08a7898bea9740a03d51f9e
Author: Jerzy Kasenberg 
AuthorDate: Fri Jan 19 15:09:32 2024 +0100

Add cortex common startup and linker scripts

This provides way to have common linker script for mynewt.
Linker script is generated by script will be unified across MCU's, so 
switching between devices will not
lead to some unexpected behavior.

Signed-off-by: Jerzy Kasenberg 
---
 boot/startup/include/mynewt_config.ld.h|  76 +
 boot/startup/mynewt_cortex_m0.ld   | 311 +
 boot/startup/mynewt_cortex_m33.ld  | 311 +
 boot/startup/mynewt_cortex_m4.ld   | 311 +
 boot/startup/mynewt_cortex_m7.ld   | 306 
 boot/startup/pkg.yml   |  31 ++
 boot/startup/scripts/generate_linker_script.sh |  40 +++
 .../startup/src/arch/cortex_m0/cortex_m0_startup.s |  74 +
 .../src/arch/cortex_m33/cortex_m33_startup.s   |  80 ++
 .../startup/src/arch/cortex_m4/cortex_m4_startup.s |  77 +
 .../startup/src/arch/cortex_m7/cortex_m7_startup.s |  77 +
 boot/startup/src/interrupts.c  | 131 +
 boot/startup/syscfg.yml|  45 +++
 13 files changed, 1870 insertions(+)

diff --git a/boot/startup/include/mynewt_config.ld.h 
b/boot/startup/include/mynewt_config.ld.h
new file mode 100644
index 0..43baa54f7
--- /dev/null
+++ b/boot/startup/include/mynewt_config.ld.h
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef MYNEWT_CONFIG_LD_H
+#define MYNEWT_CONFIG_LD_H
+
+/* Default destination for RTT section */
+#ifndef RTT_RAM
+#define RTT_RAM RAM
+#endif
+
+/* Default destination section for function that should be execute from RAM */
+#ifndef TEXT_RAM
+#define TEXT_RAM RAM
+#endif
+
+#ifndef VECTOR_RELOCATION_RAM
+#define VECTOR_RELOCATION_RAM RAM
+#endif
+/*#define COREDATA_RAM RAM*/
+/*#define COREBSS_RAM RAM*/
+#ifndef DATA_RAM
+#define DATA_RAM RAM
+#endif
+#ifndef BSS_RAM
+#define BSS_RAM RAM
+#endif
+#ifndef BSSNZ_RAM
+#define BSSNZ_RAM RAM
+#endif
+#ifndef STACK_RAM
+#define STACK_RAM RAM
+#endif
+
+#ifndef MYNEWT_VAL_RESET_HANDLER
+#define RESET_HANDLER Reset_Handler
+#else
+#define RESET_HANDLER MYNEWT_VAL_RESET_HANDLER
+#endif
+
+#ifndef MYNEWT_VAL_MAIN_STACK_SIZE
+#define STACK_SIZE 0x800
+#else
+#define STACK_SIZE MYNEWT_VAL_MAIN_STACK_SIZE
+#endif
+
+#define RAM_START MYNEWT_VAL_MCU_RAM_START
+#define RAM_SIZE MYNEWT_VAL_MCU_RAM_SIZE
+
+#ifndef MYNEWT_CODE
+#if MYNEWT_VAL_RAM_RESIDENT
+#define MYNEWT_CODE RAM
+#elif MYNEWT_VAL_BOOT_LOADER
+#define MYNEWT_CODE BOOT
+#else
+#define MYNEWT_CODE SLOT0
+#endif
+#endif
+
+#endif
diff --git a/boot/startup/mynewt_cortex_m0.ld b/boot/startup/mynewt_cortex_m0.ld
new file mode 100644
index 0..7d47daf66
--- /dev/null
+++ b/boot/startup/mynewt_cortex_m0.ld
@@ -0,0 +1,311 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* Entry Point */

(mynewt-newt) branch master updated: newt: Add possibility to mark package as experimental

2024-03-04 Thread janc
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 679b6a8e newt: Add possibility to mark package as experimental
679b6a8e is described below

commit 679b6a8e93bdcec9cdf3ea00fb461043083a632b
Author: Michal Gorecki 
AuthorDate: Fri Jan 12 13:50:49 2024 +0100

newt: Add possibility to mark package as experimental

This adds possibility to mark package as experimental
by adding "pkg.experimental: 1" line in the pkg.yml file.
---
 newt/builder/targetbuild.go |  6 +-
 newt/resolve/resolve.go | 19 ++-
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/newt/builder/targetbuild.go b/newt/builder/targetbuild.go
index 675d4e01..c7efc03a 100644
--- a/newt/builder/targetbuild.go
+++ b/newt/builder/targetbuild.go
@@ -284,7 +284,11 @@ func (t *TargetBuilder) validateAndWriteCfg() error {
log.Warn(line)
}
 
-   for _, line := range t.res.ExperimentalWarning() {
+   for _, line := range t.res.CfgExperimentalWarning() {
+   log.Warn(line)
+   }
+
+   for _, line := range t.res.PkgExperimentalWarning() {
log.Warn(line)
}
 
diff --git a/newt/resolve/resolve.go b/newt/resolve/resolve.go
index c04d3336..ef883de5 100644
--- a/newt/resolve/resolve.go
+++ b/newt/resolve/resolve.go
@@ -1358,10 +1358,27 @@ func (res *Resolution) DeprecatedWarning() []string {
return res.Cfg.DeprecatedWarning()
 }
 
-func (res *Resolution) ExperimentalWarning() []string {
+func (res *Resolution) CfgExperimentalWarning() []string {
return res.Cfg.ExperimentalWarning()
 }
 
+func (res *Resolution) PkgExperimentalWarning() []string {
+   lines := []string{}
+
+   for pkg := range res.LpkgRpkgMap {
+   experimental, err := pkg.PkgY.GetValBool("pkg.experimental", 
nil)
+   if err != nil {
+   log.Errorf("Internal error; Could not read package %s 
yml file", pkg.Name())
+   }
+   if experimental {
+   lines = append(lines,
+   fmt.Sprintf("Use of experimental package %s", 
pkg.Name()))
+   }
+   }
+
+   return lines
+}
+
 func LogTransientWarning(lpkg *pkg.LocalPackage) {
if lpkg.Type() == pkg.PACKAGE_TYPE_TRANSIENT {
log.Warnf("Transient package %s used, update configuration "+



Re: [PR] newt: Add possibility to mark package as experimental [mynewt-newt]

2024-03-04 Thread via GitHub


sjanc merged PR #539:
URL: https://github.com/apache/mynewt-newt/pull/539


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] tinyusb: Change revision to include NRF5x ISO fixes [mynewt-core]

2024-03-04 Thread via GitHub


kasjer closed pull request #3149: tinyusb: Change revision to include NRF5x ISO 
fixes
URL: https://github.com/apache/mynewt-core/pull/3149


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] tinyusb: Change revision to include NRF5x ISO fixes [mynewt-core]

2024-03-04 Thread via GitHub


kasjer commented on PR #3149:
URL: https://github.com/apache/mynewt-core/pull/3149#issuecomment-1976232452

   Due to repository.yml in TinyUSB this change while reasonable does not work 
and project.yml has to specify version and we have to wait till TinyUSB tag 
shows up and repository.yml is updated. It would be good for other external 
repository that don't have repository.yml file.


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [I] warn on missing or incomplete external repository [mynewt-newt]

2024-03-04 Thread via GitHub


sjanc closed issue #524: warn on missing or incomplete external repository
URL: https://github.com/apache/mynewt-newt/issues/524


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



(mynewt-newt) branch master updated: builder: Print warning if external repository is modified or missing

2024-03-04 Thread janc
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new ba89f152 builder: Print warning if external repository is modified or 
missing
ba89f152 is described below

commit ba89f15262bab671b61e146ea99edc4497202dd2
Author: Michal Gorecki 
AuthorDate: Tue Sep 5 14:55:50 2023 +0200

builder: Print warning if external repository is modified or missing

This adds functionality described in this issue:
https://github.com/apache/mynewt-newt/issues/524

Warning is only shown when the build failed
---
 newt/builder/build.go| 24 +++
 newt/builder/buildpackage.go | 46 
 newt/cli/build_cmds.go   |  5 +
 3 files changed, 75 insertions(+)

diff --git a/newt/builder/build.go b/newt/builder/build.go
index 543c5cb9..651c7dc4 100644
--- a/newt/builder/build.go
+++ b/newt/builder/build.go
@@ -57,6 +57,7 @@ type Builder struct {
buildNamestring
linkElf  string
injectedSettings map[string]string
+   modifiedExtRepos []string
 }
 
 func NewBuilder(
@@ -680,6 +681,8 @@ func (b *Builder) Build() error {
}
entries = append(entries, subEntries...)
 
+   b.modifiedExtRepos = append(b.modifiedExtRepos, 
bpkg.getModifiedReposNames()...)
+
if len(subEntries) > 0 {
bpkgCompilerMap[bpkg] = subEntries[0].Compiler
}
@@ -920,3 +923,24 @@ func (b *Builder) CleanArtifacts() {
os.Remove(p)
}
 }
+
+func Contains(elements []string, val string) bool {
+   for _, s := range elements {
+   if val == s {
+   return true
+   }
+   }
+   return false
+}
+
+func (b *Builder) AppendModifiedRepos(modifiedRepos []string) {
+   for _, repo := range modifiedRepos {
+   if !Contains(b.modifiedExtRepos, repo) {
+   b.modifiedExtRepos = append(b.modifiedExtRepos, repo)
+   }
+   }
+}
+
+func (b *Builder) GetModifiedRepos() []string {
+   return b.modifiedExtRepos
+}
diff --git a/newt/builder/buildpackage.go b/newt/builder/buildpackage.go
index c731872e..b5a9135b 100644
--- a/newt/builder/buildpackage.go
+++ b/newt/builder/buildpackage.go
@@ -20,9 +20,12 @@
 package builder
 
 import (
+   "mynewt.apache.org/newt/newt/downloader"
+   "mynewt.apache.org/newt/newt/repo"
"os"
"path/filepath"
"regexp"
+   "strings"
 
"mynewt.apache.org/newt/newt/newtutil"
"mynewt.apache.org/newt/newt/pkg"
@@ -341,3 +344,46 @@ func (bpkg *BuildPackage) privateIncludeDirs(b *Builder) 
[]string {
 
return incls
 }
+
+func (bpkg *BuildPackage) getModifiedReposNames() []string {
+   var modifiedRepos []string
+
+   settings := bpkg.rpkg.Lpkg.PkgY.AllSettings()
+   for settingName, setting := range settings {
+   if strings.HasPrefix(settingName, "repository") {
+   var version string
+
+   dl := downloader.NewGitDownloader()
+   rName := strings.TrimPrefix(settingName, "repository.")
+   r, _ := repo.NewRepo(rName, dl)
+
+   if util.NodeNotExist(r.Path()) {
+   modifiedRepos = append(modifiedRepos, r.Name())
+   continue
+   }
+
+   currentHash, _ := dl.HashFor(r.Path(), "HEAD")
+
+   aSetting, ok := setting.(map[interface{}]interface{})
+   if ok {
+   for field, value := range aSetting {
+   if field == "vers" {
+   aValue, ok := value.(string)
+   if ok {
+   version = 
strings.TrimSuffix(aValue, "-commit")
+   }
+   }
+   }
+   }
+
+   expectedHash, _ := dl.HashFor(r.Path(), version)
+   dirtyState, _ := r.DirtyState()
+
+   if currentHash != expectedHash || dirtyState != "" {
+   modifiedRepos = append(modifiedRepos, r.Name())
+   }
+   }
+   }
+
+   return modifiedRepos
+}
diff --git a/newt/cli/build_cmds.go b/newt/cli/build_cmds.go
index 6902e098..309b4345 100644
--- a/newt/cli/build_cmds.go
+++ b/newt/cli/build_cmds.go
@@ -161,6 +161,11 @@ func buildRunCmd(cmd *cobra.Command, args []string, 
printShellCmds bool, execute
}
 
 

Re: [PR] builder: Print warning if external repository is modified or missing [mynewt-newt]

2024-03-04 Thread via GitHub


sjanc merged PR #529:
URL: https://github.com/apache/mynewt-newt/pull/529


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



(mynewt-newt) branch master updated: newt: Fix shallow upgrade with specific commit version

2024-03-04 Thread janc
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 4632ba20 newt: Fix shallow upgrade with specific commit version
4632ba20 is described below

commit 4632ba209543c4163ffbb1153b5f75a37d35e514
Author: Michal Gorecki 
AuthorDate: Fri Feb 23 09:49:09 2024 +0100

newt: Fix shallow upgrade with specific commit version

Upgrading project using shallow option was causing an error if
repository version was specified as specific commit.
Because this specific commit could not yet be fetched
it could not be found during version validation.
Now if specific commit could not be found, instead of returning
an error immediately, we first try to fetch it.
---
 newt/downloader/downloader.go | 18 ++
 newt/repo/version.go  |  9 +
 2 files changed, 27 insertions(+)

diff --git a/newt/downloader/downloader.go b/newt/downloader/downloader.go
index 8ed2927b..eea3249a 100644
--- a/newt/downloader/downloader.go
+++ b/newt/downloader/downloader.go
@@ -61,6 +61,9 @@ type Downloader interface {
// Fetches all remotes.
Fetch(path string) error
 
+   // Fetches specific commit
+   FetchCommit(path string, commit string) error
+
// Checks out the specified commit (hash, tag, or branch).  Always puts 
the
// repo in a "detached head" state.
Checkout(path string, commit string) error
@@ -774,6 +777,11 @@ func (gd *GithubDownloader) Fetch(repoDir string) error {
})
 }
 
+func (gd *GithubDownloader) FetchCommit(repoDir string, commit string) error {
+   _, err := executeGitCommand(repoDir, []string{"fetch", "--depth=1", 
"origin", commit}, true)
+   return err
+}
+
 func (gd *GithubDownloader) password() string {
if gd.Password != "" {
return gd.Password
@@ -943,6 +951,11 @@ func (gd *GitDownloader) Fetch(repoDir string) error {
})
 }
 
+func (gd *GitDownloader) FetchCommit(repoDir string, commit string) error {
+   _, err := executeGitCommand(repoDir, []string{"fetch", "--depth=1", 
"origin", commit}, true)
+   return err
+}
+
 func (gd *GitDownloader) FetchFile(
commit string, path string, filename string, dstDir string) error {
 
@@ -1043,6 +1056,11 @@ func (ld *LocalDownloader) Fetch(path string) error {
return ld.Clone(ld.MainBranch(), path)
 }
 
+func (ld *LocalDownloader) FetchCommit(path string, commit string) error {
+   _, err := executeGitCommand(path, []string{"fetch", "--depth=1", 
"origin", commit}, true)
+   return err
+}
+
 func (ld *LocalDownloader) Checkout(path string, commit string) error {
_, err := executeGitCommand(path, []string{"checkout", commit}, true)
return err
diff --git a/newt/repo/version.go b/newt/repo/version.go
index 5f0329be..b4aa09c5 100644
--- a/newt/repo/version.go
+++ b/newt/repo/version.go
@@ -126,6 +126,15 @@ func (r *Repo) VersionIsValid(ver newtutil.RepoVersion) 
bool {
}
 
cs, _ := r.downloader.CommitsFor(r.Path(), ver.Commit)
+
+   // Try to fetch commit if it was not found
+   if len(cs) <= 0 {
+   err := r.Downloader().FetchCommit(r.Path(), ver.Commit)
+   if err != nil {
+   return false
+   }
+   cs, _ = r.downloader.CommitsFor(r.Path(), ver.Commit)
+   }
return len(cs) > 0
 }
 



Re: [PR] newt: Fix shallow upgrade with specific commit version [mynewt-newt]

2024-03-04 Thread via GitHub


sjanc merged PR #543:
URL: https://github.com/apache/mynewt-newt/pull/543


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Fix Coverity issues in mesh [mynewt-nimble]

2024-03-04 Thread via GitHub


github-advanced-security[bot] commented on code in PR #:
URL: https://github.com/apache/mynewt-nimble/pull/#discussion_r1510768677


##
nimble/host/mesh/src/testing.c:
##
@@ -123,18 +123,18 @@
console_printf("IV Index: %08lx\n", (long) bt_mesh.iv_index);
console_printf("Dev key: %s\n", bt_hex(bt_mesh.dev_key, 16));
 
-   for (i = 0; i < ARRAY_SIZE(bt_mesh_cdb.app_keys); ++i)
+   for (i = 0; i < ARRAY_SIZE(bt_mesh_cdb.subnets); ++i)

Review Comment:
   ## Comparison result is always the same
   
   Comparison is always false because i >= 0.
   
   [Show more 
details](https://github.com/apache/mynewt-nimble/security/code-scanning/83)



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Fix Coverity issues in mesh [mynewt-nimble]

2024-03-04 Thread via GitHub


KKopyscinski commented on code in PR #:
URL: https://github.com/apache/mynewt-nimble/pull/#discussion_r1510739784


##
nimble/host/mesh/src/cfg_cli.c:
##
@@ -815,17 +815,13 @@ static int node_identity_status(struct bt_mesh_model 
*model,
}
 
status = net_buf_simple_pull_u8(buf);
-   net_idx = net_buf_simple_pull_le16(buf) & 0xfff;
+   net_buf_simple_pull_le16(buf);

Review Comment:
   done



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org