Merge pull request #3341 from opentx/projectkk2glider/horus_reboot_and_external_module
Projectkk2glider/horus reboot and external module
This commit is contained in:
@@ -18,6 +18,7 @@ option(AUTOSOURCE "Automatic source detection in menus" ON)
|
||||
option(AUTOSWITCH "Automatic switch detection in menus" ON)
|
||||
option(JITTER_MEASURE "Enable ADC jitter measurement" OFF)
|
||||
option(JITTER_FILTER "Enable ADC jitter filtering" ON)
|
||||
option(WATCHDOG_DISABLED "Disable hardware Watchdog on Horus" ON)
|
||||
|
||||
enable_language(ASM)
|
||||
set(OPT s)
|
||||
@@ -106,6 +107,7 @@ if(PCB STREQUAL HORUS)
|
||||
pwr_driver.cpp
|
||||
sdram_driver.c
|
||||
led_driver.cpp
|
||||
startup_stm32f40_41xxx.s
|
||||
)
|
||||
set(STM32LIB_SRC
|
||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_sdio.c
|
||||
@@ -134,7 +136,12 @@ elseif(PCB STREQUAL TARANIS)
|
||||
set(FLAVOUR taranis-x9e)
|
||||
add_definitions(-DSTM32F40_41xxx -DREVPLUS -DREV9E)
|
||||
add_definitions(-DEEPROM_VARIANT=32768)
|
||||
set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} top_lcd_driver.cpp bluetooth_driver.cpp)
|
||||
set(FIRMWARE_TARGET_SRC
|
||||
${FIRMWARE_TARGET_SRC}
|
||||
top_lcd_driver.cpp
|
||||
bluetooth_driver.cpp
|
||||
startup_stm32f40_41xxx.s
|
||||
)
|
||||
if(STICKS STREQUAL HORUS)
|
||||
add_definitions(-DHORUS_STICKS)
|
||||
endif()
|
||||
@@ -337,7 +344,6 @@ if(CPU_TYPE STREQUAL STM32F4)
|
||||
add_definitions(-DSTM32F4)
|
||||
set(STM32LIB_SRC
|
||||
${STM32LIB_SRC}
|
||||
CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc_ride7/startup_stm32f40_41xxx.s
|
||||
STM32F4xx_StdPeriph_Driver/src/misc.c
|
||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c
|
||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dbgmcu.c
|
||||
@@ -779,6 +785,10 @@ if(JITTER_FILTER)
|
||||
add_definitions(-DJITTER_FILTER)
|
||||
endif()
|
||||
|
||||
if(WATCHDOG_DISABLED)
|
||||
add_definitions(-DWATCHDOG_DISABLED)
|
||||
endif()
|
||||
|
||||
if(SDCARD)
|
||||
add_definitions(-DSDCARD)
|
||||
include_directories(${FATFS_DIR} ${FATFS_DIR}/option)
|
||||
|
||||
+43
-3
@@ -272,7 +272,13 @@ int cliMemoryInfo(const char ** argv)
|
||||
int cliReboot(const char ** argv)
|
||||
{
|
||||
#if !defined(SIMU)
|
||||
NVIC_SystemReset();
|
||||
if (!strcmp(argv[1], "wdt")) {
|
||||
// do a user requested watchdog test by pausing mixer thread
|
||||
pausePulses();
|
||||
}
|
||||
else {
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@@ -385,12 +391,12 @@ int cliDisplay(const char ** argv)
|
||||
}
|
||||
else if (!strcmp(argv[1], "adc")) {
|
||||
for (int i=0; i<NUMBER_ANALOG; i++) {
|
||||
serialPrint("adc[%d] = %04X", i, adcValues[i]);
|
||||
serialPrint("adc[%d] = %04X", i, (int)adcValues[i]);
|
||||
}
|
||||
}
|
||||
else if (!strcmp(argv[1], "outputs")) {
|
||||
for (int i=0; i<NUM_CHNOUT; i++) {
|
||||
serialPrint("outputs[%d] = %04X", i, channelOutputs[i]);
|
||||
serialPrint("outputs[%d] = %04d", i, (int)channelOutputs[i]);
|
||||
}
|
||||
}
|
||||
else if (!strcmp(argv[1], "rtc")) {
|
||||
@@ -444,6 +450,40 @@ int cliDisplay(const char ** argv)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else if (!strcmp(argv[1], "tim")) {
|
||||
int timerNumber;
|
||||
if (toInt(argv, 2, &timerNumber) > 0) {
|
||||
TIM_TypeDef * tim = TIM1;
|
||||
switch (timerNumber) {
|
||||
case 1:
|
||||
tim = TIM1;
|
||||
break;
|
||||
case 2:
|
||||
tim = TIM2;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
serialPrint("TIM%d", timerNumber);
|
||||
serialPrint(" CR1 0x%x", tim->CR1);
|
||||
serialPrint(" CR2 0x%x", tim->CR2);
|
||||
serialPrint(" DIER 0x%x", tim->DIER);
|
||||
serialPrint(" SR 0x%x", tim->SR);
|
||||
serialPrint(" EGR 0x%x", tim->EGR);
|
||||
serialPrint(" CCMR1 0x%x", tim->CCMR1);
|
||||
serialPrint(" CCMR2 0x%x", tim->CCMR2);
|
||||
|
||||
serialPrint(" CNT 0x%x", tim->CNT);
|
||||
serialPrint(" ARR 0x%x", tim->ARR);
|
||||
serialPrint(" PSC 0x%x", tim->PSC);
|
||||
|
||||
serialPrint(" CCER 0x%x", tim->CCER);
|
||||
serialPrint(" CCR1 0x%x", tim->CCR1);
|
||||
serialPrint(" CCR2 0x%x", tim->CCR2);
|
||||
serialPrint(" CCR3 0x%x", tim->CCR3);
|
||||
serialPrint(" CCR4 0x%x", tim->CCR4);
|
||||
}
|
||||
}
|
||||
else if (toLongLongInt(argv, 1, &address) > 0) {
|
||||
int size = 256;
|
||||
if (toInt(argv, 2, &size) >= 0) {
|
||||
|
||||
@@ -54,6 +54,7 @@ uint8_t serial2TracesEnabled();
|
||||
}
|
||||
#endif
|
||||
|
||||
#define TRACE_PING(x) do { debugPrintf(x); } while(0)
|
||||
#define TRACE(...) do { debugPrintf(__VA_ARGS__); debugPrintf("\r\n"); } while(0)
|
||||
#define DUMP(data, size) dump(data, size)
|
||||
#define TRACE_DEBUG(...) debugPrintf("-D- " __VA_ARGS__)
|
||||
|
||||
@@ -111,9 +111,32 @@ extern "C" void TIM8_TRG_COM_TIM14_IRQHandler()
|
||||
|
||||
void boardInit()
|
||||
{
|
||||
RCC_AHB1PeriphClockCmd(PWR_RCC_AHB1Periph | LED_RCC_AHB1Periph | LCD_RCC_AHB1Periph | AUDIO_RCC_AHB1Periph | KEYS_RCC_AHB1Periph_GPIO | ADC_RCC_AHB1Periph | SERIAL_RCC_AHB1Periph | TELEMETRY_RCC_AHB1Periph | AUDIO_RCC_AHB1Periph | HAPTIC_RCC_AHB1Periph | INTMODULE_RCC_AHB1Periph | EXTMODULE_RCC_AHB1Periph, ENABLE);
|
||||
RCC_APB1PeriphClockCmd(INTERRUPT_5MS_APB1Periph | TIMER_2MHz_APB1Periph | AUDIO_RCC_APB1Periph | SERIAL_RCC_APB1Periph | TELEMETRY_RCC_APB1Periph | AUDIO_RCC_APB1Periph, ENABLE);
|
||||
RCC_APB2PeriphClockCmd(LCD_RCC_APB2Periph | ADC_RCC_APB2Periph | HAPTIC_RCC_APB2Periph | INTMODULE_RCC_APB2Periph | EXTMODULE_RCC_APB2Periph, ENABLE);
|
||||
RCC_AHB1PeriphClockCmd(PWR_RCC_AHB1Periph |
|
||||
LED_RCC_AHB1Periph |
|
||||
LCD_RCC_AHB1Periph |
|
||||
AUDIO_RCC_AHB1Periph |
|
||||
KEYS_RCC_AHB1Periph_GPIO |
|
||||
ADC_RCC_AHB1Periph |
|
||||
SERIAL_RCC_AHB1Periph |
|
||||
TELEMETRY_RCC_AHB1Periph |
|
||||
AUDIO_RCC_AHB1Periph |
|
||||
HAPTIC_RCC_AHB1Periph |
|
||||
INTMODULE_RCC_AHB1Periph |
|
||||
EXTMODULE_RCC_AHB1Periph,
|
||||
ENABLE);
|
||||
RCC_APB1PeriphClockCmd(INTERRUPT_5MS_APB1Periph |
|
||||
TIMER_2MHz_APB1Periph |
|
||||
AUDIO_RCC_APB1Periph |
|
||||
SERIAL_RCC_APB1Periph |
|
||||
TELEMETRY_RCC_APB1Periph |
|
||||
AUDIO_RCC_APB1Periph |
|
||||
EXTMODULE_RCC_APB1Periph,
|
||||
ENABLE);
|
||||
RCC_APB2PeriphClockCmd(LCD_RCC_APB2Periph |
|
||||
ADC_RCC_APB2Periph |
|
||||
HAPTIC_RCC_APB2Periph |
|
||||
INTMODULE_RCC_APB2Periph |
|
||||
EXTMODULE_RCC_APB2Periph, ENABLE);
|
||||
|
||||
pwrInit();
|
||||
delaysInit();
|
||||
|
||||
@@ -65,8 +65,9 @@ extern "C" {
|
||||
#define BOOTLOADER_SIZE 0x8000
|
||||
#define FIRMWARE_ADDRESS 0x08000000
|
||||
|
||||
#define PERI1_FREQUENCY 45000000
|
||||
#define PERI2_FREQUENCY 90000000
|
||||
// HSI is at 168Mhz (over-drive is not enabled!)
|
||||
#define PERI1_FREQUENCY 42000000
|
||||
#define PERI2_FREQUENCY 84000000
|
||||
#define TIMER_MULT_APB1 2
|
||||
#define TIMER_MULT_APB2 2
|
||||
|
||||
@@ -202,10 +203,16 @@ void checkRotaryEncoder(void);
|
||||
#if !defined(SIMU)
|
||||
#define wdt_disable()
|
||||
void watchdogInit(unsigned int duration);
|
||||
#define wdt_enable(x) // watchdogInit(1500)
|
||||
#define wdt_reset() // IWDG->KR = 0xAAAA
|
||||
#define WAS_RESET_BY_WATCHDOG() (RCC->CSR & (RCC_CSR_WDGRSTF | RCC_CSR_WWDGRSTF))
|
||||
#define WAS_RESET_BY_SOFTWARE() (RCC->CSR & RCC_CSR_SFTRSTF)
|
||||
#if defined(WATCHDOG_DISABLED)
|
||||
#define wdt_enable(x)
|
||||
#define wdt_reset()
|
||||
#else
|
||||
#define wdt_enable(x) watchdogInit(1500)
|
||||
#define wdt_reset() IWDG->KR = 0xAAAA
|
||||
#endif
|
||||
#define WAS_RESET_BY_WATCHDOG() (RCC->CSR & (RCC_CSR_WDGRSTF | RCC_CSR_WWDGRSTF))
|
||||
#define WAS_RESET_BY_SOFTWARE() (RCC->CSR & RCC_CSR_SFTRSTF)
|
||||
#define WAS_RESET_BY_WATCHDOG_OR_SOFTWARE() (RCC->CSR & (RCC_CSR_WDGRSTF | RCC_CSR_WWDGRSTF | RCC_CSR_SFTRSTF))
|
||||
#endif
|
||||
|
||||
// ADC driver
|
||||
@@ -247,6 +254,7 @@ void pwrInit(void);
|
||||
uint32_t pwrCheck(void);
|
||||
void pwrOn(void);
|
||||
void pwrOff(void);
|
||||
void pwrResetHandler(void);
|
||||
uint32_t pwrPressed(void);
|
||||
uint32_t pwrPressedDuration(void);
|
||||
#define UNEXPECTED_SHUTDOWN() (false) // (g_eeGeneral.unexpectedShutdown)
|
||||
|
||||
@@ -282,6 +282,7 @@
|
||||
#define INTMODULE_DMA_CHANNEL DMA_Channel_4
|
||||
#define INTMODULE_TIMER TIM1
|
||||
#define INTMODULE_TIMER_IRQn TIM1_CC_IRQn
|
||||
#define INTMODULE_TIMER_FREQ (PERI2_FREQUENCY * TIMER_MULT_APB2)
|
||||
|
||||
// External Module
|
||||
#define EXTMODULE_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB)
|
||||
@@ -295,7 +296,8 @@
|
||||
#define EXTMODULE_TIMER TIM2
|
||||
#define EXTMODULE_PPM_GPIO_AF GPIO_AF_TIM2
|
||||
#define EXTMODULE_PPM_GPIO_PinSource GPIO_PinSource15
|
||||
// #define EXTMODULE_TIMER_IRQn TIM2_CC_IRQn
|
||||
#define EXTMODULE_TIMER_IRQn TIM2_IRQn
|
||||
#define EXTMODULE_TIMER_FREQ (PERI1_FREQUENCY * TIMER_MULT_APB1)
|
||||
|
||||
// Trainer Port
|
||||
#define TRAINER_RCC_AHB1Periph (RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOC)
|
||||
|
||||
@@ -89,12 +89,9 @@ void disable_ppm(uint32_t port)
|
||||
|
||||
void set_external_ppm_parameters(uint32_t idleTime, uint32_t delay, uint32_t positive)
|
||||
{
|
||||
#if 0
|
||||
EXTMODULE_TIMER->CCR2 = idleTime;
|
||||
EXTMODULE_TIMER->CCR1 = delay;
|
||||
// we are using complementary output so logic has to be reversed here
|
||||
EXTMODULE_TIMER->CCER = TIM_CCER_CC1NE | (positive ? 0 : TIM_CCER_CC1NP);
|
||||
#endif
|
||||
EXTMODULE_TIMER->CCER = TIM_CCER_CC1E | (positive ? 0 : TIM_CCER_CC1P);
|
||||
}
|
||||
|
||||
void init_no_pulses(uint32_t port)
|
||||
@@ -143,7 +140,7 @@ static void intmoduleNoneStart()
|
||||
INTMODULE_TIMER->CR1 &= ~TIM_CR1_CEN ;
|
||||
INTMODULE_TIMER->ARR = 36000 ; // 18mS
|
||||
INTMODULE_TIMER->CCR2 = 32000 ; // Update time
|
||||
INTMODULE_TIMER->PSC = (PERI2_FREQUENCY * TIMER_MULT_APB2) / 2000000 - 1 ; // 0.5uS from 30MHz
|
||||
INTMODULE_TIMER->PSC = INTMODULE_TIMER_FREQ / 2000000 - 1 ; // 0.5uS (2Mhz)
|
||||
|
||||
INTMODULE_TIMER->CCER = TIM_CCER_CC3E ;
|
||||
|
||||
@@ -212,11 +209,11 @@ extern "C" void TIM1_CC_IRQHandler()
|
||||
|
||||
static void extmoduleNoneStart()
|
||||
{
|
||||
#if 0
|
||||
if (!IS_TRAINER_EXTERNAL_MODULE()) {
|
||||
EXTERNAL_MODULE_OFF();
|
||||
}
|
||||
|
||||
GPIO_PinAFConfig(EXTMODULE_PPM_GPIO, EXTMODULE_PPM_GPIO_PinSource, 0); // TODO : check if needed
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = EXTMODULE_PPM_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT ;
|
||||
@@ -226,35 +223,39 @@ static void extmoduleNoneStart()
|
||||
GPIO_Init(EXTMODULE_PPM_GPIO, &GPIO_InitStructure);
|
||||
GPIO_SetBits(EXTMODULE_PPM_GPIO, EXTMODULE_PPM_GPIO_PIN) ; // Set high
|
||||
|
||||
EXTMODULE_TIMER->CR1 &= ~TIM_CR1_CEN ;
|
||||
EXTMODULE_TIMER->ARR = 36000 ; // 18mS
|
||||
EXTMODULE_TIMER->CCR2 = 32000 ; // Update time
|
||||
EXTMODULE_TIMER->PSC = (PERI2_FREQUENCY * TIMER_MULT_APB2) / 2000000 - 1 ; // 0.5uS from 30MHz
|
||||
TIM_DeInit(EXTMODULE_TIMER);
|
||||
|
||||
EXTMODULE_TIMER->CCMR2 = 0 ;
|
||||
EXTMODULE_TIMER->EGR = 1 ; // Restart
|
||||
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
|
||||
TIM_TimeBaseStructure.TIM_Prescaler = EXTMODULE_TIMER_FREQ / 2000000 - 1; // 0.5uS (2Mhz)
|
||||
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
|
||||
TIM_TimeBaseStructure.TIM_Period = 36000; // 18mS
|
||||
TIM_TimeBaseStructure.TIM_ClockDivision = 0;
|
||||
TIM_TimeBaseStructure.TIM_RepetitionCounter = 0;
|
||||
TIM_TimeBaseInit(EXTMODULE_TIMER, &TIM_TimeBaseStructure);
|
||||
|
||||
EXTMODULE_TIMER->CCMR2 = TIM_CCMR2_OC3M_1 | TIM_CCMR2_OC3M_0 ; // Toggle CC1 o/p
|
||||
EXTMODULE_TIMER->SR &= ~TIM_SR_CC2IF ; // Clear flag
|
||||
EXTMODULE_TIMER->DIER |= TIM_DIER_CC2IE ; // Enable this interrupt
|
||||
EXTMODULE_TIMER->CR1 |= TIM_CR1_CEN ;
|
||||
// set CC2 compare to fire slightly before the Update
|
||||
TIM_SetCompare2(EXTMODULE_TIMER, 32000); // 16ms
|
||||
|
||||
// enable CC2 interrupt
|
||||
TIM_ClearFlag(EXTMODULE_TIMER, TIM_FLAG_CC2);
|
||||
TIM_ITConfig(EXTMODULE_TIMER, TIM_IT_CC2, ENABLE);
|
||||
|
||||
// start timer
|
||||
TIM_Cmd(EXTMODULE_TIMER, ENABLE);
|
||||
|
||||
// enable interrupt and set it's priority
|
||||
NVIC_EnableIRQ(EXTMODULE_TIMER_IRQn) ;
|
||||
NVIC_SetPriority(EXTMODULE_TIMER_IRQn, 7);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void extmoduleNoneStop()
|
||||
{
|
||||
#if 0
|
||||
NVIC_DisableIRQ(EXTMODULE_TIMER_IRQn) ;
|
||||
EXTMODULE_TIMER->DIER &= ~TIM_DIER_CC2IE ;
|
||||
EXTMODULE_TIMER->CR1 &= ~TIM_CR1_CEN ;
|
||||
#endif
|
||||
TIM_DeInit(EXTMODULE_TIMER);
|
||||
}
|
||||
|
||||
static void extmoduleCrossfireStart()
|
||||
{
|
||||
#if 0
|
||||
EXTERNAL_MODULE_ON();
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
@@ -269,7 +270,7 @@ static void extmoduleCrossfireStart()
|
||||
EXTMODULE_TIMER->CR1 &= ~TIM_CR1_CEN ;
|
||||
EXTMODULE_TIMER->ARR = 5000 ; // 2.5mS
|
||||
EXTMODULE_TIMER->CCR2 = 32000 ; // Update time
|
||||
EXTMODULE_TIMER->PSC = (PERI2_FREQUENCY * TIMER_MULT_APB2) / 2000000 - 1 ; // 0.5uS from 30MHz
|
||||
EXTMODULE_TIMER->PSC = EXTMODULE_TIMER_FREQ / 2000000 - 1 ; // 0.5uS (2Mhz)
|
||||
|
||||
EXTMODULE_TIMER->CCMR2 = 0 ;
|
||||
EXTMODULE_TIMER->EGR = 1 ; // Restart
|
||||
@@ -280,12 +281,10 @@ static void extmoduleCrossfireStart()
|
||||
EXTMODULE_TIMER->CR1 |= TIM_CR1_CEN ;
|
||||
NVIC_EnableIRQ(EXTMODULE_TIMER_IRQn) ;
|
||||
NVIC_SetPriority(EXTMODULE_TIMER_IRQn, 7);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void extmoduleCrossfireStop()
|
||||
{
|
||||
#if 0
|
||||
NVIC_DisableIRQ(EXTMODULE_TIMER_IRQn) ;
|
||||
EXTMODULE_TIMER->DIER &= ~TIM_DIER_CC2IE ;
|
||||
EXTMODULE_TIMER->CR1 &= ~TIM_CR1_CEN ;
|
||||
@@ -293,7 +292,6 @@ static void extmoduleCrossfireStop()
|
||||
if (!IS_TRAINER_EXTERNAL_MODULE()) {
|
||||
EXTERNAL_MODULE_OFF();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void intmodulePxxStart()
|
||||
@@ -373,7 +371,7 @@ void intmodulePxxStart()
|
||||
INTMODULE_TIMER->CR1 &= ~TIM_CR1_CEN ;
|
||||
INTMODULE_TIMER->ARR = 18000 ; // 9mS
|
||||
INTMODULE_TIMER->CCR2 = 15000 ; // Update time
|
||||
INTMODULE_TIMER->PSC = (PERI2_FREQUENCY * TIMER_MULT_APB2) / 2000000 - 1 ; // 0.5uS from 30MHz
|
||||
INTMODULE_TIMER->PSC = INTMODULE_TIMER_FREQ / 2000000 - 1 ; // 0.5uS (2Mhz)
|
||||
INTMODULE_TIMER->CCER = TIM_CCER_CC3E ;
|
||||
INTMODULE_TIMER->CCER = TIM_CCER_CC3E ;
|
||||
|
||||
@@ -390,13 +388,11 @@ void intmodulePxxStart()
|
||||
|
||||
static void intmodulePxxStop()
|
||||
{
|
||||
|
||||
INTERNAL_MODULE_OFF();
|
||||
}
|
||||
|
||||
void extmodulePxxStart()
|
||||
{
|
||||
#if 0
|
||||
EXTERNAL_MODULE_ON();
|
||||
|
||||
setupPulsesPXX(EXTERNAL_MODULE);
|
||||
@@ -413,7 +409,7 @@ void extmodulePxxStart()
|
||||
EXTMODULE_TIMER->CR1 &= ~TIM_CR1_CEN ;
|
||||
EXTMODULE_TIMER->ARR = 18000 ; // 9mS
|
||||
EXTMODULE_TIMER->CCR2 = 15000 ; // Update time
|
||||
EXTMODULE_TIMER->PSC = (PERI2_FREQUENCY * TIMER_MULT_APB2) / 2000000 - 1 ; // 0.5uS from 30MHz
|
||||
EXTMODULE_TIMER->PSC = EXTMODULE_TIMER_FREQ / 2000000 - 1 ; // 0.5uS (2Mhz)
|
||||
EXTMODULE_TIMER->CCER = TIM_CCER_CC1NE ;
|
||||
EXTMODULE_TIMER->CR2 = TIM_CR2_OIS1 ; // O/P idle high
|
||||
EXTMODULE_TIMER->BDTR = TIM_BDTR_MOE ; // Enable outputs
|
||||
@@ -424,16 +420,16 @@ void extmodulePxxStart()
|
||||
EXTMODULE_TIMER->DIER |= TIM_DIER_CC1DE ; // Enable DMA on CC1 match
|
||||
EXTMODULE_TIMER->DCR = 13;
|
||||
|
||||
// Enable the DMA channel here, DMA2 stream 2, channel 7
|
||||
DMA2_Stream2->CR &= ~DMA_SxCR_EN ; // Disable DMA
|
||||
DMA2->LIFCR = DMA_LIFCR_CTCIF2 | DMA_LIFCR_CHTIF2 | DMA_LIFCR_CTEIF2 | DMA_LIFCR_CDMEIF2 | DMA_LIFCR_CFEIF2 ; // Write ones to clear bits
|
||||
DMA2_Stream2->CR = DMA_SxCR_CHSEL_0 | DMA_SxCR_CHSEL_1 | DMA_SxCR_CHSEL_2 | DMA_SxCR_PL_0 | DMA_SxCR_MSIZE_0
|
||||
// Enable the DMA channel here, DMA1 stream 5, channel 3 (TIM2_CH1)
|
||||
DMA1_Stream5->CR &= ~DMA_SxCR_EN ; // Disable DMA
|
||||
DMA1->HIFCR = DMA_HIFCR_CTCIF5 | DMA_HIFCR_CHTIF5 | DMA_HIFCR_CTEIF5 | DMA_HIFCR_CDMEIF5 | DMA_HIFCR_CFEIF5 ; // Write ones to clear bits
|
||||
DMA1_Stream5->CR = DMA_SxCR_CHSEL_0 | DMA_SxCR_CHSEL_1 | DMA_SxCR_PL_0 | DMA_SxCR_MSIZE_0
|
||||
| DMA_SxCR_PSIZE_0 | DMA_SxCR_MINC | DMA_SxCR_DIR_0 | DMA_SxCR_PFCTRL ;
|
||||
DMA2_Stream2->PAR = CONVERT_PTR_UINT(&EXTMODULE_TIMER->DMAR);
|
||||
DMA2_Stream2->M0AR = CONVERT_PTR_UINT(&modulePulsesData[EXTERNAL_MODULE].pxx.pulses[1]);
|
||||
// DMA2_Stream2->FCR = 0x05 ; //DMA_SxFCR_DMDIS | DMA_SxFCR_FTH_0 ;
|
||||
// DMA2_Stream2->NDTR = 100 ;
|
||||
DMA2_Stream2->CR |= DMA_SxCR_EN ; // Enable DMA
|
||||
DMA1_Stream5->PAR = CONVERT_PTR_UINT(&EXTMODULE_TIMER->DMAR);
|
||||
DMA1_Stream5->M0AR = CONVERT_PTR_UINT(&modulePulsesData[EXTERNAL_MODULE].pxx.pulses[1]);
|
||||
// DMA1_Stream5->FCR = 0x05 ; //DMA_SxFCR_DMDIS | DMA_SxFCR_FTH_0 ;
|
||||
// DMA1_Stream5->NDTR = 100 ;
|
||||
DMA1_Stream5->CR |= DMA_SxCR_EN ; // Enable DMA
|
||||
|
||||
EXTMODULE_TIMER->CCMR1 = TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_0 ; // Toggle CC1 o/p
|
||||
EXTMODULE_TIMER->SR &= ~TIM_SR_CC2IF ; // Clear flag
|
||||
@@ -441,27 +437,22 @@ void extmodulePxxStart()
|
||||
EXTMODULE_TIMER->CR1 |= TIM_CR1_CEN ;
|
||||
NVIC_EnableIRQ(EXTMODULE_TIMER_IRQn);
|
||||
NVIC_SetPriority(EXTMODULE_TIMER_IRQn, 7);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void extmodulePxxStop()
|
||||
{
|
||||
#if 0
|
||||
DMA2_Stream2->CR &= ~DMA_SxCR_EN ; // Disable DMA
|
||||
DMA1_Stream5->CR &= ~DMA_SxCR_EN ; // Disable DMA
|
||||
NVIC_DisableIRQ(EXTMODULE_TIMER_IRQn) ;
|
||||
EXTMODULE_TIMER->DIER &= ~TIM_DIER_CC2IE ;
|
||||
EXTMODULE_TIMER->CR1 &= ~TIM_CR1_CEN ;
|
||||
if (!IS_TRAINER_EXTERNAL_MODULE()) {
|
||||
EXTERNAL_MODULE_OFF();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(DSM2)
|
||||
static void extmoduleDsm2Start()
|
||||
{
|
||||
#if 0
|
||||
|
||||
EXTERNAL_MODULE_ON();
|
||||
|
||||
setupPulsesDSM2(EXTERNAL_MODULE);
|
||||
@@ -478,7 +469,7 @@ static void extmoduleDsm2Start()
|
||||
EXTMODULE_TIMER->CR1 &= ~TIM_CR1_CEN ;
|
||||
EXTMODULE_TIMER->ARR = 44000 ; // 22mS
|
||||
EXTMODULE_TIMER->CCR2 = 40000 ; // Update time
|
||||
EXTMODULE_TIMER->PSC = (PERI2_FREQUENCY * TIMER_MULT_APB2) / 2000000 - 1 ; // 0.5uS from 30MHz
|
||||
EXTMODULE_TIMER->PSC = EXTMODULE_TIMER_FREQ / 2000000 - 1 ; // 0.5uS (2Mhz)
|
||||
EXTMODULE_TIMER->CCER = TIM_CCER_CC1NE | TIM_CCER_CC1NP ;
|
||||
EXTMODULE_TIMER->CR2 = TIM_CR2_OIS1 ; // O/P idle high
|
||||
EXTMODULE_TIMER->BDTR = TIM_BDTR_MOE ; // Enable outputs
|
||||
@@ -489,16 +480,16 @@ static void extmoduleDsm2Start()
|
||||
EXTMODULE_TIMER->DIER |= TIM_DIER_CC1DE ; // Enable DMA on CC1 match
|
||||
EXTMODULE_TIMER->DCR = 13 ; // DMA to CC1
|
||||
|
||||
// Enable the DMA channel here, DMA2 stream 2, channel 7
|
||||
DMA2_Stream2->CR &= ~DMA_SxCR_EN ; // Disable DMA
|
||||
DMA2->LIFCR = DMA_LIFCR_CTCIF2 | DMA_LIFCR_CHTIF2 | DMA_LIFCR_CTEIF2 | DMA_LIFCR_CDMEIF2 | DMA_LIFCR_CFEIF2 ; // Write ones to clear bits
|
||||
DMA2_Stream2->CR = DMA_SxCR_CHSEL_0 | DMA_SxCR_CHSEL_1 | DMA_SxCR_CHSEL_2 | DMA_SxCR_PL_0 | DMA_SxCR_MSIZE_0
|
||||
// Enable the DMA channel here, DMA1 stream 5, channel 3 (TIM2_CH1)
|
||||
DMA1_Stream5->CR &= ~DMA_SxCR_EN ; // Disable DMA
|
||||
DMA1->HIFCR = DMA_HIFCR_CTCIF5 | DMA_HIFCR_CHTIF5 | DMA_HIFCR_CTEIF5 | DMA_HIFCR_CDMEIF5 | DMA_HIFCR_CFEIF5 ; // Write ones to clear bits
|
||||
DMA1_Stream5->CR = DMA_SxCR_CHSEL_0 | DMA_SxCR_CHSEL_1 | DMA_SxCR_PL_0 | DMA_SxCR_MSIZE_0
|
||||
| DMA_SxCR_PSIZE_0 | DMA_SxCR_MINC | DMA_SxCR_DIR_0 | DMA_SxCR_PFCTRL ;
|
||||
DMA2_Stream2->PAR = CONVERT_PTR_UINT(&EXTMODULE_TIMER->DMAR);
|
||||
DMA2_Stream2->M0AR = CONVERT_PTR_UINT(&modulePulsesData[EXTERNAL_MODULE].dsm2.pulses[1]);
|
||||
// DMA2_Stream2->FCR = 0x05 ; //DMA_SxFCR_DMDIS | DMA_SxFCR_FTH_0 ;
|
||||
// DMA2_Stream2->NDTR = 100 ;
|
||||
DMA2_Stream2->CR |= DMA_SxCR_EN ; // Enable DMA
|
||||
DMA1_Stream5->PAR = CONVERT_PTR_UINT(&EXTMODULE_TIMER->DMAR);
|
||||
DMA1_Stream5->M0AR = CONVERT_PTR_UINT(&modulePulsesData[EXTERNAL_MODULE].dsm2.pulses[1]);
|
||||
// DMA1_Stream5->FCR = 0x05 ; //DMA_SxFCR_DMDIS | DMA_SxFCR_FTH_0 ;
|
||||
// DMA1_Stream5->NDTR = 100 ;
|
||||
DMA1_Stream5->CR |= DMA_SxCR_EN ; // Enable DMA
|
||||
|
||||
EXTMODULE_TIMER->CCMR1 = TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_0 ; // Toggle CC1 o/p
|
||||
EXTMODULE_TIMER->SR &= ~TIM_SR_CC2IF ; // Clear flag
|
||||
@@ -506,32 +497,45 @@ static void extmoduleDsm2Start()
|
||||
EXTMODULE_TIMER->CR1 |= TIM_CR1_CEN ;
|
||||
NVIC_EnableIRQ(EXTMODULE_TIMER_IRQn) ;
|
||||
NVIC_SetPriority(EXTMODULE_TIMER_IRQn, 7);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void extmoduleDsm2Stop()
|
||||
{
|
||||
#if 0
|
||||
DMA2_Stream2->CR &= ~DMA_SxCR_EN ; // Disable DMA
|
||||
DMA1_Stream5->CR &= ~DMA_SxCR_EN ; // Disable DMA
|
||||
NVIC_DisableIRQ(EXTMODULE_TIMER_IRQn) ;
|
||||
EXTMODULE_TIMER->DIER &= ~TIM_DIER_CC2IE ;
|
||||
EXTMODULE_TIMER->CR1 &= ~TIM_CR1_CEN ;
|
||||
if (!IS_TRAINER_EXTERNAL_MODULE()) {
|
||||
EXTERNAL_MODULE_OFF();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
static void extmodulePpmStart()
|
||||
{
|
||||
#if 0
|
||||
EXTERNAL_MODULE_ON();
|
||||
|
||||
configure_pins( EXTMODULE_PPM_GPIO_PIN, PIN_PERIPHERAL | PIN_PORTA | PIN_PER_3 | PIN_OS25 | PIN_PUSHPULL ) ;
|
||||
GPIO_PinAFConfig(EXTMODULE_PPM_GPIO, EXTMODULE_PPM_GPIO_PinSource, EXTMODULE_PPM_GPIO_AF);
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = EXTMODULE_PPM_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
||||
GPIO_Init(EXTMODULE_PPM_GPIO, &GPIO_InitStructure);
|
||||
|
||||
// Timer1
|
||||
modulePulsesData[EXTERNAL_MODULE].ppm.ptr = modulePulsesData[EXTERNAL_MODULE].ppm.pulses;
|
||||
// PPM generation principle:
|
||||
//
|
||||
// Hardware timer in PWM mode is used for PPM generation
|
||||
// Output is OFF if CNT<CCR1(delay) and ON if bigger
|
||||
// CCR1 register defines duration of pulse length and is constant
|
||||
// AAR register defines duration of each pulse, it is
|
||||
// updated after every pulse in Update interrupt handler.
|
||||
// CCR2 register defines duration of no pulses (time between two pulse trains)
|
||||
// it is calculated every round to have PPM period constant.
|
||||
// CC2 interrupt is then used to setup new PPM values for the
|
||||
// next PPM pulses train.
|
||||
// stop timer
|
||||
EXTMODULE_TIMER->CR1 &= ~TIM_CR1_CEN ;
|
||||
|
||||
// setupPulsesPPM() is also configuring registers,
|
||||
@@ -539,83 +543,90 @@ static void extmodulePpmStart()
|
||||
setupPulsesPPM(EXTERNAL_MODULE) ;
|
||||
|
||||
EXTMODULE_TIMER->ARR = *modulePulsesData[EXTERNAL_MODULE].ppm.ptr++ ;
|
||||
EXTMODULE_TIMER->PSC = (PERI2_FREQUENCY * TIMER_MULT_APB2) / 2000000 - 1 ; // 0.5uS from 30MHz
|
||||
EXTMODULE_TIMER->PSC = EXTMODULE_TIMER_FREQ / 2000000 - 1 ; // 0.5uS (2Mhz)
|
||||
|
||||
// CH1 PWM mode 1, CH1 out is OFF if CNT<CCR1(delay) and ON if bigger (up to AAR,which is pulse length)
|
||||
EXTMODULE_TIMER->CCMR1 = TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC2PE; // PWM mode 1
|
||||
EXTMODULE_TIMER->BDTR = TIM_BDTR_MOE ;
|
||||
|
||||
// Reloads register vales now
|
||||
EXTMODULE_TIMER->EGR = 1 ;
|
||||
|
||||
// Update DMA request enabled. WHY?????
|
||||
EXTMODULE_TIMER->DIER = TIM_DIER_UDE ;
|
||||
|
||||
// clear interrupt flags and enable Update and
|
||||
// CC2 interrupts (this one is enabled now to trigger pulse setup)
|
||||
EXTMODULE_TIMER->SR &= ~TIM_SR_UIF ; // Clear flag
|
||||
EXTMODULE_TIMER->SR &= ~TIM_SR_CC2IF ; // Clear flag
|
||||
EXTMODULE_TIMER->DIER |= TIM_DIER_CC2IE ;
|
||||
EXTMODULE_TIMER->DIER |= TIM_DIER_UIE ;
|
||||
|
||||
EXTMODULE_TIMER->CR1 = TIM_CR1_CEN ;
|
||||
// enable timer and global interrupts
|
||||
EXTMODULE_TIMER->CR1 |= TIM_CR1_CEN ;
|
||||
NVIC_EnableIRQ(EXTMODULE_TIMER_IRQn) ;
|
||||
NVIC_SetPriority(EXTMODULE_TIMER_IRQn, 7);
|
||||
NVIC_EnableIRQ(TIM8_UP_TIM13_IRQn) ;
|
||||
NVIC_SetPriority(TIM8_UP_TIM13_IRQn, 7);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void extmodulePpmStop()
|
||||
{
|
||||
#if 0
|
||||
NVIC_DisableIRQ(EXTMODULE_TIMER_IRQn) ;
|
||||
NVIC_DisableIRQ(TIM8_UP_TIM13_IRQn) ;
|
||||
EXTMODULE_TIMER->DIER &= ~TIM_DIER_CC2IE & ~TIM_DIER_UIE ;
|
||||
EXTMODULE_TIMER->CR1 &= ~TIM_CR1_CEN ;
|
||||
EXTMODULE_TIMER->SR &= ~TIM_SR_CC2IF & ~TIM_SR_UIF; // Clear all flags
|
||||
if (!IS_TRAINER_EXTERNAL_MODULE()) {
|
||||
EXTERNAL_MODULE_OFF();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 0
|
||||
extern "C" void TIM8_CC_IRQHandler()
|
||||
extern "C" void TIM2_IRQHandler()
|
||||
{
|
||||
EXTMODULE_TIMER->DIER &= ~TIM_DIER_CC2IE ; // stop this interrupt
|
||||
EXTMODULE_TIMER->SR &= ~TIM_SR_CC2IF ; // Clear flag
|
||||
//determine if its CC or UP interrupt
|
||||
uint16_t sr = EXTMODULE_TIMER->SR;
|
||||
uint16_t dier = EXTMODULE_TIMER->DIER;
|
||||
|
||||
setupPulses(EXTERNAL_MODULE) ;
|
||||
if (sr & TIM_SR_CC2IF && dier & TIM_DIER_CC2IE) { // Capture/Compare 2 interrupt enabled and fired
|
||||
EXTMODULE_TIMER->SR &= ~TIM_SR_CC2IF ; // Clear flag
|
||||
|
||||
if (s_current_protocol[EXTERNAL_MODULE] == PROTO_PXX) {
|
||||
DMA2_Stream2->CR &= ~DMA_SxCR_EN ; // Disable DMA
|
||||
DMA2->LIFCR = DMA_LIFCR_CTCIF2 | DMA_LIFCR_CHTIF2 | DMA_LIFCR_CTEIF2 | DMA_LIFCR_CDMEIF2 | DMA_LIFCR_CFEIF2 ; // Write ones to clear bits
|
||||
DMA2_Stream2->M0AR = CONVERT_PTR_UINT(&modulePulsesData[EXTERNAL_MODULE].pxx.pulses[1]);
|
||||
DMA2_Stream2->CR |= DMA_SxCR_EN ; // Enable DMA
|
||||
EXTMODULE_TIMER->CCR1 = modulePulsesData[EXTERNAL_MODULE].pxx.pulses[0];
|
||||
EXTMODULE_TIMER->DIER |= TIM_DIER_CC2IE ; // Enable this interrupt
|
||||
}
|
||||
setupPulses(EXTERNAL_MODULE);
|
||||
|
||||
if (s_current_protocol[EXTERNAL_MODULE] == PROTO_PXX) {
|
||||
DMA1_Stream5->CR &= ~DMA_SxCR_EN ; // Disable DMA
|
||||
DMA1->HIFCR = DMA_HIFCR_CTCIF5 | DMA_HIFCR_CHTIF5 | DMA_HIFCR_CTEIF5 | DMA_HIFCR_CDMEIF5 | DMA_HIFCR_CFEIF5 ; // Write ones to clear bits
|
||||
DMA1_Stream5->M0AR = CONVERT_PTR_UINT(&modulePulsesData[EXTERNAL_MODULE].pxx.pulses[1]);
|
||||
DMA1_Stream5->CR |= DMA_SxCR_EN ; // Enable DMA
|
||||
EXTMODULE_TIMER->CCR1 = modulePulsesData[EXTERNAL_MODULE].pxx.pulses[0];
|
||||
}
|
||||
#if defined(DSM2)
|
||||
else if (s_current_protocol[EXTERNAL_MODULE] >= PROTO_DSM2_LP45 && s_current_protocol[EXTERNAL_MODULE] <= PROTO_DSM2_DSMX) {
|
||||
DMA2_Stream2->CR &= ~DMA_SxCR_EN ; // Disable DMA
|
||||
DMA2->LIFCR = DMA_LIFCR_CTCIF2 | DMA_LIFCR_CHTIF2 | DMA_LIFCR_CTEIF2 | DMA_LIFCR_CDMEIF2 | DMA_LIFCR_CFEIF2 ; // Write ones to clear bits
|
||||
DMA2_Stream2->M0AR = CONVERT_PTR_UINT(&modulePulsesData[EXTERNAL_MODULE].dsm2.pulses[1]);
|
||||
DMA2_Stream2->CR |= DMA_SxCR_EN ; // Enable DMA
|
||||
EXTMODULE_TIMER->CCR1 = modulePulsesData[EXTERNAL_MODULE].dsm2.pulses[0];
|
||||
EXTMODULE_TIMER->DIER |= TIM_DIER_CC2IE ; // Enable this interrupt
|
||||
}
|
||||
else if (s_current_protocol[EXTERNAL_MODULE] >= PROTO_DSM2_LP45 && s_current_protocol[EXTERNAL_MODULE] <= PROTO_DSM2_DSMX) {
|
||||
DMA1_Stream5->CR &= ~DMA_SxCR_EN ; // Disable DMA
|
||||
DMA1->HIFCR = DMA_HIFCR_CTCIF5 | DMA_HIFCR_CHTIF5 | DMA_HIFCR_CTEIF5 | DMA_HIFCR_CDMEIF5 | DMA_HIFCR_CFEIF5 ; // Write ones to clear bits
|
||||
DMA1_Stream5->M0AR = CONVERT_PTR_UINT(&modulePulsesData[EXTERNAL_MODULE].dsm2.pulses[1]);
|
||||
DMA1_Stream5->CR |= DMA_SxCR_EN ; // Enable DMA
|
||||
EXTMODULE_TIMER->CCR1 = modulePulsesData[EXTERNAL_MODULE].dsm2.pulses[0];
|
||||
}
|
||||
#endif
|
||||
else if (s_current_protocol[EXTERNAL_MODULE] == PROTO_PPM) {
|
||||
EXTMODULE_TIMER->DIER |= TIM_DIER_UDE ;
|
||||
EXTMODULE_TIMER->SR &= ~TIM_SR_UIF ; // Clear this flag
|
||||
EXTMODULE_TIMER->DIER |= TIM_DIER_UIE ; // Enable this interrupt
|
||||
else if (s_current_protocol[EXTERNAL_MODULE] == PROTO_PPM) {
|
||||
// Stop CC2 interrupt, the pulse train period ended
|
||||
// the new PPM values were set, we begin new pulse train
|
||||
// generation with Update interrupt
|
||||
EXTMODULE_TIMER->DIER &= ~TIM_DIER_CC2IE ; // stop CC2 interrupt
|
||||
EXTMODULE_TIMER->DIER |= TIM_DIER_UDE ;
|
||||
EXTMODULE_TIMER->SR &= ~TIM_SR_UIF ; // Clear Update interrupt flag
|
||||
EXTMODULE_TIMER->DIER |= TIM_DIER_UIE ; // Enable Update interrupt
|
||||
}
|
||||
}
|
||||
else {
|
||||
EXTMODULE_TIMER->DIER |= TIM_DIER_CC2IE ; // Enable this interrupt
|
||||
|
||||
if (sr & TIM_SR_UIF && dier & TIM_DIER_UIE) { // Update interrupt enabled and fired
|
||||
EXTMODULE_TIMER->SR &= ~TIM_SR_UIF ; // Clear flag
|
||||
if (s_current_protocol[EXTERNAL_MODULE] == PROTO_PPM) {
|
||||
EXTMODULE_TIMER->ARR = *modulePulsesData[EXTERNAL_MODULE].ppm.ptr++ ;
|
||||
if (*modulePulsesData[EXTERNAL_MODULE].ppm.ptr == 0) {
|
||||
// we reached the end of PPM pulses
|
||||
// enable CC2 interrupt (which comes before Update in any case)
|
||||
// to start new PPM cycle and setup pulses
|
||||
EXTMODULE_TIMER->SR &= ~TIM_SR_CC2IF ; // Clear CC1 flag
|
||||
EXTMODULE_TIMER->DIER |= TIM_DIER_CC2IE ; // Enable CC1 interrupt
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void TIM8_UP_TIM13_IRQHandler()
|
||||
{
|
||||
EXTMODULE_TIMER->SR &= ~TIM_SR_UIF ; // Clear flag
|
||||
|
||||
EXTMODULE_TIMER->ARR = *modulePulsesData[EXTERNAL_MODULE].ppm.ptr++ ;
|
||||
if (*modulePulsesData[EXTERNAL_MODULE].ppm.ptr == 0) {
|
||||
EXTMODULE_TIMER->SR &= ~TIM_SR_CC2IF ; // Clear this flag
|
||||
EXTMODULE_TIMER->DIER |= TIM_DIER_CC2IE ; // Enable this interrupt
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -85,3 +85,31 @@ uint32_t pwrPressed()
|
||||
{
|
||||
return GPIO_ReadInputDataBit(PWR_GPIO, PWR_SWITCH_GPIO_PIN) == Bit_RESET;
|
||||
}
|
||||
|
||||
void pwrResetHandler()
|
||||
{
|
||||
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOJEN;
|
||||
|
||||
// these two NOPs are needed (see STM32F errata sheet) before the peripheral
|
||||
// register can be written after the peripheral clock was enabled
|
||||
__ASM volatile ("nop");
|
||||
__ASM volatile ("nop");
|
||||
|
||||
// Turn soft power ON now, but only if we got started because of the watchdog
|
||||
// or software reset. If the radio was started by user pressing the power button
|
||||
// then that button is providing power and we don't need to enable it here.
|
||||
//
|
||||
// If we were to turn it on here indiscriminately, then the radio can go into the
|
||||
// power on/off loop after being powered off by the user. (issue #2790)
|
||||
if (WAS_RESET_BY_WATCHDOG_OR_SOFTWARE()) {
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = PWR_ON_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_Init(PWR_GPIO, &GPIO_InitStructure);
|
||||
|
||||
pwrOn();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,529 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file startup_stm32f40_41xxx.s
|
||||
* @author MCD Application Team
|
||||
* @version V1.3.0
|
||||
* @date 08-November-2013
|
||||
* @brief STM32F40xxx/41xxx Devices vector table for RIDE7 toolchain.
|
||||
* This module performs:
|
||||
* - Set the initial SP
|
||||
* - Set the initial PC == Reset_Handler,
|
||||
* - Set the vector table entries with the exceptions ISR address
|
||||
* - Configure the clock system and the external SRAM mounted on
|
||||
* STM324xG-EVAL board to be used as data memory (optional,
|
||||
* to be enabled by user)
|
||||
* - Branches to main in the C library (which eventually
|
||||
* calls main()).
|
||||
* After Reset the Cortex-M4 processor is in Thread mode,
|
||||
* priority is Privileged, and the Stack is set to Main.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2013 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at:
|
||||
*
|
||||
* http://www.st.com/software_license_agreement_liberty_v2
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
.syntax unified
|
||||
.cpu cortex-m3
|
||||
.fpu softvfp
|
||||
.thumb
|
||||
|
||||
.global g_pfnVectors
|
||||
.global Default_Handler
|
||||
|
||||
/* start address for the initialization values of the .data section.
|
||||
defined in linker script */
|
||||
.word _sidata
|
||||
/* start address for the .data section. defined in linker script */
|
||||
.word _sdata
|
||||
/* end address for the .data section. defined in linker script */
|
||||
.word _edata
|
||||
/* start address for the .bss section. defined in linker script */
|
||||
.word _sbss
|
||||
/* end address for the .bss section. defined in linker script */
|
||||
.word _ebss
|
||||
/* stack used for SystemInit_ExtMemCtl; always internal RAM used */
|
||||
|
||||
/**
|
||||
* @brief This is the code that gets called when the processor first
|
||||
* starts execution following a reset event. Only the absolutely
|
||||
* necessary set is performed, after which the application
|
||||
* supplied main() routine is called.
|
||||
* @param None
|
||||
* @retval : None
|
||||
*/
|
||||
|
||||
.section .text.Reset_Handler
|
||||
.weak Reset_Handler
|
||||
.type Reset_Handler, %function
|
||||
Reset_Handler:
|
||||
|
||||
bl pwrResetHandler /*jump to WDT reset handler where soft power control pin is turned on as soon as possible */
|
||||
|
||||
/* Copy the data segment initializers from flash to SRAM */
|
||||
movs r1, #0
|
||||
b LoopCopyDataInit
|
||||
|
||||
CopyDataInit:
|
||||
ldr r3, =_sidata
|
||||
ldr r3, [r3, r1]
|
||||
str r3, [r0, r1]
|
||||
adds r1, r1, #4
|
||||
|
||||
LoopCopyDataInit:
|
||||
ldr r0, =_sdata
|
||||
ldr r3, =_edata
|
||||
adds r2, r0, r1
|
||||
cmp r2, r3
|
||||
bcc CopyDataInit
|
||||
ldr r2, =_sbss
|
||||
b LoopFillZerobss
|
||||
/* Zero fill the bss segment. */
|
||||
FillZerobss:
|
||||
movs r3, #0
|
||||
str r3, [r2], #4
|
||||
|
||||
LoopFillZerobss:
|
||||
ldr r3, = _ebss
|
||||
cmp r2, r3
|
||||
bcc FillZerobss
|
||||
|
||||
/*Paint Main Stack */
|
||||
ldr r2, = _main_stack_start
|
||||
PaintMainStack:
|
||||
movs r3, #0x55555555
|
||||
str r3, [r2], #4
|
||||
LoopPaintMainStack:
|
||||
ldr r3, = _estack
|
||||
cmp r2, r3
|
||||
bcc PaintMainStack
|
||||
|
||||
/* Call the clock system intitialization function.*/
|
||||
bl SystemInit
|
||||
/* Call C++ constructors for static objects */
|
||||
bl __libc_init_array
|
||||
/* Call the application's entry point.*/
|
||||
bl main
|
||||
bx lr
|
||||
.size Reset_Handler, .-Reset_Handler
|
||||
|
||||
/**
|
||||
* @brief This is the code that gets called when the processor receives an
|
||||
* unexpected interrupt. This simply enters an infinite loop, preserving
|
||||
* the system state for examination by a debugger.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
.section .text.Default_Handler,"ax",%progbits
|
||||
Default_Handler:
|
||||
Infinite_Loop:
|
||||
b Infinite_Loop
|
||||
.size Default_Handler, .-Default_Handler
|
||||
/******************************************************************************
|
||||
*
|
||||
* The minimal vector table for a Cortex M3. Note that the proper constructs
|
||||
* must be placed on this to ensure that it ends up at physical address
|
||||
* 0x0000.0000.
|
||||
*
|
||||
*******************************************************************************/
|
||||
.section .isr_vector,"a",%progbits
|
||||
.type g_pfnVectors, %object
|
||||
.size g_pfnVectors, .-g_pfnVectors
|
||||
|
||||
|
||||
g_pfnVectors:
|
||||
.word _estack
|
||||
.word Reset_Handler
|
||||
.word NMI_Handler
|
||||
.word HardFault_Handler
|
||||
.word MemManage_Handler
|
||||
.word BusFault_Handler
|
||||
.word UsageFault_Handler
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word SVC_Handler
|
||||
.word DebugMon_Handler
|
||||
.word 0
|
||||
.word PendSV_Handler
|
||||
.word SysTick_Handler
|
||||
|
||||
/* External Interrupts */
|
||||
.word WWDG_IRQHandler /* Window WatchDog */
|
||||
.word PVD_IRQHandler /* PVD through EXTI Line detection */
|
||||
.word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */
|
||||
.word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */
|
||||
.word FLASH_IRQHandler /* FLASH */
|
||||
.word RCC_IRQHandler /* RCC */
|
||||
.word EXTI0_IRQHandler /* EXTI Line0 */
|
||||
.word EXTI1_IRQHandler /* EXTI Line1 */
|
||||
.word EXTI2_IRQHandler /* EXTI Line2 */
|
||||
.word EXTI3_IRQHandler /* EXTI Line3 */
|
||||
.word EXTI4_IRQHandler /* EXTI Line4 */
|
||||
.word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */
|
||||
.word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */
|
||||
.word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */
|
||||
.word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */
|
||||
.word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */
|
||||
.word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */
|
||||
.word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */
|
||||
.word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */
|
||||
.word CAN1_TX_IRQHandler /* CAN1 TX */
|
||||
.word CAN1_RX0_IRQHandler /* CAN1 RX0 */
|
||||
.word CAN1_RX1_IRQHandler /* CAN1 RX1 */
|
||||
.word CAN1_SCE_IRQHandler /* CAN1 SCE */
|
||||
.word EXTI9_5_IRQHandler /* External Line[9:5]s */
|
||||
.word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */
|
||||
.word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */
|
||||
.word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */
|
||||
.word TIM1_CC_IRQHandler /* TIM1 Capture Compare */
|
||||
.word TIM2_IRQHandler /* TIM2 */
|
||||
.word TIM3_IRQHandler /* TIM3 */
|
||||
.word TIM4_IRQHandler /* TIM4 */
|
||||
.word I2C1_EV_IRQHandler /* I2C1 Event */
|
||||
.word I2C1_ER_IRQHandler /* I2C1 Error */
|
||||
.word I2C2_EV_IRQHandler /* I2C2 Event */
|
||||
.word I2C2_ER_IRQHandler /* I2C2 Error */
|
||||
.word SPI1_IRQHandler /* SPI1 */
|
||||
.word SPI2_IRQHandler /* SPI2 */
|
||||
.word USART1_IRQHandler /* USART1 */
|
||||
.word USART2_IRQHandler /* USART2 */
|
||||
.word USART3_IRQHandler /* USART3 */
|
||||
.word EXTI15_10_IRQHandler /* External Line[15:10]s */
|
||||
.word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */
|
||||
.word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */
|
||||
.word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */
|
||||
.word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */
|
||||
.word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */
|
||||
.word TIM8_CC_IRQHandler /* TIM8 Capture Compare */
|
||||
.word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */
|
||||
.word FSMC_IRQHandler /* FSMC */
|
||||
.word SDIO_IRQHandler /* SDIO */
|
||||
.word TIM5_IRQHandler /* TIM5 */
|
||||
.word SPI3_IRQHandler /* SPI3 */
|
||||
.word UART4_IRQHandler /* UART4 */
|
||||
.word UART5_IRQHandler /* UART5 */
|
||||
.word TIM6_DAC_IRQHandler /* TIM6 and DAC1&2 underrun errors */
|
||||
.word TIM7_IRQHandler /* TIM7 */
|
||||
.word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */
|
||||
.word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */
|
||||
.word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */
|
||||
.word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */
|
||||
.word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */
|
||||
.word ETH_IRQHandler /* Ethernet */
|
||||
.word ETH_WKUP_IRQHandler /* Ethernet Wakeup through EXTI line */
|
||||
.word CAN2_TX_IRQHandler /* CAN2 TX */
|
||||
.word CAN2_RX0_IRQHandler /* CAN2 RX0 */
|
||||
.word CAN2_RX1_IRQHandler /* CAN2 RX1 */
|
||||
.word CAN2_SCE_IRQHandler /* CAN2 SCE */
|
||||
.word OTG_FS_IRQHandler /* USB OTG FS */
|
||||
.word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */
|
||||
.word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */
|
||||
.word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */
|
||||
.word USART6_IRQHandler /* USART6 */
|
||||
.word I2C3_EV_IRQHandler /* I2C3 event */
|
||||
.word I2C3_ER_IRQHandler /* I2C3 error */
|
||||
.word OTG_HS_EP1_OUT_IRQHandler /* USB OTG HS End Point 1 Out */
|
||||
.word OTG_HS_EP1_IN_IRQHandler /* USB OTG HS End Point 1 In */
|
||||
.word OTG_HS_WKUP_IRQHandler /* USB OTG HS Wakeup through EXTI */
|
||||
.word OTG_HS_IRQHandler /* USB OTG HS */
|
||||
.word DCMI_IRQHandler /* DCMI */
|
||||
.word CRYP_IRQHandler /* CRYP crypto */
|
||||
.word HASH_RNG_IRQHandler /* Hash and Rng */
|
||||
.word FPU_IRQHandler /* FPU */
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Provide weak aliases for each Exception handler to the Default_Handler.
|
||||
* As they are weak aliases, any function with the same name will override
|
||||
* this definition.
|
||||
*
|
||||
*******************************************************************************/
|
||||
.weak NMI_Handler
|
||||
.thumb_set NMI_Handler,Default_Handler
|
||||
|
||||
.weak HardFault_Handler
|
||||
.thumb_set HardFault_Handler,Default_Handler
|
||||
|
||||
.weak MemManage_Handler
|
||||
.thumb_set MemManage_Handler,Default_Handler
|
||||
|
||||
.weak BusFault_Handler
|
||||
.thumb_set BusFault_Handler,Default_Handler
|
||||
|
||||
.weak UsageFault_Handler
|
||||
.thumb_set UsageFault_Handler,Default_Handler
|
||||
|
||||
.weak SVC_Handler
|
||||
.thumb_set SVC_Handler,Default_Handler
|
||||
|
||||
.weak DebugMon_Handler
|
||||
.thumb_set DebugMon_Handler,Default_Handler
|
||||
|
||||
.weak PendSV_Handler
|
||||
.thumb_set PendSV_Handler,Default_Handler
|
||||
|
||||
.weak SysTick_Handler
|
||||
.thumb_set SysTick_Handler,Default_Handler
|
||||
|
||||
.weak WWDG_IRQHandler
|
||||
.thumb_set WWDG_IRQHandler,Default_Handler
|
||||
|
||||
.weak PVD_IRQHandler
|
||||
.thumb_set PVD_IRQHandler,Default_Handler
|
||||
|
||||
.weak TAMP_STAMP_IRQHandler
|
||||
.thumb_set TAMP_STAMP_IRQHandler,Default_Handler
|
||||
|
||||
.weak RTC_WKUP_IRQHandler
|
||||
.thumb_set RTC_WKUP_IRQHandler,Default_Handler
|
||||
|
||||
.weak FLASH_IRQHandler
|
||||
.thumb_set FLASH_IRQHandler,Default_Handler
|
||||
|
||||
.weak RCC_IRQHandler
|
||||
.thumb_set RCC_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI0_IRQHandler
|
||||
.thumb_set EXTI0_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI1_IRQHandler
|
||||
.thumb_set EXTI1_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI2_IRQHandler
|
||||
.thumb_set EXTI2_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI3_IRQHandler
|
||||
.thumb_set EXTI3_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI4_IRQHandler
|
||||
.thumb_set EXTI4_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream0_IRQHandler
|
||||
.thumb_set DMA1_Stream0_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream1_IRQHandler
|
||||
.thumb_set DMA1_Stream1_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream2_IRQHandler
|
||||
.thumb_set DMA1_Stream2_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream3_IRQHandler
|
||||
.thumb_set DMA1_Stream3_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream4_IRQHandler
|
||||
.thumb_set DMA1_Stream4_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream5_IRQHandler
|
||||
.thumb_set DMA1_Stream5_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream6_IRQHandler
|
||||
.thumb_set DMA1_Stream6_IRQHandler,Default_Handler
|
||||
|
||||
.weak ADC_IRQHandler
|
||||
.thumb_set ADC_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN1_TX_IRQHandler
|
||||
.thumb_set CAN1_TX_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN1_RX0_IRQHandler
|
||||
.thumb_set CAN1_RX0_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN1_RX1_IRQHandler
|
||||
.thumb_set CAN1_RX1_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN1_SCE_IRQHandler
|
||||
.thumb_set CAN1_SCE_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI9_5_IRQHandler
|
||||
.thumb_set EXTI9_5_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM1_BRK_TIM9_IRQHandler
|
||||
.thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM1_UP_TIM10_IRQHandler
|
||||
.thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM1_TRG_COM_TIM11_IRQHandler
|
||||
.thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM1_CC_IRQHandler
|
||||
.thumb_set TIM1_CC_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM2_IRQHandler
|
||||
.thumb_set TIM2_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM3_IRQHandler
|
||||
.thumb_set TIM3_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM4_IRQHandler
|
||||
.thumb_set TIM4_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C1_EV_IRQHandler
|
||||
.thumb_set I2C1_EV_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C1_ER_IRQHandler
|
||||
.thumb_set I2C1_ER_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C2_EV_IRQHandler
|
||||
.thumb_set I2C2_EV_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C2_ER_IRQHandler
|
||||
.thumb_set I2C2_ER_IRQHandler,Default_Handler
|
||||
|
||||
.weak SPI1_IRQHandler
|
||||
.thumb_set SPI1_IRQHandler,Default_Handler
|
||||
|
||||
.weak SPI2_IRQHandler
|
||||
.thumb_set SPI2_IRQHandler,Default_Handler
|
||||
|
||||
.weak USART1_IRQHandler
|
||||
.thumb_set USART1_IRQHandler,Default_Handler
|
||||
|
||||
.weak USART2_IRQHandler
|
||||
.thumb_set USART2_IRQHandler,Default_Handler
|
||||
|
||||
.weak USART3_IRQHandler
|
||||
.thumb_set USART3_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI15_10_IRQHandler
|
||||
.thumb_set EXTI15_10_IRQHandler,Default_Handler
|
||||
|
||||
.weak RTC_Alarm_IRQHandler
|
||||
.thumb_set RTC_Alarm_IRQHandler,Default_Handler
|
||||
|
||||
.weak OTG_FS_WKUP_IRQHandler
|
||||
.thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM8_BRK_TIM12_IRQHandler
|
||||
.thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM8_UP_TIM13_IRQHandler
|
||||
.thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM8_TRG_COM_TIM14_IRQHandler
|
||||
.thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM8_CC_IRQHandler
|
||||
.thumb_set TIM8_CC_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream7_IRQHandler
|
||||
.thumb_set DMA1_Stream7_IRQHandler,Default_Handler
|
||||
|
||||
.weak FSMC_IRQHandler
|
||||
.thumb_set FSMC_IRQHandler,Default_Handler
|
||||
|
||||
.weak SDIO_IRQHandler
|
||||
.thumb_set SDIO_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM5_IRQHandler
|
||||
.thumb_set TIM5_IRQHandler,Default_Handler
|
||||
|
||||
.weak SPI3_IRQHandler
|
||||
.thumb_set SPI3_IRQHandler,Default_Handler
|
||||
|
||||
.weak UART4_IRQHandler
|
||||
.thumb_set UART4_IRQHandler,Default_Handler
|
||||
|
||||
.weak UART5_IRQHandler
|
||||
.thumb_set UART5_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM6_DAC_IRQHandler
|
||||
.thumb_set TIM6_DAC_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM7_IRQHandler
|
||||
.thumb_set TIM7_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream0_IRQHandler
|
||||
.thumb_set DMA2_Stream0_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream1_IRQHandler
|
||||
.thumb_set DMA2_Stream1_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream2_IRQHandler
|
||||
.thumb_set DMA2_Stream2_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream3_IRQHandler
|
||||
.thumb_set DMA2_Stream3_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream4_IRQHandler
|
||||
.thumb_set DMA2_Stream4_IRQHandler,Default_Handler
|
||||
|
||||
.weak ETH_IRQHandler
|
||||
.thumb_set ETH_IRQHandler,Default_Handler
|
||||
|
||||
.weak ETH_WKUP_IRQHandler
|
||||
.thumb_set ETH_WKUP_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN2_TX_IRQHandler
|
||||
.thumb_set CAN2_TX_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN2_RX0_IRQHandler
|
||||
.thumb_set CAN2_RX0_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN2_RX1_IRQHandler
|
||||
.thumb_set CAN2_RX1_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN2_SCE_IRQHandler
|
||||
.thumb_set CAN2_SCE_IRQHandler,Default_Handler
|
||||
|
||||
.weak OTG_FS_IRQHandler
|
||||
.thumb_set OTG_FS_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream5_IRQHandler
|
||||
.thumb_set DMA2_Stream5_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream6_IRQHandler
|
||||
.thumb_set DMA2_Stream6_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream7_IRQHandler
|
||||
.thumb_set DMA2_Stream7_IRQHandler,Default_Handler
|
||||
|
||||
.weak USART6_IRQHandler
|
||||
.thumb_set USART6_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C3_EV_IRQHandler
|
||||
.thumb_set I2C3_EV_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C3_ER_IRQHandler
|
||||
.thumb_set I2C3_ER_IRQHandler,Default_Handler
|
||||
|
||||
.weak OTG_HS_EP1_OUT_IRQHandler
|
||||
.thumb_set OTG_HS_EP1_OUT_IRQHandler,Default_Handler
|
||||
|
||||
.weak OTG_HS_EP1_IN_IRQHandler
|
||||
.thumb_set OTG_HS_EP1_IN_IRQHandler,Default_Handler
|
||||
|
||||
.weak OTG_HS_WKUP_IRQHandler
|
||||
.thumb_set OTG_HS_WKUP_IRQHandler,Default_Handler
|
||||
|
||||
.weak OTG_HS_IRQHandler
|
||||
.thumb_set OTG_HS_IRQHandler,Default_Handler
|
||||
|
||||
.weak DCMI_IRQHandler
|
||||
.thumb_set DCMI_IRQHandler,Default_Handler
|
||||
|
||||
.weak CRYP_IRQHandler
|
||||
.thumb_set CRYP_IRQHandler,Default_Handler
|
||||
|
||||
.weak HASH_RNG_IRQHandler
|
||||
.thumb_set HASH_RNG_IRQHandler,Default_Handler
|
||||
|
||||
.weak FPU_IRQHandler
|
||||
.thumb_set FPU_IRQHandler,Default_Handler
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -403,6 +403,12 @@ extern OS_MutexID audioMutex;
|
||||
|
||||
#if defined(CPUSTM32)
|
||||
inline void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct) { }
|
||||
#define TIM_DeInit(...)
|
||||
#define TIM_TimeBaseInit(...)
|
||||
#define TIM_SetCompare2(...)
|
||||
#define TIM_ClearFlag(...)
|
||||
#define TIM_Cmd(...)
|
||||
#define TIM_ITConfig(...)
|
||||
#define GPIO_SetBits(GPIOx, pin) GPIOx->BSRRL |= pin
|
||||
#define GPIO_ResetBits(GPIOx, pin) GPIOx->BSRRL &= ~pin
|
||||
#define GPIO_ReadInputDataBit(GPIOx, pin) (GPIOx->BSRRL & pin)
|
||||
|
||||
@@ -0,0 +1,527 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file startup_stm32f40_41xxx.s
|
||||
* @author MCD Application Team
|
||||
* @version V1.3.0
|
||||
* @date 08-November-2013
|
||||
* @brief STM32F40xxx/41xxx Devices vector table for RIDE7 toolchain.
|
||||
* This module performs:
|
||||
* - Set the initial SP
|
||||
* - Set the initial PC == Reset_Handler,
|
||||
* - Set the vector table entries with the exceptions ISR address
|
||||
* - Configure the clock system and the external SRAM mounted on
|
||||
* STM324xG-EVAL board to be used as data memory (optional,
|
||||
* to be enabled by user)
|
||||
* - Branches to main in the C library (which eventually
|
||||
* calls main()).
|
||||
* After Reset the Cortex-M4 processor is in Thread mode,
|
||||
* priority is Privileged, and the Stack is set to Main.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2013 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
|
||||
* You may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at:
|
||||
*
|
||||
* http://www.st.com/software_license_agreement_liberty_v2
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
.syntax unified
|
||||
.cpu cortex-m3
|
||||
.fpu softvfp
|
||||
.thumb
|
||||
|
||||
.global g_pfnVectors
|
||||
.global Default_Handler
|
||||
|
||||
/* start address for the initialization values of the .data section.
|
||||
defined in linker script */
|
||||
.word _sidata
|
||||
/* start address for the .data section. defined in linker script */
|
||||
.word _sdata
|
||||
/* end address for the .data section. defined in linker script */
|
||||
.word _edata
|
||||
/* start address for the .bss section. defined in linker script */
|
||||
.word _sbss
|
||||
/* end address for the .bss section. defined in linker script */
|
||||
.word _ebss
|
||||
/* stack used for SystemInit_ExtMemCtl; always internal RAM used */
|
||||
|
||||
/**
|
||||
* @brief This is the code that gets called when the processor first
|
||||
* starts execution following a reset event. Only the absolutely
|
||||
* necessary set is performed, after which the application
|
||||
* supplied main() routine is called.
|
||||
* @param None
|
||||
* @retval : None
|
||||
*/
|
||||
|
||||
.section .text.Reset_Handler
|
||||
.weak Reset_Handler
|
||||
.type Reset_Handler, %function
|
||||
Reset_Handler:
|
||||
|
||||
/* Copy the data segment initializers from flash to SRAM */
|
||||
movs r1, #0
|
||||
b LoopCopyDataInit
|
||||
|
||||
CopyDataInit:
|
||||
ldr r3, =_sidata
|
||||
ldr r3, [r3, r1]
|
||||
str r3, [r0, r1]
|
||||
adds r1, r1, #4
|
||||
|
||||
LoopCopyDataInit:
|
||||
ldr r0, =_sdata
|
||||
ldr r3, =_edata
|
||||
adds r2, r0, r1
|
||||
cmp r2, r3
|
||||
bcc CopyDataInit
|
||||
ldr r2, =_sbss
|
||||
b LoopFillZerobss
|
||||
/* Zero fill the bss segment. */
|
||||
FillZerobss:
|
||||
movs r3, #0
|
||||
str r3, [r2], #4
|
||||
|
||||
LoopFillZerobss:
|
||||
ldr r3, = _ebss
|
||||
cmp r2, r3
|
||||
bcc FillZerobss
|
||||
|
||||
/*Paint Main Stack */
|
||||
ldr r2, = _main_stack_start
|
||||
PaintMainStack:
|
||||
movs r3, #0x55555555
|
||||
str r3, [r2], #4
|
||||
LoopPaintMainStack:
|
||||
ldr r3, = _estack
|
||||
cmp r2, r3
|
||||
bcc PaintMainStack
|
||||
|
||||
/* Call the clock system intitialization function.*/
|
||||
bl SystemInit
|
||||
/* Call C++ constructors for static objects */
|
||||
bl __libc_init_array
|
||||
/* Call the application's entry point.*/
|
||||
bl main
|
||||
bx lr
|
||||
.size Reset_Handler, .-Reset_Handler
|
||||
|
||||
/**
|
||||
* @brief This is the code that gets called when the processor receives an
|
||||
* unexpected interrupt. This simply enters an infinite loop, preserving
|
||||
* the system state for examination by a debugger.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
.section .text.Default_Handler,"ax",%progbits
|
||||
Default_Handler:
|
||||
Infinite_Loop:
|
||||
b Infinite_Loop
|
||||
.size Default_Handler, .-Default_Handler
|
||||
/******************************************************************************
|
||||
*
|
||||
* The minimal vector table for a Cortex M3. Note that the proper constructs
|
||||
* must be placed on this to ensure that it ends up at physical address
|
||||
* 0x0000.0000.
|
||||
*
|
||||
*******************************************************************************/
|
||||
.section .isr_vector,"a",%progbits
|
||||
.type g_pfnVectors, %object
|
||||
.size g_pfnVectors, .-g_pfnVectors
|
||||
|
||||
|
||||
g_pfnVectors:
|
||||
.word _estack
|
||||
.word Reset_Handler
|
||||
.word NMI_Handler
|
||||
.word HardFault_Handler
|
||||
.word MemManage_Handler
|
||||
.word BusFault_Handler
|
||||
.word UsageFault_Handler
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word SVC_Handler
|
||||
.word DebugMon_Handler
|
||||
.word 0
|
||||
.word PendSV_Handler
|
||||
.word SysTick_Handler
|
||||
|
||||
/* External Interrupts */
|
||||
.word WWDG_IRQHandler /* Window WatchDog */
|
||||
.word PVD_IRQHandler /* PVD through EXTI Line detection */
|
||||
.word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */
|
||||
.word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */
|
||||
.word FLASH_IRQHandler /* FLASH */
|
||||
.word RCC_IRQHandler /* RCC */
|
||||
.word EXTI0_IRQHandler /* EXTI Line0 */
|
||||
.word EXTI1_IRQHandler /* EXTI Line1 */
|
||||
.word EXTI2_IRQHandler /* EXTI Line2 */
|
||||
.word EXTI3_IRQHandler /* EXTI Line3 */
|
||||
.word EXTI4_IRQHandler /* EXTI Line4 */
|
||||
.word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */
|
||||
.word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */
|
||||
.word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */
|
||||
.word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */
|
||||
.word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */
|
||||
.word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */
|
||||
.word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */
|
||||
.word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */
|
||||
.word CAN1_TX_IRQHandler /* CAN1 TX */
|
||||
.word CAN1_RX0_IRQHandler /* CAN1 RX0 */
|
||||
.word CAN1_RX1_IRQHandler /* CAN1 RX1 */
|
||||
.word CAN1_SCE_IRQHandler /* CAN1 SCE */
|
||||
.word EXTI9_5_IRQHandler /* External Line[9:5]s */
|
||||
.word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */
|
||||
.word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */
|
||||
.word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */
|
||||
.word TIM1_CC_IRQHandler /* TIM1 Capture Compare */
|
||||
.word TIM2_IRQHandler /* TIM2 */
|
||||
.word TIM3_IRQHandler /* TIM3 */
|
||||
.word TIM4_IRQHandler /* TIM4 */
|
||||
.word I2C1_EV_IRQHandler /* I2C1 Event */
|
||||
.word I2C1_ER_IRQHandler /* I2C1 Error */
|
||||
.word I2C2_EV_IRQHandler /* I2C2 Event */
|
||||
.word I2C2_ER_IRQHandler /* I2C2 Error */
|
||||
.word SPI1_IRQHandler /* SPI1 */
|
||||
.word SPI2_IRQHandler /* SPI2 */
|
||||
.word USART1_IRQHandler /* USART1 */
|
||||
.word USART2_IRQHandler /* USART2 */
|
||||
.word USART3_IRQHandler /* USART3 */
|
||||
.word EXTI15_10_IRQHandler /* External Line[15:10]s */
|
||||
.word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */
|
||||
.word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */
|
||||
.word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */
|
||||
.word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */
|
||||
.word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */
|
||||
.word TIM8_CC_IRQHandler /* TIM8 Capture Compare */
|
||||
.word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */
|
||||
.word FSMC_IRQHandler /* FSMC */
|
||||
.word SDIO_IRQHandler /* SDIO */
|
||||
.word TIM5_IRQHandler /* TIM5 */
|
||||
.word SPI3_IRQHandler /* SPI3 */
|
||||
.word UART4_IRQHandler /* UART4 */
|
||||
.word UART5_IRQHandler /* UART5 */
|
||||
.word TIM6_DAC_IRQHandler /* TIM6 and DAC1&2 underrun errors */
|
||||
.word TIM7_IRQHandler /* TIM7 */
|
||||
.word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */
|
||||
.word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */
|
||||
.word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */
|
||||
.word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */
|
||||
.word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */
|
||||
.word ETH_IRQHandler /* Ethernet */
|
||||
.word ETH_WKUP_IRQHandler /* Ethernet Wakeup through EXTI line */
|
||||
.word CAN2_TX_IRQHandler /* CAN2 TX */
|
||||
.word CAN2_RX0_IRQHandler /* CAN2 RX0 */
|
||||
.word CAN2_RX1_IRQHandler /* CAN2 RX1 */
|
||||
.word CAN2_SCE_IRQHandler /* CAN2 SCE */
|
||||
.word OTG_FS_IRQHandler /* USB OTG FS */
|
||||
.word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */
|
||||
.word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */
|
||||
.word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */
|
||||
.word USART6_IRQHandler /* USART6 */
|
||||
.word I2C3_EV_IRQHandler /* I2C3 event */
|
||||
.word I2C3_ER_IRQHandler /* I2C3 error */
|
||||
.word OTG_HS_EP1_OUT_IRQHandler /* USB OTG HS End Point 1 Out */
|
||||
.word OTG_HS_EP1_IN_IRQHandler /* USB OTG HS End Point 1 In */
|
||||
.word OTG_HS_WKUP_IRQHandler /* USB OTG HS Wakeup through EXTI */
|
||||
.word OTG_HS_IRQHandler /* USB OTG HS */
|
||||
.word DCMI_IRQHandler /* DCMI */
|
||||
.word CRYP_IRQHandler /* CRYP crypto */
|
||||
.word HASH_RNG_IRQHandler /* Hash and Rng */
|
||||
.word FPU_IRQHandler /* FPU */
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Provide weak aliases for each Exception handler to the Default_Handler.
|
||||
* As they are weak aliases, any function with the same name will override
|
||||
* this definition.
|
||||
*
|
||||
*******************************************************************************/
|
||||
.weak NMI_Handler
|
||||
.thumb_set NMI_Handler,Default_Handler
|
||||
|
||||
.weak HardFault_Handler
|
||||
.thumb_set HardFault_Handler,Default_Handler
|
||||
|
||||
.weak MemManage_Handler
|
||||
.thumb_set MemManage_Handler,Default_Handler
|
||||
|
||||
.weak BusFault_Handler
|
||||
.thumb_set BusFault_Handler,Default_Handler
|
||||
|
||||
.weak UsageFault_Handler
|
||||
.thumb_set UsageFault_Handler,Default_Handler
|
||||
|
||||
.weak SVC_Handler
|
||||
.thumb_set SVC_Handler,Default_Handler
|
||||
|
||||
.weak DebugMon_Handler
|
||||
.thumb_set DebugMon_Handler,Default_Handler
|
||||
|
||||
.weak PendSV_Handler
|
||||
.thumb_set PendSV_Handler,Default_Handler
|
||||
|
||||
.weak SysTick_Handler
|
||||
.thumb_set SysTick_Handler,Default_Handler
|
||||
|
||||
.weak WWDG_IRQHandler
|
||||
.thumb_set WWDG_IRQHandler,Default_Handler
|
||||
|
||||
.weak PVD_IRQHandler
|
||||
.thumb_set PVD_IRQHandler,Default_Handler
|
||||
|
||||
.weak TAMP_STAMP_IRQHandler
|
||||
.thumb_set TAMP_STAMP_IRQHandler,Default_Handler
|
||||
|
||||
.weak RTC_WKUP_IRQHandler
|
||||
.thumb_set RTC_WKUP_IRQHandler,Default_Handler
|
||||
|
||||
.weak FLASH_IRQHandler
|
||||
.thumb_set FLASH_IRQHandler,Default_Handler
|
||||
|
||||
.weak RCC_IRQHandler
|
||||
.thumb_set RCC_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI0_IRQHandler
|
||||
.thumb_set EXTI0_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI1_IRQHandler
|
||||
.thumb_set EXTI1_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI2_IRQHandler
|
||||
.thumb_set EXTI2_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI3_IRQHandler
|
||||
.thumb_set EXTI3_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI4_IRQHandler
|
||||
.thumb_set EXTI4_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream0_IRQHandler
|
||||
.thumb_set DMA1_Stream0_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream1_IRQHandler
|
||||
.thumb_set DMA1_Stream1_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream2_IRQHandler
|
||||
.thumb_set DMA1_Stream2_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream3_IRQHandler
|
||||
.thumb_set DMA1_Stream3_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream4_IRQHandler
|
||||
.thumb_set DMA1_Stream4_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream5_IRQHandler
|
||||
.thumb_set DMA1_Stream5_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream6_IRQHandler
|
||||
.thumb_set DMA1_Stream6_IRQHandler,Default_Handler
|
||||
|
||||
.weak ADC_IRQHandler
|
||||
.thumb_set ADC_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN1_TX_IRQHandler
|
||||
.thumb_set CAN1_TX_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN1_RX0_IRQHandler
|
||||
.thumb_set CAN1_RX0_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN1_RX1_IRQHandler
|
||||
.thumb_set CAN1_RX1_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN1_SCE_IRQHandler
|
||||
.thumb_set CAN1_SCE_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI9_5_IRQHandler
|
||||
.thumb_set EXTI9_5_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM1_BRK_TIM9_IRQHandler
|
||||
.thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM1_UP_TIM10_IRQHandler
|
||||
.thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM1_TRG_COM_TIM11_IRQHandler
|
||||
.thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM1_CC_IRQHandler
|
||||
.thumb_set TIM1_CC_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM2_IRQHandler
|
||||
.thumb_set TIM2_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM3_IRQHandler
|
||||
.thumb_set TIM3_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM4_IRQHandler
|
||||
.thumb_set TIM4_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C1_EV_IRQHandler
|
||||
.thumb_set I2C1_EV_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C1_ER_IRQHandler
|
||||
.thumb_set I2C1_ER_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C2_EV_IRQHandler
|
||||
.thumb_set I2C2_EV_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C2_ER_IRQHandler
|
||||
.thumb_set I2C2_ER_IRQHandler,Default_Handler
|
||||
|
||||
.weak SPI1_IRQHandler
|
||||
.thumb_set SPI1_IRQHandler,Default_Handler
|
||||
|
||||
.weak SPI2_IRQHandler
|
||||
.thumb_set SPI2_IRQHandler,Default_Handler
|
||||
|
||||
.weak USART1_IRQHandler
|
||||
.thumb_set USART1_IRQHandler,Default_Handler
|
||||
|
||||
.weak USART2_IRQHandler
|
||||
.thumb_set USART2_IRQHandler,Default_Handler
|
||||
|
||||
.weak USART3_IRQHandler
|
||||
.thumb_set USART3_IRQHandler,Default_Handler
|
||||
|
||||
.weak EXTI15_10_IRQHandler
|
||||
.thumb_set EXTI15_10_IRQHandler,Default_Handler
|
||||
|
||||
.weak RTC_Alarm_IRQHandler
|
||||
.thumb_set RTC_Alarm_IRQHandler,Default_Handler
|
||||
|
||||
.weak OTG_FS_WKUP_IRQHandler
|
||||
.thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM8_BRK_TIM12_IRQHandler
|
||||
.thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM8_UP_TIM13_IRQHandler
|
||||
.thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM8_TRG_COM_TIM14_IRQHandler
|
||||
.thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM8_CC_IRQHandler
|
||||
.thumb_set TIM8_CC_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA1_Stream7_IRQHandler
|
||||
.thumb_set DMA1_Stream7_IRQHandler,Default_Handler
|
||||
|
||||
.weak FSMC_IRQHandler
|
||||
.thumb_set FSMC_IRQHandler,Default_Handler
|
||||
|
||||
.weak SDIO_IRQHandler
|
||||
.thumb_set SDIO_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM5_IRQHandler
|
||||
.thumb_set TIM5_IRQHandler,Default_Handler
|
||||
|
||||
.weak SPI3_IRQHandler
|
||||
.thumb_set SPI3_IRQHandler,Default_Handler
|
||||
|
||||
.weak UART4_IRQHandler
|
||||
.thumb_set UART4_IRQHandler,Default_Handler
|
||||
|
||||
.weak UART5_IRQHandler
|
||||
.thumb_set UART5_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM6_DAC_IRQHandler
|
||||
.thumb_set TIM6_DAC_IRQHandler,Default_Handler
|
||||
|
||||
.weak TIM7_IRQHandler
|
||||
.thumb_set TIM7_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream0_IRQHandler
|
||||
.thumb_set DMA2_Stream0_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream1_IRQHandler
|
||||
.thumb_set DMA2_Stream1_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream2_IRQHandler
|
||||
.thumb_set DMA2_Stream2_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream3_IRQHandler
|
||||
.thumb_set DMA2_Stream3_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream4_IRQHandler
|
||||
.thumb_set DMA2_Stream4_IRQHandler,Default_Handler
|
||||
|
||||
.weak ETH_IRQHandler
|
||||
.thumb_set ETH_IRQHandler,Default_Handler
|
||||
|
||||
.weak ETH_WKUP_IRQHandler
|
||||
.thumb_set ETH_WKUP_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN2_TX_IRQHandler
|
||||
.thumb_set CAN2_TX_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN2_RX0_IRQHandler
|
||||
.thumb_set CAN2_RX0_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN2_RX1_IRQHandler
|
||||
.thumb_set CAN2_RX1_IRQHandler,Default_Handler
|
||||
|
||||
.weak CAN2_SCE_IRQHandler
|
||||
.thumb_set CAN2_SCE_IRQHandler,Default_Handler
|
||||
|
||||
.weak OTG_FS_IRQHandler
|
||||
.thumb_set OTG_FS_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream5_IRQHandler
|
||||
.thumb_set DMA2_Stream5_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream6_IRQHandler
|
||||
.thumb_set DMA2_Stream6_IRQHandler,Default_Handler
|
||||
|
||||
.weak DMA2_Stream7_IRQHandler
|
||||
.thumb_set DMA2_Stream7_IRQHandler,Default_Handler
|
||||
|
||||
.weak USART6_IRQHandler
|
||||
.thumb_set USART6_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C3_EV_IRQHandler
|
||||
.thumb_set I2C3_EV_IRQHandler,Default_Handler
|
||||
|
||||
.weak I2C3_ER_IRQHandler
|
||||
.thumb_set I2C3_ER_IRQHandler,Default_Handler
|
||||
|
||||
.weak OTG_HS_EP1_OUT_IRQHandler
|
||||
.thumb_set OTG_HS_EP1_OUT_IRQHandler,Default_Handler
|
||||
|
||||
.weak OTG_HS_EP1_IN_IRQHandler
|
||||
.thumb_set OTG_HS_EP1_IN_IRQHandler,Default_Handler
|
||||
|
||||
.weak OTG_HS_WKUP_IRQHandler
|
||||
.thumb_set OTG_HS_WKUP_IRQHandler,Default_Handler
|
||||
|
||||
.weak OTG_HS_IRQHandler
|
||||
.thumb_set OTG_HS_IRQHandler,Default_Handler
|
||||
|
||||
.weak DCMI_IRQHandler
|
||||
.thumb_set DCMI_IRQHandler,Default_Handler
|
||||
|
||||
.weak CRYP_IRQHandler
|
||||
.thumb_set CRYP_IRQHandler,Default_Handler
|
||||
|
||||
.weak HASH_RNG_IRQHandler
|
||||
.thumb_set HASH_RNG_IRQHandler,Default_Handler
|
||||
|
||||
.weak FPU_IRQHandler
|
||||
.thumb_set FPU_IRQHandler,Default_Handler
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
Reference in New Issue
Block a user