Hi, I’m trying to add support to the wio e5 module using the stm32cube framework, in order to do so I followed the suggestion in the following thread How to use STM32WL55JC under STM32Cube framework. Specifically I did the following.
1.- Copy the ststm32 repo to the platforms folder inside platformio folder .platform in my case since i’m using ubuntu 22
2.- Added a file called wioe5.json inside the boards folder with the following code:
{
"build": {
"core": "stm32",
"cpu": "cortex-m4",
"extra_flags": "-DSTM32WLxx -DSTM32WLE5xx",
"f_cpu": "32000000L",
"mcu": "stm32wle5jc",
"product_line": "STM32WLE5xx"
},
"debug": {
"default_tools": [
"stlink"
],
"jlink_device": "STM32WLE5JC",
"onboard_tools": [
"stlink"
],
"openocd_target": "stm32wlex",
"svd_path": "STM32WLE5x_CM4.svd"
},
"frameworks": [
"stm32cube"
],
"name": "Wio E5",
"upload": {
"maximum_ram_size": 65536,
"maximum_size": 262144,
"protocol": "stlink",
"protocols": [
"stlink"
]
},
"url": "https://wiki.seeedstudio.com/LoRa-E5_STM32WLE5JC_Module",
"vendor": "Seeedstudio"
}
3.- Modified the ststm32’s platform.json file adding the following entry in the packages section:
"framework-stm32cubewl": {
"type": "framework",
"optional": true,
"owner": "platformio",
"version": "symlink:///home/felipe/.platformio/packages/STM32CubeWL"
},
4.- Cloned the STM32CubeWL repo inside my packages folder inside the platformio folder.
5.- Added a file called package.json to the cloned STM32CubeWL folder with the following contents.
{
"description": "STM32Cube is a set of tools and embedded software bricks available free of charge to enable fast and easy development on the STM32 platform (STM32CubeWL MCU Firmware Package)",
"keywords": [
"framework",
"hal",
"stm32",
"st"
],
"name": "framework-stm32cubewl",
"version": "1.26.2",
"homepage": "https://github.com/STMicroelectronics/STM32CubeWL"
}
6.- Created a blank pio proyect with the following platform.ini file
[env:wioe5]
platform = ststm32
board = wioe5
framework = stm32cube
7.- Tried to run pio run and get the following output
pio run -v
Processing wioe5 (platform: ststm32; board: wioe5; framework: stm32cube)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Tool Manager: Installing symlink:///home/felipe/.platformio/packages/STM32CubeWL
Tool Manager: framework-stm32cubewl@1.26.2 has been installed!
AttributeError: 'PosixPath' object has no attribute 'read_text':
File "/home/felipe/anaconda3/lib/python3.9/site-packages/platformio/builder/main.py", line 32:
from platformio.platform.base import PlatformBase
File "/home/felipe/anaconda3/lib/python3.9/site-packages/platformio/platform/base.py", line 17:
import semantic_version
File "/home/felipe/anaconda3/lib/python3.9/site-packages/semantic_version/__init__.py", line 14:
__version__ = version("semantic_version")
File "/home/felipe/anaconda3/lib/python3.9/importlib/metadata.py", line 569:
return distribution(distribution_name).version
File "/home/felipe/anaconda3/lib/python3.9/importlib/metadata.py", line 266:
return self.metadata['Version']
File "/home/felipe/anaconda3/lib/python3.9/importlib/metadata.py", line 254:
self.read_text('METADATA')
File "/home/felipe/anaconda3/lib/python3.9/importlib/metadata.py", line 529:
return self._path.joinpath(filename).read_text(encoding='utf-8')
I don’t know what causes this error, reading in the internet it seems that it appears in other projects non related to platformio, the closer I read is that it was caused by trying to directly open a string of a path as seen in a post that will be added next since the forum only lets me add 2 links. Any suggestions or help will be very much appreciated. Thanks!