Elektroda.com
Elektroda.com
X

PY32F002 - Chinese ARM for 8 cents from PUYA

piotr_go 10692 57
This content has been translated flag-pl » flag-en View the original version here.
  • #31
    piotr_go
    DIY electronics designer
    jarekgol wrote:
    piotr_go wrote:
    in LCSC they have C19
    what does it mean?

    Flu v4.xx
  • #32
    jarekgol
    Level 31  
    Right, I'm starting to effectively push it out of my mind :) from this LCSC is bought similarly to aliexpres?
  • #33
    piotr_go
    DIY electronics designer
    No, it's a normal wholesaler like TME, Mouser, etc...
    All in our own warehouses.
  • #34
    jarekgol
    Level 31  
    But shipping from China? Like 3 weeks? Because Mouser delivers it in a few days, but for PLN 80.
  • #35
    piotr_go
    DIY electronics designer
    In LCSC also if you pay more you will get it by express.
  • #36
    jarekgol
    Level 31  
    "Global direct standard line" for $5.80 7-15 days works as stated in your experience?
  • #37
    piotr_go
    DIY electronics designer
    jarekgol wrote:
    "global direct standard line"

    This is what I order.
    PY32F002 - Chinese ARM for 8 cents from PUYA
  • #39
    piotr_go
    DIY electronics designer
    Yes, yes, we know.
    Unfortunately, layouts for "10 cents" only on aliexpress.
  • #40
    Macosmail
    Level 34  
    WCH from RISC-V arrived today. LED flashes. I already have PUYA, but they are still lying and gaining power.

    PY32F002 - Chinese ARM for 8 cents from PUYA
    PY32F002 - Chinese ARM for 8 cents from PUYA
  • #41
    piotr_go
    DIY electronics designer
    I recently ordered modules for BL616 and ESP32 starter.
    Internet radio in the making. I'll start a new thread when I take pics.
  • #42
    l0ud
    Level 14  
    Hey @piotr_go, have you tested this PY32F002 in the QFN16 housing and confirmed that it is also PY32F030 with 32kB FLASH and 4kB RAM? I ordered some of it from lcsc and I'm wondering whether to prepare the PCB for the PY32F002 project with an "extra" frame, or it's better to put on 003 which I have in larger housings.
  • #43
    piotr_go
    DIY electronics designer
    One sec.......
    4kB RAM, 32kB FLASH
  • #44
    l0ud
    Level 14  
    Thank you very much. I designed and ordered an adapter for qfn16 (in my opinion, the coolest case in this series) and I will see if mine is also really 030.
  • #45
    witawat57
    Level 1  
    How to download program to mcu PY32F002A on windows?
    Can use st-link V2?
  • #47
    wichers
    Level 2  
    Made some PY32F002 boards for testing purposes, PY32F002 - Chinese ARM for 8 cents from PUYA.

    I accidently messed around with A13. Is there any way to 'unbrick'/erase a device before the firmware is loaded? Couldn't find anything in the documentation.

    A manual reset quickly following by a erase does not help..
    Thanks!
  • #48
    piotr_go
    DIY electronics designer
    Have you tried BOOT0=Hi ?
  • #49
    wichers
    Level 2  
    Thank you for your quick reply, I fixed it.

    I should have mentioned this, it was the QFN (PY32F002AW15U6TR) giving me problems it has no BOOT0 pin. BOOT0 did help to erase the TSSOP20. Solution for the QFN is to do hardware RESET when powered on.

    All very obvious. I made stupid mistake though, I had two projects with the same name but both with different MCU's. I had the wrong processor selected, ouch!
  • #50
    trimarco232
    Level 2  
    Hi,
    I am currently drawing the pcb for a nano shaped board for the PY32F030 . I am from the arduino world ...)
    the goal is to have a more powerful remplacement for existing nano projects
    so it has to have the same size as nano, same pinout, same pins for most of the peripherals, to work only at 5V, have an USB port to connect to PC, and eventually being programmed with the system bootloader
    I have questions about the BOOT0 and NRST pins :
    - the BOOT0 is connected to a solder bridge, allowing the user to rely it to GND or +5V
    is this the right way to do it ? has it an internal pull resistor ?
    - the NRST pin will be connected to the CH340 pin DTR
    can I connect it directly by a diode, or must it be inverted by a transistor ? has it an internal pull resistor ?
    thanks ! PY32F002 - Chinese ARM for 8 cents from PUYA
  • #51
    piotr_go
    DIY electronics designer
    trimarco232 wrote:
    the BOOT0

    There is an internal pull-down resistor, but may be too weak if you connect something to the IO.

    trimarco232 wrote:
    the NRST

    Internal pull-up, reset low.
  • #52
    trimarco232
    Level 2  
    Hi,
    thanks !
    the result of my research is that the RTS# output of the CH340E is normally at a high level (v or 3v3) ; il becomes low only if it is connected to USB and controlled to be active
    so, I will just put a schottky between the RTS# pin of CH340E and the reset node of the PY32, so the CH340E will reset the PY32 while the RTS# pin is active
    PY32F002 - Chinese ARM for 8 cents from PUYA
  • #53
    jarekgol
    Level 31  
    @trimarco232 in Arduins on atmegs this is capacitor coupled. And from what I observed, when you click upload, the programmer changes this state for a short while, and when you fire up the port monitor (or other terminal without flow control), the state changes to active, but thanks to the capacitor, the processor immediately comes out of the reset and works on its own .
  • #54
    trimarco232
    Level 2  
    yes , thanks ,but the question is : might it work with py32 ?
    the risk is that te pulse is too short, or have not enough steeped flanks
    one can avoid this by controlling the reset through a diode ; just hope that the 0v3 level will be LOW enough to make a proper reset
  • #55
    bclax5
    Level 1  
    >>20366259
    @l0ud Would you mind sharing the openocd files you created? That would be amazingly helpful!
  • #56
    l0ud
    Level 14  
    @bclax5 Please, code based on stm32 driver, definitely not clean or complete ;) .

    https://github.com/l0ud/openocd-puya

    It worked well enough for me before I started using pyocd.

    my usage:

    openocd.conf:
    source [find interface/cmsis-dap.cfg]
    source [find target/swj-dp.tcl]
    source [find mem_helper.tcl]
    
    adapter speed 270
    
    swd newdap puya cpu -enable
    dap create puya.dap -chain-position puya.cpu
    target create puya.cpu cortex_m -dap puya.dap
    
    flash bank puya.flash puyaf0x 0x08000000 0x8000 0 0 puya.cpu
    init
    


    VSCode, Cortex debug extension, launch.json:
    
    {
        "version": "0.2.0",
        "configurations": [
            {
                "name": "Cortex Debug",
                "cwd": "${workspaceFolder}",
                "executable": "${workspaceFolder}/build/puya_playground.out",
                "request": "launch",
                "type": "cortex-debug",
                //"breakAfterReset": true,
                "runToEntryPoint": "main",
                "servertype": "openocd",
                "configFiles": [
                    "openocd.cfg"
                ],
            },
            {
                "name": "pyOCD",
                "cwd": "${workspaceFolder}",
                "type": "cortex-debug",
                "request": "launch",
                "executable": "${workspaceFolder}/build/puya_playground.out",
                "servertype": "pyocd",
                "targetId": "PY32F030x6", 
                "svdFile": "CMSIS/Device/PY32F0xx/py32f030xx.svd",
                "svdPath": "CMSIS/Device/PY32F0xx/py32f030xx.svd",
                "showDevDebugOutput":"none",
            },
        ]
    }
    
  • #57
    dabyd64
    Level 2  
    Hi, I've been watching those puyas for several months, finally I ordered some to lcsc also made some development boards for py32f002/003/030 and hk32f030m :)

    PY32F002 - Chinese ARM for 8 cents from PUYA

    But now I've seen you're using serial to program them?
    Do they have embedded bootloader?
    What software to use?
    If this is true, I might embed a CH340E for easier programming, though I hope I can use J-Link too.

    Thanks!!