I prepared files for new board (NUCLEO F767ZI) should I commit to project and how ?

98 views
Skip to first unread message

Adam Mierzwiak

unread,
May 13, 2019, 2:12:07 PM5/13/19
to distortos
Hello,

I prepared new description for board that was not included in sources.
It is NUCLEO F767ZI. Should I commit my files to project.
If yes how should I do this? Should I push commit on my custom branch or...

Best regards

Adam

Freddie Chopin

unread,
May 13, 2019, 2:34:16 PM5/13/19
to dist...@googlegroups.com
Hi!

On Mon, 2019-05-13 at 11:12 -0700, Adam Mierzwiak wrote:
> I prepared new description for board that was not included in
> sources.
> It is NUCLEO F767ZI.

Great!

> Should I commit my files to project.

It would be great if you could do that. Contributions are highly
appreciated!

> If yes how should I do this? Should I push commit on my custom branch
> or...

The typical GitHub workflow is more or less like this:
1. Fork the original repo to your own GitHub profile.
2. Clone your forked repo to your PC.
3. Create a topic branch in your repo. This is optional, you may as
well use your master branch, it doesn't matter that much.
4. Commit whatever you have into your branch.
5. Push your branch to your repository.
6. On GitHub page of your repo, when you select this new branch, there
will be a button to create a pull request to the original repository.
Click it, fill whatever is needed (a title is obligatory, but I think
GitHub fills it automatically with the first line of commit message if
there is only one) and press OK (or sth like that).

You can probably find some descriptions of the process in GitHub's help
pages. For example start here:

https://help.github.com/en/articles/creating-a-pull-request

GitHub's help is very extensive, but I'm not sure you'll find one
article which covers the whole process - they rather have many articles
about very specific topics which sometimes overlap a bit. If needed,
you'll probably be able to find some other guides on other websites.

If in doubt - ask. You can also play around with that by doing an
experiment in your own repositories - create one, fork it, add some
commits, try to make a pull request. After you're done, you can just
delete everything (;

As for my own requirements, here is one for a start. It would be very
nice if your contribution included a distortosConfiguration.cmake file,
configured for the board, which you tested with distortosTest
application. This configuration should have similar settings to other
boards:
- max clock of the chip and proper configuration of other bus clocks
- enabled signals, values for main thread as in other configurations
(enabled/8/8)
- huge stack for main() (8192 bytes?)
- enabled thread detachment
- enabled all run-time checks and assertions
- (probably something else too [; just compare with other
configurations)

distortos creates and manages a configuration like this in your build
folder - once you configure it, CMake generates
distortosConfiguration.cmake there. When you modify the configuration
with cmake-gui, this file gets updated too. So just configure what's
required, run the test to make sure it works (it takes about ~10-15
seconds, after the test is finished the LEDs start to blink with 1 Hz
frequency). If everything is OK just copy this
distortosConfiguration.cmake file to a new folder under
configurations/<board>/test/ and commit that too!

Thanks in advance!

Regards,
FCh

Freddie Chopin

unread,
May 24, 2019, 3:57:35 AM5/24/19
to dist...@googlegroups.com
Hello again Adam!

Just to let you know, yesterday I've added support for NUCLEO-F767ZI
board to distortos.

https://github.com/DISTORTEC/distortos/tree/master/source/board/ST_NUCLEO-F767ZI

I needed this board for a project I'm doing, so had to add it quickly.

Regards,
FCh

Adam Mierzwiak

unread,
May 31, 2019, 2:20:03 AM5/31/19
to distortos
Hello,

I already setup my building stack on remote server, to have one development environment for all computers and locations.
With Ubuntu and X11 forwarding for cmake-gui works great.

When I configure correctly and build with Ninja I achieve:

/dev/distortos/output# ninja
[109/109] Linking CXX static library libdistortos.a

seems that all works, but is .a ready made image to upload to Nucleo with its ST-LINK?

Best regards

Adam

Freddie Chopin

unread,
May 31, 2019, 3:03:19 AM5/31/19
to dist...@googlegroups.com
Hi Adam!

On Thu, 2019-05-30 at 23:20 -0700, Adam Mierzwiak wrote:
> I already setup my building stack on remote server, to have one
> development environment for all computers and locations.
> With Ubuntu and X11 forwarding for cmake-gui works great.

Interesting (; If you have your website, I would really be interested
in reading an article about your setup (; Do you use any IDE?

> When I configure correctly and build with Ninja I achieve:
>
> /dev/distortos/output# ninja
> [109/109] Linking CXX static library libdistortos.a
>
> seems that all works, but is .a ready made image to upload to Nucleo
> with its ST-LINK?

Please take a look at the "Test application" paragraph here:
https://github.com/DISTORTEC/distortos/blob/master/README.md
By default, target "all" for distortos repository builds just the
static library libdistortos.a (and a few more required files like
linker script, distortosConfiguration.h header, ...), as during normal
development (distortos + external components + your application) this
is all you need. If you also want to try the test application, execute
`ninja distortosTest`. This test application (which can be found in
"test" subfolder of the main repository) is not built by default, as
this would double the build time for no useful reason.

You could also check this article:
http://distortos.org/documentation/configuring-building/
I've updated it (almost a complete rewrite) just a few days ago
(Wednesday?). It describes the typical scenario of using distortos for
your own application, with minimal amount of tricks and quirks. I hope
it shows how things should be done and that it is easy to
follow/understand.

Let me know in case you encounter any problems!

Regards,
FCh

Adam Mierzwiak

unread,
May 31, 2019, 11:34:20 AM5/31/19
to distortos
Hi Freddie,

about setup for now its just remote machine with all needed stuff for Distortos,
 but I plan to tie building the project with Jenkins looking for git commits and compile.

When I ran 'ninja distortosTest' I got errors, I put on network drive:

- output catalog
- console log

It is located here:


If it is possible to check what is wrong with linker.

First I compiled with ninja, then ninja distortosTest

Best regards

Adam

Freddie Chopin

unread,
May 31, 2019, 12:11:16 PM5/31/19
to dist...@googlegroups.com
Hello again!

On Fri, 2019-05-31 at 08:34 -0700, Adam Mierzwiak wrote:
> When I ran 'ninja distortosTest' I got errors, I put on network
> drive:
>
> - output catalog
> - console log
>
> It is located here:
>
> https://drive.google.com/open?id=1eZsRrmbuVn9O8frmW0zAxusWAzG1PaFE
>
> If it is possible to check what is wrong with linker.
>
> First I compiled with ninja, then ninja distortosTest

What toolchain are you using? The only toolchain supported by distortos
and regularly tested is bleeding-edge-toolchain. You can build it with
the script as found here:

https://github.com/FreddieChopin/bleeding-edge-toolchain

I suspect you are using a stock toolchain from Ubuntu, as there never
was a bleeding-edge-toolchain release which would identify itself as
gcc 6.3.1.

The problem is that the toolchain you are using tries to link the whole
application with a libg.a library from /usr/lib/arm-none-
eabi/lib/libg.a, while I should use something like arm-none-
eabi/lib/thumb/v7e-m/fpv5/hard/libg.a. The library it is using is most
likely meant for ARMv4 architecture (like ARM7TDMI). The strange thing
is that other libraries are selected fine (as seen in the .map file) -
for example arm-none-eabi/lib/thumb/v7e-m/fpv5/hard/libstdc++.a - it's
just libg.a and crt0.o which cause trouble.

Why does it happen - no idea... It is possible that the toolchain you
are trying to use does not properly support such combination of flags
(Cortex-M7 + DP FPU + hard FP ABI).

If the problem does not go away when you create a new build folder,
then I guess it's the toolchain which is a problem. You should
definitely try with bleeding-edge-toolchain which will most likely
solve your problem. Travis-CI does builds with last 5 versions of GCC
and the board you are trying to use works with GCC 6 too:

https://travis-ci.org/DISTORTEC/distortos/jobs/536736890#L1007

I obviously recommend the latest GCC version instead of GCC 6. As a
quick test you can try the toolchain that is used by Travis:

http://distortos.org/files/travis-ci/arm-none-eabi-gcc-9.1.0-190503.tar.xz

It should work on Ubuntu, but there are no guarantees. If it doesn't,
you have to build bleeding-edge-toolchain yourself.

I know there are a couple of rough edges when starting with distortos,
but there is no way around them - you have to use custom toolchain,
because it has a specific configuration of the libraries and disabled
C++ exceptions.

Regards,
FCh

Adam Mierzwiak

unread,
Jun 3, 2019, 2:19:09 PM6/3/19
to distortos
Hello,

I was able to compile bleeding-edge-toolchain, when I shut down non-critical processes (remote machine has only 2GB of RAM) 
Still there is same comment at the end of ninja comipilation for distortosTest, so probably it was problem that I installed gcc, g++
with apt. So it looks that I need to try in some other environment without previously installed tools and bleedin-edge only.
I will let know how it's going.

I've sent you also private message with some idea

Best regards

Adam
Reply all
Reply to author
Forward
0 new messages