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

sorin and 2 Guests are viewing this topic.

Offline DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 5912
  • Country: es
16K Flash, 2K SRAM, definitely not PY, just cheap low spec chinese CM0+ MCU not worth any mentioning.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline trimarco232

  • Newbie
  • Posts: 6
  • Country: fr
they say 64 and 8kb
but agree with you , as 32 and 4kb are enough
« Last Edit: March 21, 2024, 05:22:20 pm by trimarco232 »
 

Offline DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 5912
  • Country: es
I don't think it has 64K by any means, other twen32 listings show 16/2K
I guess it's a very opportune "mistake".
« Last Edit: March 21, 2024, 07:50:50 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline IOsetting

  • Regular Contributor
  • *
  • Posts: 56
  • Country: cn
Hi , there is something maybe new at aliexpress : TW32F003  ???https://fr.aliexpress.com/item/1005006207267714.html
it is showed as a CH32V003 equivalent , but it is ARM , so rather a new PY32 ?
some thoughts ?
I'm not sure if it's a PY32 OEM or not, as I can't find its datasheet anywhere.
The company seems to be a training agency, so this chip is definitely rebranded from some other known chips. If you have the board with you, you can try to program it using PyISP or JLink, if this works, then it might be a PY32.
 

Offline trimarco232

  • Newbie
  • Posts: 6
  • Country: fr
pinout of the board is the same as PY32
I have ordered few , we will see (I also hope arduino for PY32 will work)
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1989
  • Country: dk
pinout of the board is the same as PY32
I have ordered few , we will see (I also hope arduino for PY32 will work)

I can't remember 100% , but i have a feeling that there's an issue with the way the board led is connected , if when programming that twen
Be aware if you have issues.

 

Offline IOsetting

  • Regular Contributor
  • *
  • Posts: 56
  • Country: cn
Well, I managed to get the datasheet from their Taobao customer service. It looks quite similar to PY32F030.
 
The following users thanked this post: bingo600

Offline DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 5912
  • Country: es
That one does indeed look the same as the py32f002, 20/3K...
Anyways, were's the deal? Probably won't be any cheaper than puya?

Try reading the DBG_MCU ID register.

Ask the seller for the reference manual, not just the datasheet, which is pretty useless alone.
« Last Edit: March 30, 2024, 08:43:10 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline trimarco232

  • Newbie
  • Posts: 6
  • Country: fr
I was looking for a PY32 on a smart little board , and didn't find something similar from Puya ...
 

Offline DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 5912
  • Country: es
https://www.aliexpress.com/item/1005005698577482.html

You can replace it with the cheaper PY32F002B, which has a compatible pinout (The PY32F002A is not compatible).
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Online Sacodepatatas

  • Regular Contributor
  • *
  • Posts: 80
  • Country: es
...
Puya support pack 1: Docs, libs, ISP software...
Puya support pack 2: Similar contents but newer, has english datasheets & RM...

These two links are broken 😔.
 

Offline DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 5912
  • Country: es
Yeah, Puya changed the website, it's much better now.
Everything is in the product page:

https://www.puyasemi.com/mcu_weichuliqi.html
« Last Edit: April 03, 2024, 07:23:44 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline John Celo

  • Contributor
  • Posts: 20
  • Country: lt
Are there any affordable beginner options to program SOP8/SOP16 versions of these chips?
2:
And this Jlink-OB
https://www.aliexpress.com/item/1005003620592002.html
So this JLink-OB thing has arrived in the mail.

It shows missing drivers in the device manager.
Where do I get drivers for it?
How do I use it? Any documentation or anything?

The baidu link doesn't work (the one I received has FMD mcu on it).
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1989
  • Country: dk
Are there any affordable beginner options to program SOP8/SOP16 versions of these chips?
2:
And this Jlink-OB
https://www.aliexpress.com/item/1005003620592002.html
So this JLink-OB thing has arrived in the mail.

