-
Notifications
You must be signed in to change notification settings - Fork 18
hal: GD32A503: add support for gd32a503 #30
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
|
For the reason to quickly deliver new gd32a503 mcu to user, I accept to add a pack in here. But there have a high potential that gd32a503 pack will be add to keil in next few month. After that, I suggest to remove the pack from gd32 hal, and update the board document. |
2917edd to
1982915
Compare
|
Hi @feilongfl , I agreed with @cameled about pack. You can point that in the board documentation. Once you made the changes move to ready so we can move forward. It will be nice have this new platform for next release but we don't have much time. |
add firmware library support for gd32a503. Origin: https://www.gd32mcu.com/data/documents/toolSoftware/GD32A50x_Firmware_Library_V1.0.1.rar Signed-off-by: YuLong Yao <[email protected]>
apply fllowing patches for hal: - drop I2CCLK_MAX/I2CCLK_MIN - add `gd32_` prefix for timer_init - add ifdef to BIT macro - remove nvic_vector_table_set function call - rename CAN_xxx_MODE to GD32_CAN_xxx_MODE Signed-off-by: YuLong Yao <[email protected]>
Add pin configurations for the GD32A503XX series. Information has been taken from datasheet. Signed-off-by: YuLong Yao <[email protected]>
Add autogenerated pinctrl files for GD32A503 series. Signed-off-by: YuLong Yao <[email protected]>
Update common_include headers (using gd32headers.py) Signed-off-by: YuLong Yao <[email protected]>
add device package for pyocd origin: https://www.gd32mcu.com/download/down/document_id/405/path_type/1 Signed-off-by: YuLong Yao <[email protected]>
Fix bug in hal. Signed-off-by: YuLong Yao <[email protected]>
1982915 to
4040618
Compare
|
Hi @feilongfl , This PR still as Draft. When you think it is ready change status to review. |
|
About commit 4040618 In past few weeks I've try to communicate with FAE of I think the gigadevice code has the following problem, so I think it should be modified.
|
|
Hi @feilongfl , You are correct. My feeling is that they would like to have something like: pllmf += ((0xFU == GET_BITS(RCU_CFG0, 18, 21)) ? 1U : 2U);But I think below will be easy to comprehend: |
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.
About support: gd32a50x: add device pack for pyocd. I may contradict my self a little here but I start to think it will be better just point pack in the board documentation. It is far easy to update board docs than hal.
Sorry about above noise. I was reconsidering and it seems best move this way currently.
|
I write a simple test, OUTPUT: |
|
I check the gd32 download site. There only have three gd32 series pack not include in Keil MDK5 Software Packs, If we add a directory to store these pack, this directory may change frequently.
|
|
Let`s document pack solution and then I think this is ready. |
d72b902 to
25fa471
Compare
|
|
Hi @feilongfl , Please, document the exception following the current proposal c8faa49. Just add an pack entry mentioning how someone should proceed. We can discuss west extensions in a way to not block proposals. |
- gd32a50x have pllmf calculate error, explain how to fix it. - gigadevice not upload pack to mdk website, explain how to storage pack - update arm library structure Signed-off-by: YuLong Yao <[email protected]>
25fa471 to
afbf04e
Compare
| └── support (optional) | ||
| └── GigaDevice.GD32xxx_DFP.1.0.0.pack (Only for packs not in [Keil MDK5 Software Packs](https://www.keil.com/dd2/pack/)) |
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.
Please remove binaries from this module (send a new PR dropping this). This is not acceptable, you can provide details on how to download suck packs (not to mention that GD is responsible to host them, and can be installed automatically via cmsis-pack-manager).
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'm trying to make a west extension commands to solve pack problems.(#31 )
I'd like to know is it possible to save the file link in the repository like this.
hal_gigadevice/zephyr/west/gigadevice.yml
Lines 5 to 9 in 2017359
| pyocd-packages: | |
| - pack: gd32e103 # pack in mdk website | |
| - pack: gd32a503 # pack not in mdk website | |
| url: https://www.gd32mcu.com/download/down/document_id/405/path_type/1 | |
| hash: 23c8840812ef9d86fbb87bca7d9c452c71bd9291 |
This way we can use commands like west gigadevice install to install all packages or download them from the gigadevice website
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.
IMO GD should be responsible of updating packages in CMSIS repo, so that the standard tool cmsis-pack-manager can be used. In fact, they seem to have most of them (A503 is new, maybe it's not there yet, time to ping vendor?).
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.
@gmarull ,
Why you are saying that the pack file is a binary file? As far I can see it is just a zip with source code and register definitions. You can just unzip and read all the content.
Below is the full content of the file:
.
├── Device
│ ├── Firmware
│ │ └── Peripherals
│ │ ├── inc
│ │ │ ├── gd32a50x_adc.h
│ │ │ ├── gd32a50x_bkp.h
│ │ │ ├── gd32a50x_can.h
│ │ │ ├── gd32a50x_cmp.h
│ │ │ ├── gd32a50x_crc.h
│ │ │ ├── gd32a50x_dac.h
│ │ │ ├── gd32a50x_dbg.h
│ │ │ ├── gd32a50x_dma.h
│ │ │ ├── gd32a50x_exti.h
│ │ │ ├── gd32a50x_fmc.h
│ │ │ ├── gd32a50x_fwdgt.h
│ │ │ ├── gd32a50x_gpio.h
│ │ │ ├── gd32a50x_i2c.h
│ │ │ ├── gd32a50x_mfcom.h
│ │ │ ├── gd32a50x_misc.h
│ │ │ ├── gd32a50x_pmu.h
│ │ │ ├── gd32a50x_rcu.h
│ │ │ ├── gd32a50x_rtc.h
│ │ │ ├── gd32a50x_spi.h
│ │ │ ├── gd32a50x_syscfg.h
│ │ │ ├── gd32a50x_timer.h
│ │ │ ├── gd32a50x_trigsel.h
│ │ │ ├── gd32a50x_usart.h
│ │ │ └── gd32a50x_wwdgt.h
│ │ └── src
│ │ ├── gd32a50x_adc.c
│ │ ├── gd32a50x_bkp.c
│ │ ├── gd32a50x_can.c
│ │ ├── gd32a50x_cmp.c
│ │ ├── gd32a50x_crc.c
│ │ ├── gd32a50x_dac.c
│ │ ├── gd32a50x_dbg.c
│ │ ├── gd32a50x_dma.c
│ │ ├── gd32a50x_exti.c
│ │ ├── gd32a50x_fmc.c
│ │ ├── gd32a50x_fwdgt.c
│ │ ├── gd32a50x_gpio.c
│ │ ├── gd32a50x_i2c.c
│ │ ├── gd32a50x_mfcom.c
│ │ ├── gd32a50x_misc.c
│ │ ├── gd32a50x_pmu.c
│ │ ├── gd32a50x_rcu.c
│ │ ├── gd32a50x_rtc.c
│ │ ├── gd32a50x_spi.c
│ │ ├── gd32a50x_syscfg.c
│ │ ├── gd32a50x_timer.c
│ │ ├── gd32a50x_trigsel.c
│ │ ├── gd32a50x_usart.c
│ │ └── gd32a50x_wwdgt.c
│ ├── Include
│ │ ├── gd32a50x.h
│ │ └── system_gd32a50x.h
│ ├── Source
│ │ ├── ARM
│ │ │ └── startup_gd32a50x.s
│ │ └── system_gd32a50x.c
│ ├── Template
│ │ └── gd32a50x_libopt.h
│ └── Utilities
│ ├── gd32a503v_eval.c
│ └── gd32a503v_eval.h
├── Flash
│ ├── GD32A50x_128KB.FLM
│ ├── GD32A50x_256KB.FLM
│ └── GD32A50x_384KB.FLM
├── GigaDevice.GD32A50x_DFP.pdsc
└── SVD
├── GD32A503.SFR
└── GD32A503.svd
I think the intention was keep easy to users until pack be available into cmsis-pack-manager and after that content will be dropped from here. The major concern was that pack is only available in the Chinese website version and it is not easy to find it if link is broke.
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.
The content is not binary, but a zip file is a binary from a git perspective. Binaries are well known to blow git history (see zephyr with board pictures), and remember Zephyr modules carry all their Git history.
add gd32a503 support.