-
Notifications
You must be signed in to change notification settings - Fork 243
Add Support for CH579M #437
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
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
os/common/startup/ARMCMx/compilers/GCC/mk/startup_ch579m.mk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # CH579M startup files (ARM Cortex-M0, ARMv6-M). | ||
| # | ||
| # Uses the generic ChibiOS ARMv6-M startup (crt0_v6m.S + vectors.S) | ||
| # with WCH's CH579M CMSIS device header for the vector table layout. | ||
| # | ||
| # The system_ch579m.c provides SystemInit() which is called from crt0; | ||
| # our hal_lld_init() then does the PLL switch in __early_init(). | ||
|
|
||
| STARTUPSRC = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt1.c | ||
|
|
||
| STARTUPASM = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/crt0_v6m.S \ | ||
| $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/vectors.S | ||
|
|
||
| STARTUPINC = $(CHIBIOS)/os/common/portability/GCC \ | ||
| $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC \ | ||
| $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/ld \ | ||
| $(CHIBIOS)/os/common/ext/ARM/CMSIS/Core/Include \ | ||
| $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/devices/CH579 \ | ||
| $(CHIBIOS_CONTRIB)/os/hal/ports/WCH/CH579 \ | ||
| $(KEYBOARD_PATH_1)/ld | ||
|
|
||
| STARTUPLD = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/ld | ||
| STARTUPLD_CONTRIB = $(KEYBOARD_PATH_1)/ld | ||
|
|
||
| LDFLAGS += -L$(KEYBOARD_PATH_1)/ld | ||
|
|
||
| # Shared variables | ||
| ALLXASMSRC += $(STARTUPASM) | ||
| ALLCSRC += $(STARTUPSRC) | ||
| ALLINC += $(STARTUPINC) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| /* | ||
| * ChibiOS - CH579M Cortex-M0 CMSIS parameters | ||
| * | ||
| * CH579M interrupt vector count: 26 external IRQs from the datasheet, | ||
| * rounded up to the next multiple of 8 → 32. | ||
| */ | ||
|
|
||
| #ifndef CMPARAMS_H | ||
| #define CMPARAMS_H | ||
|
|
||
| /** @brief Cortex core model: 0 = Cortex-M0. */ | ||
| #define CORTEX_MODEL 0 | ||
|
|
||
| /** @brief No FPU on Cortex-M0. */ | ||
| #define CORTEX_HAS_FPU 0 | ||
|
|
||
| /** | ||
| * @brief Number of bits in priority masks. | ||
| * @note Cortex-M0 only implements the top 2 bits of the priority field. | ||
| */ | ||
| #define CORTEX_PRIORITY_BITS 2 | ||
|
|
||
| /** | ||
| * @brief Number of interrupt vectors. | ||
| * @note Does NOT include the 16 system vectors. Must be a multiple of 8. | ||
| * CH579M has 26 external IRQs → rounded to 32. | ||
| */ | ||
| #define CORTEX_NUM_VECTORS 32 | ||
|
|
||
| #if !defined(_FROM_ASM_) | ||
|
|
||
| #include "board.h" | ||
|
|
||
| /* Pull in the device register header solely to verify parameters match. */ | ||
| #include "CH579.h" | ||
|
|
||
| #if CORTEX_MODEL != __CORTEX_M | ||
| #error "CMSIS __CORTEX_M mismatch — verify CH579.h defines __CORTEX_M 0" | ||
| #endif | ||
|
|
||
| #if CORTEX_PRIORITY_BITS != __NVIC_PRIO_BITS | ||
| #error \ | ||
| "CMSIS __NVIC_PRIO_BITS mismatch — verify CH579.h defines __NVIC_PRIO_BITS 2" | ||
| #endif | ||
|
|
||
| #endif /* !defined(_FROM_ASM_) */ | ||
|
|
||
| #endif /* CMPARAMS_H */ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
KEYBOARD_PATH_1is a QMK specific variable, and should not have been included in this lower layer dependency.