platformio / platform-ststm32

ST STM32: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/ststm32
Apache License 2.0
389 stars 305 forks source link

stm32 C0 Family - Missing Board #693

Open tgrotowski opened 1 year ago

tgrotowski commented 1 year ago

Hello, I can't find nucleo board stm32 C031C6. https://www.st.com/en/evaluation-tools/nucleo-c031c6.html

C0 it's quite new stm32 family with Cortex M0+ but becomes popular. There are more and more each day, it would be really useful to programming it on PlatformIO.

minumn commented 1 year ago

I would like to use this board as well and together with zephyr. Can anyone help me with how I could implement this?

RudolphRiedel commented 1 year ago

The Arduino core v2.5.0 added support for C031C6 back in end of march but the last update of the Arduino core was to v2.4.0 back in 15.5.0. So at least for Arduino this is looking promising.

RudolphRiedel commented 1 year ago

I made a board definition for the nucleo-c031c6: nucleo_c031c6.zip

It kind of works but not entirely as expected or I would have opened a pull-request for this. First of all stlink upload does not work, I set it to mbed and that works. And then I only used it to compile an Arduino test-project which works in general but for some reason this is awfully slow, at least with SPI, I measure huge pauses between SPI.transfer(byte) calls of almost 6µs. I deleted framework Arduino-mbed and it is not getting installed, so it runs on framework-arduinoststm32.

I am using the development version of platform-ststm32 now but that also makes no difference.

RudolphRiedel commented 11 months ago

I just tried this again in order to perhaps put in a pull request but now my board definition does not work anymore: Resolving STM32C0C31 dependencies... KeyError: Traceback (most recent call last): File "C:\Users\Ich.platformio\penv\lib\site-packages\platformio__main.py", line 103, in main cli() # pylint: disable=no-value-for-parameter File "C:\Users\Ich.platformio\penv\lib\site-packages\click\core.py", line 1130, in call return self.main(*args, kwargs) File "C:\Users\Ich.platformio\penv\lib\site-packages\click\core.py", line 1055, in main rv = self.invoke(ctx) File "C:\Users\Ich.platformio\penv\lib\site-packages\platformio\cli.py", line 85, in invoke return super().invoke(ctx) File "C:\Users\Ich.platformio\penv\lib\site-packages\click\core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Users\Ich.platformio\penv\lib\site-packages\click\core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Users\Ich.platformio\penv\lib\site-packages\click\core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "C:\Users\Ich.platformio\penv\lib\site-packages\click\core.py", line 760, in invoke return callback(*args, **kwargs) File "C:\Users\Ich.platformio\penv\lib\site-packages\platformio\package\commands\list.py", line 56, in package_list_cmd list_project_packages(options) File "C:\Users\Ich.platformio\penv\lib\site-packages\platformio\package\commands\list.py", line 179, in list_project_packages _found = print_project_env_platform_packages(env, options) File "C:\Users\Ich.platformio\penv\lib\site-packages\platformio\package\commands\list.py", line 192, in print_project_env_platform_packages p = PlatformFactory.from_env(project_env) File "C:\Users\Ich.platformio\penv\lib\site-packages\platformio\platform\factory.py", line 102, in from_env p.configure_project_packages(env, targets) File "C:\Users\Ich.platformio\penv\lib\site-packages\platformio\platform\base.py", line 184, in configure_project_packages self.configure_default_packages(options, targets or []) File "C:\Users\Ich.platformio\platforms\ststm32\platform.py", line 110, in configure_default_packages return PlatformBase.configure_default_packages(self, variables, File "C:\Users\Ich.platformio\penv\lib\site-packages\platformio\platform\base.py", line 196, in configure_default_packages self.packages[_pkg_name]["optional"] = False KeyError: 'framework-stm32cubec0'

Looks like there was a change to PlatformIO itself that removed framework-stm32cubec0???

RudolphRiedel commented 8 months ago

I tried this again adding my nucleo_c031c6.json to .platformio\platforms\ststm32\boards after installing 17.2.0 and I can not get this to work anymore.

It really would be nice if someone could take a look at this who has some understanding of what is going on there in regards of PlatformIO.

Overall I have to say that PlatformIO really is nice as long there already is support for the board you want to use and when the board definition supports the framework you like to use. But beyond that PlatformIO tends to be a major pain for those like me who are unfamiliar with the inner workings of PlatformIO itself. Do I want to know how to fix these things? Yes and No. Yes, I am interested in fixing these things myself and therefore I would apreciate it if beeing pointed to a tutorial on how to add new boards. But no in the sense that what I am actually trying to do is to compile software for the board I have right before me.

ftab commented 3 weeks ago

I got the same error after making a custom board definition for the STM32C0116-DK. (It works in Arduino, but I can't use Arduino due to the license)

What do we need to do to get it to recognize c0 for stm32cube?