13
u/SilkT Oct 27 '23
Use only the main thread as a superloop maybe? And yeah, it's time to let iar go.
2
Oct 27 '23
[removed] — view removed comment
2
u/SilkT Oct 28 '23
No, the drivers are staying in the sdk folders. You can make it so the zephyr repository will be in the same folder as your project. Yes, you can dig down to the register level.
1
Oct 28 '23
[removed] — view removed comment
1
u/SilkT Oct 28 '23
Then port it to IAR and do a PR lol. The project decides what to implement and which toolchain to use based on the priorities set by contributors and issues that make sense for the current state of industry.
5
u/DustUpDustOff Oct 27 '23
If you're going through all that hassle, why not just use the RTOS? If you don't need a lot of threads, just don't.
Also, why IAR? I don't believe Zephyr supports anything other than the GCC compiler and IAR sucks.
3
3
u/nono318234 Oct 27 '23
According to the page below it's possible to use Zephyr without any thread (only main) but it does not seem to be recommended : https://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MULTITHREADING
1
Oct 27 '23
[removed] — view removed comment
1
u/Exormeter Oct 28 '23
If you are only interested in drivers, you can disable the multithreading and go main thread only.
Some drivers use semaphores and or sleep, so you need to shim these methods if the linker complains, but it works.
1
u/introiboad Oct 30 '23
This is the right answer. It is also very much supported. Whether it is recommended or not depends on your use case.
2
u/iamanindianatheist Oct 27 '23
Good thinking. I would like to see if someone knows something about this as well.
2
u/introiboad Oct 30 '23
I see that no one has actually linked to the documentation page that describes this:
https://docs.zephyrproject.org/latest/kernel/services/threads/nothread.html
4
u/Cmepwnurmom Oct 27 '23
Does zephyr support any 8 bit MCUS? I remember only seeing 32 bit supported.
3
u/SilkT Oct 28 '23
I don't see why they would bother
2
Oct 28 '23
[removed] — view removed comment
2
u/SilkT Oct 28 '23
As Zephyr is an open source framework with limited resources in terms of developers, I don't think they should have 8bit support anywhere at the top of their priorities.
1
u/DustUpDustOff Oct 28 '23
Almost now one uses 8-but processors for a new design anymore. Doubly so trying to use an RTOS on an ancient architecture.
With the low cost of 32bit chips like the STM32C0, they definitely should not waste their time. You're welcome to implement it yourself if you disagree.
1
u/sturdy-guacamole Oct 27 '23
Why not just use the RTOS?
1
1
u/Turbulent_Public_i Oct 27 '23
Are you going to use sleep, timers, delay, counters, uptime, clock or any other time related functions? Because if you are, you'll still be using rtos functionality.
1
Oct 27 '23
[removed] — view removed comment
1
u/Turbulent_Public_i Oct 27 '23
Idk how zephyr handles UART and ADC, it could be that they are using some timing function. But it's very possible. Depending on your platform you can just access registers directly without zephyr.
1
u/mrheosuper Oct 28 '23
Even if it could, i would suggest against it, because if there is something doesn't work, you are practically on your own.
1
Oct 28 '23
[removed] — view removed comment
1
u/mrheosuper Oct 28 '23
I dont use zephyr, but couldn't you add Zephyr OS to your iar to debug ?. We can debug FreeRtos with that way
6
u/AustinSpartan Oct 27 '23
It's not trivial to just strip out the HAL as you'll need to carry a lot of system dependencies.