-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NXP][Zephyr] Migrate to nxp-zsdk v4.0.0 #36749
[NXP][Zephyr] Migrate to nxp-zsdk v4.0.0 #36749
Conversation
2c6b6ba
to
b631ab4
Compare
95fc697
to
ef633d7
Compare
PR #36749: Size comparison from 9e671ad to ef633d7 Full report (80 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
ef633d7
to
4af12a6
Compare
- Kconfigs/CMake updates for nxp-zsdk v4.0.0 (Zephyr 4.0 base) - Add ThreadMetrics support for Zephyr platforms - Add missing WiFi Diagnostic support for NXP Zephyr - Add Matter over WiFi support for frdm_rw612 - Update and fix memory overlays Restyled by clang-format Restyled by prettier-markdown
PR #36749: Size comparison from 84fb78f to 4af12a6 Full report (80 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
{ | ||
size_t unusedStackSize; | ||
ThreadMetrics ** threadMetricsListHead = (ThreadMetrics **) user_data; | ||
ThreadMetrics * threadMetrics = (ThreadMetrics *) malloc(sizeof(ThreadMetrics)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all allocations made by Matter should be done via Platform::New
, which will btw. properly initialize the object. Also, you should validate if the allocation has succeeded.
ThreadMetrics ** threadMetricsListHead = (ThreadMetrics **) user_data; | ||
ThreadMetrics * threadMetrics = (ThreadMetrics *) malloc(sizeof(ThreadMetrics)); | ||
|
||
Platform::CopyString(threadMetrics->NameBuf, k_thread_name_get((k_tid_t) thread)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k_thread_name_get
may return NULL if CONFIG_THREAD_NAME=n
. This functionality should be configurable depending on thread name being enabled.
@@ -33,8 +33,11 @@ namespace DeviceLayer { | |||
|
|||
// Maximum length of vendor defined name or prefix of the software thread that is | |||
// static for the duration of the thread. | |||
#if defined(CONFIG_THREAD_MAX_NAME_LEN) | |||
static constexpr size_t kMaxThreadNameLength = CONFIG_THREAD_MAX_NAME_LEN - 1; | |||
#else | |||
static constexpr size_t kMaxThreadNameLength = 8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't override this limit, as this comes from the spec.
static void GetThreadInfo(const struct k_thread * thread, void * user_data) | ||
{ | ||
size_t unusedStackSize; | ||
ThreadMetrics ** threadMetricsListHead = (ThreadMetrics **) user_data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Could you use C++ cast operators like static_cast
?
if (*threadMetricsListHead) | ||
{ | ||
threadMetrics->Next = *threadMetricsListHead; | ||
} | ||
else | ||
{ | ||
threadMetrics->Next = NULL; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is equivalent to just:
if (*threadMetricsListHead) | |
{ | |
threadMetrics->Next = *threadMetricsListHead; | |
} | |
else | |
{ | |
threadMetrics->Next = NULL; | |
} | |
threadMetrics->Next = *threadMetricsListHead; |
Addressing review comments from project-chip#36749 Signed-off-by: Axel Le Bourhis <[email protected]>
Addressing review comments from project-chip#36749 Signed-off-by: Axel Le Bourhis <[email protected]>
Addressing review comments from #36749 Signed-off-by: Axel Le Bourhis <[email protected]>
- Kconfigs/CMake updates for nxp-zsdk v4.0.0 (Zephyr 4.0 base) - Add ThreadMetrics support for Zephyr platforms - Add missing WiFi Diagnostic support for NXP Zephyr - Add Matter over WiFi support for frdm_rw612 - Update and fix memory overlays Restyled by clang-format Restyled by prettier-markdown Co-authored-by: Yassine El Aissaoui <[email protected]>
…-chip#36765) Addressing review comments from project-chip#36749 Signed-off-by: Axel Le Bourhis <[email protected]>
This PR depends on a Docker image update PR: #36748