It shows missing drivers in the device manager.
Where do I get drivers for it?
How do I use it? Any documentation or anything?

The baidu link doesn't work (the one I received has FMD mcu on it).

I suppose you're talking Windows here
I'm on linux , so not much experience with win.

I would expect you can find something on segger.com (Jlink manuf)
 

Offline John Celo

  • Contributor
  • Posts: 20
  • Country: lt
Got blink sketch to work, used WeActStudio DAP-Link. (for a py32 chip without a boot pin)

Used Keil uVision v5 IDE (it has support packages for various devices, including py32). Keil is german subsidy of ARM that makes software tools, including IDEs. For some reason couldn't get it to flash from uVision though.

So used pyOCD to flash the .hex file instead. pyOCD is python API and command line tools for flashing/erasing/debugging ARM Cortex microcontrollers.
Ideally would like to flash/debug right from the uVision, but will figure that out another day...

For beginner this stuff's pretty tough, so much ambigious, confusing terminology where most sources never bother to explain any of it... plus, you aren't even sure initially if dap-link is not defective, if my solder job wasn't sloppy and if the blinksketch itself is correct(you have to enable perhiphery clock or it wont work!)
« Last Edit: April 09, 2024, 01:19:32 am by John Celo »
 

Offline John Celo

  • Contributor
  • Posts: 20
  • Country: lt
I'm getting this exact error when trying to flash it via uVision5 and a DAPLink.
Code: [Select]
Erase Failed!
Cannot access Memory (@ 0xe000edf0, Read, Acc Size: 4 Byte)
Error: Flash Download failed  -  "Cortex-M0+"
All the settings in uVision5 are exactly like in their manual! This is sop8 version of PY32F002! (PY32F002AL15S6TU)

It flashes perfectly via:
Code: [Select]
pyocd flash -t PY32F002Ax5 Project.hexBut doesn't in uVision!

I've no idea what i'm doing wrong. I would like to debug the device within uVision, so I'd love to get this to work!

I've seen a post of somebody with the exact same problem on a chinese forum (with no answer how to solve it).
 

Offline John Celo

  • Contributor
  • Posts: 20
  • Country: lt
I'm getting this exact error when trying to flash it via uVision5 and a DAPLink.
Code: [Select]
Erase Failed!
Cannot access Memory (@ 0xe000edf0, Read, Acc Size: 4 Byte)
Error: Flash Download failed  -  "Cortex-M0+"
All the settings in uVision5 are exactly like in their manual! This is sop8 version of PY32F002! (PY32F002AL15S6TU)

It flashes perfectly via:
Code: [Select]
pyocd flash -t PY32F002Ax5 Project.hexBut doesn't in uVision!

I've no idea what i'm doing wrong. I would like to debug the device within uVision, so I'd love to get this to work!

I've seen a post of somebody with the exact same problem on a chinese forum (with no answer how to solve it).
Great news! Flashing and debugging works in uVision5 with J-Link OB clone thingie! (not sure why it doesn't work with daplink)!

(for beginners out there: J-Link OB thing also works nicely for stm32 arm chips in uVision, so this is definitely handy tool to have!
Keil uVision seems to be particularly popular in China and lots of chinese chips come with uVision project files/examples!)

 

Offline prosper

  • Regular Contributor
  • *
  • Posts: 79
  • Country: ca
that doesn't surprise me. in my experience, the py32 is really picky about which probes it'll work with. some flash ok but are unstable for debugging, some work ok with pyocd, but not probers or vice versa... its a mixed bag.
 

Online Sacodepatatas

  • Regular Contributor
  • *
  • Posts: 80
  • Country: es
Has anybody noticed any funcional difference between the PY32F002BF15P and the PY32L020F15P apart from the specified max speed? I would like to know if these two chips are both interchangeable.
 

Offline DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 5912
  • Country: es
I guess you'll have to buy a few and find yourself!
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Online Sacodepatatas

  • Regular Contributor
  • *
  • Posts: 80
  • Country: es
I guess you'll have to buy a few and find yourself!

I guess so, and i purchased several PY32F002BF from LCSC, that i expect receiving next week. But the PY32L020F seems to be unbtainable from outside China.

The most I can do is treating the F002BF as it was the L020F and see what happens.
 

Offline IOsetting

  • Regular Contributor
  • *
  • Posts: 56
  • Country: cn
Has anybody noticed any funcional difference between the PY32F002BF15P and the PY32L020F15P apart from the specified max speed? I would like to know if these two chips are both interchangeable.
What I know about PY32L020 is that it has an extra "deep stop" mode while PY32F002B only has "stop" mode.
If you don't need the low power feature, they are the same.
BTW, PY32F002BF15P can also run in 48MHz, add a "#define RCC_HSI48M_SUPPORT" in CMSIS/Device/PY32F0xx/Include/py32f002bx5.h will enable it.
 

Offline DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 5912
  • Country: es
Are you sure the "Super Deep sleep" isn't also included with the 030?
If so, then it likely to also be present in the 002.
« Last Edit: April 22, 2024, 08:43:22 am by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline IOsetting

  • Regular Contributor
  • *
  • Posts: 56
  • Country: cn
No, 002a/003/030 has no "Super Deep Sleep".
002b/L020 is a different core (the option bytes are different from those of 002a/003/030).
I doubt 002b also supports "Super Deep Sleep" but I didn't test it.
 

Offline John_doe

  • Regular Contributor
  • *
  • Posts: 51
  • Country: il
Hi, another newbie/amateur here, hopefully you still have some patience for one of those  :D
I'd like some help writing to the flash of the PY32F002AL15S6TU (That is, the SOP-8 package).
After reading this thread and finding out that only the TSSOP-20 package supports ISP, I tried first with my PY32F002AF15P6TU (TSSOP-20) using Arduino as my IDE and writing to the PY32F002AF15P6TU directly from Arduino using a USB->TTL adapter with BOOT0 pulled high and everything worked well on the first try (yes, I was also surprised :) ) - Got some LEDs blinking and some buzzers beeping and was happy.

But now I want to return to my original goal of flashing the SOP-8 version. The thing is, I haven't touched a traditional IDE since collage (more than 3 decades ago) and I really don't want to start installing and then messing with CubeIDE, Keil, Eclipse, Python stuff, or any other heavy software that requires fiddling with definitions, settings and configuration files. Is there a simple solution like a standalone software such as PuyaISP in the the sense of just running an EXE (I'm on Windows) and writing? Or better yet, writing directly from the Arduino IDE ?

I'll emphasize that I DON'T need debugging at all, just programming the flash with the hex file that I get from the Arduino IDE.


Another thing is the hardware (programmer). I just bought the DAPLINK and J-Link OB that you guys recommended from AliExpress:
https://www.aliexpress.com/item/1005003620126365.html
https://www.aliexpress.com/item/1005005179354439.html

But it'll take about a month for them to arrive and I don't want to wait. I'd like to ask your expert help with how I can use what I have now, which is:
1. One ST-Link v2 clone. specifically this one:
https://www.aliexpress.com/item/33045347900.html
I looked 'under the hood' and it has a APM32F103CBT6 MCU, if it matters.

2. A WCH-LinkE, specifically this one:
https://www.aliexpress.com/item/1005005269690018.html

3. Many Arduino compatible STM32F103 boards (bluepills, blackpills, redpills, Etc.) as well as other Arduino dev boards (ESP32, RP2040, ATMEGA 328p, Etc.)

4. Many USB->TTL converters of all kinds.

So, any ideas? What programmer (if any) I need in order to write this firmware to a bluepill / blackpill? Will my ST-Link v2 clone work?
https://github.com/RadioOperator/STM32F103C8T6_CMSIS-DAP_SWO
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf