diff --git a/arch/arm/SAM_D2X/hal/src/hal_sam_d2x.cpp b/arch/arm/SAM_D2X/hal/src/hal_sam_d2x.cpp index 5fc70b39..deb65256 100644 --- a/arch/arm/SAM_D2X/hal/src/hal_sam_d2x.cpp +++ b/arch/arm/SAM_D2X/hal/src/hal_sam_d2x.cpp @@ -1,17 +1,2 @@ #include "hal_sam_d2x.hpp" -#define __SYSTEM_CLOCK (1000000) -uint32_t SystemCoreClock = __SYSTEM_CLOCK; - -void hal::arm::sam_d2x::init() -{ - // Keep the default device state after reset - SystemCoreClock = __SYSTEM_CLOCK; - return; -} - -void hal::arm::sam_d2x::clock_update() -{ - SystemCoreClock = __SYSTEM_CLOCK; - return; -} diff --git a/arch/arm/SAM_D2X/hdi/inc/hdi_sam_d2x.h b/arch/arm/SAM_D2X/hdi/inc/hdi_sam_d2x.h index 8404a2dd..38d6a434 100644 --- a/arch/arm/SAM_D2X/hdi/inc/hdi_sam_d2x.h +++ b/arch/arm/SAM_D2X/hdi/inc/hdi_sam_d2x.h @@ -184,6 +184,7 @@ void I2S_Handler ( void ); */ #include #if !defined(DONT_USE_CMSIS_INIT) +extern uint32_t SystemCoreClock; void SystemInit(void); void SystemCoreClockUpdate(void); #endif diff --git a/arch/arm/SAM_D2X/hdi/src/hdi_sam_d2x.c b/arch/arm/SAM_D2X/hdi/src/hdi_sam_d2x.c index ae49c5d4..c13eb658 100644 --- a/arch/arm/SAM_D2X/hdi/src/hdi_sam_d2x.c +++ b/arch/arm/SAM_D2X/hdi/src/hdi_sam_d2x.c @@ -16,7 +16,13 @@ int main(void); void __libc_init_array(void); // Dummy Handler -static void Dummy_Handler(void); +static void Dummy_Handler(void) +{ + while(1) + { + + } +} #define __SYSTEM_CLOCK (1000000) @@ -232,12 +238,6 @@ void Reset_Handler(void) while (1); } - -void Dummy_Handler(void) -{ - while(1){} -} - uint32_t SystemCoreClock = __SYSTEM_CLOCK; diff --git a/arch/arm/common/inc/hal_arm.hpp b/arch/arm/common/inc/hal_arm.hpp index d1387a12..46ffc379 100644 --- a/arch/arm/common/inc/hal_arm.hpp +++ b/arch/arm/common/inc/hal_arm.hpp @@ -8,33 +8,6 @@ #endif -#if !(defined(__ASSEMBLY__)) -#include -// #ifndef __cplusplus -// typedef volatile const uint32_t RoReg; // Read only 32-bit register (volatile const unsigned int) -// typedef volatile const uint16_t RoReg16; // Read only 16-bit register (volatile const unsigned int) -// typedef volatile const uint8_t RoReg8; // Read only 8-bit register (volatile const unsigned int) -// #else -// typedef volatile uint32_t RoReg; // Read only 32-bit register (volatile const unsigned int) -// typedef volatile uint16_t RoReg16; // Read only 16-bit register (volatile const unsigned int) -// typedef volatile uint8_t RoReg8; // Read only 8-bit register (volatile const unsigned int) -// #endif -typedef volatile const uint32_t RoReg; // Read only 32-bit register (volatile const unsigned int) -typedef volatile const uint16_t RoReg16; // Read only 16-bit register (volatile const unsigned int) -typedef volatile const uint8_t RoReg8; // Read only 8-bit register (volatile const unsigned int Ts) -typedef volatile uint32_t WoReg; // Write only 32-bit register (volatile unsigned int) -typedef volatile uint16_t WoReg16; // Write only 16-bit register (volatile unsigned int) -typedef volatile uint16_t WoReg8; // Write only 8-bit register (volatile unsigned int) -typedef volatile uint32_t RwReg; // Write only 32-bit register (volatile unsigned int) -typedef volatile uint16_t RwReg16; // Write only 16-bit register (volatile unsigned int) -typedef volatile uint8_t RwReg8; // Write only 8-bit register (volatile unsigned int) -#define CAST(type, value) ((type*)(value)) -#define REG_ACCESS(type, address) (*(type*)(address)) -#else -#define CAST(type, value) (value) -#define REG_ACCESS(type, address) (address) -#endif - namespace hal::arm { diff --git a/test/.gdb_history b/test/.gdb_history new file mode 100644 index 00000000..29754531 --- /dev/null +++ b/test/.gdb_history @@ -0,0 +1,3 @@ +load +monitor reset +q diff --git a/test/Makefile b/test/Makefile index f8167a80..0f8036cb 100644 --- a/test/Makefile +++ b/test/Makefile @@ -18,7 +18,7 @@ endif # Tools CC=arm-none-eabi-g++ -LD=arm-none-eabi-g++ +LD=arm-none-eabi-gcc AR=arm-none-eabi-ar AS=arm-none-eabi-as @@ -61,9 +61,9 @@ $(BUILD_DIR)/%.o: %.c @mkdir -p $(dir $@) @echo "***************" @echo "Compiling $< ---> $@" - $(_ATSYM_)$(CC) -c $(CFLAGS) $< -o $@ + $(_ATSYM_)arm-none-eabi-gcc -c $(CFLAGS) $< -o $@ @echo "Outputting Dependency from $< ---> "$(BUILD_DIR)/$*.d - $(_ATSYM_)$(CC) -MM $(CFLAGS) $< > $(BUILD_DIR)/$*.d + $(_ATSYM_)arm-none-eabi-gcc -MM $(CFLAGS) $< > $(BUILD_DIR)/$*.d # compile and generate dependency info $(BUILD_DIR)/%.o: %.cpp diff --git a/test/bin/main.elf b/test/bin/main.elf new file mode 100644 index 00000000..dea2d837 Binary files /dev/null and b/test/bin/main.elf differ diff --git a/test/build/hal_sam_d2x.d b/test/build/hal_sam_d2x.d new file mode 100644 index 00000000..77351811 --- /dev/null +++ b/test/build/hal_sam_d2x.d @@ -0,0 +1,11 @@ +hal_sam_d2x.o: src/hal/hal_sam_d2x.cpp inc/hal/hal_sam_d2x.hpp \ + inc/common/hal_arm.hpp conf/epenguin_conf.h inc/hdi/hdi_sam_d2x.h \ + inc/common/epenguin_dev_arm_util.h inc/common/cmsis/core_cm0plus.h \ + inc/common/cmsis/cmsis_version.h inc/common/cmsis/cmsis_compiler.h \ + inc/common/cmsis/cmsis_gcc.h inc/hdi/hdi_ac.h inc/hdi/hdi_adc.h \ + inc/hdi/hdi_dmac.h inc/hdi/hdi_dsu.h inc/hdi/hdi_eic.h \ + inc/hdi/hdi_evsys.h inc/hdi/hdi_gclk.h inc/hdi/hdi_hmatrixb.h \ + inc/hdi/hdi_i2s.h inc/hdi/hdi_mtb.h inc/hdi/hdi_nvmctrl.h \ + inc/hdi/hdi_pac.h inc/hdi/hdi_pm.h inc/hdi/hdi_port.h inc/hdi/hdi_rtc.h \ + inc/hdi/hdi_sercom.h inc/hdi/hdi_sysctrl.h inc/hdi/hdi_tc.h \ + inc/hdi/hdi_tcc.h inc/hdi/hdi_usb.h inc/hdi/hdi_wdt.h diff --git a/test/build/hal_sam_d2x.o b/test/build/hal_sam_d2x.o new file mode 100644 index 00000000..d5312ac2 Binary files /dev/null and b/test/build/hal_sam_d2x.o differ diff --git a/test/build/hdi_sam_d2x.d b/test/build/hdi_sam_d2x.d new file mode 100644 index 00000000..565e0c97 --- /dev/null +++ b/test/build/hdi_sam_d2x.d @@ -0,0 +1,10 @@ +hdi_sam_d2x.o: src/hdi/hdi_sam_d2x.c inc/hdi/hdi_sam_d2x.h \ + inc/common/epenguin_dev_arm_util.h inc/common/cmsis/core_cm0plus.h \ + inc/common/cmsis/cmsis_version.h inc/common/cmsis/cmsis_compiler.h \ + inc/common/cmsis/cmsis_gcc.h inc/hdi/hdi_ac.h inc/hdi/hdi_adc.h \ + inc/hdi/hdi_dmac.h inc/hdi/hdi_dsu.h inc/hdi/hdi_eic.h \ + inc/hdi/hdi_evsys.h inc/hdi/hdi_gclk.h inc/hdi/hdi_hmatrixb.h \ + inc/hdi/hdi_i2s.h inc/hdi/hdi_mtb.h inc/hdi/hdi_nvmctrl.h \ + inc/hdi/hdi_pac.h inc/hdi/hdi_pm.h inc/hdi/hdi_port.h inc/hdi/hdi_rtc.h \ + inc/hdi/hdi_sercom.h inc/hdi/hdi_sysctrl.h inc/hdi/hdi_tc.h \ + inc/hdi/hdi_tcc.h inc/hdi/hdi_usb.h inc/hdi/hdi_wdt.h diff --git a/test/build/hdi_sam_d2x.o b/test/build/hdi_sam_d2x.o new file mode 100644 index 00000000..0f078552 Binary files /dev/null and b/test/build/hdi_sam_d2x.o differ diff --git a/test/build/main.d b/test/build/main.d new file mode 100644 index 00000000..f16d06b4 --- /dev/null +++ b/test/build/main.d @@ -0,0 +1,11 @@ +main.o: src/main.cpp inc/epenguin.hpp conf/epenguin_conf.h \ + inc/hal/hal_sam_d2x.hpp inc/common/hal_arm.hpp inc/hdi/hdi_sam_d2x.h \ + inc/common/epenguin_dev_arm_util.h inc/common/cmsis/core_cm0plus.h \ + inc/common/cmsis/cmsis_version.h inc/common/cmsis/cmsis_compiler.h \ + inc/common/cmsis/cmsis_gcc.h inc/hdi/hdi_ac.h inc/hdi/hdi_adc.h \ + inc/hdi/hdi_dmac.h inc/hdi/hdi_dsu.h inc/hdi/hdi_eic.h \ + inc/hdi/hdi_evsys.h inc/hdi/hdi_gclk.h inc/hdi/hdi_hmatrixb.h \ + inc/hdi/hdi_i2s.h inc/hdi/hdi_mtb.h inc/hdi/hdi_nvmctrl.h \ + inc/hdi/hdi_pac.h inc/hdi/hdi_pm.h inc/hdi/hdi_port.h inc/hdi/hdi_rtc.h \ + inc/hdi/hdi_sercom.h inc/hdi/hdi_sysctrl.h inc/hdi/hdi_tc.h \ + inc/hdi/hdi_tcc.h inc/hdi/hdi_usb.h inc/hdi/hdi_wdt.h diff --git a/test/build/main.o b/test/build/main.o new file mode 100644 index 00000000..756522bb Binary files /dev/null and b/test/build/main.o differ diff --git a/test/build/mcu.d b/test/build/mcu.d new file mode 100644 index 00000000..91bc5c58 --- /dev/null +++ b/test/build/mcu.d @@ -0,0 +1 @@ +mcu.o: src/common/mcu.cpp diff --git a/test/build/mcu.o b/test/build/mcu.o new file mode 100644 index 00000000..da4934de Binary files /dev/null and b/test/build/mcu.o differ