Open be-engineer opened 6 months ago
What specific series did you choose? PY32F003x8 or PY32F003x6
What specific series did you choose? PY32F003x8 or PY32F003x6 PY32F003x8
same here, i tried build a f002(air001) led blink rom and download to 003, download can be success, but seems nothing works :(
Hi. I found a way to resolve this problem and its working now. you need change the include file in
Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system\Arduino-PY32F0xx-Drivers\CMSIS\Device\PY32F0xx\Include\py32f0xx.h
about line 126(maybe, i change some code thus i dont know the origin line number :D, but its close)
replace `#elif defined(PY32F003x8)
to `#elif defined(PY32F003x8)
then compile and run will be ok just like other chips.
with error logs, i think thats because py32f003x8.h doesn't contain relevant defines about "Bit definition for RCC_CR register " and I didnt find it in official latest py32f003x8.h, but py32Arduino use the generic codes for all chips that need some definitions like RCC_CR_HSION doesn't contain in 003xx.h
after change 003x8 to 030x8 , seems all function works correct and u can use all of 64k flashs i tested some codes like LED blink, Serial print and DHT11 Temper and Humid sensor, it runs successfully
btw this is my code about DHT11
#include <DHT11.h>
DHT11 dht11 = DHT11(PA_12);
void setup() {
Serial.begin(9600);
Serial.println("ARDUINO PY003 READY!");
}
void loop() {
int humid = dht11.readHumidity();
int temper = dht11.readTemperature();
Serial.printf("Temp:%d Humid:%d\n",temper,humid);
delay(1000);
}
oh, and the wire connect: USBTTL -> py32f003f18P6 TXD -> PA3 RXD -> PA2
pull up boot(maybe button or pin header) and reset to download mode :D
hope someone can helps to fix this bug
Thank you very much for your reply, may I ask what is the real model of the MCU you are using @XusMochizuki
Thank you very much for your reply, may I ask what is the real model of the MCU you are using @XusMochizuki
py32f003f18P6
Thank you very much for your reply, may I ask what is the real model of the MCU you are using @XusMochizuki
py32f003f18P6
It works fine with modified .h file,thanks
Can you make a pr with the modified code?
Dear @XusMochizuki Do you have any tool to upload code? I wrote a program using Arduino ide but I don't know how to load the program. Thanks
Dear @XusMochizuki Do you have any tool to upload code? I wrote a program using Arduino ide but I don't know how to load the program. Thanks
I use pyocd with pwlink tool in linux.You can refer to it
Can you make a pr with the modified code?
Im afraid that I cant do it now, thats because this proj was created based some MCU with PLL function, many codes need reference the defines of PLL, these defines in the official file such as "py32f003x8.h", due to issues such as open source protocols not being included in this GitHub project, it is not feasible to add definitions. Although it is possible to modify the code in this repository for areas that require special definitions (such as # ifdef NOPLL...), this is a complex project and I currently do not have much time to solve this problem. Therefore, if conditions permit, I recommend fixing it by modifying the reference files
我很抱歉我现在不能做到, 因为项目是基于有PLL外设的MCU的代码开发的, 在像是py32f003这样的mcu代码中并不包括这些定义, 并且定义代码是由普冉官方创建的, 由于开源协议等问题并不包括在该github项目中, 因此通过添加定义的方法并不可行, 虽然可以通过修改该仓库中的代码对需要特殊定义的地方进行修改(例如#ifdef NO_PLL...)但这是一个较为复杂的工程, 由于我最近的工作较为繁忙因此难以抽出较多时间来修复 因此, 如果条件允许, 我还是推荐通过修改引用文件的方式来修复
描述一下这个bug / Describe the bug
I installed py32duino in arduino ide and selected py32f003 board,when I compile blink demo code.I got many error messages
复现步骤 / To Reproduce
Open demo code :
Select board Generic PY32F003 series. Press compile button.
如果正常,应该是什么样 / Expected behavior
If OK, the code should compile without errors.
截图 / Screenshots
日志 / Logs
error message are as follow:
系统 / System
debian12
PACK包版本 / Version
0.1.3
验证