Re: How to detect a thread is aborted and restart it?
Li, Jun R
Andrew, Thank you! I’ll try more times to see if it can restart. Where is the testing application you mentioned for restarting thread? Maybe I didn’t use it in the right way.
Regards, Jun
From: "Boie, Andrew P" <andrew.p.boie@...>
Ø However, it seems not possible to restart the same thread with the same struct thread variable, with the function “k_thread_create”. When the function is called, the system is stuck. Has anyone tried to restart an aborted thread before?
Hi Li,
Yes this should be possible, we do this all the time (recycle thread objects) in our test cases. Have you had a chance to debug this further? Where does it get stuck for you?
Andrew
|
|
Re: multithread problem in zephyr application
Boie, Andrew P
Ø I have no idea why the application crashes at this address, is it like a thread racing condition problem or the thread stack overflow happened?
My money would be on stack overflow. You can try to enable the MPU (if supported) or enable CONFIG_STACK_SENTINEL to try to establish if this is the case. Stack overflows tend to cause all kinds of impossible/baffling behavior.
Ø By the way, how can I check which thread crashes with the thread ID “20000c4c”?
The address should resolve to an instance of struct k_thread in the symbol table.
HTH, Andrew
|
|
Re: How to detect a thread is aborted and restart it?
Boie, Andrew P
Ø However, it seems not possible to restart the same thread with the same struct thread variable, with the function “k_thread_create”. When the function is called, the system is stuck. Has anyone tried to restart an aborted thread before?
Hi Li,
Yes this should be possible, we do this all the time (recycle thread objects) in our test cases. Have you had a chance to debug this further? Where does it get stuck for you?
Andrew
|
|
Re: How to detect a thread is aborted and restart it?
Li, Jun R
Another question still related to thread problem: now I can use fn_abort to detect a thread was forcibly aborted due to something wrong. However, it seems not possible to restart the same thread with the same struct thread variable, with the function “k_thread_create”. When the function is called, the system is stuck. Has anyone tried to restart an aborted thread before?
Thank you!
Regards, Jun
From: <zephyr-devel-bounces@...> on behalf of "Li, Jun R" <jun.r.li@...>
Thank you, Andrew and Mike!
I think the function fn_abort is good enough to meet my requests. Thank you very much!
Regards, Jun
From: "Boie, Andrew P" <andrew.p.boie@...>
Ø I don’t see much other way unfortunately; I think it would be nice is Zephyr added Fault hooks per thread so you could set a function to be called on a thread faulting.
There is a fn_abort member in struct k_thread which if not NULL, gets called when a thread goes through the k_thread_abort() code path, including when it hits a fatal exception. It's a void function that takes no parameters.
There appear to be no public APIs to set a thread abort function, but it should be fairly straightforward to add them.
HTH Andrew
|
|
multithread problem in zephyr application
Li, Jun R
Hi everyone,
I got a strange issue on my multi-threaded application. Sometimes, my application crashes due to the error like below:
Executing thread ID (thread): 0x20000c4c Faulting instruction address: 0x8010c16 Imprecise data bus error Fatal fault in ISR! Spinning...
I checked the address 0x8010c16 and found the crashed point is below: /* must be called with interrupts locked */ static inline void _thread_priority_set(struct k_thread *thread, int prio) { if (_is_thread_ready(thread)) { _remove_thread_from_ready_q(thread); 8010c04: f000 fbe2 bl 80113cc <_remove_thread_from_ready_q> thread->base.prio = prio; 8010c08: 72a5 strb r5, [r4, #10] _add_thread_to_ready_q(thread); 8010c0a: 4620 mov r0, r4 'y' : 'n', new_prio, mutex->owner->base.prio);
_thread_priority_set(mutex->owner, new_prio); } } 8010c0c: e8bd 4038 ldmia.w sp!, {r3, r4, r5, lr} 8010c10: f000 bbb4 b.w 801137c <_add_thread_to_ready_q> } else { thread->base.prio = prio; 8010c14: 72a5 strb r5, [r4, #10] 8010c16: bd38 pop {r3, r4, r5, pc}
I have no idea why the application crashes at this address, is it like a thread racing condition problem or the thread stack overflow happened?
By the way, how can I check which thread crashes with the thread ID “20000c4c”?
Thank you!
Regards, Jun Li
|
|
Re: Zephyr issue tracking system moved to Github
Paul Sokolovsky
Hello,
[] Thanks for acking. As a follow-up, I went and deleted the "area: NetMakes sense, +1 from me. Also consistent with Bluetooth, which is a* There are too many networking labels, one "area: Networking" isThis RFC from Jukka never got a response, but it seems that everyone Protocols" label. However, when checking stats above, I looked at only pull request numbers, but labels are also used by issues. And "area: Networking Clients" is currently assigned to 26+30 issues, while there're 126+319 "area: Networking". In other words, there're quite many "networking" issues (which after all may mean that we need further separation) and more than 10% of them are tagged as "area: Networking Clients". So, I guess I'll leave deciding on this issue to Jukka when he's back from vacation. -- Best Regards, Paul Linaro.org | Open source software for ARM SoCs Follow Linaro: http://www.facebook.com/pages/Linaro http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog
|
|
Re: BLE Nitrogen
Zarkhin, Gene <Gene_Zarkhin@...>
nRF52832 UART is connected to NXP front end chip and works correctly through CDC driver. I can communicate with nRF52 with no problem. I changed the board file and set correct LED and UART pins. There is nothing else there to modify 😊 And yes, from BLE point everything is the same. As other people mentioned radio is not the best, so next step I may try Nitrogen board rev.1.1
From: Puzdrowski, Andrzej [mailto:Andrzej.Puzdrowski@...]
Sent: Tuesday, December 12, 2017 10:01 AM To: Zarkhin, Gene <Gene_Zarkhin@...> Cc: zephyr-devel@...; Zarkhin, Gene <Gene_Zarkhin@...> Subject: RE: [Zephyr-devel] BLE Nitrogen
> Well, board configuration is different, different pins are used for LEDs, buttons and UART, but from BLE point of view everything should be the same, correct?
Can you check how you configured UART flow control on both boards you have used? Mabey this cause your troubles?
Andrzej
From:
zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...]
On Behalf Of Marti Bolivar
Hi,
On Mon, Dec 11, 2017 at 12:14 PM, Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...> wrote:
FWIW, my personal experience with 1.0 Nitrogen boards has been... suboptimal. 1.1 is indeed better and usable for things like IPSP at shorter ranges, but still falls short of other boards I've tried. Gene, if you can get them replaced with 1.1s, I'd start there.
For comparison, see BLE Nano 2 for another small form-factor Zephyr compatible nRF52 board, which claims BLE 4.2 certification: https://github.com/redbear/nRF5x/blob/master/nRF52832/docs/Specifications.md#ble-module-mb-n2
Marti
|
|
Re: BLE Nitrogen
Puzdrowski, Andrzej
> Well, board configuration is different, different pins are used for LEDs, buttons and UART, but from BLE point of view everything should be the same, correct?
Can you check how you configured UART flow control on both boards you have used? Mabey this cause your troubles?
Andrzej
From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...]
On Behalf Of Marti Bolivar
Sent: Tuesday, December 12, 2017 6:42 AM To: Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...> Cc: zephyr-devel@...; Zarkhin, Gene <Gene_Zarkhin@...> Subject: Re: [Zephyr-devel] BLE Nitrogen
Hi,
On Mon, Dec 11, 2017 at 12:14 PM, Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...> wrote:
FWIW, my personal experience with 1.0 Nitrogen boards has been... suboptimal. 1.1 is indeed better and usable for things like IPSP at shorter ranges, but still falls short of other boards I've tried. Gene, if you can get them replaced with 1.1s, I'd start there.
For comparison, see BLE Nano 2 for another small form-factor Zephyr compatible nRF52 board, which claims BLE 4.2 certification: https://github.com/redbear/nRF5x/blob/master/nRF52832/docs/Specifications.md#ble-module-mb-n2
Marti
|
|
Re: unique ID for flash devices
Puzdrowski, Andrzej
Hi Marti
Of course the providing of substitute of flash_area primitives is intermedium step for adding other modules. I will adapt mynewt FCB (Flash Circular Buffer) to zephyr, I will take mynewt Config module (or something very similar ) as well. What I also potentially want to do providing something like mynewt’s Manufacturer meta region is – this would be useful for inform both bootloader and application about how memory map looks like. I think that zephyr flash_map will simplify support for multi-memories and multi-images mcuboot support as well or event we can support dynamic image slots allocation basing on that (so will be possible to change flash areas boundaries during FWU – we see the case for that).
What I already do is that I took some part of your job from mcuboot as well. I thing after this It will be possible (even necessary) to use zephyr flash_map instead of mcuboot one.
> “Hard Link” – sory for this ambiguity. I mean that I need to define a proper way to describe Flash entity of certain flash_area and assign proper driver to it. It must be a multi applications solution – so basing a few application programed into one SoC will can discovered unambiguously memory layout of the system. I can imagine it would be for example the bootloader, the main application, the falbac application.
Andrzej
From: Marti Bolivar [mailto:marti@...]
Sent: Friday, December 08, 2017 9:29 PM To: Puzdrowski, Andrzej <Andrzej.Puzdrowski@...> Cc: zephyr-devel@... Subject: Re: [Zephyr-devel] unique ID for flash devices
Hi Andrzej,
On Thu, Dec 7, 2017 at 7:50 AM, Puzdrowski, Andrzej <Andrzej.Puzdrowski@...> wrote:
I'm a bit confused about what you will implement based on this description. Zephyr already has equivalents to several functions in this API.
In particular I don't understand which feature you're referring to here. What do you mean by "hard link"? I assume you're not referring to a hard link in the sense of a file system.
It seems like what you want to add is something like the "fa_device_id" field in struct flash_area. That is, an ID number for the flash device that contains a given area. Can you say a bit more about why you need an ID number, and can't just use a pointer to the struct device corresponding to the flash?
Are you trying to support this API for something outside of mcuboot? The mcuboot Zephyr port already has a shim which maps the defines from DT into fields in struct flash_areas in boot/zephyr/flash_map.c.
What's this for? Maybe that will help understand.
Thanks, Marti
|
|
Re: what's the status of cmake build system
Sebastian Boe
It is possible to subscribe to this issue to stay in-the-loop.
https://github.com/zephyrproject-rtos/zephyr/issues/4687 ________________________________________ From: zephyr-devel-bounces@... <zephyr-devel-bounces@...> on behalf of jack ma <assangema@...> Sent: Tuesday, 12 December 2017 10:43:22 AM To: Cufi, Carles Cc: zephyr-devel@... Subject: Re: [Zephyr-devel] what's the status of cmake build system Hi Carles, Thanks, I am looking forward to it. 2017-12-12 15:55 GMT+08:00 Cufi, Carles <Carles.Cufi@...<mailto:Carles.Cufi@...>>: Hi Jack, You are right, a binary executable of Kconfig is still required, alongside with the Device Tree Compiler, so it is not yet possible to build Zephyr without MSYS2 on Windows yet. We hope to address this issue in the near future. Thanks, Carles From: zephyr-devel-bounces@...<mailto:zephyr-devel-bounces@...> [mailto:zephyr-devel-bounces@...<mailto:zephyr-devel-bounces@...>] On Behalf Of jack ma Sent: 12 December 2017 05:27 To: zephyr-devel@...<mailto:zephyr-devel@...> Subject: [Zephyr-devel] what's the status of cmake build system Hi, it looks like Kconfig and Linux environments still need to compile zephyr, is that right? Is it possible to build zephyr without msys2(or linux subsystem) on Windows now? Thanks.
|
|
Re: what's the status of cmake build system
jack ma
Hi Carles, Thanks, I am looking forward to it. 2017-12-12 15:55 GMT+08:00 Cufi, Carles <Carles.Cufi@...>:
|
|
Re: [Zephyr-users] I2C and adc support for nRF5
Steve Brown
Hi Ashish,
On Tue, 2017-12-12 at 10:09 +0530, ashish.shukla@... wrote: Hi Felipe,The board name is nrf52840_pca10056 That works on my boards. Steve
|
|
Re: what's the status of cmake build system
Carles Cufi
Hi Jack,
You are right, a binary executable of Kconfig is still required, alongside with the Device Tree Compiler, so it is not yet possible to build Zephyr without MSYS2 on Windows yet. We hope to address this issue in the near future.
Thanks, Carles
From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...]
On Behalf Of jack ma
Sent: 12 December 2017 05:27 To: zephyr-devel@... Subject: [Zephyr-devel] what's the status of cmake build system
Hi, it looks like Kconfig and Linux environments still need to compile zephyr, is that right? Is it possible to build zephyr without msys2(or linux subsystem) on Windows now?
Thanks.
|
|
Re: BLE Nitrogen
Marti Bolivar
Hi, On Mon, Dec 11, 2017 at 12:14 PM, Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...> wrote:
FWIW, my personal experience with 1.0 Nitrogen boards has been... suboptimal. 1.1 is indeed better and usable for things like IPSP at shorter ranges, but still falls short of other boards I've tried. Gene, if you can get them replaced with 1.1s, I'd start there. For comparison, see BLE Nano 2 for another small form-factor Zephyr compatible nRF52 board, which claims BLE 4.2 certification: https://github.com/redbear/nRF5x/blob/master/nRF52832/docs/Specifications.md#ble-module-mb-n2 Marti
|
|
Re: [Zephyr-users] I2C and adc support for nRF5
ashish.shukla@corvi.com <ashish.shukla@...>
Hi Felipe, Code builds successfully after making a minor change in main.c file #define I2C_DEV CONFIG_GPIO_NRF5_P0_DEV_NAME $ cmake -DBOARD=nrf52_pca10056 .. What needs to be done to remove this error ? -- Warm regards, Ashish Shukla Jr. Embedded Engineer Research & Development Please consider the environment before printing this e-mail or its attachments. Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi
On Mon, Dec 11, 2017 at 5:38 PM, Felipe Neves <ryukokki.felipe@...> wrote:
|
|
what's the status of cmake build system
jack ma
Hi, it looks like Kconfig and Linux environments still need to compile zephyr, is that right? Is it possible to build zephyr without msys2(or linux subsystem) on Windows now? Thanks.
|
|
Re: How to detect a thread is aborted and restart it?
Li, Jun R
Thank you, Andrew and Mike!
I think the function fn_abort is good enough to meet my requests. Thank you very much!
Regards, Jun
From: "Boie, Andrew P" <andrew.p.boie@...>
Ø I don’t see much other way unfortunately; I think it would be nice is Zephyr added Fault hooks per thread so you could set a function to be called on a thread faulting.
There is a fn_abort member in struct k_thread which if not NULL, gets called when a thread goes through the k_thread_abort() code path, including when it hits a fatal exception. It's a void function that takes no parameters.
There appear to be no public APIs to set a thread abort function, but it should be fairly straightforward to add them.
HTH Andrew
|
|
Re: How to detect a thread is aborted and restart it?
Boie, Andrew P
Ø I don’t see much other way unfortunately; I think it would be nice is Zephyr added Fault hooks per thread so you could set a function to be called on a thread faulting.
There is a fn_abort member in struct k_thread which if not NULL, gets called when a thread goes through the k_thread_abort() code path, including when it hits a fatal exception. It's a void function that takes no parameters.
There appear to be no public APIs to set a thread abort function, but it should be fairly straightforward to add them.
HTH Andrew
|
|
Re: How to detect a thread is aborted and restart it?
Michael Rosen
Jun,
I don’t see much other way unfortunately; I think it would be nice is Zephyr added Fault hooks per thread so you could set a function to be called on a thread faulting.
Otherwise, you can always add kernel/include to the include search path for your project so you don’t have to move anything via: subdir-cc-flags-y += -I$(ZEPHYR_BASE)/kernel/include
Not ideal, but should give you access to these functions.
Mike
From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...]
On Behalf Of Li, Jun R
Sent: Monday, December 11, 2017 3:10 PM To: Pallala, Ramakrishna <ramakrishna.pallala@...>; zephyr-devel@... Subject: Re: [Zephyr-devel] How to detect a thread is aborted and restart it?
Hi Ram, Thanks for providing this helpful information! However, the two functions seem not to be published API functions and can’t be included without being moved to somewhere. Also, unfortunately, I can’t find a public function in zephyr/include which can do the same thing as these two internal functions.
Regards, Jun
From: "Pallala, Ramakrishna" <ramakrishna.pallala@...>
Hi Jun Li,
There are few inline functions in kernel/include/ksched.h from which you can get the status of a particular thread.
static inline int _is_thread_prevented_from_running(struct k_thread *thread) static inline int _is_thread_state_set(struct k_thread *thread, u32_t state)
From the above functions you can get the status of your critical thread and based the status you can invoke/restart the thread from background thread.
Thanks, Ram
From:
zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...]
On Behalf Of Li, Jun R
Hello everyone,
My application has one critical thread which needs to be always running. However, sometimes, it could crash due to some incorrect memory operations. I want to find a way to detect the thread abortion event and restart that thread from a background thread. Is there a way in Zephyr to check the current status of a specific thread and restart it if it aborts?
Thank you!
Regards, Jun Li
|
|
Re: How to detect a thread is aborted and restart it?
Li, Jun R
Hi Ram, Thanks for providing this helpful information! However, the two functions seem not to be published API functions and can’t be included without being moved to somewhere. Also, unfortunately, I can’t find a public function in zephyr/include which can do the same thing as these two internal functions.
Regards, Jun
From: "Pallala, Ramakrishna" <ramakrishna.pallala@...>
Hi Jun Li,
There are few inline functions in kernel/include/ksched.h from which you can get the status of a particular thread.
static inline int _is_thread_prevented_from_running(struct k_thread *thread) static inline int _is_thread_state_set(struct k_thread *thread, u32_t state)
From the above functions you can get the status of your critical thread and based the status you can invoke/restart the thread from background thread.
Thanks, Ram
From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...]
On Behalf Of Li, Jun R
Sent: Monday, December 11, 2017 4:49 PM To: zephyr-devel@... Subject: [Zephyr-devel] How to detect a thread is aborted and restart it?
Hello everyone,
My application has one critical thread which needs to be always running. However, sometimes, it could crash due to some incorrect memory operations. I want to find a way to detect the thread abortion event and restart that thread from a background thread. Is there a way in Zephyr to check the current status of a specific thread and restart it if it aborts?
Thank you!
Regards, Jun Li
|
|