Community-PIO-CH32V / platform-ch32v

PlatformIO platform for CH32V RISC-V chips (CH32V003, CH32V103, CH32V20x, CH32V30x, CH32X035) and CH56x, CH57x, CH58x, CH59x
Apache License 2.0
237 stars 37 forks source link

Fatal error when building blinky on CH32X033 #75

Closed Rockwell1799 closed 1 week ago

Rockwell1799 commented 1 week ago

Hello I'm using the examples on this repository below, but I keep getting a fatal error regarding a debug.h file missing. I have used other examples on CH32V003 and they are all working fine. Can someone help me please?

https://github.com/wagiminator/Development-Boards/tree/main/CH32X033F8P6_DevBoard/software/blink

ne3gjR5KGh

Rockwell1799 commented 1 week ago

Never mind! By removing the line debug.h, everything is working fine!

maxgerhardt commented 1 week ago

This is still supposed to work because the CH32X035 SDK (also used for X033) does have the debug.h.

https://github.com/Community-PIO-CH32V/framework-wch-noneos-sdk/tree/main/Debug/ch32x035

Let me check it out..

maxgerhardt commented 1 week ago

Why is this set to no, so that the debug directory and code won't be added, but still debug.h is included?

https://github.com/wagiminator/Development-Boards/blob/0c34956e895d184507ce73b2b2f01aaf6da6cf62/CH32X033F8P6_DevBoard/software/blink/platformio.ini#L24

maxgerhardt commented 1 week ago

Mhmm I see. The include doesn't come from the firmware code, but from the auto-included SDK code. ch32x035_pwr.c always wants debug.h. Nasty.

And it only needs in one case where it needs a delay:

https://github.com/Community-PIO-CH32V/framework-wch-noneos-sdk/blob/342b5d0126878e9db048adeb91db256a2a1c5788/Peripheral/ch32x035/src/ch32x035_pwr.c#L143-L150

maxgerhardt commented 1 week ago

Fixed in https://github.com/Community-PIO-CH32V/framework-wch-noneos-sdk/commit/ce988d62cab26e26f43ed0e0d6f294c35c75c3e2

Update your packages and rebuild. (Simplest: Delete C:\Users\<user>\.platformio\packages\framework-wch-noneos-sdk)