Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[variant] Improve variant support and genericity#1091

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fpistm merged 81 commits intostm32duino:masterfromfpistm:subvariant
Apr 17, 2021

Conversation

fpistm
Copy link
Member

@fpistmfpistm commentedJun 5, 2020
edited
Loading

As the number of variants continues to grow and in order to ease navigation, they have been grouped in sub-folders per
series.

To improve variants support and generic ones several enhancements/fixes has been done:

  • Each variant will be linked to its mcu/package
  • All pins capabilities will be possible without modifying thePeriperhalPins.c PinMap array. ALTx pin naming will allow to use all alternative possibilities which use other HW peripheral instances.
  • All remap pins will be supported (F0/G0)
  • All dual pad pins will be supported (H7)
  • Analog definition clean up
  • Several fixes in existing variants

All generic variants are now automatically generated thanks theSTM32_open_pin_data repository which provides all the information required for the pin configuration of products based on STM32 MCU. All the generic variants are generated in the variant folder, this means all the generic STM32 MCU are generated. Only the linker script and the clock config are missing. A board_entry.txt file is generated to ease board declaration.

Migrated STM32 series:

  • STM32F0
  • STM32F1
  • STM32F2
  • STM32F3
  • STM32F4
  • STM32F7
  • STM32G0
  • STM32G4
  • STM32H7
  • STM32L0
  • STM32L1
  • STM32L4
  • STM32L5
  • STM32MP1
  • STM32WB

Issues linked to this PR:

Fix#855,fix#857,fix#1180,fix#1276,fix#1277,fix#1302,fix#1144

PR for new variant included in this one;


One issue has been met with Arduino IDE about the menu scrolling:arduino/Arduino#11416

Wiki will be updated after official 2.0.0 core release

That would be fine to define the variant in a different way, like this for example:

GenYY.build.variant={build.series}/{build.subvariant}...Nucleo_144.menu.pnum.NUCLEO_XYZ.build.subvariant=Generix_XYZx

but it does not work. It builds fine until the compile core step. The automatic default include is simply ignored while for other step it works fine.
I guess there is an issue around the way variant is managed in the Arduino IDE.
Any input are welcome.
@matthijskooijman do you have any idea about this issue? -->arduino/arduino-cli#762

@fpistmfpistm added the enhancementNew feature or request labelJun 5, 2020
@fpistmfpistm marked this pull request as ready for reviewJune 5, 2020 19:20
@fpistm
Copy link
MemberAuthor

fpistm commentedJun 6, 2020
edited
Loading

This change impact PIO and I don't know how to solve this.
@valeros, I'm currently studying how to better handle variants, this PR is one solution I've planned.
How can we handle this correctly with PIO to ensure backward compatibility?

@fpistmfpistm marked this pull request as draftJune 9, 2020 15:35
@fpistm
Copy link
MemberAuthor

@matthijskooijman

I saw in 1.8.13 your rework of the boards menu per architecturearduino/Arduino#9238

has you any though on this PR and this question ?

That would be fine to define the variant in a different way, like this for example:

Nucleo_144.build.variant=Nucleo_144/{build.subvariant}...Nucleo_144.menu.pnum.NUCLEO_F207ZG.build.subvariant=NUCLEO_F207ZG

but it does not work. It builds fine until the compile core step. The automatic default include is simply ignored while for other step it works fine.
I guess there is an issue around the way variant is managed in the Arduino IDE.
Any input are welcome.
@matthijskooijman do you have any idea about this issue?

I think about open an issue about that or a question on the devel group list.

The way to define a board/variant does not allows enough possibilities and seems very restricted. I guess it would be fine to allows build submenu more easily and have a variant path more "dynamic"

@valeros
Copy link
Contributor

valeros commentedJun 24, 2020
edited
Loading

Thanks for keeping me informed. We're going to update STM32 platform with the v1.9.0 release, so we can take into account possible future changes of variant paths. Is it already decided to introduce an intermediary folder
variants/ARMED_V1/PinNamesVar.h → variants/3dprinter/ARMED_V1/PinNamesVar.h?

@fpistm
Copy link
MemberAuthor

Thanks for keeping me informed. We're going to update STM32 platform with the v1.9.0 release, so we can take into account possible future changes of variant paths. Is it already decided to introduce a intermediary folder
variants/ARMED_V1/PinNamesVar.h → variants/3dprinter/ARMED_V1/PinNamesVar.h?

Hi@valeros

currently this is under investigation. 1.9.0 is not impacted.
Could you give me some tricks how to manage this during my testing?

@valeros
Copy link
Contributor

Probably the best way is to forkplatform-ststm32 and changevariant field in the board manifests that used in CI checks blackpill_f103c8 remram_v1), e.g.:

{  "build": {    "core": "stm32",    ...    "variant": "ARMED_V1"  },  ....}
{  "build": {    "core": "stm32",    ...    "variant": "3dprinter/ARMED_V1"  },  ....}

@matthijskooijman
Copy link
Contributor

matthijskooijman commentedJun 25, 2020
edited
Loading

@fpistm, that{build.subvariant} does not work seems to be a limitation or bug in thearduino-cli code (which is used by the Arduino IDE viaarduino-builder). I reported a bug, look there for more details:arduino/arduino-cli#762

A workaround would be what you've done now: Just repeat the group path in each menu option. Not elegant, but at least it works. Maybe if Arduino fixes this, it can be changed later. I can't comment on PlatformIO, but I think@valeros can :-)

Is this what you wanted feedback on? Or is there any other question I missed?

per1234 reacted with thumbs up emojifpistm reacted with heart emojifpistm reacted with rocket emoji

@fpistm
Copy link
MemberAuthor

Thanks@matthijskooijman !!

Note that the compiler command has no -I option for the variant when compiling the core (but it is present for the sketch).

Yes that's what I saw during my test. For sketch it works but not for compiler while with the method used in this PR the -I option is available with the correct path.

In fact when I saw your rework of the menu, I'm thinking about why we do this kind of boards.txt with the boards group and then the real variant. This is due to the fact it is not possible to construct a submenu.

What would be fine would be to be able to construct a menu with submenu easily and then also be able to link upload method per submenu to avoid duplicate upload boards entries for each group.

Anyway, thanks again.

Just FYI, I've an empty menu with Roger's core. I guess this is due to empty boards.txt in drivers and tools folders:
image

https://github.com/rogerclarkmelbourne/Arduino_STM32/blob/master/drivers/boards.txt
https://github.com/rogerclarkmelbourne/Arduino_STM32/blob/master/tools/boards.txt

Maybe this file can now be safely deleted or simply Arduino should ignore empty file?

@matthijskooijman
Copy link
Contributor

In fact when I saw your rework of the menu, I'm thinking about why we do this kind of boards.txt with the boards group and then the real variant. This is due to the fact it is not possible to construct a submenu.

What would be fine would be to be able to construct a menu with submenu easily and then also be able to link upload method per submenu to avoid duplicate upload boards entries for each group.

Well, reworking the nested menu was easy, that was just GUI code, it did not require changes to theboards.txt interpretation... Reading what you wrote, I thought it could be nice to allow grouping of boards (e.g. to have submenus within the "Boards" -> "STM32..." menu). However, that would probably only causemore duplication of stuff inboards.txt rather than less.

This is because the extra menus are now always defined per-board, so there is no way to have common (per-core) menus. I've realized this would be a good feature to add, but I haven't really sat down to think about this, let alone implement it (and it changes semantics ofboards.txt, so that would not be possible in a backward-compatible manner).

Just FYI, I've an empty menu with Roger's core. I guess this is due to empty boards.txt in drivers and tools folders:

Ah, that's a completely separate issue that is triggered by my nested boards change. I'm not sure what the best fix for this is, since Roger's core does sort of abuse the system by providing an emptyboards.txt. Maybe you should file a bug at Roger's repository to further discuss this, since it's a bit off-topic for this issue.

@fpistm
Copy link
MemberAuthor

Ah, that's a completely separate issue that is triggered by my nested boards change. I'm not sure what the best fix for this is, since Roger's core does sort of abuse the system by providing an emptyboards.txt. Maybe you should file a bug at Roger's repository to further discuss this, since it's a bit off-topic for this issue.

As said it is just for your interest and of course off-topic ;)

However, that would probably only causemore duplication of stuff inboards.txt rather than less.

OK. Just a thought as I think this could be probably better managed. Anyway, I guess this would be really useful only for this core. We planned to deployed more generic variant and so this will add a lot of entry in the boards.txt. Hope there is no limit in Arduino IDE (even the new pro IDE) and also with arduino-cli.

@fpistmfpistm added this to the2.0.0 milestoneJul 8, 2020
@fpistmfpistmforce-pushed thesubvariant branch 3 times, most recently from1e544ef to38f6145CompareJuly 10, 2020 09:56
@fpistm
Copy link
MemberAuthor

Thanks@valeros for the hints. I've made the patch in the GH action and it works well:
38f6145

I wonder if it could be possible to manage backward compatibilities in the script which manages the variant JSON entry to test if the path exists or not ?
Maybe having in the boards JSON:

"variant":"Generic_F1/PILL_F103XX","alt_variant":"PILL_F103XX",
valeros reacted with thumbs up emoji

@valeros
Copy link
Contributor

@fpistm I think we can handle this is in the build script instead of adding a new filedalt_variant to the board manifests. If the pathGeneric_F1/PILL_F103XX doesn't exist, then we can use only the latterPILL_F103XX.

fpistm reacted with thumbs up emoji

@fpistm
Copy link
MemberAuthor

Thanks@valeros
This would be fine and ensure backward compatibility.

@fpistmfpistm changed the title[variant] Group each variant per boards type[variant] Group each variant per boards type or manufacturersJul 10, 2020
@fpistmfpistm marked this pull request as ready for reviewJuly 10, 2020 14:16
@fpistmfpistm marked this pull request as draftJuly 10, 2020 14:53
@ABOSTM
Copy link
Contributor

I think that having 2 ways of categorization at the same level (by manufacturer and by board type) may be ambiguous, there may be some overlap. What to do when manufacturer XXX introduce a 3D printer board ?
So I would prefer only 1 rule, or several rules at several level (ex manufacturer 1st level, board type second level).

That said, I would be in favor of 1st level being STM32 series (F1, F4, ...), this could help future enhancement where a board inherit from Generic implementation.

@fpistm
Copy link
MemberAuthor

Thanks for you feedback@ABOSTM
This make sense as the core is more MCU oriented.
I guess this need more investigation and probably this will help to factorize boards definitions, mainly for generic ones.

Any feedback are welcome. 😉

ABOSTMand others added9 commitsApril 16, 2021 15:09
Supersedestm32duino#1337Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
Note this user button is not available on all revisions of this boardFixesstm32duino#1144Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
Supersedstm32duino#1130Signed-off-by: dds90 <40141422+dds90@users.noreply.github.com>Co-authored-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
Invert PF9 and PF10 in digitalPin[] to match their definition invariant.hFixes forum issue:https://www.stm32duino.com/viewtopic.php?p=6652#p6652Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
Supersedstm32duino#1208Signed-off-by: Martin Cerný <mail@martincerny.info>Co-authored-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
This is is only a workaround to allow the PIO build action.Targets have been changed due to '(' and ')' in their pathswhich prevent the build even if they are protected.Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Wiki will be updated to describe the new way to define a variant.Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
This new function could be called by STM32duino_Low_Power librarySigned-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
Currently only H7 is concerned.MP1 hardware also have dualpad analog switch but behavior is differentand in our case, switch should always remain open.Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
@fpistmfpistm merged commiteaeb794 intostm32duino:masterApr 17, 2021
@fpistmfpistm deleted the subvariant branchApril 17, 2021 12:44
@matthijskooijman
Copy link
Contributor

