Skip to content
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

[docs] clarify "customization" section of BSP page #286

Closed
wants to merge 1 commit into from

Conversation

WasabiFan
Copy link
Contributor

Minor updates. I did make a change to the actual meaning of the instructions by changing a path, so please make sure I didn't make a mistake. I see:

image

  • Break one step into two, and clarify the wording of the first half
  • Correct path to copy files from: there isn't an extra path segment after the "board" directory

- Break one step into two, and clarify the wording of the first half
- Correct path to copy files from: there isn't an extra path segment after the "board" directory
Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is clearer!

@WasabiFan
Copy link
Contributor Author

Ya know... I think this needs more steps. Because if you follow it as stated, due to #285, you get this:

(modm) D:\kaeli_000\Source\Repos\modm-test-project\modm-test-project>scons build
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
�[;0;32mCompiling C++·· �[;0;33mbuild\modm-test-project\release\main.o�[;0;0m
Compiling C++·· build\modm-test-project\release\modm\src\modm\architecture\driver\atomic\flag.o
Compiling C++·· build\modm-test-project\release\modm\src\modm\board\board.o
Compiling C++·· build\modm-test-project\release\modm\src\modm\platform\clock\rcc.o
Compiling C++·· build\modm-test-project\release\modm\src\modm\platform\clock\systick_timer.o
Compiling C++·· build\modm-test-project\release\modm\src\modm\platform\core\assert.o
Compiling C++·· build\modm-test-project\release\modm\src\modm\platform\core\delay.o
Compiling C++·· build\modm-test-project\release\modm\src\modm\platform\core\heap_newlib.o
Compiling C···· build\modm-test-project\release\modm\src\modm\platform\core\startup.o
Compiling C···· build\modm-test-project\release\modm\src\modm\platform\core\startup_platform.o
Compiling C···· build\modm-test-project\release\modm\src\modm\platform\core\vectors.o
Compiling C++·· build\modm-test-project\release\modm\src\modm\platform\gpio\enable.o
Compiling C++·· build\modm-test-project\release\modm\src\modm\platform\spi\spi_master_5.o
Create Library· build\modm-test-project\release\modm\libmodm.a
Linking········ build\modm-test-project\release\test.elf
d:/tools/gnu tools arm embedded/8 2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld.exe: build\modm-test-project\release\modm\libmodm.a(board.o): in function `modm_abandon':
D:\kaeli_000\Source\Repos\modm-test-project\modm-test-project/modm\src\modm\board/board.cpp:19: multiple definition of `modm_abandon'; build\modm-test-project\release\custom-boards\stm32f411e-disco\board.o:D:\kaeli_000\Source\Repos\modm-test-project\modm-test-project/custom-boards\stm32f411e-disco/board.cpp:19: first defined here
collect2.exe: error: ld returned 1 exit status
scons: *** [build\modm-test-project\release\test.elf] Error 1
scons: building terminated because of errors.

@salkinium
Copy link
Member

Thanks, this is clearer!

I need to go get some sleep.

2. In your `project.xml` remove the board config inheritance (`<extends>`) and
1. Generate the BSP closest to your custom hardware (using `lbuild build`).
2. Copy the files from `modm/src/modm/board` to your own project and modify them.
3. In your `project.xml` remove the board config inheritance (`<extends>`) and
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should also clarify this while we're at it... if I figure out what it means I'll update the PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're using a custom board config, you cannot extend the modm config anymore, or there would be conflicts. Technically you now need to manually merge the board.xml into your project.xml.

Copy link
Member

@salkinium salkinium Sep 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And then obviously modify the config to your needs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The part I'm unsure about is "copy the pre-defined options into your own config". I clearly need to copy in the module dependencies, but then now I presumably need to do something to replace:

env.collect(":build:openocd.source", "board/stm32f429discovery.cfg");

And I am not sure what that is yet.

And then I need a target option set, which is listed in another repo (e.g. here).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that depends on your board. There's probably no predefined openoce config, you'll need to provide your own (see https://modm.io/reference/module/modm-build/#openocdsource).
You can also lbuild discover -n :target for the target, but you should already know the identifier.

@asmfreak
Copy link
Contributor

I'm using my own custom BSP copied over from modm with some added quality-of-life stuff like logging and fault handler included in BSP and several assumptions on board usage.

@salkinium
Copy link
Member

This has been clarified in the new guide: https://modm.io/guide/custom-project/#using-a-board-support-package

@salkinium salkinium closed this Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants