RIOT icon indicating copy to clipboard operation
RIOT copied to clipboard

cpu, boards: add stm32c0

Open jparker324 opened this issue 1 year ago • 5 comments

Adding updated STM32C0 targets per https://www.st.com/en/microcontrollers-microprocessors/stm32c0x1.html

image

Supported cpu targets now include STM32C011, STM32C031, STM32C051, STM32C071, STM32C091, and STM32C092.

Added board targets stm32c0116-dk and stm32c0316-dk, further resolving issue #19210, and nucleo-c071rb (https://www.st.com/en/evaluation-tools/nucleo-c071rb.html).

General reference issue #19264

jparker324 avatar Oct 23 '24 19:10 jparker324

Very nice! Can you please split up the commit into one for the CPU changes, one for each new board and then another one for the Makefile.ci updates?

Thank you!

benpicco avatar Nov 04 '24 13:11 benpicco

Very nice! Can you please split up the commit into one for the CPU changes, one for each new board and then another one for the Makefile.ci updates?

Thank you!

@benpicco updated commits :+1:

jparker324 avatar Nov 07 '24 13:11 jparker324

formal: <area of work>: is missing for title and commits just saw @benpicco already said that and provided possible titles

https://github.com/RIOT-OS/RIOT/blob/master/CONTRIBUTING.md#commit-conventions

kfessel avatar Dec 04 '24 17:12 kfessel

I ~~accidentally~~ intentionally bought a Nucleo-C071RB last week, so I can give this a test.

Unfortunately it does not compile for me:

RIOT/tests/periph/adc$ BOARD=nucleo-c071rb make hexfile -j12
Traceback (most recent call last):
  File "/home/cbuec/riot-stm32c0/RIOT/cpu/stm32/dist/irqs/gen_vectors.py", line 147, in <module>
    main(PARSER.parse_args())
  File "/home/cbuec/riot-stm32c0/RIOT/cpu/stm32/dist/irqs/gen_vectors.py", line 138, in main
    context = parse_cmsis(args.cmsis_dir, args.cpu_line)
  File "/home/cbuec/riot-stm32c0/RIOT/cpu/stm32/dist/irqs/gen_vectors.py", line 63, in parse_cmsis
    with open(cpu_line_cmsis, 'rb') as cmsis:
FileNotFoundError: [Errno 2] No such file or directory: '/home/cbuec/riot-stm32c0/RIOT/build/stm32/cmsis/c0/Include/stm32c071xx.h'
make: *** [/home/cbuec/riot-stm32c0/RIOT/cpu/stm32/Makefile.include:109: /home/cbuec/riot-stm32c0/RIOT/cpu/stm32/vectors/STM32C071xx.c] Error 1
make: *** Waiting for unfinished jobs....

The cause of this is that an old CMSIS version is loaded. Fron the RIOT/build/stm32/cmsis/c0/Release_Notes.html image

The support for the C071 was only added in Version 1.2.0: https://github.com/STMicroelectronics/cmsis-device-c0/commits/main/Include/stm32c071xx.h

These lines have to be updated: https://github.com/RIOT-OS/RIOT/blob/26e46ae0396437e0b2978b90ee7024e856bdf3a6/cpu/stm32/Makefile.cmsis#L6-L7

# v1.3.0
PKG_VERSION_c0=517611273f835ffe95318947647bc1408f69120d

With that change, the tests/periph/adc test compiles and runs on the C071RB Nucleo.

crasbe avatar Feb 17 '25 17:02 crasbe

@jparker324 are you still interested in getting this merged? I think it only requires small changes (like a rebase after #21135 to reflect the new examples folder structure).

crasbe avatar Apr 23 '25 12:04 crasbe

Closed as this is replaced by https://github.com/RIOT-OS/RIOT/pull/21775 and https://github.com/RIOT-OS/RIOT/pull/21776.

crasbe avatar Oct 10 '25 11:10 crasbe