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

0 Members and 3 Guests are viewing this topic.

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 2004
  • Country: dk

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

Your ST_link should be able to program a "Bluepill" with the above firmware.

I'd suggest you program the "remap hex" from here : https://github.com/RadioOperator/STM32F103C8T6_CMSIS-DAP_SWO/tree/master/build
Then the picts on the above site seem to match your new cmsis-dap bluepill board.


Unless you're a Linux user.
I can't help with "how to do it" ...


This post might come in handy, when needing the PY devicepacks for pyocd
https://www.eevblog.com/forum/microcontrollers/$0-11-py32f002a-m0-24mhz-320kb-actually-324kb-more-peripherals/msg5213643/#msg5213643


/Bingo
« Last Edit: April 22, 2024, 05:31:47 pm by bingo600 »
 

Offline Sacodepatatas

  • Regular Contributor
  • *
  • Posts: 90
  • 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.
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.

Very informative. Thank you so much.
 

Offline John Celo

  • Contributor
  • Posts: 24
  • Country: lt
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'm an absolutest newbie/amateur, and I did get SOP-8 flashing, used J-Link OB (with keil uvision) and CMSIS/DAP-link (via pyOCD which is a command line flasher, it's not hard to use at all!).

That being said, SOP-8 is pain in the ass to work with, you functionally have 3 pins left (VCC/GND/SWC/SWD/NRST) if you don't remap SWC/SWD/NRST - and I dont think it's worth bothering with that. SOP-16 is just a better fit for a beginner, since you can hook up uart and have some extra printfs diagnostics messages ON TOP of debugger. I also use uart to send commands from my computer to the chip.

Frankly, if you want Arduino as an IDE, I'd suggest to stick with tssop-20 package, it takes as much space as SOP-8 anyway and costs the same.

I did go the absolute opposite route - I do want a debugger and prefer an IDE, so I use keil uVision (but might move to another IDE).
This sop16 chip is my first step outside of Arduino environment.

So far I've got multiple ADCs working in continuous mode, uart and i2c is also working (although i2c is a bit finicky) using provided high-level HAL (as far as I can tell it's similar to hal used by stm32), I do intend to move to lower level HAL as I find them easier to reason about with reference sheet in hand.

These chips are kind of slow, so if you sample multiple ADCs at total sample rate of 400kHz, and it runs at 24mHz, you only get ~60 cycles
to work for every sample! If you have some external timing sensitive signals that trigger an interrupt, those can easily take 16 cycles or more if you account for storing/restoring registers state, etc! (I have to time this!)

I've yet to try the "hidden" PY32F002A features like DMA and clocking it to 48mhz (is this hard to do?).
« Last Edit: April 23, 2024, 01:37:01 am by John Celo »
 

Offline John_doe

  • Regular Contributor
  • *
  • Posts: 52
  • Country: il
Your ST_link should be able to program a "Bluepill" with the above firmware.

I'd suggest you program the "remap hex" from here : https://github.com/RadioOperator/STM32F103C8T6_CMSIS-DAP_SWO/tree/master/build
Then the picts on the above site seem to match your new cmsis-dap bluepill board.
Thanks Bingo, I was able to write the "remap" firmware to the blue pill with 'STM32 ST-LINK utility'.
I also had success writing to the SOP-8 chip with OpenOCD. I will write a summery of what I did in a new message.

I'm an absolutest newbie/amateur, and I did get SOP-8 flashing, used J-Link OB (with keil uvision) and CMSIS/DAP-link (via pyOCD which is a command line flasher, it's not hard to use at all!).
Thank you, but I already managed to write to the chip with OpenOCD, and a good thing I did, because I HATE Python with a vengeance!  >:D

That being said, SOP-8 is pain in the ass to work with, you functionally have 3 pins left (VCC/GND/SWC/SWD/NRST) if you don't remap SWC/SWD/NRST - and I dont think it's worth bothering with that. SOP-16 is just a better fit for a beginner, since you can hook up uart and have some extra printfs diagnostics messages ON TOP of debugger. I also use uart to send commands from my computer to the chip.
Wait, only 3 pins? Does that mean that if I use the SWC/SWD pins in my Arduino sketch, I won't be able to write to the chip again  ???

I've yet to try the "hidden" PY32F002A features like DMA and clocking it to 48mhz (is this hard to do?).
No idea, but I would also like to know how to do that. Maybe you just select PY32F030 as your target chip when writing?
 

Offline John Celo

  • Contributor
  • Posts: 24
  • Country: lt
That being said, SOP-8 is pain in the ass to work with, you functionally have 3 pins left (VCC/GND/SWC/SWD/NRST) if you don't remap SWC/SWD/NRST - and I dont think it's worth bothering with that. SOP-16 is just a better fit for a beginner, since you can hook up uart and have some extra printfs diagnostics messages ON TOP of debugger. I also use uart to send commands from my computer to the chip.
Wait, only 3 pins? Does that mean that if I use the SWC/SWD pins in my Arduino sketch, I won't be able to write to the chip again  ???
The chip is gone if you reassign both SWC/SWD and NRST.
If you have SWC/SWD reassigned, but NRST is still available, you can still flash the chip if you pull NRST low (which forces the SWC/SWD pins to get reassigned to defaults).

What I mean by saying "3 pins" is - that during development, you will probably want to have SWC/SWD connected all the time as you iterate and work on your design & code.

If you reassign SWC/SWD you'll have to have some way to share those programming wires with whatever peripherals you want there and have some way to connect/reconnect those - not to interfere with flashing, as well as have to hold NRST while programming.

It just seems like a hassle for no real benefit? Price is the same, and package is roughly the same size as tssop20.

I bought a few py32 sop8 chips myself, and retrospectively that was a mistake, with so few pins there's not much I can use them for.

 

Offline John_doe

  • Regular Contributor
  • *
  • Posts: 52
  • Country: il
I'm writing a summery of what I did to program these PY32F002A chips. Maybe it'll help some other n00b to save some time:

1. I installed PY32Duino for the Arduino IDE. I just followed the instructions here (used Google to translate the site to English):
https://arduino.py32.org/

2. Wrote a simple test sketch and compiled it. To upload it to the TSSOP-20 version, I just connected a USB to TTL module (costs less than $1 on AliExpress) and uploaded from the Arduino GUI. Instructions on how to connect the module to the chip can be found here:
https://github.com/wagiminator/MCU-Flash-Tools?tab=readme-ov-file#puyaisp

3. To write to the chip packages that do not have a BOOT0 pin, a programmer was needed, I didn't have a suitable one, such as these that were recommended in this thread:
https://www.aliexpress.com/item/1005003620126365.html
https://www.aliexpress.com/item/1005005179354439.html
So I used an ST-Link v2 clone to write this firmware to an STM32F103 "Blue Pill":
https://github.com/RadioOperator/STM32F103C8T6_CMSIS-DAP_SWO/blob/master/build/F103-DAP-SWO-CDC-BLUEPILL-SWD_REMAP.hex
To do that I used STM32 ST-LINK utility from this link:
https://www.st.com/en/development-tools/stsw-link004.html
I had to hold the reset button while pressing Target>Connect . Connections from ST-Link to blue pill are 3.3v->3.3V ; GND ->GND ; SWCLK->SWCLK ; SWDIO->SWDIO.

4. After I had a working CMSIS-DAP, I took the compiled Arduino hex file (if you don't know where to find it, google it) and used OpenOCD. To do that I downloaded the OpenOCD package that already includes the PY32 support files from the PUYA gitee:
https://gitee.com/puya-semiconductor/tools-and-software/blob/master/PY32_GCC/openocd-0.12.0.zip
(Thanks IOsetting and DavidAlfa for the link)
I had to modify the "openocd_run.bat" file to include the ".\bin" folder:
Code: [Select]
.\bin\openocd.exe -s ./scripts -f ./scripts/interface/cmsis-dap.cfg -f ./scripts/target/py32f002x.cfg
5. Had to enable Telnet for my Windows 10 (google it if you don't know how) from the control panel.

6. To connect the blue pill CMSIS-DAP to the IC, I connected the USB of it to my PC and from the blue pill to the PY32F002A the connections are: 3.3V->VCC ; GND->GND ;  SWCLK->SWC ; SWDIO->SWD. For the SOP-8 Package, the pins are 1 ; 8 ; 4 ; 5, respectively.

7. To use OpenOCD, I ran the batch file and in a new command prompt window I entered:
Code: [Select]
telnet localhost 4444And then the following commands:
Code: [Select]
reset halt
flash write_image erase c:/myfolder/myfile.hex
Notice the forward slash in the path to hex file. The command will fail if a Backslash is used.
 
The following users thanked this post: IOsetting, John Celo, JimNickerson

Offline prosper

  • Regular Contributor
  • *
  • Posts: 83
  • Country: ca
Thanks for the write up. I was excited about openocd for the PY32.... but there's (still) no source and no linux version. Ah well.

Also may be worth noting: beyond openocd and pyocd, there's also probe-rs which supports the py32. Probe-rs has similar capabilities to openocd and pyocd, but has a much nicer CLI than openocd (more like pyocd). It's also pretty quick (not being python). The only real downside that I've found is that its GDB stub is pretty limited (you can't 'load,' for example), so its not as good as a debug server. [though it does have a vscode extension which supports the microsoft DAP protocol directly, if vscode is your thang]
« Last Edit: April 24, 2024, 04:08:37 pm by prosper »
 

Offline John_doe

  • Regular Contributor
  • *
  • Posts: 52
  • Country: il
The chip is gone if you reassign both SWC/SWD and NRST.
If you have SWC/SWD reassigned, but NRST is still available, you can still flash the chip if you pull NRST low (which forces the SWC/SWD pins to get reassigned to defaults).
Thanks for the useful tip! I tried it, that is, pinMode() for both the SWD and SWC pins and indeed couldn't connect to the chip anymore. Holding NRST low (and releasing it after the command "reset halt") worked like a charm!

Thanks for the write up. I was excited about openocd for the PY32.... but there's (still) no source and no linux version. Ah well.
Wait, so the PY32 support of openOCD is built into the executable? I didn't know that... I thought that if you download the official Linux version and add the *.cfg files to it from the gitee archive it'll work.

Also may be worth noting: beyond openocd and pyocd, there's also probe-rs which supports the py32.
Thanks, right now I got myself busy with something else but when I'll return to the PY32F002A project I'll be sure to try probe-rs.
« Last Edit: April 25, 2024, 04:37:01 am by John_doe »
 

Offline prosper

  • Regular Contributor
  • *
  • Posts: 83
  • Country: ca
Quote
Wait, so the PY32 support of openOCD is built into the executable? I didn't know that... I thought that if you download the official Linux version and add the *.cfg files to it from the gitee archive it'll work.

That's right. You need the configs, but they just specify which functions to use. The functions themselves are in the binary.
 

Offline IOsetting

  • Regular Contributor
  • *
  • Posts: 60
  • Country: cn
I doubt 002b also supports "Super Deep Sleep" but I didn't test it.
it's very likely that 002B is an equivalent of L020, I just run the Deep Stop example on a TSSOP20 PY32F002b, the current consumption is much lower than the Stop mode ( 0.6 uA vs 1.6 uA).
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11394
  • Country: us
    • Personal site
FYI, I just added PY32F002A to my programming tool https://github.com/ataradov/edbg . It works with any CMSIS-DAP debugger and is just a simple standalone executable with no dependencies. Binaries for Windows/Linux/Mac are available.

I'm happy to add other parts, but nowhere I can find IDCODE values for them. They are not documented anywhere. So, if you have other devices and need support, run the tool, it will report the ID for the unsupported device.

BTW, 002B does not officially document code read protection. There is no RDP field and all text about read protection is removed. No idea what this is all about, seems rather strange.
« Last Edit: April 29, 2024, 06:57:18 pm by ataradov »
Alex
 
The following users thanked this post: bingo600

Online DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 6047
  • Country: es
Very nice tool  :-+
AFAIK the 002B is the same thing, just a different pinout, making the higher end 030 a direct swap.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline John_doe

  • Regular Contributor
  • *
  • Posts: 52
  • Country: il
That's right. You need the configs, but they just specify which functions to use. The functions themselves are in the binary.
Thank you for clarifying.

...I just added PY32F002A to my programming tool https://github.com/ataradov/edbg . It works with any CMSIS-DAP debugger and is just a simple standalone executable with no dependencies.
Phenomenal! Just tried EDBG and it works like a charm (see attachment). This is much more convenient than OpenOCD for me. Hopefully the guys on this forum will help you with the missing ID codes.
« Last Edit: April 30, 2024, 12:44:49 am by John_doe »
 

Offline IOsetting

  • Regular Contributor
  • *
  • Posts: 60
  • Country: cn
BTW, 002B does not officially document code read protection. There is no RDP field and all text about read protection is removed. No idea what this is all about, seems rather strange.
I checked this with their tech, FLASH_SDKR in option bytes can be used for read protection. They gave a short video https://v.douyin.com/i2R2Ecd7/ (in Chinese) to demonstrate this feature. They use an offline programmer to write the option bytes.
« Last Edit: April 30, 2024, 03:12:01 am by IOsetting »
 

Offline Sacodepatatas

  • Regular Contributor
  • *
  • Posts: 90
  • Country: es
it's very likely that 002B is an equivalent of L020, I just run the Deep Stop example on a TSSOP20 PY32F002b, the current consumption is much lower than the Stop mode ( 0.6 uA vs 1.6 uA).

In fact, I checked this header file of the LL driver in your repo...

https://github.com/IOsetting/py32f0-template/blob/main/Libraries/PY32F002B_LL_Driver/Inc/py32f002b_ll_pwr.h

And i found an interesting paragraph...

Quote
#if defined(PWR_DEEPSTOP_SUPPORT)
/**
  * @brief  Set SRAM retention voltage control in deep stop mode.
  * @note   Depending on devices and packages, Deep Low Power Run mode may not be available.
  *         Refer to device datasheet for Deep Low Power Run mode availability.
  * @param  VoltCtrl This parameter can be one of the following values:
  *         @arg @ref LL_PWR_SRAM_RETENTION_VOLT_CTRL_LDO
  *         @arg @ref LL_PWR_SRAM_RETENTION_VOLT_CTRL_LOW
  * @retval None
  */
....

So if you define PWR_DEEPSTOP_SUPPORT in the code, you can use the Deep Stop functions in the library. However It remains knowing if lower pin count packages support this in practice, because of lack of those packages in the L020.

Very nice tool  :-+
AFAIK the 002B is the same thing, just a different pinout, making the higher end 030 a direct swap.

It looks like the F002B/L020 is aimed for replacing existing 8 bit low end MCUs. If you notice, GPIOs and AFs range from 0 to 7, and pinouts of various packages match the ones of other 8 bit MCUs such as STM8S, Nuvoton, FMD, etc.

I noticed there is a new PY32T020 whose doc is only in chinese. AFAIK the T means "touch button" capability. I wonder if there is any correspondence to the ones we know about at silicon level...
 

Offline John Celo

  • Contributor
  • Posts: 24
  • Country: lt
I can confirm that all three DMA channels of DMA1 work, USART with DMA works, PLL works (48mhz), continuous ADC sampling with DMA also works.

All what has to be changed is you have to use the startup .s file from py32f030 (startup_py32f030xx.s) which contains all the extra interrupt vectors, and adjust RAM/ROM size (although this is not strictly necessary since base address is the same). And it "just" works!

I've also switched over from using high level HAL to low level hal. Makes it way easier to understand things!

For beginners out there: don't be afraid of the disassembly, turns out these Cortex-M0+ chips have very simple instruction set:
https://developer.arm.com/documentation/ddi0484/c/Programmers-Model/Instruction-set-summary

This includes timings! Two stage-pipeline!
These chips are great! Way less complicated peripherals than all the fancy cortex-m7 chips, which makes them a great starting point!

« Last Edit: April 30, 2024, 03:02:31 pm by John Celo »
 

Offline Sacodepatatas

  • Regular Contributor
  • *
  • Posts: 90
  • Country: es

I'm happy to add other parts, but nowhere I can find IDCODE values for them. They are not documented anywhere. So, if you have other devices and need support, run the tool, it will report the ID for the unsupported device.


FYI...


 

Online DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 6047
  • Country: es
Apparently only 0x60001000 ID code is supported.
Easy fix, though:
Code: [Select]
  { 0x20220064, "py32f0", "PY32F002Bxx5", 24*1024 },
« Last Edit: May 08, 2024, 09:41:12 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline Sacodepatatas

  • Regular Contributor
  • *
  • Posts: 90
  • Country: es
Apparently only 0x60001000 ID code is supported.
Easy fix, though:
Code: [Select]
  { 0x20220064, "py32f0", "PY32F002Bxx5", 20*1024 },

Remember, the 002B has 24kB of flash, so the last member in the struct (flash size) would be 24*1024.

EDIT:

The JEDEC JEP-106 for this part is [4][3B] (no surprises here), and the DBG_IDCODE at 0xE0042000 reads '0x00000000'.  Here is the AP dump from the romtable at address 0xE00FFFD0:

Code: [Select]
0xE00FFFD0  04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 
0xE00FFFE0  C0 00 00 00 B4 00 00 00 0B 00 00 00 00 00 00 00  À...´........... 
0xE00FFFF0  0D 00 00 00 10 00 00 00 05 00 00 00 B1 00 00 00  ............±... 
« Last Edit: May 08, 2024, 05:29:19 pm by Sacodepatatas »
 

Offline SaccharinGoat

  • Newbie
  • Posts: 3
  • Country: us
Forgive me if this should be in a separate thread but I can't find any documentation on if any of the GPIO pins on the Puya PY32F003F16 are pulled high or low during boot. Does anyone know the initial state of them on boot?
 

Online DavidAlfaTopic starter

  • Super Contributor
  • ***
  • Posts: 6047
  • Country: es
See datasheet or RM. Usually they're set in analog mode by default (Hi-Z) except SWD pins.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11394
  • Country: us
    • Personal site
Alex
 

Offline client

  • Newbie
  • Posts: 8
  • Country: cn
Hello, I have installed these environments as above, but  compile errors occured as the code is just a simple test,my chip number is py32f003f18p6, could you show me how to solve this problem? Thank you.

Error info:
警告:SrcWrapper 库声称在 AirMCU 体系结构上运行,可能与当前在 PY32 体系结构上运行的开发板不兼容。
In file included from C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal_def.h:35,
                 from C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal_rcc.h:32,
                 from C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/PY32F0xx/py32f0xx_hal_conf_default.h:208,
                 from C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/PY32F0xx/py32f0xx_hal_conf.h:13,
                 from C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal.h:33,
                 from C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:57,
                 from C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\libraries\SrcWrapper\src\HAL\py32yyxx_hal_rcc.c:8:
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c: In function 'HAL_RCC_DeInit':
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:251:28: error: 'RCC_CR_PLLRDY' undeclared (first use in this function); did you mean 'RCC_IT_PLLRDY'?
  251 |   while (READ_BIT(RCC->CR, RCC_CR_PLLRDY) != 0U)
      |                            ^~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/CMSIS/Device/PY32F0xx/Include/py32f0xx.h:174:41: note: in definition of macro 'READ_BIT'
  174 | #define READ_BIT(REG, BIT)    ((REG) & (BIT))
      |                                         ^~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:251:28: note: each undeclared identifier is reported only once for each function it appears in
  251 |   while (READ_BIT(RCC->CR, RCC_CR_PLLRDY) != 0U)
      |                            ^~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/CMSIS/Device/PY32F0xx/Include/py32f0xx.h:174:41: note: in definition of macro 'READ_BIT'
  174 | #define READ_BIT(REG, BIT)    ((REG) & (BIT))
      |                                         ^~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:260:8: error: 'RCC_TypeDef' has no member named 'PLLCFGR'; did you mean 'CFGR'?
  260 |   RCC->PLLCFGR = 0x00000000u;
      |        ^~~~~~~
      |        CFGR
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c: In function 'HAL_RCC_OscConfig':
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal_rcc.h:1514:56: error: 'RCC_TypeDef' has no member named 'PLLCFGR'; did you mean 'CFGR'?
 1514 | #define __HAL_RCC_GET_PLL_OSCSOURCE() ((uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC))
      |                                                        ^~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:322:21: note: in expansion of macro '__HAL_RCC_GET_PLL_OSCSOURCE'
  322 |     temp_pllckcfg = __HAL_RCC_GET_PLL_OSCSOURCE();
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal_rcc.h:1514:66: error: 'RCC_PLLCFGR_PLLSRC' undeclared (first use in this function)
 1514 | #define __HAL_RCC_GET_PLL_OSCSOURCE() ((uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC))
      |                                                                  ^~~~~~~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:322:21: note: in expansion of macro '__HAL_RCC_GET_PLL_OSCSOURCE'
  322 |     temp_pllckcfg = __HAL_RCC_GET_PLL_OSCSOURCE();
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:325:29: error: 'RCC_CFGR_SWS_PLL' undeclared (first use in this function); did you mean 'RCC_CFGR_SWS_Pos'?
  325 |     if (((temp_sysclksrc == RCC_CFGR_SWS_PLL) && (temp_pllckcfg == RCC_PLLSOURCE_HSE)) || (temp_sysclksrc == RCC_CFGR_SWS_HSE))
      |                             ^~~~~~~~~~~~~~~~
      |                             RCC_CFGR_SWS_Pos
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal_rcc.h:408:40: error: 'RCC_PLLCFGR_PLLSRC_HSE' undeclared (first use in this function); did you mean 'RCC_CFGR_SWS_HSE'?
  408 | #define RCC_PLLSOURCE_HSE              RCC_PLLCFGR_PLLSRC_HSE  /*!< HSE clock selected as PLL entry clock source */
      |                                        ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:325:68: note: in expansion of macro 'RCC_PLLSOURCE_HSE'
  325 |     if (((temp_sysclksrc == RCC_CFGR_SWS_PLL) && (temp_pllckcfg == RCC_PLLSOURCE_HSE)) || (temp_sysclksrc == RCC_CFGR_SWS_HSE))
      |                                                                    ^~~~~~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal_rcc.h:1514:56: error: 'RCC_TypeDef' has no member named 'PLLCFGR'; did you mean 'CFGR'?
 1514 | #define __HAL_RCC_GET_PLL_OSCSOURCE() ((uint32_t)(RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC))
      |                                                        ^~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:398:21: note: in expansion of macro '__HAL_RCC_GET_PLL_OSCSOURCE'
  398 |     temp_pllckcfg = __HAL_RCC_GET_PLL_OSCSOURCE();
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal_rcc.h:407:40: error: 'RCC_PLLCFGR_PLLSRC_HSI' undeclared (first use in this function); did you mean 'RCC_CFGR_SWS_HSI'?
  407 | #define RCC_PLLSOURCE_HSI              RCC_PLLCFGR_PLLSRC_HSI  /*!< HSI clock selected as PLL entry clock source */
      |                                        ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:399:68: note: in expansion of macro 'RCC_PLLSOURCE_HSI'
  399 |     if (((temp_sysclksrc == RCC_CFGR_SWS_PLL) && (temp_pllckcfg == RCC_PLLSOURCE_HSI)) || (temp_sysclksrc == RCC_CFGR_SWS_HSI))
      |                                                                    ^~~~~~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal_rcc.h:1492:59: error: 'RCC_CR_PLLON' undeclared (first use in this function); did you mean 'RCC_CR_HSION'?
 1492 | #define __HAL_RCC_PLL_DISABLE()        CLEAR_BIT(RCC->CR, RCC_CR_PLLON)
      |                                                           ^~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/CMSIS/Device/PY32F0xx/Include/py32f0xx.h:172:43: note: in definition of macro 'CLEAR_BIT'
  172 | #define CLEAR_BIT(REG, BIT)   ((REG) &= ~(BIT))
      |                                           ^~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:656:9: note: in expansion of macro '__HAL_RCC_PLL_DISABLE'
  656 |         __HAL_RCC_PLL_DISABLE();
      |         ^~~~~~~~~~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:662:34: error: 'RCC_CR_PLLRDY' undeclared (first use in this function); did you mean 'RCC_IT_PLLRDY'?
  662 |         while (READ_BIT(RCC->CR, RCC_CR_PLLRDY) != 0U)
      |                                  ^~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/CMSIS/Device/PY32F0xx/Include/py32f0xx.h:174:41: note: in definition of macro 'READ_BIT'
  174 | #define READ_BIT(REG, BIT)    ((REG) & (BIT))
      |                                         ^~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal_rcc.h:1505:35: error: 'RCC_TypeDef' has no member named 'PLLCFGR'; did you mean 'CFGR'?
 1505 |                   MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC, (__PLLSOURCE__))
      |                                   ^~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/CMSIS/Device/PY32F0xx/Include/py32f0xx.h:178:33: note: in definition of macro 'WRITE_REG'
  178 | #define WRITE_REG(REG, VAL)   ((REG) = (VAL))
      |                                 ^~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal_rcc.h:1505:19: note: in expansion of macro 'MODIFY_REG'
 1505 |                   MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC, (__PLLSOURCE__))
      |                   ^~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:679:9: note: in expansion of macro '__HAL_RCC_PLL_PLLSOURCE_CONFIG'
  679 |         __HAL_RCC_PLL_PLLSOURCE_CONFIG(RCC_OscInitStruct->PLL.PLLSource);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal_rcc.h:1505:35: error: 'RCC_TypeDef' has no member named 'PLLCFGR'; did you mean 'CFGR'?
 1505 |                   MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC, (__PLLSOURCE__))
      |                                   ^~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/CMSIS/Device/PY32F0xx/Include/py32f0xx.h:178:41: note: in definition of macro 'WRITE_REG'
  178 | #define WRITE_REG(REG, VAL)   ((REG) = (VAL))
      |                                         ^~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/CMSIS/Device/PY32F0xx/Include/py32f0xx.h:182:66: note: in expansion of macro 'READ_REG'
  182 | #define MODIFY_REG(REG, CLEARMASK, SETMASK)  WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
      |                                                                  ^~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal_rcc.h:1505:19: note: in expansion of macro 'MODIFY_REG'
 1505 |                   MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC, (__PLLSOURCE__))
      |                   ^~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:679:9: note: in expansion of macro '__HAL_RCC_PLL_PLLSOURCE_CONFIG'
  679 |         __HAL_RCC_PLL_PLLSOURCE_CONFIG(RCC_OscInitStruct->PLL.PLLSource);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:702:25: error: 'RCC_TypeDef' has no member named 'PLLCFGR'; did you mean 'CFGR'?
  702 |         MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC, PLLSOURCE_NONE);
      |                         ^~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/CMSIS/Device/PY32F0xx/Include/py32f0xx.h:178:33: note: in definition of macro 'WRITE_REG'
  178 | #define WRITE_REG(REG, VAL)   ((REG) = (VAL))
      |                                 ^~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:702:9: note: in expansion of macro 'MODIFY_REG'
  702 |         MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC, PLLSOURCE_NONE);
      |         ^~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:702:25: error: 'RCC_TypeDef' has no member named 'PLLCFGR'; did you mean 'CFGR'?
  702 |         MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC, PLLSOURCE_NONE);
      |                         ^~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/CMSIS/Device/PY32F0xx/Include/py32f0xx.h:178:41: note: in definition of macro 'WRITE_REG'
  178 | #define WRITE_REG(REG, VAL)   ((REG) = (VAL))
      |                                         ^~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/CMSIS/Device/PY32F0xx/Include/py32f0xx.h:182:66: note: in expansion of macro 'READ_REG'
  182 | #define MODIFY_REG(REG, CLEARMASK, SETMASK)  WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
      |                                                                  ^~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:702:9: note: in expansion of macro 'MODIFY_REG'
  702 |         MODIFY_REG(RCC->PLLCFGR, RCC_PLLCFGR_PLLSRC, PLLSOURCE_NONE);
      |         ^~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:727:30: error: 'RCC_TypeDef' has no member named 'PLLCFGR'; did you mean 'CFGR'?
  727 |         temp_pllckcfg = RCC->PLLCFGR;
      |                              ^~~~~~~
      |                              CFGR
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c: In function 'HAL_RCC_ClockConfig':
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:858:29: error: 'RCC_CR_PLLRDY' undeclared (first use in this function); did you mean 'RCC_IT_PLLRDY'?
  858 |       if (READ_BIT(RCC->CR, RCC_CR_PLLRDY) == 0U)
      |                             ^~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/CMSIS/Device/PY32F0xx/Include/py32f0xx.h:174:41: note: in definition of macro 'READ_BIT'
  174 | #define READ_BIT(REG, BIT)    ((REG) & (BIT))
      |                                         ^~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c: In function 'HAL_RCC_GetSysClockFreq':
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:1118:45: error: 'RCC_CFGR_SWS_PLL' undeclared (first use in this function); did you mean 'RCC_CFGR_SWS_Pos'?
 1118 |   else if (__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_CFGR_SWS_PLL)
      |                                             ^~~~~~~~~~~~~~~~
      |                                             RCC_CFGR_SWS_Pos
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:1120:23: error: 'RCC_TypeDef' has no member named 'PLLCFGR'; did you mean 'CFGR'?
 1120 |     pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC);
      |                       ^~~~~~~
      |                       CFGR
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:1120:33: error: 'RCC_PLLCFGR_PLLSRC' undeclared (first use in this function)
 1120 |     pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC);
      |                                 ^~~~~~~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal_rcc.h:408:40: error: 'RCC_PLLCFGR_PLLSRC_HSE' undeclared (first use in this function); did you mean 'RCC_CFGR_SWS_HSE'?
  408 | #define RCC_PLLSOURCE_HSE              RCC_PLLCFGR_PLLSRC_HSE  /*!< HSE clock selected as PLL entry clock source */
      |                                        ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:1124:10: note: in expansion of macro 'RCC_PLLSOURCE_HSE'
 1124 |     case RCC_PLLSOURCE_HSE:  /* HSE used as PLL clock source */
      |          ^~~~~~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Inc/py32f0xx_hal_rcc.h:407:40: error: 'RCC_PLLCFGR_PLLSRC_HSI' undeclared (first use in this function); did you mean 'RCC_CFGR_SWS_HSI'?
  407 | #define RCC_PLLSOURCE_HSI              RCC_PLLCFGR_PLLSRC_HSI  /*!< HSI clock selected as PLL entry clock source */
      |                                        ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:1128:10: note: in expansion of macro 'RCC_PLLSOURCE_HSI'
 1128 |     case RCC_PLLSOURCE_HSI:  /* HSI used as PLL clock source */
      |          ^~~~~~~~~~~~~~~~~
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c: In function 'HAL_RCC_GetOscConfig':
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:1266:18: error: 'RCC_CR_PLLON' undeclared (first use in this function); did you mean 'RCC_CR_HSION'?
 1266 |   if ((RCC->CR & RCC_CR_PLLON) == RCC_CR_PLLON)
      |                  ^~~~~~~~~~~~
      |                  RCC_CR_HSION
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:1275:44: error: 'RCC_TypeDef' has no member named 'PLLCFGR'; did you mean 'CFGR'?
 1275 |   RCC_OscInitStruct->PLL.PLLSource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC);
      |                                            ^~~~~~~
      |                                            CFGR
C:\Users\Administrator\AppData\Local\Arduino15\packages\PY32Duino\hardware\PY32\0.1.3\system/Arduino-PY32F0xx-Drivers/PY32F0xx_HAL_Driver/Src/py32f0xx_hal_rcc.c:1275:54: error: 'RCC_PLLCFGR_PLLSRC' undeclared (first use in this function)
 1275 |   RCC_OscInitStruct->PLL.PLLSource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC);
      |                                                      ^~~~~~~~~~~~~~~~~~

exit status 1

Compilation error: exit status 1
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 2004
  • Country: dk
Hello, I have installed these environments as above, but  compile errors occured as the code is just a simple test,my chip number is py32f003f18p6, could you show me how to solve this problem? Thank you.

The PLL related error , probably indicates that you have:
Mixed F003 libraries (NO PLL) and F030 code.  ... "Been there"

You have to change the "makefile" libraries to match the F030 , when using the "extended" functions.

/Bingo
« Last Edit: May 19, 2024, 05:57:04 am by bingo600 »
 
The following users thanked this post: client

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 2004
  • Country: dk
STM32 has a lot of pins specified as 5v tolerant.
Before digging through tonzzz of DS/RM pages - Does anyone know if the PY32Fxxx - Has 5v tolerant I/O pins ?
When MCU VCC = 3v3

I am reusing a DVB-T Receiver cabinet for a NTP server i'm making (DDROWN code).
And it has a 4 digit 7-seg display/button board,  based on a SC6928B_Superchip. That i have to interface to.

I'm using a STM32F407 Ethernet board, for the NTP Server.
And already have some proof of concept code running on a F401 (Blackpill) for bitbanging the communications.

Even though the DS says "SC6928 - Vih" has to be 0.8xVcc (5v), it works fine with the 3v3 from the F407.
But i'm burning a lot of "NOP" cycles, in the bitbang delay's, and have some worries about that wrt. the NTP code in the F407.
So I was thinking of using a PY32F002 for controlling the display, and use SPI (1 or 2MHz) between the F407 and the F002 display MCU.
Nice little challenge .....

If the F002 desn't have 5v tolerant SPI I/O, I can probably run the F002 of 5v.
And use the F407 SPI2, as think this one is 5v tolerant (will check).

But for ease of implementing, i'd like to run the F002 at 3v3 if possible.

/Bingo
« Last Edit: May 19, 2024, 06:23:17 am by bingo600 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf