Skip to content

Conversation

@feilongfl
Copy link
Contributor

@feilongfl feilongfl commented Mar 1, 2022

This add an initial support for gd32 can device.

There two version of CAN ip in GD32.

  • CAN 2.0 B
    • GD32F4xx
    • ... (add later)
  • CAN-FD
    • GD32C103
    • GD32E103
      Only a few early specific batches of GD32E103 can works, and CAN function have been removed for the new batch.

Because there is no eval board for GD32C103 series, I can only test it through the special GD32E103 in my hand.All commits related to GD32E103 will be marked as DNM and will be deleted when the draft is complete.

Tasks:

  • initial can
    • device tree
    • kconfig
    • clock
    • pinmux
    • bus timing (uncalc value for now)
  • can send
    • can
    • can-fd (not tested)
  • filter config
    • device tree
    • kconfig
    • add
    • add to sub filter
    • search
    • remove
  • can recv
    • can
    • canfd (not tested)
  • boards
    • gd32vf103c_starter (can only)
    • gd32e103v_eval (special chip version can run can-fd function well)
      • CAN0 (main controller)
      • CAN1 (secondary controller)
  • documents

filter design

over view

How to use can filter was not wrote to gigadevice document, but it looks same as stm32F4's can filter.
so I use the example in stm32's reference manual.

STM32F4 Reference Manual (RM0090 Rev19, Page1089)

gd32_can_filter drawio

All callback of reveive can message will be storaged into linked-list,and invoke when message received.

  • size of filter linked-list can be set by kconfig item CAN_MAX_FILTER
  • split of main can controller(CAN0) and secondary controller(CAN1) can be set by CAN_FILTER_SPLIT

depend on:


More GD32 work #38657

@github-actions
Copy link

github-actions bot commented Mar 1, 2022

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff
hal_gigadevice feilongfl/hal_gigadevice@63a72ca feilongfl/hal_gigadevice@086af8d (hal_gd32e1_can) feilongfl/[email protected]

Note: This message is automatically posted and updated by the Manifest GitHub Action.

drivers: can: add assert to can_calc_prescaler func

Signed-off-by: YuLong Yao <[email protected]>
drivers: can: fix div0 error.


drivers: can: add assert when calc CANFD pkg dlc and byte size.
add iso and non-ISO type to can.h

Signed-off-by: YuLong Yao <[email protected]>
do not merge.
use a special hal_gigadevice to enable can function for gd32e103

Signed-off-by: YuLong Yao <[email protected]>
add can and canfd yaml to dt-bindings.

Signed-off-by: YuLong Yao <[email protected]>
for test, only a few of gd32e103v_eval can function is work well.

Signed-off-by: YuLong Yao <[email protected]>
test only, do not merge.

Signed-off-by: YuLong Yao <[email protected]>
add can to gd32vf1 soc.

Signed-off-by: YuLong Yao <[email protected]>
add can and canfd driver for gd32.


drivers: can: gd32: refact code


drivers: can: gd32: add ewsr isr


drivers: can: gd32: support debug freeze


drivers: can: gd32: fix dts load error


add recv func


merge cfg


Signed-off-by: YuLong Yao <[email protected]>
dts: can: refact can bindings.

dts: can: refact can bindings.


Signed-off-by: YuLong Yao <[email protected]>
fix


fix


drivers: can: fix comment

drivers: can: fix comment

Signed-off-by: YuLong Yao <[email protected]>

add filter size


d


xxx


[DNM] boards: gd32e103_eval: add can1
function changed: 67ba990
@github-actions
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label May 29, 2022
@github-actions github-actions bot closed this Jun 13, 2022
@str4t0m str4t0m added the platform: GD32 GigaDevice label Aug 26, 2022
@str4t0m
Copy link
Contributor

str4t0m commented Oct 3, 2022

@feilongfl Do you have the intention to continue working on this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants