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

Fix STM32 remapped GPIO data #47

Merged
merged 2 commits into from
Sep 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions devices/stm32/stm32f0-42.xml
Original file line number Diff line number Diff line change
Expand Up @@ -308,22 +308,22 @@
<signal af="3" driver="tsc" name="g4_io2"/>
<signal af="4" driver="i2c" instance="1" name="sda"/>
</gpio>
<gpio port="a" pin="11">
<gpio device-pin="c|k|t" port="a" pin="11">
<signal driver="usb" name="dm"/>
<signal device-pin="c|g|k|t" af="1" driver="usart" instance="1" name="cts"/>
<signal af="1" driver="usart" instance="1" name="cts"/>
<signal af="2" driver="tim" instance="1" name="ch4"/>
<signal af="3" driver="tsc" name="g4_io3"/>
<signal af="4" driver="can" name="rx"/>
<signal af="5" driver="i2c" instance="1" name="scl"/>
</gpio>
<gpio port="a" pin="12">
<gpio device-pin="c|k|t" port="a" pin="12">
<signal driver="usb" name="dp"/>
<signal device-pin="c|g|k|t" af="1" driver="usart" instance="1" name="de"/>
<signal device-pin="c|g|k|t" af="1" driver="usart" instance="1" name="rts"/>
<signal af="1" driver="usart" instance="1" name="de"/>
<signal af="1" driver="usart" instance="1" name="rts"/>
<signal af="2" driver="tim" instance="1" name="etr"/>
<signal af="3" driver="tsc" name="g4_io4"/>
<signal af="4" driver="can" name="tx"/>
<signal device-pin="c|k|t" af="5" driver="i2c" instance="1" name="sda"/>
<signal af="5" driver="i2c" instance="1" name="sda"/>
</gpio>
<gpio port="a" pin="13">
<signal af="0" driver="sys" name="swdio"/>
Expand Down
6 changes: 3 additions & 3 deletions devices/stm32/stm32f0-48.xml
Original file line number Diff line number Diff line change
Expand Up @@ -288,20 +288,20 @@
<signal af="3" driver="tsc" name="g4_io2"/>
<signal af="4" driver="i2c" instance="1" name="sda"/>
</gpio>
<gpio port="a" pin="11">
<gpio device-pin="c|t" port="a" pin="11">
<signal driver="usb" name="dm"/>
<signal af="1" driver="usart" instance="1" name="cts"/>
<signal af="2" driver="tim" instance="1" name="ch4"/>
<signal af="3" driver="tsc" name="g4_io3"/>
<signal af="5" driver="i2c" instance="1" name="scl"/>
</gpio>
<gpio port="a" pin="12">
<gpio device-pin="c|t" port="a" pin="12">
<signal driver="usb" name="dp"/>
<signal af="1" driver="usart" instance="1" name="de"/>
<signal af="1" driver="usart" instance="1" name="rts"/>
<signal af="2" driver="tim" instance="1" name="etr"/>
<signal af="3" driver="tsc" name="g4_io4"/>
<signal device-pin="c|t" af="5" driver="i2c" instance="1" name="sda"/>
<signal af="5" driver="i2c" instance="1" name="sda"/>
</gpio>
<gpio port="a" pin="13">
<signal af="0" driver="sys" name="swdio"/>
Expand Down
5 changes: 2 additions & 3 deletions devices/stm32/stm32f0-70.xml
Original file line number Diff line number Diff line change
Expand Up @@ -341,13 +341,12 @@
<signal af="2" driver="tim" instance="1" name="ch3"/>
<signal device-size="6" af="4" driver="i2c" instance="1" name="sda"/>
</gpio>
<gpio port="a" pin="11">
<gpio device-pin="c|r" port="a" pin="11">
<signal driver="usb" name="dm"/>
<signal af="1" driver="usart" instance="1" name="cts"/>
<signal af="2" driver="tim" instance="1" name="ch4"/>
<signal device-pin="f" af="5" driver="i2c" instance="1" name="scl"/>
</gpio>
<gpio port="a" pin="12">
<gpio device-pin="c|r" port="a" pin="12">
<signal driver="usb" name="dp"/>
<signal af="1" driver="usart" instance="1" name="de"/>
<signal af="1" driver="usart" instance="1" name="rts"/>
Expand Down
14 changes: 0 additions & 14 deletions devices/stm32/stm32g0-30.xml
Original file line number Diff line number Diff line change
Expand Up @@ -279,27 +279,13 @@
<signal af="1" driver="spi" instance="2" name="nss"/>
<signal af="2" driver="tim" instance="1" name="ch1"/>
</gpio>
<gpio port="a" pin="9">
<signal af="0" driver="rcc" name="mco"/>
<signal af="1" driver="usart" instance="1" name="tx"/>
<signal af="2" driver="tim" instance="1" name="ch2"/>
<signal af="4" driver="spi" instance="2" name="miso"/>
<signal af="6" driver="i2c" instance="1" name="scl"/>
</gpio>
<gpio device-pin="c|k" port="a" pin="9">
<signal af="0" driver="rcc" name="mco"/>
<signal af="1" driver="usart" instance="1" name="tx"/>
<signal af="2" driver="tim" instance="1" name="ch2"/>
<signal af="4" driver="spi" instance="2" name="miso"/>
<signal af="6" driver="i2c" instance="1" name="scl"/>
</gpio>
<gpio port="a" pin="10">
<signal af="0" driver="spi" instance="2" name="mosi"/>
<signal af="1" driver="usart" instance="1" name="rx"/>
<signal af="2" driver="tim" instance="1" name="ch3"/>
<signal af="5" driver="tim" instance="17" name="bk"/>
<signal af="6" driver="i2c" instance="1" name="sda"/>
</gpio>
<gpio device-pin="c|k" port="a" pin="10">
<signal af="0" driver="spi" instance="2" name="mosi"/>
<signal af="1" driver="usart" instance="1" name="rx"/>
Expand Down
14 changes: 0 additions & 14 deletions devices/stm32/stm32g0-31_41.xml
Original file line number Diff line number Diff line change
Expand Up @@ -377,27 +377,13 @@
<signal af="2" driver="tim" instance="1" name="ch1"/>
<signal af="5" driver="lptim" instance="2" name="out"/>
</gpio>
<gpio port="a" pin="9">
<signal af="0" driver="rcc" name="mco"/>
<signal af="1" driver="usart" instance="1" name="tx"/>
<signal af="2" driver="tim" instance="1" name="ch2"/>
<signal af="4" driver="spi" instance="2" name="miso"/>
<signal af="6" driver="i2c" instance="1" name="scl"/>
</gpio>
<gpio device-pin="c|k" port="a" pin="9">
<signal af="0" driver="rcc" name="mco"/>
<signal af="1" driver="usart" instance="1" name="tx"/>
<signal af="2" driver="tim" instance="1" name="ch2"/>
<signal af="4" driver="spi" instance="2" name="miso"/>
<signal af="6" driver="i2c" instance="1" name="scl"/>
</gpio>
<gpio port="a" pin="10">
<signal af="0" driver="spi" instance="2" name="mosi"/>
<signal af="1" driver="usart" instance="1" name="rx"/>
<signal af="2" driver="tim" instance="1" name="ch3"/>
<signal af="5" driver="tim" instance="17" name="bk"/>
<signal af="6" driver="i2c" instance="1" name="sda"/>
</gpio>
<gpio device-pin="c|k" port="a" pin="10">
<signal af="0" driver="spi" instance="2" name="mosi"/>
<signal af="1" driver="usart" instance="1" name="rx"/>
Expand Down
15 changes: 0 additions & 15 deletions devices/stm32/stm32g0-70.xml
Original file line number Diff line number Diff line change
Expand Up @@ -329,21 +329,6 @@
<signal af="5" driver="tim" instance="15" name="bk"/>
<signal af="6" driver="i2c" instance="1" name="scl"/>
</gpio>
<gpio port="a" pin="9">
<signal af="0" driver="rcc" name="mco"/>
<signal af="1" driver="usart" instance="1" name="tx"/>
<signal af="2" driver="tim" instance="1" name="ch2"/>
<signal af="4" driver="spi" instance="2" name="miso"/>
<signal af="5" driver="tim" instance="15" name="bk"/>
<signal af="6" driver="i2c" instance="1" name="scl"/>
</gpio>
<gpio port="a" pin="10">
<signal af="0" driver="spi" instance="2" name="mosi"/>
<signal af="1" driver="usart" instance="1" name="rx"/>
<signal af="2" driver="tim" instance="1" name="ch3"/>
<signal af="5" driver="tim" instance="17" name="bk"/>
<signal af="6" driver="i2c" instance="1" name="sda"/>
</gpio>
<gpio port="a" pin="10">
<signal af="0" driver="spi" instance="2" name="mosi"/>
<signal af="1" driver="usart" instance="1" name="rx"/>
Expand Down
23 changes: 2 additions & 21 deletions devices/stm32/stm32g0-71_81.xml
Original file line number Diff line number Diff line change
Expand Up @@ -535,36 +535,17 @@
<signal af="2" driver="tim" instance="1" name="ch1"/>
<signal af="5" driver="lptim" instance="2" name="out"/>
</gpio>
<gpio port="a" pin="9">
<signal device-pin="c|k" device-package="u" driver="ucpd" instance="1" name="dbcc1"/>
<signal device-pin="c|k|r" device-package="t" driver="ucpd" instance="1" name="dbcc1"/>
<signal af="0" driver="rcc" name="mco"/>
<signal af="1" driver="usart" instance="1" name="tx"/>
<signal af="2" driver="tim" instance="1" name="ch2"/>
<signal af="4" driver="spi" instance="2" name="miso"/>
<signal af="5" driver="tim" instance="15" name="bk"/>
<signal af="6" driver="i2c" instance="1" name="scl"/>
</gpio>
<gpio device-pin="c|k|r" port="a" pin="9">
<signal device-package="i" driver="ucpd" instance="1" name="dbcc1"/>
<signal driver="ucpd" instance="1" name="dbcc1"/>
<signal af="0" driver="rcc" name="mco"/>
<signal af="1" driver="usart" instance="1" name="tx"/>
<signal af="2" driver="tim" instance="1" name="ch2"/>
<signal af="4" driver="spi" instance="2" name="miso"/>
<signal af="5" driver="tim" instance="15" name="bk"/>
<signal af="6" driver="i2c" instance="1" name="scl"/>
</gpio>
<gpio port="a" pin="10">
<signal device-pin="c|k" device-package="u" driver="ucpd" instance="1" name="dbcc2"/>
<signal device-pin="c|k|r" device-package="t" driver="ucpd" instance="1" name="dbcc2"/>
<signal af="0" driver="spi" instance="2" name="mosi"/>
<signal af="1" driver="usart" instance="1" name="rx"/>
<signal af="2" driver="tim" instance="1" name="ch3"/>
<signal af="5" driver="tim" instance="17" name="bk"/>
<signal af="6" driver="i2c" instance="1" name="sda"/>
</gpio>
<gpio device-pin="c|k|r" port="a" pin="10">
<signal device-package="i" driver="ucpd" instance="1" name="dbcc2"/>
<signal driver="ucpd" instance="1" name="dbcc2"/>
<signal af="0" driver="spi" instance="2" name="mosi"/>
<signal af="1" driver="usart" instance="1" name="rx"/>
<signal af="2" driver="tim" instance="1" name="ch3"/>
Expand Down
2 changes: 1 addition & 1 deletion modm_devices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

__all__ = ['exception', 'device_file', 'device_identifier', 'device', 'parser', 'pkg']

__version__ = "0.2.0"
__version__ = "0.2.1"
4 changes: 2 additions & 2 deletions tools/generator/dfg/stm32/stm_device_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ def raw_pin_sort(p):
pin = pin[:3]
return (port, int(pin[2:]))
pins = sorted(pins, key=raw_pin_sort)
# STM32G0 has pin remaps?!?
# pins = filter(lambda p: "PINREMAP" not in p.get("Variant", ""), pins)
# Remove package remaps from GPIO data (but not from package)
pins = filter(lambda p: "PINREMAP" not in p.get("Variant", ""), pins)

gpios = []

Expand Down