Repository navigation
Conversation
d2d6b2f to
f533689
Compare
|
Ok, so in order to deduplicate more examples we need |
|
I've prototyped this for some NUCLEO-32 boards, I think it's a good idea to deduplicate all the I2C/SPI examples too. |
2afca50 to
87a6802
Compare
87a6802 to
6221a7b
Compare
3125e63 to
7e9a13f
Compare
|
ok, so I think the deduplication is a good thing, but I don't like the idea of putting everything into the
|
|
What about a more flat structure? I would prefer no subdirectories over non-obvious subdirectories. |
|
it's flat like that, the second indentation is already the example folder. I just didn't list all the i2c drivers. |
|
ah, you mean completely flat? I think it's just too much, particularly because not everything can actually be deduplicated. I currently have 285 examples in this PR (down from 374 on develop), The analog examples can be fairly device specific, so they would be multiple ones like |
|
I think tags instead of categories are more useful for users (including me) to find an example. But that is not possible to implement using filesystem structures anyway, but we could generate a table of all examples inside |
|
I'm also a bit skeptical about the impact of deduplication, use of scripting and undocumented magic XML comment syntax for new modm users. The examples are most users' first exposure to modm, and I find it unfavorable to add unnecessary complexity. What do we think about generating the examples completely in a separate repo (e.g. https://github.com/modm-io/modm-examples) for all boards, including the modm repo as submodules and a |
|
To get users started with their own projects, I created the I hope users are not even gonna notice that there's magic XML syntax in the |
|
(deleted) |
2935385 to
a17f93b
Compare
b6e6323 to
45bf5de
Compare
Replaces: - examples/nucleo_g474re/can - examples/nucleo_h723zg/can
Replaces: - examples/nucleo_f429zi/ethernet
Replaces: - examples/avr/assert
Replaces: - examples/linux/build_info
Replaces: - examples/avr/fiber
Replaces: - examples/nucleo_f446re/flash - examples/nucleo_g071rb/flash - examples/nucleo_g431kb/flash - examples/nucleo_g431rb/flash - examples/nucleo_h723zg/flash - examples/nucleo_h743zi/flash
Replaces: - examples/stm32f072_discovery/hard_fault - examples/stm32f3_discovery/gdb - examples/stm32f469_discovery/hard_fault
Replaces: - examples/blue_pill_f103/itm - examples/nucleo_f103rb/itm - examples/nucleo_l476rg/itm
Replaces: - examples/nucleo_f042k6/vector_table_ram
Replaces: - examples/nucleo_f429zi/rtc_mcp7941x
Replaces: - examples/stm32f072_discovery/tmp102 - examples/stm32f746g_discovery/tmp102
Replaces: - examples/nucleo_f103rb/rtos - examples/nucleo_f303k8/rtos - examples/nucleo_f303re/rtos - examples/nucleo_f411re/rtos - examples/nucleo_f767zi/freertos_blink - examples/nucleo_g071rb/rtos - examples/nucleo_l552ze-q/freertos_blink
Replaces: - examples/weact_u585ci/usb
Replaces: - examples/nucleo_f429zi/usbfatfs
Replaces: - examples/feather_m4/usbserial - examples/nucleo_f446ze/usbserial - examples/samd21_xplained_pro/usbserial - examples/same54_xplained_pro/usbserial - examples/samg55_xplained_pro/usbserial
Replaces: - examples/arduino_uno/basic/blink - examples/avr/mega_pro - examples/black_pill_f103/blink - examples/black_pill_f401/blink - examples/black_pill_f411/blink - examples/blue_pill_f103/blink - examples/feather_m4/blink - examples/feather_rp2040/blink - examples/nrf51422-dk/blink - examples/nrf52840-dk/blink - examples/nrf5340-dk/blink - examples/nucleo_c031c6/blink - examples/nucleo_f031k6/blink - examples/nucleo_f042k6/blink - examples/nucleo_f072rb/blink - examples/nucleo_f091rc/blink - examples/nucleo_f103rb/blink - examples/nucleo_f207zg/blink - examples/nucleo_f303k8/blink - examples/nucleo_f303re/blink - examples/nucleo_f334r8/blink - examples/nucleo_f401re/blink - examples/nucleo_f411re/blink - examples/nucleo_f429zi/blink - examples/nucleo_f439zi/blink - examples/nucleo_f446re/blink - examples/nucleo_f446ze/blink - examples/nucleo_f722ze/blink - examples/nucleo_f746zg/blink - examples/nucleo_f767zi/blink - examples/nucleo_g070rb/blink - examples/nucleo_g071rb/blink - examples/nucleo_g431kb/blink - examples/nucleo_g431rb/blink - examples/nucleo_g474re/blink - examples/nucleo_h503rb/blink - examples/nucleo_h533re/blink - examples/nucleo_h563zi/blink - examples/nucleo_h723zg/blink - examples/nucleo_h743zi/blink - examples/nucleo_l031k6/blink - examples/nucleo_l053r8/blink - examples/nucleo_l152re/blink - examples/nucleo_l432kc/blink - examples/nucleo_l452re/blink - examples/nucleo_l476rg/blink - examples/nucleo_l496zg-p/blink - examples/nucleo_l552ze-q/blink - examples/nucleo_u083rc/blink - examples/nucleo_u385rg-q/blink - examples/nucleo_u575zi-q/blink - examples/olimexino_stm32/blink - examples/rp_pico/blink - examples/samd/blink - examples/samd21_xplained_pro/blink - examples/same54_xplained_pro/blink - examples/same70_xplained/blink - examples/samg55_xplained_pro/blink - examples/samv71_xplained_ultra/blink - examples/srxe/blink - examples/stm32f030f4p6_demo_board/blink - examples/stm32f072_discovery/blink - examples/stm32f0_discovery/blink - examples/stm32f1_discovery/blink - examples/stm32f3_discovery/blink - examples/stm32f401_discovery/blink - examples/stm32f407vet6_devebox/blink - examples/stm32f429_discovery/blink - examples/stm32f469_discovery/blink - examples/stm32f746g_discovery/blink - examples/stm32f769i_discovery/blink - examples/stm32h750vbt6_devebox/blink - examples/stm32l1_discovery/blink - examples/stm32l476_discovery/blink - examples/thingplus_rp2040/blink - examples/weact_g0b1cb/blink - examples/weact_h503cb/blink - examples/weact_h523ce/blink - examples/weact_h562rg/blink - examples/weact_u585ci/blink
Replaces: - examples/avr/logger - examples/linux/logger
Replaces: - examples/arduino_nano/printf - examples/linux/printf
Replaces: - examples/stm32f072_discovery/uart - examples/stm32f401_discovery/uart
Replaces: - examples/samv71_xplained_ultra/pwm
Replaces: - examples/same70_xplained/timer
Replaces the table of every single example, which is not useful anymore with examples that run on many boards.
8eee4f7 to
9195d0a
Compare
Depends on #1387 and #1389merged.This flips the example matrix from "board -> use case" to "use case -> board": an example now lists all the boards it runs on in its
project.xmland the CI compiles it for every one of them. Turns out we had a lot of copy-pasted examples, whoops.The syntax is based on XML comments, so that the example remains usable manually and is hopefully self-explanatory:
<extends>, commented or not, is one configuration.<option>,<collect>and<module>lines directly below it to these configurations. Everything else applies to all of them.examples_compile.pycopies the example into the build folder once per configuration, flips the comments and compiles it. Relative includes still resolve to the original folder.modm:hostedconfiguration (from Add board connections, hosted configuration and fixes for deduplicated examples #1387) with the versionslinux-x86_64,linux-arm64,darwin-x86_64,darwin-arm64andwindows, defaulting to your computer. So no special casing ofhosted-*in the scripts.Since the board is now just a configuration, sorting the examples by board makes no sense anymore, so they are sorted by what they show:
coregpioanalogtimerloggingcandrivermodm:driver: sensors, displays, radios, LEDs and more.uicommunicationextThis is the layout from #1118 (comment). Almost half of all examples show an external device, so the
driverfolder has the same categories assrc/modm/driver:driver/inertial/bmi270,driver/display/ssd1306,driver/radio/nrf24and so on. If you know where the driver lives, you know where its example is, and the bus it uses does not matter. A suffix likeanalog/dac_dma_g4names the family that an example is specific to.A bunch of "examples" were really tests or benchmarks that nobody would use as a starting point. These moved to
test/integrationand all end with aINTEGRATION TEST PASSEDorFAILEDline on the logger (and the exit code on hosted), so that we can eventually run them automatically on real hardware.Some numbers:
So half the projects, but more builds, since a lot of examples now also compile for boards that never had them. That found a few boards that were missing clocks, connections or aliases, which is fixed here too.
The commits are sorted so that moves and changes are separate and you can review them one by one:
modm:hostedmoved to Add board connections, hosted configuration and fixes for deduplicated examples #1387.Only the last commit is guaranteed to compile, since the scripts and CI expect the final layout from the start.
The CI now uses all 20 concurrent jobs and splits the configurations in a stable pseudo-random order (sorted by hash) instead of contiguous chunks, so that every part gets a similar mix of examples and targets. The Cortex-M examples and the HAL compile are matrix jobs now and the STM32 unit tests have their own job, so the check names changed.
examples_compile.pywith--target REGEXfilter and--split/--partover configurations.test/integrationwith a pass result.examples_check.pychecks for unknown configurations, boards without any example, and targets that no CI job compiles. No more silent failures.examples/README.md.examples/README.md.test/integration/flashandspi_flashgenerate the CompilationDB again, so that it keeps getting compiled on Windows.Board::i2candBoard::spifor the remaining Nucleo boards: all Nucleo-144 and C031C6 get both, H503RB/H533RE/H563ZI/U575ZI-Q only I2C and U083RC only SPI, since the other driver does not exist yet. U385RG-Q has neither.D3was PF13 instead of PE13 on all UM1974 Nucleo-144, and H723ZG, H743ZI2 and H753ZI are MB1364 boards with their own pinout (UM2407) that differs in 17 pins from our shared header. They now have their ownnucleo144_arduino_h7.hpp. PlusA2on U083RC andA2,D0,D1,D2on U385RG-Q, which still had the pins of the H5 boards.driver/inertial/lis3mdlnow compiles for all 39 boards withBoard::i2c,driver/pwm/sk6812only for the 6 boards whose SPI can do exactly 3 MHz.Do we need negative filters?noDo we want config globbing support?no,--targettakes a regex instead.Missing: The integration tests compile, but their pass criteria have not been run on hardware yet.
Also missing:
examples/analogis still a mess with one example per family and macros in the merged ones. The ADC drivers have ten different APIs with nineinitialize()signatures between them, so this needs fixing in the drivers first and not in the examples. I'm leaving the folder as is, its shape alone is a good reminder to fix this later, lol.cc @rleh @chris-durand