-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
[Controller] Added board config for custom controller STeMCell #16287
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
0fc5bf0
Add STeMCell controller board config
Mariappan d23df2b
Use custom ld script
Mariappan 32b375f
Add copyright
8c45bb4
Fix ld script and added some EEPROM hack
Mariappan e97a2ed
Simplify ADDR2PAGE fn
Mariappan 6589ae2
Fix flash addresses
2d879ce
add via keymap for adux
ccebe2a
Fix matrin setPin bug which prevents flash saving
3aabe10
Fix serial default driver
aaae842
Fix board pinmapping and minor nitpiks
Mariappan 03ebd64
revert matrix_init_pin changes
Mariappan f4935c9
Fix formatting issue
Mariappan 27f08d2
Address comments
Mariappan bb90d1b
Enable EEPROM defs for STM32F4 series
Mariappan eb4d4b8
Remove a_dux test keymaps
Mariappan aeea94f
Use v1.0.1 pinout since v1.0.0 is not in use anyway
Mariappan 30f63e6
Fix rebase submodule error
Mariappan f55d4fd
Adapt to new CONVERT_TO framework
Mariappan 85cd819
Remove now unwanted files
megamind4089 77ffaa1
use existing board config files from chibios
megamind4089 8e3b39b
Move flash definitions out of pin defs
megamind4089 0ad07cc
Use newer wearleveling driver for EEPROM emulation
Mariappan 77668f8
minor refactor
megamind4089 92dd21a
Add better defaults and update readme about stemcell converter
megamind4089 c8c2efa
update readme
megamind4089 9c0d4f9
Fix lint error
megamind4089 fd371ae
missing elite-c pins for stemcell (#1)
sadekbaroudi d30a976
Address comments
megamind4089 84bba9c
Move I2C pin defns to configs.h
megamind4089 9bc9b3d
Remove version support
megamind4089 76d0017
Update license header based on PR checklist
megamind4089 f7e8b5c
Adjusted clock to support F401 chips
megamind4089 5764797
Revert back the default UART changes, which does not align with HW ju…
megamind4089 edc7d40
Merge branch 'develop' into stemcell
megamind4089 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,15 @@ | ||
# Copyright 2022 Mega Mind (@megamind4089) | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
# Default pin config of nucleo64_411re has most pins in input pull up mode | ||
|
||
# List of all the board related files. | ||
BOARDSRC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_F411RE/board.c | ||
|
||
# Required include directories | ||
BOARDINC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_F411RE | ||
|
||
|
||
# Shared variables | ||
ALLCSRC += $(BOARDSRC) | ||
ALLINC += $(BOARDINC) |
This file contains 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,8 @@ | ||
// Copyright 2022 Mega Mind (@megamind4089) | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#pragma once | ||
|
||
#include_next "board.h" | ||
|
||
#undef STM32_HSE_BYPASS |
This file contains 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,9 @@ | ||
// Copyright 2022 Mega Mind (@megamind4089) | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#pragma once | ||
megamind4089 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
#define CH_CFG_ST_RESOLUTION 16 | ||
#define CH_CFG_ST_FREQUENCY 10000 | ||
|
||
#include_next <chconf.h> |
This file contains 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,29 @@ | ||
// Copyright 2022 Mega Mind(@megamind4089) | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#pragma once | ||
|
||
#ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP | ||
# define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE | ||
#endif | ||
|
||
/**====================== | ||
** I2C Driver | ||
*========================**/ | ||
|
||
#if !defined(I2C1_SDA_PIN) | ||
# define I2C1_SDA_PIN D0 | ||
#endif | ||
|
||
#if !defined(I2C1_SCL_PIN) | ||
# define I2C1_SCL_PIN D1 | ||
#endif | ||
|
||
/**====================== | ||
** SERIAL Driver | ||
*========================**/ | ||
|
||
#if !defined(SERIAL_USART_DRIVER) | ||
# define SERIAL_USART_DRIVER SD2 | ||
#endif | ||
|
This file contains 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,11 @@ | ||
// Copyright 2022 Mega Mind (@megamind4089) | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#pragma once | ||
|
||
#define PAL_USE_WAIT TRUE | ||
#define PAL_USE_CALLBACKS TRUE | ||
#define HAL_USE_I2C TRUE | ||
#define HAL_USE_SERIAL TRUE | ||
|
||
#include_next <halconf.h> |
This file contains 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,231 @@ | ||
// Copyright 2022 Mega Mind (@megamind4089) | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#ifndef MCUCONF_H | ||
#define MCUCONF_H | ||
|
||
/* | ||
* STM32F4xx drivers configuration. | ||
* The following settings override the default settings present in | ||
* the various device driver implementation headers. | ||
* Note that the settings for each driver only have effect if the whole | ||
* driver is enabled in halconf.h. | ||
* | ||
* IRQ priorities: | ||
* 15...0 Lowest...Highest. | ||
* | ||
* DMA priorities: | ||
* 0...3 Lowest...Highest. | ||
*/ | ||
|
||
#define STM32F4xx_MCUCONF | ||
#define STM32F411_MCUCONF | ||
|
||
/* | ||
* HAL driver system settings. | ||
*/ | ||
#define STM32_NO_INIT FALSE | ||
#define STM32_PVD_ENABLE FALSE | ||
#define STM32_PLS STM32_PLS_LEV0 | ||
#define STM32_BKPRAM_ENABLE FALSE | ||
#define STM32_HSI_ENABLED TRUE | ||
#define STM32_LSI_ENABLED TRUE | ||
#define STM32_HSE_ENABLED TRUE | ||
#define STM32_LSE_ENABLED FALSE | ||
#define STM32_CLOCK48_REQUIRED TRUE | ||
#define STM32_SW STM32_SW_PLL | ||
#define STM32_PLLSRC STM32_PLLSRC_HSE | ||
#define STM32_PLLM_VALUE 8 | ||
#define STM32_PLLN_VALUE 336 | ||
#define STM32_PLLP_VALUE 4 | ||
#define STM32_PLLQ_VALUE 7 | ||
#define STM32_HPRE STM32_HPRE_DIV1 | ||
#define STM32_PPRE1 STM32_PPRE1_DIV2 | ||
#define STM32_PPRE2 STM32_PPRE2_DIV1 | ||
#define STM32_RTCSEL STM32_RTCSEL_LSI | ||
#define STM32_RTCPRE_VALUE 8 | ||
#define STM32_MCO1SEL STM32_MCO1SEL_HSI | ||
#define STM32_MCO1PRE STM32_MCO1PRE_DIV1 | ||
#define STM32_MCO2SEL STM32_MCO2SEL_SYSCLK | ||
#define STM32_MCO2PRE STM32_MCO2PRE_DIV5 | ||
#define STM32_I2SSRC STM32_I2SSRC_CKIN | ||
#define STM32_PLLI2SN_VALUE 192 | ||
#define STM32_PLLI2SR_VALUE 5 | ||
|
||
/* | ||
* IRQ system settings. | ||
*/ | ||
#define STM32_IRQ_EXTI0_PRIORITY 6 | ||
#define STM32_IRQ_EXTI1_PRIORITY 6 | ||
#define STM32_IRQ_EXTI2_PRIORITY 6 | ||
#define STM32_IRQ_EXTI3_PRIORITY 6 | ||
#define STM32_IRQ_EXTI4_PRIORITY 6 | ||
#define STM32_IRQ_EXTI5_9_PRIORITY 6 | ||
#define STM32_IRQ_EXTI10_15_PRIORITY 6 | ||
#define STM32_IRQ_EXTI16_PRIORITY 6 | ||
#define STM32_IRQ_EXTI17_PRIORITY 15 | ||
#define STM32_IRQ_EXTI18_PRIORITY 6 | ||
#define STM32_IRQ_EXTI19_PRIORITY 6 | ||
#define STM32_IRQ_EXTI20_PRIORITY 6 | ||
#define STM32_IRQ_EXTI21_PRIORITY 15 | ||
#define STM32_IRQ_EXTI22_PRIORITY 15 | ||
|
||
#define STM32_IRQ_TIM1_BRK_TIM9_PRIORITY 7 | ||
#define STM32_IRQ_TIM1_UP_TIM10_PRIORITY 7 | ||
#define STM32_IRQ_TIM1_TRGCO_TIM11_PRIORITY 7 | ||
#define STM32_IRQ_TIM1_CC_PRIORITY 7 | ||
#define STM32_IRQ_TIM2_PRIORITY 7 | ||
#define STM32_IRQ_TIM3_PRIORITY 7 | ||
#define STM32_IRQ_TIM4_PRIORITY 7 | ||
#define STM32_IRQ_TIM5_PRIORITY 7 | ||
|
||
#define STM32_IRQ_USART1_PRIORITY 12 | ||
#define STM32_IRQ_USART2_PRIORITY 12 | ||
#define STM32_IRQ_USART6_PRIORITY 12 | ||
|
||
/* | ||
* ADC driver system settings. | ||
*/ | ||
#define STM32_ADC_ADCPRE ADC_CCR_ADCPRE_DIV4 | ||
#define STM32_ADC_USE_ADC1 FALSE | ||
#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(2, 4) | ||
#define STM32_ADC_ADC1_DMA_PRIORITY 2 | ||
#define STM32_ADC_IRQ_PRIORITY 6 | ||
#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 6 | ||
|
||
/* | ||
* GPT driver system settings. | ||
*/ | ||
#define STM32_GPT_USE_TIM1 FALSE | ||
#define STM32_GPT_USE_TIM2 FALSE | ||
#define STM32_GPT_USE_TIM3 FALSE | ||
#define STM32_GPT_USE_TIM4 FALSE | ||
#define STM32_GPT_USE_TIM5 FALSE | ||
#define STM32_GPT_USE_TIM9 FALSE | ||
#define STM32_GPT_USE_TIM10 FALSE | ||
#define STM32_GPT_USE_TIM11 FALSE | ||
|
||
/* | ||
* I2C driver system settings. | ||
*/ | ||
#define STM32_I2C_USE_I2C1 TRUE | ||
#define STM32_I2C_USE_I2C2 FALSE | ||
#define STM32_I2C_USE_I2C3 FALSE | ||
#define STM32_I2C_BUSY_TIMEOUT 50 | ||
#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) | ||
#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) | ||
#define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) | ||
#define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) | ||
#define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2) | ||
#define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) | ||
#define STM32_I2C_I2C1_IRQ_PRIORITY 5 | ||
#define STM32_I2C_I2C2_IRQ_PRIORITY 5 | ||
#define STM32_I2C_I2C3_IRQ_PRIORITY 5 | ||
#define STM32_I2C_I2C1_DMA_PRIORITY 3 | ||
#define STM32_I2C_I2C2_DMA_PRIORITY 3 | ||
#define STM32_I2C_I2C3_DMA_PRIORITY 3 | ||
#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") | ||
|
||
/* | ||
* I2S driver system settings. | ||
*/ | ||
#define STM32_I2S_USE_SPI2 FALSE | ||
#define STM32_I2S_USE_SPI3 FALSE | ||
#define STM32_I2S_SPI2_IRQ_PRIORITY 10 | ||
#define STM32_I2S_SPI3_IRQ_PRIORITY 10 | ||
#define STM32_I2S_SPI2_DMA_PRIORITY 1 | ||
#define STM32_I2S_SPI3_DMA_PRIORITY 1 | ||
#define STM32_I2S_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) | ||
#define STM32_I2S_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) | ||
#define STM32_I2S_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) | ||
#define STM32_I2S_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) | ||
#define STM32_I2S_DMA_ERROR_HOOK(i2sp) osalSysHalt("DMA failure") | ||
|
||
/* | ||
* ICU driver system settings. | ||
*/ | ||
#define STM32_ICU_USE_TIM1 FALSE | ||
#define STM32_ICU_USE_TIM2 FALSE | ||
#define STM32_ICU_USE_TIM3 FALSE | ||
#define STM32_ICU_USE_TIM4 FALSE | ||
#define STM32_ICU_USE_TIM5 FALSE | ||
#define STM32_ICU_USE_TIM9 FALSE | ||
#define STM32_ICU_USE_TIM10 FALSE | ||
#define STM32_ICU_USE_TIM11 FALSE | ||
|
||
/* | ||
* PWM driver system settings. | ||
*/ | ||
#define STM32_PWM_USE_TIM1 FALSE | ||
#define STM32_PWM_USE_TIM2 FALSE | ||
#define STM32_PWM_USE_TIM3 FALSE | ||
#define STM32_PWM_USE_TIM4 FALSE | ||
#define STM32_PWM_USE_TIM5 FALSE | ||
#define STM32_PWM_USE_TIM9 FALSE | ||
#define STM32_PWM_USE_TIM10 FALSE | ||
#define STM32_PWM_USE_TIM11 FALSE | ||
|
||
/* | ||
* SERIAL driver system settings. | ||
*/ | ||
#define STM32_SERIAL_USE_USART1 TRUE | ||
#define STM32_SERIAL_USE_USART2 TRUE | ||
#define STM32_SERIAL_USE_USART6 FALSE | ||
|
||
/* | ||
* SPI driver system settings. | ||
*/ | ||
#define STM32_SPI_USE_SPI1 FALSE | ||
#define STM32_SPI_USE_SPI2 FALSE | ||
#define STM32_SPI_USE_SPI3 FALSE | ||
#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 0) | ||
#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3) | ||
#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) | ||
#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) | ||
#define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) | ||
#define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) | ||
#define STM32_SPI_SPI1_DMA_PRIORITY 1 | ||
#define STM32_SPI_SPI2_DMA_PRIORITY 1 | ||
#define STM32_SPI_SPI3_DMA_PRIORITY 1 | ||
#define STM32_SPI_SPI1_IRQ_PRIORITY 10 | ||
#define STM32_SPI_SPI2_IRQ_PRIORITY 10 | ||
#define STM32_SPI_SPI3_IRQ_PRIORITY 10 | ||
#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") | ||
|
||
/* | ||
* ST driver system settings. | ||
*/ | ||
#define STM32_ST_IRQ_PRIORITY 8 | ||
#define STM32_ST_USE_TIMER 2 | ||
|
||
/* | ||
* UART driver system settings. | ||
*/ | ||
#define STM32_UART_USE_USART1 FALSE | ||
#define STM32_UART_USE_USART2 FALSE | ||
#define STM32_UART_USE_USART6 FALSE | ||
#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) | ||
#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7) | ||
#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) | ||
#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) | ||
#define STM32_UART_USART6_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) | ||
#define STM32_UART_USART6_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7) | ||
#define STM32_UART_USART1_DMA_PRIORITY 0 | ||
#define STM32_UART_USART2_DMA_PRIORITY 0 | ||
#define STM32_UART_USART6_DMA_PRIORITY 0 | ||
#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") | ||
|
||
/* | ||
* USB driver system settings. | ||
*/ | ||
#define STM32_USB_USE_OTG1 TRUE | ||
#define STM32_USB_OTG1_IRQ_PRIORITY 14 | ||
#define STM32_USB_OTG1_RX_FIFO_SIZE 512 | ||
#define STM32_USB_HOST_WAKEUP_DURATION 2 | ||
|
||
/* | ||
* WDG driver system settings. | ||
*/ | ||
#define STM32_WDG_USE_IWDG FALSE | ||
|
||
#endif /* MCUCONF_H */ |
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.
I missed this changes with my last rebase.
Also i find see other checks for mcus below as redundant, since all of these mcus define MCU_SERIES as STM32F4xx
_STM32F401xC %_STM32F401xE %_STM32F405xG %_STM32F411xE
Shall i change remove the above checks and keep only
STM32F4xx_%
?Or should i use my ld script value to enable EEPROM_DRIVER
I may be missing something here. Please advise