DISTORTEC / distortos

object-oriented C++ RTOS for microcontrollers
https://distortos.org/
Mozilla Public License 2.0
434 stars 67 forks source link

Port to STM32F769I-DISCO #40

Closed tvb377 closed 7 years ago

tvb377 commented 7 years ago

Hi, distortosTest.bin can be made, and both user leds are blinking slowly. I did not investigate any further yet. Let me know if I messed something up. Regards, Titus

tvb377 commented 7 years ago

Hi, having multiple arm toolchains installed I find it easier to change the tuple. But that's rather a matter of taste. Turning the question around: Why hide that optio0n? It has a sensible default. I just forgot to set it back to the default in the config file before pushing the change.

The tests seem to take rather long (around 5 to 10s). I find it nice to see immediately that the CPU gets at least to the start of main().

Blinking slowly means quite precisely 1Hz. When I set the delay in test/main.cpp forcibly to 50ms it looks and feels like 10Hz. So the sleepFor() seems to do the right thing.

BTW: Without having more than a faintest idea what it's supposed to do: When I run make board CONFIG_FILE=.....json it fails with jinja2.exceptions.TemplateAssertionError: no filter named 'sanitize' What do you think of CMake ;-)

Regards

FreddieChopin commented 7 years ago

having multiple arm toolchains installed I find it easier to change the tuple. But that's rather a matter of taste.

But would distortos work at all with anything else than "arm-none-eabi-"?

Why hide that optio0n?

I had no need to make it configurable until now (; I'm not a strict follower of GNOME philosophy of extreme reduction of configuration options, but it's not deniable that each new option is a new opportunity for an error...

The tests seem to take rather long (around 5 to 10s).

This would be true - they usually take about ~11-12 seconds.

I find it nice to see immediately that the CPU gets at least to the start of main().

I see. If you want to know precisely about reaching main(), then indeed enabling them at the start of that function would be the best option. Otherwise it is possible to configure initial state of LEDs in ChipOutputPin constructors, but then they would be "on" extremely early in the boot process.

BTW: Without having more than a faintest idea what it's supposed to do: When I run make board CONFIG_FILE=.....json it fails with jinja2.exceptions.TemplateAssertionError: no filter named 'sanitize'

Currently I'm in a process of replacing json-based board generator with dts-based board generator, and - as you see - I (again) managed to break the previous version with templates for the new version <: I'll take a look at that in a moment and let you know.

What do you think of CMake ;-)

Personally I think in case of such project and in embedded it has no strong selling points. But if you have some good arguments, we can discuss it.

FreddieChopin commented 7 years ago

Currently I'm in a process of replacing json-based board generator with dts-based board generator, and - as you see - I (again) managed to break the previous version with templates for the new version <: I'll take a look at that in a moment and let you know.

This error should now be fixed in master branch.

tvb377 commented 7 years ago

Thanks for patching the json stuff. I'll have a look tomorrow.

"arm-none-eabi" is just a name, it doesn't tell you about incompatiblities e.g. in the libraries built along with the compiler. But as I said, it's a matter of taste how you make sure the right stuff is chosen.

I like CMake very much because:

An example: For the last embedded project I wrote a small UI simulator (based on wxWidgets) and it was regarding the CMake build system trivial to get the software built under Linux and Windows with ninja for the embedded cortex-m4 target, as well as the simulation on Windows with MSVC++. I found that ease of portability quite nifty.

Let me know if you would like to give it a try.

Regards, Titus

tvb377 commented 7 years ago

Hi,

it still works (the same as before) after the required changes, with the autogenerated files.

In case I'd like to implement additions to distortos: What is the primary discussion channel for development of distortos?

Regards, Titus

FreddieChopin commented 7 years ago

Thanks for your high-quality contribution (I was pleasantly surprised with the presence of .dts file)!

I have merged the pull request with some changes. First of all I've squashed the commits a little bit. I've enabled more features in the config (signals in main thread) and changed some values to keep them in sync with other configs (-O2 optimization, increased size of stack, enabled run-time checks and asserts, ...), which increase number of executed tests - could you please verify that the code still works?

For now I have omitted the change to Kconfig menu. I'm not against it, but in its current form the option would be displayed in "generic chip options" or somewhere around there, while it definitely should be in the "build configuration menu". I'll try to move it to a better place soon, but I'm not sure this will be easy - Kconfig is really stupid and limiting /; I wish there was some alternative, but I'm afraid there is nothing comparable...

In case I'd like to implement additions to distortos: What is the primary discussion channel for development of distortos?

Well, this is an open question. We can have some discussion on github in the "Issues" section. There is a mailing list ( https://sourceforge.net/projects/distortos/lists/distortos-development ). If there would be a demand and you think it would be a good idea I could setup a regular forum (phpbb or maybe even something like discourse, but the latter one would require some investments, so phpbb or something similar is preferred). Alternatively you can contact me directly via e-mail. However this list is not a "closed" one - if you have some ideas how to make the communication easier and "more approachable", then don't hesitate to express them!

One more thing - adoption of cmake is an option too, however I still don't see significant benefits which would convince me fully. As I don't know and don't use it, I'm not very enthusiastic to learning yet another tool, as knowing it would be required to maintain and extend the files. However - as I said - I can be convinced if there is some feature worth the trouble. I would be more open to a more recent tool - Meson has much better syntax (based on Python), but from what I understand it doesn't generate projects for anything else than Visual Studio.

Regards, FCh

FreddieChopin commented 7 years ago

Oh, one more thing. If you add the e-mail address used in the commits as an alternative e-mail to your github account, you will be listed in "Contributors" section and the commits will have a link to your account. See the question mark next to your name in any of your commits, for example this one - https://github.com/DISTORTEC/distortos/commit/2ba4c93241f9ed6d9f968dc91dafeb88b9ac9e91

FreddieChopin commented 7 years ago

For now I have omitted the change to Kconfig menu. ...

This is done too (; Fortunately it was easier than I expected - I've credited you in this commit.