-
Notifications
You must be signed in to change notification settings - Fork 128
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
[feat][zephyr] Enable bl_mcu_sdk as zephyr module #18
Conversation
Hello, due to recent changes in Zephyr. I'd prefer add 3437feb later. The 0bc9054 is just a proposal. But a similar solution is essential to allow use bl_mcu_sdk as hal_bouffalolab for Zephyr. Regards, |
@nandojve Thank you sincerely for your PR.
Also, if your project has managed irq, like nuttx, zephyr or other os, you need to ignore Best Regards, |
495e840
to
163314f
Compare
Hi @sakumisu , Thank you for the explanation. I successfully drop Regards, |
Hi @nandojve ,is the directory:zephyr updated frequently?If so ,maybe bl_mcu_sdk and zephyr are in the peer path better?
Another, |
No, is rarely updated. Zephyr uses this directory to instruct toolchain how to handle Cmake and Kconfig option. The newer format allows include any project into ZephyrRTOS without add files. You can see by here how I manage to build bl_mcu_sdk as hal_bouffalolab. This means that every newer version of bl_mcu_sdk can be easy
I set this as 'build always' in your toolchain cmake rules. This means, if users try to build using BFLB cmake, it will be always included. From my side, this is never defined and |
Hi,@nandojve in |
37fb2c1
to
2b90019
Compare
Hi @sakumisu , I think best I can do is add the __ZEPHYR__ conditional guard to allow build ZephyrRTOS without breaking BFLB code compatibility. |
Hi @nandojve,I think you may have misunderstood what I meant.What I mean is that ,for example, if i need |
170a16a
to
c1bf06f
Compare
Hi @sakumisu , Yes, I did. I took another look and it is clear to me that RISC-V should be initialized at Zephyr side. For now, I just copy source from sdk and added temporally at soc directory. The proposed changes at Let me know what you think about this. |
Hi,@nandojve, if
in c flag will be |
Just another comment, not sure if it is relevant at this moment but I saw that you have NMSIS at components/nmsis. |
yes,also in nmsis has the same encoding. |
0d4d28b
to
f33ca05
Compare
Hi @sakumisu , I was thinking about this issue and realize that real problem is that arch dependent files are together with SoC registers definition. RISC-V core files are used in very few places: risc-v timer, interrupts and system initialization; and can be defined by RTOS, like Zephyr is doing.
On my view, drivers never will require any risc-v/arm definitions and that entries could be safe removed from blX02.h. It require only add proper include in a few places like f33ca05. I'm asking to you review this option because for any RTOS those will be specific. In case of Zephyr, risc-v timer, interrupts and system initialization will be made in the main tree and will not use On my view, and I can be wrong, seems better not contaminate register include files. Could you check if this is a valid solution ? |
Hi @sakumisu , I was wondering if you have time to check my last comment. BTW, Nuclei specific will be add as a newer file instead a full module. This reinforce that #18 (comment) may be a definitive solution. Do you mind send me PVT your expected solution so I can incorporate at Draft? If you prefer, you can simple open a Zephyr PR adding missing entries. |
@nandojve Hi, we have evaluated your solution,is a better way currently, and next time will be merged in locally. |
This move riscv specific includes to source files that require the definitions. It drop all arch files dependencies at blX02.h file. Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
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.
Has done,i cherry picked your previous commit
Already merged |
The ZephyrRTOS is a newer Open Source RTOS. It strives to deliver the best-in-class RTOS for connected resource-constrained devices, built to be secure and safe.
This add ZephyrRTOS entry point and define environment to build Bouffalo Lab low level peripheral drivers as hal_bouffalolab. Initially, bl602 is the target but can be extended to any other SoC series present in the bl_mcu_sdk.
The commit sequence try fix small issues found due to code isolation. The BFLB_USE_PLATFORM was necessary to be created to isolate low level drivers and Bouffalo Lab HAL, once Zephyr have their own.
The zephyr directory is completely isolated from bl_mcu_sdk and not interfere. This layout was created to allow add manufacturer repositories as external modules into ZephyrRTOS.
Currently there is a minimal attempt to enable Bouffalo Lab SoC at ZephyrRTOS at PR 37686
How to Build/Flash on a working zephyr environment: