IOsetting / py32f0-template

Puya PY32F002A PY32F003 PY32F030 GNU GCC SDK, template and examples
153 stars 56 forks source link

What is the closest STM32 part¿? #15

Open NoNamedCat opened 1 year ago

NoNamedCat commented 1 year ago

Hello again. Im wondering what is the closest MCU on the STM32 family to this microcontroller? I want try to port the arduino core for the PY32F0 and i don't want to start from scratch.

prosper00 commented 1 year ago

the official stmicro arduino cores are pretty terrible. They're built on top of the HAL - which might make them easy to port, but not exactly lightweight. Arduino's own HAL, sitting on top of ST's HAL - not a great fit for smaller arm micros. It's hard getting anything useful to fit in flash with so much blubber. Even just the basic 'blink' example built on Arduino is huge:

for the Nano, blink is 924 bytes with 9 bytes of sram. for the stm32g030, it's 13304 bytes of flash, and 1236 of SRAM!! for BLINK!! They sent a man to the moon with less resources.

It's ridiculous. Especially when the smaller arm cores don't exactly have flash and sram to spare. Its also super annoying how long it takes to build, pulling in every individual library and compiling them sequentially. Even 'make' can do parallel compilation (do better, Arduino!).

NoNamedCat commented 1 year ago

Some time ago, I found and then forgot where I found an Arduino core that is not based on HAL but on LL. Do you think that would be better? I suppose the STM32G030 is the MCU most similar to the PY32F030, PY32F002...?

NoNamedCat commented 1 year ago

https://github.com/geosmall/Arduino_STM32_LL?

prosper00 commented 1 year ago

It seems relatively similar by specs, but I haven't compared them all that closely. The peripheral set has a slight resemblance, but it's definitley not a 1:1 clone

IOsetting commented 1 year ago

Hello again. Im wondering what is the closest MCU on the STM32 family to this microcontroller? I want try to port the arduino core for the PY32F0 and i don't want to start from scratch.

Someone is already working on this: https://github.com/Air-duino/Arduino-AirMCU

AIR001xx is a variant(much likely the same core) of PY32F002A, so in theory the Arduino implementation also works on PY32F003 and PY32F030.

More details about AIR001xx can be found at below links. This chip hasn't been released officially, some documents may be incomplete https://gitee.com/openLuat/luatos-broads/tree/master/broads/Air001-Board/ https://wiki.luatos.com/chips/air001/index.html

NoNamedCat commented 1 year ago

I can design a PCB for this microcontroller if you wish. Let me know what peripherals you would like it to have (LEDs, voltage regulator, programming headers...).

如果您愿意,我可以为这个微控制器设计一块PCB。请告诉我您希望它具备哪些外设(LED灯,电压调节器,编程接头...)

IOsetting commented 1 year ago

Thank you for your kindness but I already have a bunch of pcb boards of PY32 chips. Recently my interests have been shifting from PY32. I believe that you are professional in pcb design and you have good ideas that you want to share, please create a repository for your design, then you can share and get feedback, that is how GitHub works.