\o/

dreamcat4 and fpistm reacted with thumbs up emojifpistm and dreamcat4 reacted with laugh emoji

@fpistm
Copy link
MemberAuthor

Finally done!

LMESTM and cypheron reacted with rocket emoji

@dreamcat4
Copy link

that was some huge merge. well done! very good work.

sorry if this is wrong place to ask. but had a simple little question (linked over on other issue), just if anybody here happens to know the answer

Serasidis/STM32_HID_Bootloader#23 (comment)

if these newly commited improvement can... lets me flash an hid bootloader and memory magic for flashing mode... without manually be pressing the reset button to reboot it every time. i think it means some special signal has to be sent over HID usb connection. to interrupt the running userland program, ad jump into the hid bootloader. which can then do all the flashing, reboot etc.

because for the life of me... i cannot find the answer to this question! yet the weact black pill f4xx is a very popular board. i searched and searched

@fpistm
Copy link
MemberAuthor

@dreamcat4

Thanks.

For HID. I saw several issue linked to the WeAct HID fork. I don't know why so many issue... Anyway, I do not use it and HID seems no more maintained by@Serasidis.
I have to end#710 which is more generic (except for F1 which doesn't have USB support in builtin bootloader) and do not need extra stuff.

dreamcat4 reacted with thumbs up emoji

@avtoneru
Copy link

avtoneru commentedMay 16, 2021
edited
Loading

Wiki will be updated after official 2.0.0 core release

When can we expect an update wiki?

@ABOSTM
Copy link
Contributor

@ridvanmelih

I looks like there is something wrong with github:
I receive a email notification about the following comment

Do we have a chance to define the SPI2 pins here?

related to this commit (part of this PR)

Re: [stm32duino/Arduino_Core_STM32] Add all generated STM32F1xx generic variant files (6b2b23d)

But I could not found the comment in github.
Consequently I don't know the context of this comment

  • which directory is concerned
  • which file is concerned
  • which line is concerned
  • which MCU/board is concerned

What I can tell is that generic files are automatically generated, and all supported spi instances are made available.
So maybe the concerned MCU doesn't have spi2, or you are on a board/MCU which doesn't output spi2 pins

@ridvanmelih
Copy link

ridvanmelih commentedAug 3, 2021 via email

