Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a diagram of connections to program PY32F002 Chip SOP8 PY32F002AL15S6TU #9

Open
5 tasks done
vinorasu opened this issue Feb 6, 2024 · 3 comments
Open
5 tasks done

Comments

@vinorasu
Copy link

vinorasu commented Feb 6, 2024

您的功能请求是否与解决某些问题有关?请描述一下。/ Is your feature request related to a problem? Please describe.

I am unable to program the SOP8 PY32F002AL15S6TU. using the board "Generic PY32F002A Series"

I tested the usb to serial connected to PA1-PA2 and PA2-PA3 for serial port ,but I am unable to program the chip from arduino 2.0 with this core.

this is the error I get:

WARNING: library SrcWrapper claims to run on AirMCU architecture(s) and may be incompatible with your current board which runs on PY32 architecture(s).
Sketch uses 6292 bytes (30%) of program storage space. Maximum is 20480 bytes.
Global variables use 808 bytes (26%) of dynamic memory, leaving 2264 bytes for local variables. Maximum is 3072 bytes.
AirISP v1.2.8.0
Serial port /dev/ttyUSB0
Connect...___
fail to reset device to boot status, timeout, exit...
Failed uploading: uploading error: exit status 1

Is there a Pin to drive to ground or VCC to program the chip? there is no BOOT0 or BOOT1 in this chip.

There is no option to add an STlink programmer to use PA14/PA13 for SWD protocol.

描述您想要的解决方案 / Describe the solution you'd like

Please provide a diagram of connections to program the chip, or instructions how to program it
or add an STlink programmer ,thank you.

描述您想要的详细使用步骤描述 / Describe the solution you'd like to use in what way

To be able to select a STlink programmer in the arduino menu or to use the serial connection when the connections diagram or instructions are provided.

其他备注信息或截图 / Add any other context or screenshots about the feature request here

No response

确认信息

  • 检查过该需求,之前没有人提过 / Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • 这个需求是真实存在的,并且对于本项目来说是必要的
  • 我已经提供了该需求的清晰、详细、完整的方案,请按该方案进行实施
  • 我认为我提供的信息已经足够,不需要其他人继续完善该需求的其他细节
  • 我同意跟进该需求的实施进程,并在适时提供合理的解释与纠正
@vinorasu vinorasu changed the title Add a diagram of connections to program PY32F002 Add a diagram of connections to program PY32F002 Chip SOP8 PY32F002AL15S6TU Feb 7, 2024
@vinorasu
Copy link
Author

vinorasu commented Feb 8, 2024

puya py32f002al15s  PINOUT

and the PDF where I got the pinout https://datasheet.lcsc.com/lcsc/2303271200_PUYA--PY32F002AL15S6TU_C5292060.pdf
can this SOP8 or the SOP16 be programmed with this core?
Thanks in advance

@HalfSweet
Copy link
Member

I'm sorry I'm just now seeing the email because of the holidays.

In some packages of the PY32, there may not be a pin for accessing the ISP and programming with the UART, so in later releases we will consider adding SWD programming to cater for such scenarios.

For now, you can export the compiled binary and program it using one of the other supported methods, such as openocd pyocd, etc.

@vinorasu
Copy link
Author

vinorasu commented Feb 14, 2024

No worries and thanks for your reply.
In case you decide to implement the support for SWD programming with ST-link , this is what worked for me with pyocd and the SOP8 chip that I mentioned above (this works as well for the SOP16 PY32F002AW15S version):

pyocd load ./Blink.ino.hex -t py32f002ax5 --config ./pyocd.yaml
0000469 I Loading /home/user/Descargas/PUYA-SEMI PY32F002/PY32Duino.PY32.GenF002Acompiled/Blink.ino.hex [load_cmd]
[==================================================] 100%
0002038 I Erased 12288 bytes (3 sectors), programmed 9088 bytes (71 pages), skipped 0 bytes (0 pages) at 5.68 kB/s [loader]

and the content of the config file being listed with command cat pyocd.yaml
pack:
" - ./Puya.PY32F0xx_DFP.1.1.0.pack" <<<please remove the "" characters , otherwise the - gets edited as a bullet point

That file "Puya.PY32F0xx_DFP.1.1.0.pack" comes from this rar file: https://www.puyasemi.com/uploadfiles/2022/11/PY-MCU%E8%B5%84%E6%96%99-20221117.rar

Install pyocd with:
python3 -mpip install -U pyocd
Useful commands:

pyocd erase --chip -t py32f002ax5 --config /HERE-GOES-THE-FOLDER-WHERE-YOU-PUT-THE-FILE/pyocd.yaml

pyocd load -t py32f002ax5 --config /HERE-GOES-THE-FOLDER-WHERE-YOU-PUT-THE-FILE/pyocd.yaml ./*.hex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants