Skip to content

boards: gd32e507z_eval: add initial support #49547

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

Merged
merged 2 commits into from
Aug 31, 2022

Conversation

gmarull
Copy link
Member

@gmarull gmarull commented Aug 25, 2022

Add initial support for the GD32E507Z-EVAL board. Only basic peripherals
are enabled for now:

  • UART
  • GPIO (LEDs, keys)
  • PWM

Others, e.g. I2C, EEPROM, DAC, etc. require further testing and likely
some driver adjustments.

Signed-off-by: Gerard Marull-Paretas gerard@teslabs.com

str4t0m
str4t0m previously approved these changes Aug 26, 2022
Copy link
Contributor

@str4t0m str4t0m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't test on the board itself, but all looks good.

str4t0m
str4t0m previously approved these changes Aug 27, 2022
@nandojve nandojve mentioned this pull request Aug 27, 2022
55 tasks
@nandojve
Copy link
Member

Probably not related with PR but I couldn't test PyOCD. Any tips?

My device:

[26306.414466] usb 1-9: new full-speed USB device number 17 using xhci_hcd
[26306.563427] usb 1-9: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.64
[26306.563428] usb 1-9: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[26306.563429] usb 1-9: Product: USB Serial
[26306.566317] ch341 1-9:1.0: ch341-uart converter detected
[26306.567208] usb 1-9: ch341-uart converter now attached to ttyUSB0
[26306.842462] usb 1-7: new full-speed USB device number 18 using xhci_hcd
[26306.991243] usb 1-7: New USB device found, idVendor=28e9, idProduct=058f, bcdDevice= 1.00
[26306.991244] usb 1-7: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[26306.991245] usb 1-7: Product: CMSIS-DAP
[26306.991246] usb 1-7: Manufacturer: GD32 ARM

Check probe ID:

$ python3 -m pyocd list
  #   Probe                Unique ID                         
-------------------------------------------------------------
  0   GD32 ARM CMSIS-DAP   7CR7UIQJEENC2BODXRBZYTXCB3AWSK4M 

Try to flash:

$ west flash
-- west flash: rebuilding
ninja: no work to do.
-- west flash: using runner pyocd
-- runners.pyocd: Flashing file: /home/gfbudke/zephyr/mainline/zephyr/build/zephyr/zephyr.hex
0001377:CRITICAL:__main__:Device 7CR7UIQJEENC2BODXRBZYTXCB3AWSK4M not found
Traceback (most recent call last):
  File "/home/gfbudke/.local/lib/python3.8/site-packages/pyocd/probe/cmsis_dap_probe.py", line 174, in open
    self._link.open()
  File "/home/gfbudke/.local/lib/python3.8/site-packages/pyocd/utility/concurrency.py", line 28, in _locking
    return func(self, *args, **kwargs)
  File "/home/gfbudke/.local/lib/python3.8/site-packages/pyocd/probe/pydapaccess/dap_access_cmsis_dap.py", line 658, in open
    self._interface.open()
  File "/home/gfbudke/.local/lib/python3.8/site-packages/pyocd/probe/pydapaccess/interface/pyusb_backend.py", line 73, in open
    raise DAPAccessIntf.DeviceError("Device %s not found" % self.serial_number)
pyocd.probe.pydapaccess.dap_access_api.DAPAccessIntf.DeviceError: Device 7CR7UIQJEENC2BODXRBZYTXCB3AWSK4M not found

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/gfbudke/.local/lib/python3.8/site-packages/pyocd/__main__.py", line 150, in run
    status = cmd.invoke()
  File "/home/gfbudke/.local/lib/python3.8/site-packages/pyocd/subcommands/load_cmd.py", line 96, in invoke
    with session:
  File "/home/gfbudke/.local/lib/python3.8/site-packages/pyocd/core/session.py", line 341, in __enter__
    self.open()
  File "/home/gfbudke/.local/lib/python3.8/site-packages/pyocd/core/session.py", line 455, in open
    self._probe.open()
  File "/home/gfbudke/.local/lib/python3.8/site-packages/pyocd/probe/cmsis_dap_probe.py", line 197, in open
    raise self._convert_exception(exc) from exc
pyocd.core.exceptions.ProbeError: Device 7CR7UIQJEENC2BODXRBZYTXCB3AWSK4M not found
FATAL ERROR: command exited with status 1: pyocd flash -e sector -a 0x8000000 -t gd32e507ze /home/gfbudke/zephyr/mainline/zephyr/build/zephyr/zephyr.hex

@nandojve nandojve added this to the v3.2.0 milestone Aug 28, 2022
@gmarull
Copy link
Member Author

gmarull commented Aug 29, 2022

@nandojve looks like you don't have the CMSIS-Pack correctly installed. I can flash it:

0001187 I Loading /home/gmarull/ws/teslabs/zephyrproject/zephyr/build/zephyr/zephyr.hex at 0x08000000 [load_cmd]
[==================================================] 100%
0002900 I Erased 8192 bytes (1 sector), programmed 6144 bytes (6 pages), skipped 8192 bytes (8 pages) at 8.35 kB/s [loader]

@nandojve
Copy link
Member

@nandojve looks like you don't have the CMSIS-Pack correctly installed. I can flash it:

0001187 I Loading /home/gmarull/ws/teslabs/zephyrproject/zephyr/build/zephyr/zephyr.hex at 0x08000000 [load_cmd]
[==================================================] 100%
0002900 I Erased 8192 bytes (1 sector), programmed 6144 bytes (6 pages), skipped 8192 bytes (8 pages) at 8.35 kB/s [loader]

I managed to make it work but I still have few problems. Anyway, definitely it is something with my Debian.
Thank you for the tip.

nandojve
nandojve previously approved these changes Aug 29, 2022
@fabiobaltieri
Copy link
Member

@gmarull can you rebase?

The clock entry was wrong, fix it.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Add initial support for the GD32E507Z-EVAL board. Only basic peripherals
are enabled for now:

- UART
- GPIO (LEDs, keys)
- PWM

Others, e.g. I2C, EEPROM, DAC, etc. require further testing and likely
some driver adjustments.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
@gmarull gmarull dismissed stale reviews from nandojve and str4t0m via d186449 August 30, 2022 08:24
@gmarull
Copy link
Member Author

gmarull commented Aug 30, 2022

@gmarull can you rebase?

done

@gmarull gmarull requested review from str4t0m and nandojve August 30, 2022 08:24
Copy link
Contributor

@str4t0m str4t0m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed tests are unrelated (qemu_x86_64: kernel, qemu_x86: logging ).

Copy link
Member

@soburi soburi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stephanosio
Copy link
Member

Please rebase to fix CI failure

@fabiobaltieri fabiobaltieri merged commit eedab17 into zephyrproject-rtos:main Aug 31, 2022
@gmarull gmarull deleted the gd32e507z-eval branch April 24, 2023 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: GD32 GigaDevice
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants