Add support for generating PAC for dual cores

* Chips that have multiple cores will be exposed as chipname_corename,
  i.e. stm32wl55jc_cm4
* Chips that have single cores will use the chip family as feature name
  and pick the first and only core from the list
* Add support for stm32wl55 chip family
This commit is contained in:
Ulf Lilleengen
2021-06-16 15:12:07 +02:00
parent c9bf039cae
commit b6a8703698
12 changed files with 463 additions and 90 deletions

View File

@ -1,7 +1,13 @@
import os
import toml
import yaml
from glob import glob
try:
from yaml import CSafeLoader as SafeLoader
except ImportError:
from yaml import SafeLoader
abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
os.chdir(dname)
@ -12,6 +18,7 @@ supported_families = [
'STM32L4',
'STM32H7',
'STM32WB55',
'STM32WL55',
]
# ======= load chip list
@ -21,7 +28,15 @@ for f in sorted(glob('../stm32-data/data/chips/*.yaml')):
name = os.path.splitext(os.path.basename(f))[0]
if any((family in name for family in supported_families)):
name = name.lower()
features[name] = ['stm32-metapac/' + name]
# ======= load chip
with open(f, 'r') as f:
chip = yaml.load(f, Loader=SafeLoader)
if len(chip['cores']) > 1:
for core in chip['cores']:
features[name + "_" + core['name']] = ['stm32-metapac/' + name + '_' + core['name']]
else:
features[name] = ['stm32-metapac/' + name]
# ========= Update Cargo features