-
Notifications
You must be signed in to change notification settings - Fork 18
add gd32e103xx pin config #12
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
Conversation
nandojve
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @feilongfl ,
Thank you for your PR. Please, link this with your board at Zephyr main repo.
We need build a board there using this newer changes to accept PR.
Sorry for waste your guys time to review this in-process PR. |
Don't worry about it @feilongfl everyone is learning here. You can look zephyrproject-rtos/zephyr#40283 and use it as guidance. Tips:
|
8e80fac to
4c671fc
Compare
|
Hi @nandojve @gmarull
|
nandojve
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #if !defined HXTAL_VALUE | ||
| #ifdef GD32E103V_EVAL | ||
| #ifdef CONFIG_BOARD_GD32E103V_EVAL | ||
| #define HXTAL_VALUE ((uint32_t)8000000) /*!< value of the external oscillator in Hz */ | ||
| #define HXTAL_VALUE_8M HXTAL_VALUE | ||
| #elif defined(GD32E103R_START) | ||
| #elif defined(CONFIG_BOARD_GD32E103R_START) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HAL headers can't depend on Kconfig variables. Instead, Zephyr build system should insert the HXTAL_VALUE based on a Kconfig or DT value. See zephyrproject-rtos/zephyr@a939085
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to use HXTAL_VALUE, but I'm a bit unsure if it's the same as your idea.
8d07746 to
41d9fbd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop hal:gd32e10x: temporary enable MPU flag commit. You need remove MPU at dts and soc definition.
Drop standard_peripheral/include/gd32e10x_fmc.c file.
If I Drop this commit, I'll get a compile error that header file in hal_gigadevice is not included. I try to analyse why these file not included, I write them here. Currently I have found no way to solve this problem other than turning on MPU. |
|
Please, check zephyrproject-rtos/zephyr#36833 (review) and let me know result. |
You're right, I forget that I can also modify the driver code. |
| /* get external oscillator from KCONFIG */ | ||
| #define HXTAL_VALUE CONFIG_GD32_HXTAL_VALUE | ||
| #if HXTAL_VALUE == 8000000 | ||
| #define HXTAL_VALUE_8M HXTAL_VALUE | ||
| #elif HXTAL_VALUE == 25000000 | ||
| #define HXTAL_VALUE_25M HXTAL_VALUE | ||
| #else | ||
| #error "GD32E10X lib only support 8M and 25M oscillator (HXTAL)" | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need to do that, just drop this commit and do the same as zephyrproject-rtos/zephyr@a939085 (cherry-pick it in your PR while it's not merged, even though it's now approved so it'll go in soon)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh,I see HXTAL_VALUE was defined in cmake script, I'll remove it.
Because of code in https://github.com/zephyrproject-rtos/hal_gigadevice/blob/main/gd32e10x/cmsis/gd/gd32e10x/source/system_gd32e10x.c#L745-L751 ,
I need HXTAL_VALUE_8M or HXTAL_VALUE_25M marco to make clock config success.
4167d62 to
d36cb81
Compare
Add pin configurations for the GD32E103XX SoCs. Signed-off-by: YuLong Yao <[email protected]>
Add remap definitions for GD32E103XX SoCs. Signed-off-by: YuLong Yao <[email protected]>
Files autogenerated using the gd32pinctrl.py script. Signed-off-by: YuLong Yao <[email protected]>
file from `GD32E10x_Demo_Suites_V1.2.0` Signed-off-by: YuLong Yao <[email protected]>
drop `nvic_vector_table_set`call in `SystemInit` function. Signed-off-by: YuLong Yao <[email protected]>
drop standard_peripheral/include/gd32e10x_fmc.c
add HXTAL_VALUE_8M and HXTAL_VALUE_25M marco by HXTAL_VALUE. Signed-off-by: YuLong Yao <[email protected]>
gd32pinctrl.pyscript.I noticed that the serial name of Gigadevice has changed unusually a few months ago.
They removed the CAN-FD module of the gd32e103 chip,
and the old
gd32e103with CAN-FD was renamed asgd32c103.This PR for the new
gd32e103only.