Commit 94bc7edf authored by Peter Wägemann's avatar Peter Wägemann
Browse files

Use correct integrated assembler

parent 10067c81
...@@ -36,7 +36,9 @@ STACK_SIZE?=2048 ...@@ -36,7 +36,9 @@ STACK_SIZE?=2048
JLFLAGS = -device XMC4500-1024 -if SWD -speed 300 JLFLAGS = -device XMC4500-1024 -if SWD -speed 300
CFLAGS = -target armv6m--none-eabi -mcpu=cortex-m4 -mthumb CFLAGS = -target armv6m--none-eabi -mcpu=cortex-m4 -mthumb -integrated-as -ccc-gcc-name arm-none-eabi-gcc
# CFLAGS = -g
# CFLAGS+= -fno-builtin
CFLAGS+= -O0 -ffunction-sections -fdata-sections CFLAGS+= -O0 -ffunction-sections -fdata-sections
CFLAGS+= -MD -std=c99 -Wall -fms-extensions CFLAGS+= -MD -std=c99 -Wall -fms-extensions
CFLAGS+= -DUC_ID=$(UC_ID) -DARM_MATH_CM4 -DINTERRUPT_CONTROL_ENDPOINT CFLAGS+= -DUC_ID=$(UC_ID) -DARM_MATH_CM4 -DINTERRUPT_CONTROL_ENDPOINT
......
...@@ -59,7 +59,7 @@ IHANDLER void MemManage_Handler() { P1_1_set(); while(1) {} } ...@@ -59,7 +59,7 @@ IHANDLER void MemManage_Handler() { P1_1_set(); while(1) {} }
IHANDLER void UsageFault_Handler() { P1_1_set(); while(1) {} } IHANDLER void UsageFault_Handler() { P1_1_set(); while(1) {} }
IHANDLER void BusFault_Handler() { IHANDLER void BusFault_Handler() {
__asm volatile("ldr sp,=__initial_sp; isb"); //__asm volatile("ldr sp,=__initial_sp; isb");
P1_0_reset(); P1_0_reset();
while(true) { while(true) {
...@@ -130,7 +130,8 @@ static void command_inf(char *arg) { ...@@ -130,7 +130,8 @@ static void command_inf(char *arg) {
// send FREQUENCY // send FREQUENCY
char buf[128] = {0}; char buf[128] = {0};
itoa(SystemCoreClock, buf, 10); // itoa(SystemCoreClock, buf, 10);
uint64_to_string(buf, SystemCoreClock);
CDC_Device_SendString(&VirtualSerial_CDC_Interface, "o:freq "); CDC_Device_SendString(&VirtualSerial_CDC_Interface, "o:freq ");
CDC_Device_SendString(&VirtualSerial_CDC_Interface, buf); CDC_Device_SendString(&VirtualSerial_CDC_Interface, buf);
CDC_Device_SendString(&VirtualSerial_CDC_Interface, "\r"); CDC_Device_SendString(&VirtualSerial_CDC_Interface, "\r");
...@@ -165,6 +166,14 @@ static void command_rst(char *arg) { ...@@ -165,6 +166,14 @@ static void command_rst(char *arg) {
NVIC_SystemReset(); NVIC_SystemReset();
} }
void* __aeabi_memset(void *s, int c, size_t n){
size_t i;
for (i = 0; i < n; i++) {
((char *)s)[i] = (char)c;
}
return s;
}
int main(void) { int main(void) {
P1_0_set_mode(OUTPUT_PP_GP); P1_0_set_mode(OUTPUT_PP_GP);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment