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
When will GD32E230C be supported? #55
Comments
There isn't a hard schedule since I'm doing the board-support part of this project as a hobby, but in the new year we expect to quickly add support for all not-yet support microcontrollers. The GD32E230C is supported with the standard SPL framework (use e.g. the |
Meh actually the E230 series is so similiar to the F1x0 series for which we can autogenerate the pinmaps, I'll give it a quick try. |
I've just added GD32E230C series chips to the Arduino core and variants, see here. All untested. Please use PlatformIO for testing. Open a CLI and execute Use the code from e.g. https://github.com/CommunityGD32Cores/gd32-pio-projects/tree/main/gd32-arduino-blinky to test UART (output on PA2) and LED (PC13). The code should compile. OpenOCD upload is however not working right now -- what upload method are you using? STLink? GDLink? Black magic probe? .. |
Dear Sir, Thank you again for your contribution Nathan Kuo |
It's possible if the new OpenOCD support for GD32E230x works. I've added an explicit new board definition ( Can you please do the following:
If the last step fails, please post the complete output of the terminal. For all of these steps you need to have Git installed. |
Dear Maximilian Gerhardt, The log is as follows, upload code seems to be unsuccessful, any suggestions?
Processing gd32e230c_start (board: gd32e230c_start; framework: arduino; platform: https://github.com/CommunityGD32Cores/platform-gd32.git)
swd Nathan Kuo |
Dear Maximilian Gerhardt,
Processing gd32e230c_start (board: gd32e230c_start; framework: arduino; platform: https://github.com/CommunityGD32Cores/platform-gd32.git)
J-Link Command File read successfully. J-Link connection not established yet but required for command. Connecting to target via SWD Downloading file [.pio\build\gd32e230c_start\firmware.bin]... ****** Error: Timeout while calculating CRC, RAMCode did not respond in time. (PC = 0x04280412, CPSR = 0x2122D802, LR = 0x01000000)!Failed to erase sectors 0 @ address 0x08000000 ((erase error)) Unspecified error -1 Reset delay: 0 ms Script processing completed. Nathan Kuo |
Your upload with the CMSIS-DAP standard configuration looks good. The JLink upload does not look good, because it says
The GD32E230C8 is definitely a Cortex-M23 part (https://www.gigadevice.com/microcontroller/gd32e230c8t6/) and not a Cortex-M3. Did you connect the JLink to a different microcontroller? What I would suggest is that you go back to the standard CMSIS-DAP upload (no JLink), but change the code of project ( #include <Arduino.h>
#define LED PA7
void setup(){
pinMode(LED, OUTPUT);
}
void loop(){
digitalWrite(LED, LOW);
delay(500);
digitalWrite(LED, HIGH);
delay(500);
} and, to the original debug_tool = cmsis-dap
debug_init_break = tbreak Reset_Handler then start a debug session (Debugger sidebar -> make sure "PIO Debug (gd32e230c_start)" is selected -> press play button). Does the firmware then upload and halt in the |
After flash the code as below, the LED1 PA7 still not working , I also recorded a few videos, can you help me see what's wrong with my environment? https://drive.google.com/file/d/11OsIg0DLUIanU-olDO7gNXIqcU2EiIE6/view?usp=sharing `#include <Arduino.h> void setup(){ void loop(){ Nathan Kuo |
Okay thanks for the videos, these clearly show that uploading & debugging works, that the code reaches the In the meantime I've ordered a GD32E230C-START board myself so that I have GD32E230 hardware -- though this board will only arrive in about a month. I have two requests:
|
This project is working :https://github.com/maxgerhardt/pio-gd32e230c-spl-blinky , the LED1(PA7) is blinking only on the debug mode , but there seems to be a problem with the upload method and it doesn’t work properly. Nathan Kuo |
Hm okay if SPL Blinky works in debug mode (I'm not yet sure why it wouldn't work in release mode) then the core likely has a bug. I've looked at the pin-mapping logic and noticed a potential bug (f6dc080). Can you do a |
After do Nathan Kuo |
Okay then I'll see why that is when I get hardware and can debug it myself line-by-line. Sadly my order for the board seems to have canceled though because "out of stock", so I'm not sure if I'm getting hardware before the end of the year.. If you have free time and the will to do it you can also help debugging. Especially interesting would be wether when the code enters the |
Thank you for your efforts. Nathan Kuo |
@maxgerhardt - if you're able to generate the pin maps for either a GD32E230F8 or GD32E230K8 I can have a go at debugging the digitalWrite() function. |
Sure, let me have a go at that. Adding the Fx or Kx subseries should be quick. |
I've just added and tested the compilation for E230Kx series in 45e54cc, including your K8. These are the unmodified autogenerated variant folders, so they have that You can use https://github.com/CommunityGD32Cores/gd32-pio-projects/tree/main/gd32-arduino-blinky as a base project with the [env]
platform = https://github.com/CommunityGD32Cores/platform-gd32.git
platform_packages =
framework-arduinogd32@https://github.com/CommunityGD32Cores/ArduinoCore-GD32.git
tool-openocd@https://github.com/maxgerhardt/pio-openocd-gd32/raw/main/tool-openocd-windows_amd64-2.1100.211123.tar.gz
[env:genericGD32E230K8]
board = genericGD32E230K8
framework = arduino
debug_tool = cmsis-dap
upload_protocol = cmsis-dap Also make sure to open a CLI and execute |
Great - I'll git it a try this evening and let you know. |
Ok - so I couldn't wait until this evening! On first look it seems that pinMode( ) isn't setting the output mode correctly. Setting it manually in the setup() function causes the LED to flash (mine's on PB1, but I tried PA7 with same result).
looking further it seems that |
AAaargh that makes kinda sense... I have pushed commit cbb43a8, can you again do a (If it still doesn't work properly after that it might be that remapping problem with |
Great, just updated and confirm that it now works as expected - straight update - no change to |
Great! I'll add the pinmaps for the remaining E230 boards and close this issue. If there are issues with other subsystems like Serial, I2C, SPI or whatever, please open new issues to let us know :) And, as of now, the platform_packages =
framework-arduinogd32@https://github.com/CommunityGD32Cores/ArduinoCore-GD32.git
tool-openocd@https://github.com/maxgerhardt/pio-openocd-gd32/raw/main/tool-openocd-windows_amd64-2.1100.211123.tar.gz are critical for getting the latest OpenOCD version that can handle the E230 series. We plan to address this later when we can obtain a compiled version of bleeding-edge OpenOCD for all OSes and upload that to the PlatformIO registry.. |
Thanks - will try out Serial, I2C, SPI etc ... over the next few days. I use an M1 MacBook so have a latest OpenOCD build that handles the E230 on that platform ... if you let me know how you'd like me to package it I can make that available |
Oh that would be truely awesome! Are you able to compile it in Intel x64 mode too or only ARM? (Because PlatformIO prefers for Mac that x64 packages are used since they work on x64 and ARM / M1 machines through Rosetta). The process for packaging would be to first compile OpenOCD, then change-up the folder structure to match what I have in the Windows x64 build above (requires moving some folders up), then in the root of the folder add a {
"name": "tool-openocd",
"version": "2.1100.211123",
"description": "Open On-Chip Debugger. Free and Open On-Chip Debugging, In-System Programming and Boundary-Scan Testing",
"keywords": [
"tools",
"debugger",
"debug server",
"uploader"
],
"homepage": "http://openocd.org",
"license": "GPL-2.0-or-later",
"repository": {
"type": "git",
"url": "https://sourceforge.net/p/openocd/code/ci/master/tree/"
},
"system": [
"darwin_x86_64",
"darwin_arm64"
]
} (declares package name, version, compatible OSes), and then from a CLI where |
Ok, great - I can have a go at building the Intel x64 version and pack it up per your instructions. I'll let you know when I've a package for testing. |
seems a strange one - I've no problem on Mac OS 12.0.1 using the regular platformio openocd to connect to an stm32f411 via a Stlink clone. Just confirmed. |
Oh I read over that, yes https://github.com/xpack-dev-tools/openocd-xpack/releases seems really good and has the |
@maxgerhardt - do you have a way I can send you the
|
Just realized its small enough that I could attach it. |
Looking great from the output side, I'll collect Windows + Linux package too and upload them to the PlatformIO registry, then I can reference that in platform-gd32's |
Great - one thing to note, I did adjust the |
I've renamed and repacked it as @djix123 Can you again do a @NathanKuo0821 Can you also update and confirm https://github.com/maxgerhardt/pio-gd32e230c-start is now uploading and working (with LEDs) out of the box? |
Confirmation new verision of
@maxgerhardt - that's a coincidence! - I just did that as I was about to look at the Arduino peripherals: e.g. Serial, SPI etc ... |
Ok, so Serial works fine (by fine meaning default settings, I've tried nothing exotic) and so does SPI, but to get the Arduino framework to compile I needed to patch I've cut/pasted the
|
Similarly I2C works fine, but needed to add this patch so that
|
Thanks for the feedback and patches, I'll have a look at this tomorrow -- indeed the SPI code shouldn't assume which exact SPI peripherals are available, we have to clean up this technical debt inherited by GigaDevice's original code. |
Another (very) minor patch to exclude the
|
Can confirm the fixes work for me with the GD32E230F8 board. Compiles and works as expected. One thing I did note, though, is that the update to install Just noticed something else, when I click the 'Upload' button in PlatformIO it re-downloads |
Thanks for confirming the code still works.
This should be counteracted through CommunityGD32Cores/pio-gd32-gdlinkcli@7f0f480. For now, I only need thihs GDLinkCLI tool, which is provided by GigaDevice as a Windows-only tool, to upload comfortably to a GD32E50x device while my OpenOCD patch (https://review.openocd.org/c/openocd/+/6794) is not completed yet. I will close this issue as solved for E230x then. |
Thanks - the update to Also just playing with the Arduino |
There's also a fundamental bug in |
Could update again to see if 8fd01ef fixes the issue? You should be using code like https://github.com/CommunityGD32Cores/gd32-pio-projects/blob/main/gd32-arduino-pwm-out/src/main.cpp together with a PWM enabled pin as listed in e.g. https://github.com/CommunityGD32Cores/ArduinoCore-GD32/blob/main/variants/GD32E230F8_GENERIC/PeripheralPins.c#L130-L148 |
Yes, commenting out |
This is my code (very simple):
|
If I switch |
Are you using the very latest Arduino core code from this repo? |
PWM confirmed as working. I have an LED on Also tried with the PWM on |
I am, yes. |
Timer0 is special with |
f8dd851 tries to fix this, can you retest? |
Yes, thanks. That fixes it. Working now. |
I have been waiting for GD32E230C to support Arduino , Is there a plan to support? schedule?
Very thanks.
The text was updated successfully, but these errors were encountered: