-
-
Couldn't load subscription status.
- Fork 9
esp32 port technology preview - DO NOT MERGE #48
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: main
Are you sure you want to change the base?
Conversation
Initial preview of development work towards an esp32 compatible port. Several issues to address, starting with how to manage disparate requirements of CMakeLists.txt Initial development being tested on an esp32dev board with toolchain ESP-IDF v5.4.1-dirty Primary goal is to achieve little impact on the existing codebase. Review feedback welcome.
The secondary esp32 uart is configured for the tcli console, with the primary uart still utilised for diagnostics.
|
@Inspirati thank you very much for the preview, I have taken a bit of time to review and consider.
I fully support this, the code is reasonably portable with only the timer and flash APIs being specific (and easily ported to other MCUs). However, I do have some pause and concern with this particular approach. A significant chunk of this effort has been splicing in the espidf framework with further work needed to manage and integrate the build to support both rp2040 and esp32. Perhaps an alternative to this effort (which I have already been idly entertaining), port the project to Zephyr. Zephyr also provides functionality that would supersede some of the custom work here, especially:
Of course, this is more effort, but I believe has longer term benefit. Regardless of the outcome, thank you @Inspirati for your interest, I appreciate it. |
|
G'day gkoh, I appreciate your timely response.
Preliminary proof of concept would ideally not make a mess of your current art, such that #if/#endif is apt to do.
Thankfully I found the code easily portable, unlike many other projects I have worked with. I only came here looking to glean the interrupt driven cec decoder, however have found myself venturing far beyond..
This is only the pathway, and not an intended destination. 'tis only meant as a means to achieving my objective of evaluating the desired routines in an esp environment.
I am a make (makefile) aficionado myself, having never taken favourably to cmake. This recent experience is only reinforcing such. A brief attempt at coercing cmake to do what is required, with both the esp-idf and pi vscode extensions in mind, has proven frustratingly futile.
Not familiar with Zephyr so shall take a look. However upon initialy noting it is an rtos unto itself, my hopes are not high. The entire espressif ecosystem seems to be very much tightly coupled to freertos. Indeed, the freertos scheduler is already running before main (or rather app_main) is invoked. My guess is this would prove more challenging than the multi-platform build dilemma. But trying to run Zephyr within a freertos task could be fun, until it aint.
I feel like your quotation marks around 'just' are justified. Rarely such is the case with such things.
I quite like the shell, and have now got it coupled with a relative minimum of effort. Abstracting it for ready extension may be a another story, so I probably won't be taking it away with me.
As per above (re cec interrupt algorithm), I am not planning on going there, and would leave this functionality to the next guy.
Let's see what I make (intended) of Zephyr. If you could please report back any regressions with the pico build, such would be a great help. I'm not exactly set-up, nor familiar enough with it, to be at all thorough. My basic philosophy being that if I don't touch it, it shouldn't break? |
Minor changes to structure and modification of several function prototypes to official parameter types & names.
In order to improve namespace clarity utilised git mv to change name of a couple of port support modules.
Based on #49 I think we can minimise
Excellent, I did spend some time refactoring things so they were clean.
At a minimum, I would be fine with this being a staged approach, I recall that "perfect is the enemy of done".
Aha, a fellow Makefile zealot 🙂
My suggestion here would be to completely replace FreeRTOS with Zephyr, not integrate the two.
Yes, I'm wary of what is advertised vs what is true.
As noted in #49, I regard |
Significant progress along with major cleanup of the port code. Also successfully build tested the pico target. Requires replacing CMakeFiles.txt with the accompanying CMakeFiles.pico More work to come with renaming a few modules as discussed in the refactoring pull request.
Commit the rest of the update.
Mostly to quiet the format checker, but a few fixes addressing issues found during an independent build test.
|
@Inspirati Might be better to exclude the imported sources from clang-format. pico-cec/.github/workflows/main.yml Line 28 in 23fb232
Note I exclude the cloned into external libraries (FreeRTOS-Kernel, crc, tcli, etc). |
I went ahead and did this to help move things along. |
…into esp32-preview
Both the legacy and new esp-idf i2c driver models are optionally supported. The former requires no change to the mainline source, the later requires a single processor conditional.
Significant cleanup preparing for a merge candidate. As yet no run-time test conducted on pico hardware. Proposed solution to disparate requirements for CMakeLists.txt is to require the user to copy one of the template versions as provided. Now includes I2C (DDC) support, with options to try both new and legacy esp-idf i2c drivers. Two potential methods to facilitate pico-sdk header inclusion - either with dummy (empty) headers in a replicated directory structure (to satisfy the C pre-processor), or by including all required headers in a common include. Both approaches can be trialled via use of the USE_PORTABLE define in CMakeFiles.txt
Builds and runs nicely on both esp32 and pico-pi. With the addition of several new diagnostic features, RX_ABORTS have seemingly been eliminated. Additional feature allows asynchronous sending of cec messages from external tasks.
…into esp32-preview
Significant progress towards a fully functional esp32 port, with support for USB HID with target board esp32s3. CEC modules decoupled from main application and moved to lib directory, for portability to other projects. CEC driver now supports ability to asynchronously inject transmit messages from external tasks. Includes numerous additional cec bus diagnostic features.
Initial preview of development work towards an esp32 compatible port.
Several issues to address, starting with how to manage disparate requirements of CMakeLists.txt
Initial development being tested on an esp32dev board with toolchain ESP-IDF v5.4.1-dirty
Primary goal is to achieve little impact on the existing codebase.
Review feedback welcome.