-
Notifications
You must be signed in to change notification settings - Fork 2
Mchp zephyr dspic release v4.0 #3
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
base: dsPIC33A
Are you sure you want to change the base?
Conversation
e346da9 to
933d1d4
Compare
1d6b675 to
ad4c3e3
Compare
933d1d4 to
68ced8c
Compare
|
The following west manifest projects have changed revision in this Pull Request:
✅ All manifest checks OK Note: This message is automatically posted and updated by the Manifest GitHub Action. |
| ? 0 | ||
| : (uint32_t)TMR1 / (uint32_t)TIMER1_CYCLES_PER_TICK; | ||
| ticks_elapsed = | ||
| (uint32_t)TMR1 < (uint32_t)TIMER1_CYCLES_PER_TICK |
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.
TMR 1 should not be hardcoded as a bigger device can have multiple TMRs. Also, the 128K device has only one TMR1 that is also used as a tick timer for the RTOS but the SCCP can be configured as a Timer and used by the application. This needs to be checked.
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.
Noted: We will make this driver configurable for different instances of the same IP with DTS.
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.
We can be addressed in next release
| #include <zephyr/drivers/timer/system_timer.h> | ||
| #include <xc.h> | ||
|
|
||
| #define TIMER1_CYCLES_PER_TICK \ |
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.
Generic and Kernel timer drivers' must be different
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.
Clarification: This is the kernel timer driver, used for kernel ticks.
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.
A driver for generic timer will be different and needs to be implemented.
We can further take this up separately
The "_too_small" test variants intentionally configure an isolated buffer
pool with only 2 buffers to validate proper error handling when the pool
is exhausted during notification of 16 msg_subscriber observers. These
tests are likely to fail on SMP systems due to a buffer recycling race
condition:
Expected behavior (uniprocessor):
Publisher Thread:
1. Allocate buf1 for bar_msg_sub1 ✓
2. k_fifo_put(sub1_fifo, buf1)
3. Allocate buf2 for bar_msg_sub2 ✓
4. k_fifo_put(sub2_fifo, buf2)
5. Try allocate buf3 for bar_msg_sub3 → FAIL -ENOMEM
Subscriber threads process messages after notification completes,
pool exhausts at subscriber #3 as expected.
SMP race condition:
CPU 0 (Publisher): CPU 1 (bar_msg_sub1): CPU 2 (bar_msg_sub2):
------------------ --------------------- ---------------------
Alloc buf1 ✓
k_fifo_put(sub1, buf1)
k_fifo_get() → buf1
zbus_sub_wait_msg()
net_buf_unref()
→ buf1 FREED!
Alloc buf2 ✓
(reuses buf1!)
k_fifo_put(sub2, buf2)
k_fifo_get() → buf2
net_buf_unref()
→ buf2 FREED!
Alloc buf3 ✓
(reuses buf1 again!)
...continues...
All 16 allocations succeed!
On SMP systems, subscriber threads on other CPUs may consume and free
buffers quickly enough that they are recycled back to the pool before the
publisher's notification loop can exhaust it. The test's assumption that
notification completes before subscribers run does not hold with parallel
execution.
Since this is a test design limitation (not a zbus bug), filter SMP
configurations from these specific test variants rather than attempt to
artificially slow down subscribers or change thread priorities.
Signed-off-by: Nicolas Pitre <[email protected]>
Highlights:
- UART interrupt support
- Program memory optimisation
- Support for ztest and twister
- Context switch refignment
- Kernel and thread test cases
- Samples support
- UART: Echo bot, native tty, passthrough
- Blinky
- Philosophers
- Hello world
- Pin control driver
- New board support (sdPIC33AK512MPS512)
Fixes:
- Context switch fixes
- System timer fixes
- Build fixes