Skip to content

Commit

Permalink
fixed e230 build and bootloader
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Aug 6, 2024
1 parent 6dc8dc6 commit bdd4de0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ FIRMWARE_VERSION := $(VERSION_MAJOR).$(VERSION_MINOR)
# Compiler options

CFLAGS_BASE := -DUSE_MAKE -fsingle-precision-constant -fomit-frame-pointer -ffast-math
CFLAGS_BASE += -I$(MAIN_INC_DIR) -g3 -O3 -Wall -ffunction-sections
CFLAGS_BASE += -I$(MAIN_INC_DIR) -g3 -O2 -Wall -ffunction-sections

CFLAGS_COMMON := $(CFLAGS_BASE)

Expand Down
6 changes: 5 additions & 1 deletion Mcu/e230/Inc/blutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static inline void bl_timer_init(void)
{
rcu_periph_clock_enable(RCU_TIMER16);
TIMER_CAR(BL_TIMER) = 0xFFFF;
TIMER_PSC(BL_TIMER) = 35;
TIMER_PSC(BL_TIMER) = 71;
timer_auto_reload_shadow_enable(BL_TIMER);
timer_enable(BL_TIMER);
}
Expand Down Expand Up @@ -124,3 +124,7 @@ static inline void jump_to_application(void)
"bx %1 \n"
: : "r"(stack_top), "r"(JumpAddress) :);
}

void SysTick_Handler(void)
{
}
6 changes: 6 additions & 0 deletions Mcu/e230/Src/gd32e23x_it.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#pragma GCC optimize("Os")

extern void transfercomplete();
extern void PeriodElapsedCallback();
extern void interruptRoutine();
Expand All @@ -21,7 +23,9 @@ int interrupt_time = 0;
#include "common.h"
#include "main.h"
#include "systick.h"
#ifndef BOOTLOADER
#include "targets.h"
#endif

/*!
\brief this function handles NMI exception
Expand Down Expand Up @@ -60,6 +64,7 @@ void SVC_Handler(void) { }
*/
void PendSV_Handler(void) { }

#ifndef BOOTLOADER
/*!
\brief this function handles SysTick exception
\param[in] none
Expand Down Expand Up @@ -151,3 +156,4 @@ void EXTI4_15_IRQHandler(void)

processDshot();
}
#endif // BOOTLOADER
4 changes: 2 additions & 2 deletions e230makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ TARGETS_$(MCU) := $(call get_targets,$(MCU))

HAL_FOLDER_$(MCU) := $(HAL_FOLDER)/$(call lc,$(MCU))

MCU_$(MCU) := -mfloat-abi=soft -mthumb -march=armv8-m.main
MCU_$(MCU) := -mfloat-abi=soft -mthumb -mcpu=cortex-m23
LDSCRIPT_$(MCU) := $(wildcard $(HAL_FOLDER_$(MCU))/*.ld)

SRC_BASE_DIR_$(MCU) := \
Expand All @@ -32,4 +32,4 @@ SRC_$(MCU) := $(foreach dir,$(SRC_DIR_$(MCU)),$(wildcard $(dir)/*.[cs]))
SRC_$(MCU)_BL := $(foreach dir,$(SRC_BASE_DIR_$(MCU)),$(wildcard $(dir)/*.[cs])) \
$(HAL_FOLDER_$(MCU))/Src/eeprom.c \
$(HAL_FOLDER_$(MCU))/Src/system_gd32e23x.c \
$(wildcard $(HAL_FOLDER_$(MCU))/*_it.c)
$(wildcard $(HAL_FOLDER_$(MCU))/Src/*_it.c)

0 comments on commit bdd4de0

Please sign in to comment.