Hello Alexandre,Thank yo for your interest.Yes, Yesterday I wrote a message and after that delete, because that’s true or not, I am not sure.When I look at the MCU STM32F103C8T6 and the datasheet I am using, I see that there are two SPIs in this MCU and I made my PCB design considering this.Both of the ICs I have used on my card use the SPI communication protocol. For this reason, I had to make my software accordingly.One of the ICs I have used is the NRF24 module. I defined this module to SPI2 and connected it to SPI1 in my other integration. But I could not establish any communication with NRF24.Afterwards, I realized that there is no SPI2-related definition in the "variant_generic.h" code.PART OF variant_generic.hAs such, I defined the SPI2 pins to the SPI pins defined in the "variant_generic.h" code in order to at least determine the operability of my card and whether the SPI2 pins are usable.Later, I realized that my card was working, so I made sure that the SPI2 pins of the MCU I used were also working.My current goal is to add the SPI1 and SPI2 pins to the relevant part (But I'm not sure which part, I just have a few thoughts.)Maybe these libraries:· PeripheralPins.h· PinAF_STM32F1.hYou can find this codes: STMicroelectronics\hardware\stm32\2.0.0\cores\arduino\stm32Thank you for your interest. I'd appreciate it if you could help me out or start a discussion on github. This may be of interest to other software developers.Saygılarımla / Best regardsRıdvan Melih ŞAHİNElektronik Tasarım Mühendisi / Electronic Design Engineer <http://dets.com.tr/> Yatay Logo Yazı2DETS DİNAMİK MÜHENDİSLİK TEKNOLOJİ SİSTEMLERİ SAN. TİC. LTD.ŞTİ.ODTÜ Teknokent Ostim Merkezi Ostim Mahallesi 1308 Cadde No:6Zemin kat No: 6 06374 - Yenimahalle/ ANKARAT: +90 312 473 16 73 M: +90 507 733 22 34 <http://www.dets.com.tr/>www.dets.com.trBu e-posta ile iletilen bilgiler ve dosyalar gönderici ve alıcı arasında gizlidir. E-postanın ulaşması gereken kişi siz değilseniz, e-posta ve tüm eklerini silerek gönderen kişiye yanlışlıkla ilgili bilgi veriniz. Alıcı ve gönderici haricinde mesajın içerdiği bilgiler kullanılamaz. Bu mesajın içerdiği bilgiler DETS Dinamik Mühendislik Teknoloji Sistemleri San. Tic. Ltd. Şti.’yi hukuki sorumluluk altında bırakmaz.The information and files transmitted by this e-mail are confidential between the sender and the receiver. If you are not the person this e-mail needs to reach, delete the e-mail and all of its attachments and let the sender know this mistake. The information contained in the message can not be used except the sender and the receiver. The information contained in this message does not leave DETS Dinamik Mühendislik Teknoloji Sistemleri San. Tic. Ltd. under legal responsibility.From: Alexandre Bourdiol ***@***.***Sent: Monday, August 2, 2021 4:42 PMTo: stm32duino/Arduino_Core_STM32Cc: Rıdvan Melih Şahin; MentionSubject: Re: [stm32duino/Arduino_Core_STM32] [variant] Improve variant support and genericity (#1091)@ridvanmelih <https://github.com/ridvanmelih>I looks like there is something wrong with github:I receive a email notification about the following commentDo we have a chance to define the SPI2 pins here?related to this commit (part of this PR)Re: [stm32duino/Arduino_Core_STM32] Add all generated STM32F1xx generic variant files ( <6b2b23d>6b2b23d)But I could not found the comment in github.Consequently I don't know the context of this comment*which directory is concerned*which file is concerned*which line is concerned*which MCU/board is concernedWhat I can tell is that generic files are automatically generated, and all supported spi instances are made available.So maybe the concerned MCU doesn't have spi2, or you are on a board/MCU which doesn't output spi2 pins—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub <#1091 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AU2SBRZ5WGH7RRXQW7LZGTLT22OEDANCNFSM4NU7GKCA> . <https://github.com/notifications/beacon/AU2SBR4GTBCMHSZGBJQL5MTT22OEDA5CNFSM4NU7GKCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGUOCSEQ.gif>

@ABOSTM
Copy link
Contributor

As you can see, SPI1 and SPI2 pins are already defined:

Arduino create a default SPI instance (instance of the class)
In variant_generic.h you can see that defaultSPI instance used is SPI1 with PA5, PA6, PA7

If you need both SPI, you just need to declare, in you sketch, a new instance with the pins of SPI2 (hardware instance)
For example, (check the pin match your board):

SPIClass SPI_2(PB_15, PB_14, PB_13);SPI_2.begin();

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@matthijskooijmanmatthijskooijmanmatthijskooijman left review comments

@per1234per1234per1234 left review comments

@jhleekrjhleekrjhleekr requested changes

@chevette77chevette77chevette77 approved these changes

@ABOSTMABOSTMAwaiting requested review from ABOSTM

Assignees

@fpistmfpistm

Labels
arduino compatibilityenhancementNew feature or requestfix 🩹Bug fixnew variantAdd support of new bard
Projects
None yet
Milestone
2.0.0
19 participants
@fpistm@valeros@matthijskooijman@ABOSTM@dreamcat4@avtoneru@ridvanmelih@per1234@jhleekr@chevette77@owennewo@seeers@gbmhunter@vladkozlov69@mkals@dnandha@Stanimir-Petev@dds90@mcer12

[8]ページ先頭

©2009-2025 Movatter.jp