Closed cocasema closed 2 years ago
This manual process obviously doesn't scale
Absolutely!
and is error-prone.
the compiler will throw error(s) if any alternate function is wrongly configured.
I think the right approach is to generate the missing description here (e.g. as a table) so that it will appear in the documentation. All necessary data are available in the file module.md
, since this also generates the Gpio-C++-classes and connect<>()
-methods.
The module.description
content is parsed as markdown, see e.g. here.
There's also stm_layout
https://pypi.org/project/stm-layout/, which uses the modm-devices data to give you a regex-able interface to the pins and their signals.
It still doesn't give you an overview per peripheral, only per pin unfortunately. But it's still very useful.
If you're motivated, I would like to see a HTML version of this that we can generate locally for your specific device and also host on ~pinout.modm.io~ docs.modm.io/pinout for all devices.
If you're motivated, I would like to see a HTML version of this that we can generate locally for your specific device
It could be done that way, but I would prefer to integrate that with the existing Doxypress documentation at https://docs.modm.io/. That's where most people are already looking for it anyway...
and also host on pinout.modm.io for all devices.
I don't see the benefit of creating another domain. Why not like this (If it cannot be integrated into the Doxypress documentation or should be more interactive (Javascript or similar) than Doxypress allows):
Yes, of course we should integrate it into the Doxygen docs first!
I was mainly thinking of implementing a pinout picker like CubeMX, but in a standalone lightweight HTML+JS website (can certainly be hosted on docs.modm.io/pinout/device). Including a small JS code gen for the specific modm config. As a stretch goal, code gen for other HALs could be added.
I mean, how difficult can it possibly be to clone this functionality? 😇 #FamousLastWords
Although playing around with CubeMX: It's so slow… and still surprisingly bad: There's a search field, but I cannot search for signals, only for PINS. WAT?!? I would want a pinout table and graphic that I can both search and filter.
@cocasema I don't have a hot fix for you now, except perhaps using stm_layout
and CubeMX, but of course you can always check the devices datasheet (not reference manual) for such tables and use PDF search to some degree: Example F303VCT
That table but as a dynamic HTML plus the above graphic layout is basically what I would want.
@salkinium Thanks a lot for the useful links and info!
Here's a very hacky HTML generator for the above AF table: pip3 install modm-devices jinja2
, then python3 pinout.py stm32f303vct7 > pinout.html
(The script should work fine for all devices except STM32F1 and STM32L1, which have additional signal remaps in groups).
Thanks a lot for the script! I was able to get the info I was looking for:
Pin | TIM1 | TIM2 | TIM3 | TIM15 | TIM16 | TIM17 |
---|---|---|---|---|---|---|
A0 | CH1 | |||||
A1 | CH2 | CH1N | ||||
A2 | CH3 | CH1 | ||||
A3 | CH4 | CH2 | ||||
A4 | CH2 | |||||
A5 | CH1 | |||||
A6 | CH1 | CH1 | ||||
A7 | CH1N | CH2 | CH1 | |||
A8 | CH1 | |||||
A9 | CH2 | CH3 | ||||
A10 | CH3 | CH4 | ||||
A11 | CH1N, CH4 | |||||
A12 | CH2N | CH1 | ||||
A13 | CH1N | |||||
A14 | ||||||
A15 | CH1 | |||||
B0 | CH2N | CH3 | ||||
B1 | CH3N | CH4 | ||||
B3 | CH2 | |||||
B4 | CH1 | CH1 | ||||
B5 | CH2 | CH1 | ||||
B6 | CH1N | |||||
B7 | CH4 | CH1N | ||||
F0 | CH3N | |||||
F1 |
FYI: I had started to build a tool to replace CubeMX, for ChibiOS: https://aktos.io/chibi-config/
It would be fun to build a web based tool to mimic CubeMX functionality, for modm (or even STM HAL), but will require a lot of effort, of course. I planned to take advantage of https://github.com/modm-io/modm-devices, however the progress is somewhat stalled for now.
I'm looking for a way to build documentation for supported functions for board's pins in a table/matrix form. Tried searching in the generated doxygen files, but no luck (or did I miss it?) I could only find what channels of the individual pins can be connected to, but this doesn't help much when trying to get a big picture.
For example, MBED has some graphical representation of the supported functions, https://os.mbed.com/media/uploads/bcostm/nucleo_f303k8_2017_10_10.png and a (mostly readable) source file: https://os.mbed.com/users/mbed_official/code/mbed-dev/file/default/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/TARGET_NUCLEO_F303K8/PeripheralPins.c/
In my case, I was particularly looking into how many and which timers are there available for use. I tried to get data into a simple table manually (and I see mbed code and modm have different opinions in some cases).
This manual process obviously doesn't scale and is error-prone. If I want to automate it, would you suggest extending
lbuild
with more options (similar todiscover-options
), and/or generate templates for a doxygen?