Re: C library re-entrancy under Zephyr
Dave Nadler
Hi Rob - Went through this a few years
back with FreeRTOS.
The link below may be helpful. Hope that helps! Best Regards, Dave On 3/11/2021 1:04 PM, Rob Meades via
lists.zephyrproject.org wrote:
Thanks for the swift response. That's a shame. I will go look at the PR at your link as shifting to the re-entrant versions just for Zephyr is going to be painful. Rob -----Original Message----- From: users@... <users@...> On Behalf Of Kumar Gala Sent: 11 March 2021 17:54 To: Rob Meades <Rob.Meades@...> Cc: users@... Subject: Re: [Zephyr-users] C library re-entrancy under Zephyr *** This is an EXTERNAL email. It was sent from outside of u-blox. *** Re-entrant support between newlib and zephyr is not currently supported. There’s an old PR on the subject https://github.com/zephyrproject-rtos/zephyr/pull/21518 - kOn Mar 11, 2021, at 11:51 AM, Rob Meades via lists.zephyrproject.org <Rob.Meades=u-blox.com@...> wrote: Should I expect C library functions (e.g. strtok()) under Zephyr to be re-entrant or must I call the re-entrant versions (i.e. in this case strtok_r())? I ask because I am building/running nRF52840 (cortex-m4) and strok() _appears_ to NOT be re-entrant: I'd like to understand if this is expected or if I've messed up a configuration somewhere. My prj.conf file is attached in case it is helpful in answering the question. Rob <prj.conf>
-- Dave Nadler, USA East Coast voice (978) 263-0097, drn@..., Skype Dave.Nadler1
|
|
Re: [Zephyr-devel] Changing default branch name on GitHub - possible action required
Kumar Gala
Will see if other downstream users request such support.
toggle quoted messageShow quoted text
How long would want for the various phases? - k
On Mar 11, 2021, at 11:45 AM, Jack Rosenthal <jrosenth@...> wrote:
|
|
Re: C library re-entrancy under Zephyr
Kumar Gala
As with and open source project, patches/PRs are welcome to improve and support this :)
toggle quoted messageShow quoted text
- k
On Mar 11, 2021, at 12:04 PM, Rob Meades <Rob.Meades@...> wrote:
|
|
Re: C library re-entrancy under Zephyr
Rob Meades
Thanks for the swift response. That's a shame. I will go look at the PR at your link as shifting to the re-entrant versions just for Zephyr is going to be painful.
toggle quoted messageShow quoted text
Rob
-----Original Message-----
From: users@... <users@...> On Behalf Of Kumar Gala Sent: 11 March 2021 17:54 To: Rob Meades <Rob.Meades@...> Cc: users@... Subject: Re: [Zephyr-users] C library re-entrancy under Zephyr *** This is an EXTERNAL email. It was sent from outside of u-blox. *** Re-entrant support between newlib and zephyr is not currently supported. There’s an old PR on the subject https://github.com/zephyrproject-rtos/zephyr/pull/21518 - k On Mar 11, 2021, at 11:51 AM, Rob Meades via lists.zephyrproject.org <Rob.Meades=u-blox.com@...> wrote:
|
|
Re: C library re-entrancy under Zephyr
Kumar Gala
Re-entrant support between newlib and zephyr is not currently supported.
toggle quoted messageShow quoted text
There’s an old PR on the subject https://github.com/zephyrproject-rtos/zephyr/pull/21518 - k
On Mar 11, 2021, at 11:51 AM, Rob Meades via lists.zephyrproject.org <Rob.Meades=u-blox.com@...> wrote:
|
|
C library re-entrancy under Zephyr
Rob Meades
Should I expect C library functions (e.g. strtok()) under Zephyr to be re-entrant or must I call the re-entrant versions (i.e. in this case strtok_r())?
I ask because I am building/running nRF52840 (cortex-m4) and strok() _appears_ to NOT be re-entrant: I'd like to understand if this is expected or if I've messed up a configuration somewhere. My prj.conf file is attached in case it is helpful in answering the question. Rob
|
|
Re: [Zephyr-devel] Changing default branch name on GitHub - possible action required
Jack Rosenthal <jrosenth@...>
The typical way I've seen this done is: Phase 1: Create the main branch at the same commit hash as master. Repo maintainers make sure that the main branch is synced to master. Phase 2: Set the default branch to "main". Continue syncing "main" and "master". Phase 3: Stop syncing "main" and "master". Master goes stale. Phase 4: Delete the (now stale) master branch. I'm not sure if GitHub has tools for branch syncing, but it can be done easy enough from the command line by someone with push access.
On Thu, Mar 11, 2021 at 10:38 AM Kumar Gala <kumar.gala@...> wrote: Jack,
|
|
Re: [Zephyr-devel] Changing default branch name on GitHub - possible action required
Kumar Gala
Jack,
toggle quoted messageShow quoted text
We are utilizing what GitHub provides and as far as I can tell once we make the change to the default branch from ‘master’ to ‘main’ the ‘master’ branch will no longer exist in the repository. So downstream users will need to adjust after the change is made. If you have some means to handle such a synchronization its something that we can discuss. - k
On Mar 11, 2021, at 10:12 AM, Jack Rosenthal <jrosenth@...> wrote:
|
|
Re: [Zephyr-devel] Changing default branch name on GitHub - possible action required
Jack Rosenthal <jrosenth@...>
Hi, Will there be a period of time that we have two main branches ("master" and "main") that are auto-synced to give time for people to adjust their tools? Thanks, Jack
On Thu, Mar 11, 2021 at 6:32 AM Kumar Gala <kumar.gala@...> wrote: We will be changing the default branch on github from ‘master' to ‘main' on Friday (Mar 11, 2021).
|
|
Re: [Zephyr-devel] Changing default branch name on GitHub (delayed)
Kumar Gala
All,
toggle quoted messageShow quoted text
We’ve identified some changes we need to make to west to make the transition of branch name cleaner. We will delay the branch name change until these changes are made to west and a version of west is released. Sorry for the inconvenience. - k
On Mar 11, 2021, at 7:32 AM, Kumar Gala via lists.zephyrproject.org <kumar.gala=linaro.org@...> wrote:
|
|
Changing default branch name on GitHub - possible action required
Kumar Gala
We will be changing the default branch on github from ‘master' to ‘main' on Friday (Mar 11, 2021).
There is no action required for any open PRs, however you’ll need to update your local git clone as follows: git branch -m master main git fetch origin git branch -u origin/main main Will announce here when this change is made on Friday. thanks - k
|
|
Re: Building error on linux.
#west
Carles Cufi
Hi there,
This means that you don’t have a full zephyr environment.
Please follow the Getting Started Guide from scratch and you should be able to get this working:
https://docs.zephyrproject.org/latest/getting_started/index.html
Carles
From: users@... <users@...>
On Behalf Of wbasser via lists.zephyrproject.org
Sent: 09 March 2021 22:01 To: users@... Subject: [Zephyr-users] Building error on linux. #west
I created this project on windows and built it successfully. Migrated to Linux as this is our normal build environment. Checked the file out of git and upon attempting to build I get the following error. wbasser@ubuntu:~/strongarmtech/git/fuse-zephyr$ dir CMakeLists.txt prj.conf README.md src wbasser@ubuntu:~/strongarmtech/git/fuse-zephyr$ west build -p auto -b nrf52dk_nrf52832 usage: west [-h] [-z ZEPHYR_BASE] [-v] [-V] <command> ... west: error: argument <command>: invalid choice: 'build' (choose from 'init', 'update', 'list', 'manifest', 'diff', 'status', 'forall', 'help', 'config', 'topdir', 'selfupdate')
<pre><font color="#4E9A06"><b>wbasser@ubuntu</b></font>:<font color="#3465A4"><b>~/zephyrproject/zephyr</b></font>$ west build -p auto -b nrf52dk_nrf52832 ~/strongarmtech/git/fuse-zephyr <font color="#8AE234">-- west build: generating a build system</font> CMake Error: The source "/home/wbasser/strongarmtech/git/fuse-zephyr/CMakeLists.txt" does not match the source "/home/wbasser/zephyrproject/zephyr/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory. <font color="#EF2929">FATAL ERROR: command exited with status 1: /usr/bin/cmake -DWEST_PYTHON=/usr/bin/python3 -B/home/wbasser/zephyrproject/zephyr/build -S/home/wbasser/strongarmtech/git/fuse-zephyr -GNinja -DBOARD=nrf52dk_nrf52832</font> <font color="#4E9A06"><b>wbasser@ubuntu</b></font>:<font color="#3465A4"><b>~/zephyrproject/zephyr</b></font>$ </pre>
|
|
Building error on linux.
#west
wbasser@...
I created this project on windows and built it successfully. Migrated to Linux as this is our normal build environment. Checked the file out of git and upon attempting to build I get the following error.
wbasser@ubuntu:~/strongarmtech/git/fuse-zephyr$ dir
CMakeLists.txt prj.conf README.md src
wbasser@ubuntu:~/strongarmtech/git/fuse-zephyr$ west build -p auto -b nrf52dk_nrf52832
usage: west [-h] [-z ZEPHYR_BASE] [-v] [-V] <command> ...
west: error: argument <command>: invalid choice: 'build' (choose from 'init', 'update', 'list', 'manifest', 'diff', 'status', 'forall', 'help', 'config', 'topdir', 'selfupdate')
If I go to zephyprojects/zephyr and execute the following command, I get the following: <pre><font color="#4E9A06"><b>wbasser@ubuntu</b></font>:<font color="#3465A4"><b>~/zephyrproject/zephyr</b></font>$ west build -p auto -b nrf52dk_nrf52832 ~/strongarmtech/git/fuse-zephyr
<font color="#8AE234">-- west build: generating a build system</font>
CMake Error: The source "/home/wbasser/strongarmtech/git/fuse-zephyr/CMakeLists.txt" does not match the source "/home/wbasser/zephyrproject/zephyr/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory.
<font color="#EF2929">FATAL ERROR: command exited with status 1: /usr/bin/cmake -DWEST_PYTHON=/usr/bin/python3 -B/home/wbasser/zephyrproject/zephyr/build -S/home/wbasser/strongarmtech/git/fuse-zephyr -GNinja -DBOARD=nrf52dk_nrf52832</font>
<font color="#4E9A06"><b>wbasser@ubuntu</b></font>:<font color="#3465A4"><b>~/zephyrproject/zephyr</b></font>$
</pre>
Any ideas
|
|
Re: DTS own node DT_N_S_ undeclared
Piotr Barszczewski <piotr@...>
Thank you very much. I understand more now and was able to find my mistake. I’ve focused too much on trying to get DT_N_S_vbatt_S_vbatt0 to be defined while the mistake was somewhere else - in my case it was a DEVICE_DT_GET(DT_IO_CHANNELS_CTLR(VBATT_LIPO)) further - as you previously indicated that there might be the source of the problem. Thank you again for your time and help!
Best regards
|
|
Re: DTS own node DT_N_S_ undeclared
Kumar Gala
On Mar 5, 2021, at 11:26 AM, Piotr Barszczewski <piotr@...> wrote:So you are seeing correct behavior. The are several ways to get a NODE reference (DT_PATH and DT_NODELABEL) are 2 of them. They should expand to DT_N_S_vbatt_S_vbatt0. (This is meant to be concatenated with other identifies to resolve to an actual define in the generated header - via the macros on devicetree.h). It will not resolve to a meaningful value that can be compiled by itself. It has to be used in connection with another macro in devicetree.h to get some data from the dts node. For example if you wanted the "output-ohms” for vbatt0 you’d do something like: int out_ohms = DT_PROP(VBATT_LIPO, output_ohms); That would resolve to: int out_ohms = 3300000; - k
|
|
Re: DTS own node DT_N_S_ undeclared
Piotr Barszczewski <piotr@...>
Hello, Thank you for your response. My code is very similar to https://github.com/zephyrproject-rtos/zephyr/blob/master/samples/boards/nrf/battery/src/battery.c with the change that I’ve refactored it to accept different instances instead of supporting single #define VBATT DT_PATH(vbatt) . It’s practically 1:1 with what I needed so it seemed more reasonable to approach this way. Regarding #define VBATT_LIPO DT_NODELABEL(vbatt_lipo) and #define VBATT_LIPO DT_PATH(vbatt, vbatt0) I’ve tried this but the result is that in the end /* Existence and alternate IDs: */ #define DT_N_S_vbatt_S_vbatt0_EXISTS 1 #define DT_N_INST_0_voltage_divider DT_N_S_vbatt_S_vbatt0 #define DT_N_NODELABEL_vbatt_lipo DT_N_S_vbatt_S_vbatt0 Always points to non-existing DT_N_S_vbatt_S_vbatt0. It’s not clear to me where it should it be defined if not from DTS. Best regards
|
|
Re: DTS own node DT_N_S_ undeclared
Kumar Gala
On Mar 5, 2021, at 9:55 AM, Piotr Barszczewski <piotr@...> wrote: Oh, noticed your DT_PATH(batt, vbatt_lipo) is not correct. Try: #define VBATT_LIPO DT_PATH(batt, vbatt0) or #define VBATT_LIPO DT_NODELABEL(vbatt_lipo) - k
|
|
Re: DTS own node DT_N_S_ undeclared
Kumar Gala
On Mar 5, 2021, at 9:55 AM, Piotr Barszczewski <piotr@...> wrote:That looks normal. What does the code you are building look like? What else should I do to make my own DTS node be usable in the source file? I'm following the docs, referencing it by #define VBATT_LIPO DT_PATH(vbatt, vbatt_lipo) which is in line with the guides and docs but the DT_N_S_* is missing and I don't have a clue on how could I fix this.I think the .dts you have looks reasonable, my guess is the issue is more on the code usage side. Your define of VBATT_LIPO will give you a node reference which by its self is not useful. Its useful only w/regards to the macros in include/devicetree.h If you can share a snip of what the code looks like will probably be easier to see what might be the issue. - k
|
|
DTS own node DT_N_S_ undeclared
Piotr Barszczewski <piotr@...>
Hello, I'm writing an application for nrf52832 based board ADC + voltage divider functionalty as in the great nRF battery example https://docs.zephyrproject.org/latest/samples/boards/nrf/battery/README.html. I'm adapting it to support multiple vbatt nodes from DTS and while on the code layer it's quite simple I'm struggling with the DTS. My board dts file contains this part:
The devicetree snippet seems ok /* Existence and alternate IDs: */ #define DT_N_S_vbatt_S_vbatt0_EXISTS 1 #define DT_N_INST_0_voltage_divider DT_N_S_vbatt_S_vbatt0 #define DT_N_NODELABEL_vbatt_lipo DT_N_S_vbatt_S_vbatt0 except for the DT_N_S_vbatt_S_vbatt0 which is not defined anywhere and as a result I'm getting: zephyr/include/devicetree.h:73:17: error: 'DT_N_S_vbatt_S_vbatt_lipo' undeclared here (not in a function); did you mean 'DT_N_S_vbatt_S_vbatt_lipo_ORD'? What else should I do to make my own DTS node be usable in the source file? I'm following the docs, referencing it by #define VBATT_LIPO DT_PATH(vbatt, vbatt_lipo) which is in line with the guides and docs but the DT_N_S_* is missing and I don't have a clue on how could I fix this. Did anyone experience this before and could point me to where I could find a solution? Been trying for days now without result. Best regards
|
|
Zephyr on VEGABoard - Can't flash the hello_world demo
#flash
#west
#risc-v
#vegaboard
#rv32m1
jean-baptiste.edde@...
Hello,
I’m a student in electronics and I’m trying to use Zephyr on the VEGABoard, but I’m facing some issues. I’ve been able to run some demos provided by openisa in the sdk, and modify some, using GPIOs, etc. With Zephyr though, when I’m using the toolchain of the VEGABoard and build the Zephyr hello_wolrd example with “west build …”, I’ve got an error: “Can’t build a dummy C file”. But when I build using “cmake …” then “ninja”, it works. I’ve tried with other toolchains and I’ve got no problems at all. But the issue comes when I want to flash the Zephyr app on the VEGABoard (nothing appears on the serial terminal connected to port of openSDA), it doesn’t works. Here is what I get: -- west flash: using runner openocdI’ve tried with both the RI5CY and ZERO_RISCY cores.
Could you help me figure out where the problem is and how it can be fixed please? Thank you
|
|