Author Topic: $0.11 PY32F002A: Cortex-M0+ MCU, actually a PY32F030! 32/4KB, 48MHz, PLL, DMA...  (Read 86473 times)

0 Members and 2 Guests are viewing this topic.

Offline yabba235

  • Contributor
  • Posts: 39
  • Country: pl
You can convert the ST-Link into JLink Edu, then program using JFLash. I attached everything here.
Attaching the compiled binary.

Thank you - you save my live !
P.S.
I can't convert stlink to Jlink: wrong FW error-I trying from .32 to .45 version without luck.
But thanks for fw file.
« Last Edit: December 05, 2024, 11:01:41 pm by yabba235 »
 

Offline DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 6430
  • Country: es
Probably a bad stlink clone.
Do you have a stm32f103c8 / cb somewhere?
(Commonly found in bluepill boards)
If so, you can flash the bootloader, load the official stlink fw and replace the one in the stlink.

https://github.com/Krakenw/Stlink-Bootloaders
Use v2.1
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline yabba235

  • Contributor
  • Posts: 39
  • Country: pl
Probably a bad stlink clone.
Do you have a stm32f103c8 / cb somewhere?
(Commonly found in bluepill boards)
If so, you can flash the bootloader, load the official stlink fw and replace the one in the stlink.

https://github.com/Krakenw/Stlink-Bootloaders
Use v2.1
I dont't think is clone:

« Last Edit: December 06, 2024, 05:44:25 am by yabba235 »
 

Offline DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 6430
  • Country: es
Do you have a bluepill? Then you can flash it with jlink ob firmware, see here.

nRST  PA0
SWCLK PA5
SWDIO PA7

Pins can be connected directly to the mcu to be programmed.
« Last Edit: December 06, 2024, 09:02:10 am by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline positron96

  • Newbie
  • Posts: 4
  • Country: nl
Hello again. Does anybody know where the GPIO speed is described in the datasheet or RM? There is a GPIOx_OSPEEDR register with 4 possible speed values, that is very similar to STM32, but STM32 datasheet has a table with frequencies and rise/fall timings. There is no such table for PY32 (at least I couldn't find any)
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11930
  • Country: us
    • Personal site
It is not described anywhere, and likely not characterized past a few basic tests you can do yourself as well.

There is no magic, cost reduction comes at the expense of things like this.For the price of the device, I'm pleasantly surprised by the amount information they do publish.
Alex
 
The following users thanked this post: positron96

Offline positron96

  • Newbie
  • Posts: 4
  • Country: nl
Hi everyone. In the middle of this thread there is a mention of the PlatformIO framework being developed for PY32. I couldn't find the results of that development, so I made my own: https://github.com/positron96/platform-py32f0

It has HAL and LL drivers, no Arduino core.

At the moment it was only tested with PY32F030 and blackmagicprobe debugger, but the project contains everything from https://github.com/IOsetting/py32f0-template project, so using it with other MCUs should similarly easy.
 

Offline DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 6430
  • Country: es
Nice work!
I really tried VSCode but I find extremely awkard, also lacking debugging support.
Any way to debug SWO or monitor variables in real time?
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline positron96

  • Newbie
  • Posts: 4
  • Country: nl
Quote
Any way to debug SWO or monitor variables in real time?
No, I don't think so. It relies on GDB under the hood, which, afaik, does not do any of that.
 

Offline Sacodepatatas

  • Regular Contributor
  • *
  • Posts: 113
  • Country: es
What happened to the PY32F002, PY32F003 and PY32F030 parts? They're no longer listed in the puyasemi web. Are they discontinued?
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 2123
  • Country: au
What happened to the PY32F002, PY32F003 and PY32F030 parts? They're no longer listed in the puyasemi web. Are they discontinued?

That may be Chinese / English web page creepage. The /en/ pages have fewer parts listed.

Their 'value' parts show up here :

https://www.puyasemi.com/py32_xilie.html
 

Offline DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 6430
  • Country: es
lcsc has 50K+ in stock so it seems alive and healthy
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline Sacodepatatas

  • Regular Contributor
  • *
  • Posts: 113
  • Country: es
Yes, I've seen that lcsc has 50K of F6 and 22K of U6 (among other references having 7K, 2K...) anyhow it seems a bit odd that even the chinese web doesn't list resources for the 002A (there's plenty of resources out there besides the official site, i know). Anyways I'm going to make a local mirror of the chinese web. Thanks.
 

Offline DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 6430
  • Country: es
« Last Edit: February 01, 2025, 08:16:32 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 2123
  • Country: au
Yes, I've seen that lcsc has 50K of F6 and 22K of U6 (among other references having 7K, 2K...) anyhow it seems a bit odd that even the chinese web doesn't list resources for the 002A (there's plenty of resources out there besides the official site, i know). Anyways I'm going to make a local mirror of the chinese web. Thanks.

? The link I gave above works for 002  even gives English download links, and they are new revisions too.

PY32F002B Datasheet  1.5   2025.01.26
PY32F002B Reference Manual 1.0  2025.01.26
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 2123
  • Country: au
 

Offline Sacodepatatas

  • Regular Contributor
  • *
  • Posts: 113
  • Country: es
Definitely there:
https://www.puyasemi.com/download.html?keywords=Py32f002

I wonder how the new PY32F002B-C  differs ?

And also the new and very original "PuyaCubeProgrammer" 😅😅😅, when I leave the hospital I'll try if it works with the st-link (it is supposed to work with J-link or Py-link).
 

Offline DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 6430
  • Country: es
And also the new and very original "PuyaCubeProgrammer" 😅😅😅, when I leave the hospital I'll try if it works with the st-link (it is supposed to work with J-link or Py-link).
Get well soon Sacodepatatas!
Indeed, very original programmer name :), they cloned the GUI entirely!
Also, it seems the PY32F002A was completely wiped off their site?
« Last Edit: February 01, 2025, 08:21:21 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Online voltsandjolts

  • Supporter
  • ****
  • Posts: 2589
  • Country: gb
I wonder if Puya see the irony on that screenshot...'Technology Innovator' it says in the top left, whereas the GUI is a total ripoff copy ::)
 

Offline DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 6430
  • Country: es
I have no problem with that as long it's their own work, with a "similar" gui  :)
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11930
  • Country: us
    • Personal site
Copying UI is a very smart move, it simplifies the transition and lets you gain new customers quickly. Same goes for register sets. I don't really see a problem here. There is no need to "innovate" a UI of the programmer in this case.

Plus they make a ton of other devices outside of MCUs and those are not a copy of anything.
Alex
 

Online voltsandjolts

  • Supporter
  • ****
  • Posts: 2589
  • Country: gb
Copying the programming software, down to the layout and even the colour scheme, is just lame. It would have been smarter to copy the pinouts and have 100% pin compatability with stm32. That would have been much more useful by allowing many existing cost crictical designs to switch quickly.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11930
  • Country: us
    • Personal site
Copying the programming software, down to the layout and even the colour scheme, is just lame.
It just makes sure your new customers already familiar with the tools.

It would have been smarter to copy the pinouts and have 100% pin compatability with stm32.
That's what other vendors do that actually make compatible devices. PY32 have no direct equivalents in STM32 world, ST does not bother with really low pin count devices.

There is now STM32G03x, but those devices were released at about the same time as PY32 devices, so they did not have a chance to make them pin-compatible.
« Last Edit: February 02, 2025, 05:35:19 pm by ataradov »
Alex
 
The following users thanked this post: voltsandjolts

Offline prosper

  • Regular Contributor
  • *
  • Posts: 87
  • Country: ca
 
Nice work!
I really tried VSCode but I find extremely awkard, also lacking debugging support.
Any way to debug SWO or monitor variables in real time?


I dont think the M0 *has* SWO. Otherwise, check out cortex debug for vscode. it does breakpoint debugging, memory ( and register, if you have an SVD file ) examine.

I set up a quick 'template' project with my VSCode configs here: https://github.com/prosper00/py32-vscode
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf