-
Notifications
You must be signed in to change notification settings - Fork 52
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
WIP: zephyr: added initial support to Zephyr RTOS as host OS. #398
base: main
Are you sure you want to change the base?
Conversation
@Simonbdy , @nicolas-rabault PTAL it is on WIP state but since this touches in some of the common folders from Luos I would like to hear your options while I finish the Zephyr specific code. The current state of this PR it is able to build and run on qemu zephyr target, but the final PR would add some boards. |
Please refer the sample code below: https://github.com/uLipe/luos_engine/tree/feature/luos_zephyr/examples/projects/zephyr |
@Simonbdy, @JeromeGalan is working on it with @uLipe , I think @JeromeGalan will be more relevant than me about it. |
Hi folks, it has been a while, just to update you I'm still working on this PR, probably will update things here at the end of this week. |
Nice! |
Added initial port of robus hal, it still needs to finish the uart part, it just to you follow-up the progress. |
cc: @JeromeGalan . @nicolas-rabault |
c760508
to
13783df
Compare
{ | ||
{ | ||
//Way to make Luos run in event driven mode | ||
RobusHAL_WaitNetworkActivity(); |
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 planned to create a macro on Luos for this!
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.
Will work on it 👍👨💻
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.
Please check also the implementation on Robus side, my initial idea was to defer a user defined callback, although a binary semaphore solves very well the issue of trigeering Luos loop upon a network activity.
if(irq_nest) | ||
{ | ||
irq_nest--; | ||
if(!irq_nest) | ||
{ |
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.
Very interesting idea!
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.
13783df
to
9c27dc6
Compare
Added the missing timeout functions, and now tested with high baud rate > 400k |
uart_fifo_fill(luos_serial, &c, 1); | ||
LOG_DBG("Transmitting the following byte from serial 0x%x", c); | ||
} | ||
k_sem_give(&net_activity_sem); |
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.
If I understand it, you use it to trigger the Luos_loop task.
Here is a few thought about running Luos_loop like that.
We will need a deeper check, but I think:
- Luos_loop don't need to do anything in case of TX.
- Luos_loop need to run only one time per complete message (but you can't manage it at HAL level, that is why a macro is interesting here)
- Luos_loop check time during execution to trigger auto-update messages. We have to find a way to avoid this polling strategy to be able to male it completely event driven.
👨💻👍
…On Tue, 3 Jan 2023, 2:52 pm Nicolas Rabault, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In network/robus/HAL/zephyr/robus_hal.c
<#398 (comment)>:
> + {
+ uint8_t c;
+
+ if(ring_buf_is_empty(&out_ringbuf))
+ {
+ uart_irq_tx_disable(luos_serial);
+ RobusHAL_SetTxState(false);
+ }
+ else
+ {
+ RobusHAL_ResetTimeout(0);
+ ring_buf_get(&out_ringbuf, &c, 1);
+ uart_fifo_fill(luos_serial, &c, 1);
+ LOG_DBG("Transmitting the following byte from serial 0x%x", c);
+ }
+ k_sem_give(&net_activity_sem);
If I understand it, you use it to trigger the Luos_loop task.
Here is a few thought about running Luos_loop like that.
We will need a deeper check, but I think:
- Luos_loop don't need to do anything in case of TX.
- Luos_loop need to run only one time per complete message (but you
can't manage it at HAL level, that is why a macro is interesting here)
- Luos_loop check time during execution to trigger auto-update
messages. We have to find a way to avoid this polling strategy to be able
to male it completely event driven.
—
Reply to this email directly, view it on GitHub
<#398 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A4522T73XIUWUX6LEGVXAKTWQPVTRANCNFSM6AAAAAARYUD4TY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Signed-off-by: Felipe Neves <felipe.neves@linaro.org>
Signed-off-by: Felipe Neves <felipe.neves@linaro.org>
9c27dc6
to
2516a7c
Compare
Just rebased |
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.
Many improvements have been done
Hi Folks, sorry for the long hiatus here, I got some hard times in my work, with almost no time for my open source stuff. Once I find a proper timeslot I will finish this one. |
By submiting this PR, you agree with the associated license (Apache 2.0 or MIT) and with our Contributor License Agreement (CLA).
Before to begin
Thank you for contributing to the Luos project!
Before to begin, please follow these steps:
Luos contribution project
Feel free to read the Luos contribution's guidelines and the documentation page to have more insight about how to contribute to Luos.
PR Description section
Description and dependencies
This PR enables Luos to be built on top of Zephyr RTOS, as a result Luos is seen by Zephyr as an out-of-tree module, and a Zephyr application is able to include Luos and its features. It also brings zephyr specific code to the HAL and Robus/HAL sections enabling Luos on Zephyr supported boards.
Changes
Please choose the relevant options:
WARNING: Do not edit the checklist below.
Developer section
QA section
🆕 Feature: [Feature] Description...
🆕 Added: [Feature] Description...
🆕 Changed: [Feature] Description...
🛠️ Fix: [Feature] Description...