Arduino_Core_STM32 icon indicating copy to clipboard operation
Arduino_Core_STM32 copied to clipboard

Adding support for stm32c011j4m6

Open alexnagelberg opened this issue 9 months ago • 7 comments

  • [ ] Adds C011J(4-6)Mxx variants

alexnagelberg avatar May 05 '24 05:05 alexnagelberg

Hi @alexnagelberg

Thanks for this PR.

Could you update tour PR to reference the new generic in the README.md and add a generic clock using LL API (you can use STM32CubeMx to generate it).

Plus a small update of the ldscript to be generic.

Here an example: https://github.com/stm32duino/Arduino_Core_STM32/pull/2048/files

@fpistm Sure, although this ldscript was generated by cubemx, so I'm not sure how to get it to include but will play around. Just a heads up that this PR is not ready so I put it in draft, mostly as a reminder to myself to finish it.

alexnagelberg avatar May 06 '24 13:05 alexnagelberg

Added remaining changes. Still in testing with my new chip.

alexnagelberg avatar May 06 '24 21:05 alexnagelberg

One thing I'm concerned about with the existing code is default generic Serial is I believe pointed at the same pins which will only work for half-duplex. May want to use the same pin configuration as the bootloader uses for USART1. I've been having trouble getting it to work even with pin changes though.

alexnagelberg avatar May 07 '24 16:05 alexnagelberg

Pins defined in the variant generic have no link with the built-in bootloader. Generic files could not be changed as they are automatically generated.

fpistm avatar May 13 '24 12:05 fpistm

@alexnagelberg If it is ok for you I will merge the PR.

fpistm avatar May 13 '24 13:05 fpistm

@alexnagelberg If it is ok for you I will merge the PR.

@fpistm Serial doesn't appear to be setup correctly but everything else appears working. I'm okay with it being merged and staying yellow heart.

alexnagelberg avatar May 13 '24 13:05 alexnagelberg

Serial doesn't appear to be setup correctly

The only thing which could avoid serial to work is a wrong clock config anyway on C0 clock tree is not complicated so it should basically work. What is the issue? wrong speed ? ...

fpistm avatar May 13 '24 14:05 fpistm

Serial doesn't appear to be setup correctly

The only thing which could avoid serial to work is a wrong clock config anyway on C0 clock tree is not complicated so it should basically work. What is the issue? wrong speed ? ...

Looking at the package, by default Serial is mapped on USART1 Using PA0 and PA1 but they are both on the same pin. So to test you can try to redefine the RX on PC14 before calling begin()

Serial.setRx(PC14);

fpistm avatar May 27 '24 09:05 fpistm

I've squash you PR and update the clock config to use LL instead of HAL. This allows to save 1K flash.

fpistm avatar May 27 '24 13:05 fpistm

Codespell issue can be safely ignored (see #2379).

fpistm avatar May 27 '24 13:05 fpistm