diff --git a/bootloaders/zero/Debug/Exe/samd21_sam_ba.bin b/bootloaders/zero/Debug/Exe/samd21_sam_ba.bin deleted file mode 100644 index 6f2e320b730ab4636415e7cdeabbcc75b8d1a3c3..0000000000000000000000000000000000000000 Binary files a/bootloaders/zero/Debug/Exe/samd21_sam_ba.bin and /dev/null differ diff --git a/bootloaders/zero/Debug/Exe/samd21_sam_ba.out b/bootloaders/zero/Debug/Exe/samd21_sam_ba.out deleted file mode 100644 index 386ee9961b0b007af1fb90f555112d0efc5d235f..0000000000000000000000000000000000000000 Binary files a/bootloaders/zero/Debug/Exe/samd21_sam_ba.out and /dev/null differ diff --git a/bootloaders/zero/Debug/List/samd21_sam_ba.map b/bootloaders/zero/Debug/List/samd21_sam_ba.map deleted file mode 100644 index 0bee980def006b41f9bf9af52ebb6b4f28c794fa..0000000000000000000000000000000000000000 --- a/bootloaders/zero/Debug/List/samd21_sam_ba.map +++ /dev/null @@ -1,377 +0,0 @@ -############################################################################### -# -# IAR ELF Linker V7.10.3.6832/W32 for ARM 07/Aug/2014 15:50:04 -# Copyright 2007-2014 IAR Systems AB. -# -# Output file = -# E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Debug\Exe\samd21_sam_ba.out -# Map file = -# E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Debug\List\samd21_sam_ba.map -# Command line = -# "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Debug\Obj\cdc_enumerate.o" -# "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Debug\Obj\interrupt_sam_nvic.o" -# "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Debug\Obj\main.o" -# "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Debug\Obj\sam_ba_monitor.o" -# "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Debug\Obj\startup_samd21.o" -# "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Debug\Obj\uart_driver.o" -# "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Debug\Obj\usart_sam_ba.o" -# -o "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Debug\Exe\samd21_sam_ba.out" -# --redirect _Printf=_PrintfFull --redirect _Scanf=_ScanfFull --map -# "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Debug\List\samd21_sam_ba.map" -# --config "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\samd21_sam_ba.icf" -# --entry __iar_program_start --vfe -# -############################################################################### - -******************************************************************************* -*** RUNTIME MODEL ATTRIBUTES -*** - -CppFlavor = * -__SystemLibrary = DLib - - -******************************************************************************* -*** PLACEMENT SUMMARY -*** - -"A1": place at 0x00000000 { ro section .intvec }; -"P1": place in [from 0x00000000 to 0x00001fff] { ro }; -"P2": place in [from 0x20000000 to 0x20007fff] { rw, block CSTACK, block HEAP }; - - Section Kind Address Size Object - ------- ---- ------- ---- ------ -"A1": 0xb0 - .intvec 0x00000000 0xb0 <Block> - .intvec const 0x00000000 0xb0 startup_samd21.o [1] - - 0x000000b0 0xb0 - -"P1": 0x1c18 - .text ro code 0x000000b0 0xa84 cdc_enumerate.o [1] - .text ro code 0x00000b34 0x14 memset.o [3] - .text ro code 0x00000b48 0xc memcpy.o [3] - .text ro code 0x00000b54 0x54 ABImemset.o [4] - .text ro code 0x00000ba8 0x5c ABImemcpy.o [4] - .text ro code 0x00000c04 0x5e4 usart_sam_ba.o [1] - .text ro code 0x000011e8 0xf8 uart_driver.o [1] - .text ro code 0x000012e0 0x520 sam_ba_monitor.o [1] - .text ro code 0x00001800 0x10 strlen.o [4] - .text ro code 0x00001810 0x2bc main.o [1] - .text ro code 0x00001acc 0x30 copy_init3.o [4] - .text ro code 0x00001afc 0x2a zero_init3.o [4] - .text ro code 0x00001b28 0x28 data_init.o [4] - .text ro code 0x00001b50 0x24 startup_samd21.o [1] - .text ro code 0x00001b74 0xc cstartup_M.o [4] - .text ro code 0x00001b80 0x1a cmain.o [4] - .text ro code 0x00001b9a 0x8 exit.o [3] - .text ro code 0x00001ba4 0xa cexit.o [4] - .text ro code 0x00001bb0 0xc XXexit.o [4] - .iar.init_table const 0x00001bbc 0x24 - Linker created - - .rodata const 0x00001be0 0x1c sam_ba_monitor.o [1] - .rodata const 0x00001bfc 0x1c sam_ba_monitor.o [1] - .rodata const 0x00001c18 0x18 uart_driver.o [1] - .rodata const 0x00001c30 0x14 cdc_enumerate.o [1] - .rodata const 0x00001c44 0xc sam_ba_monitor.o [1] - .rodata const 0x00001c50 0xc sam_ba_monitor.o [1] - .rodata const 0x00001c5c 0x4 cdc_enumerate.o [1] - .rodata const 0x00001c60 0x4 main.o [1] - .rodata const 0x00001c64 0x4 main.o [1] - .rodata const 0x00001c68 0x4 main.o [1] - .rodata const 0x00001c6c 0x4 main.o [1] - .rodata const 0x00001c70 0x4 sam_ba_monitor.o [1] - .rodata const 0x00001c74 0x4 usart_sam_ba.o [1] - .rodata const 0x00001c78 0x0 zero_init3.o [4] - .rodata const 0x00001c78 0x0 copy_init3.o [4] - Initializer bytes ro data 0x00001c78 0x50 <for P2 s0> - - 0x00001cc8 0x1c18 - -"P2", part 1 of 3: 0x50 - P2 s0 0x20000000 0x50 <Init block> - .data inited 0x20000000 0x44 cdc_enumerate.o [1] - .data inited 0x20000044 0x8 cdc_enumerate.o [1] - .data inited 0x2000004c 0x1 interrupt_sam_nvic.o [1] - - 0x20000050 0x50 - -"P2", part 2 of 3: 0x210 - .bss zero 0x20000050 0x80 cdc_enumerate.o [1] - .bss zero 0x200000d0 0x80 cdc_enumerate.o [1] - .bss zero 0x20000150 0x80 cdc_enumerate.o [1] - .bss zero 0x200001d0 0x40 sam_ba_monitor.o [1] - .bss zero 0x20000210 0x14 cdc_enumerate.o [1] - .bss zero 0x20000224 0x4 sam_ba_monitor.o [1] - .bss zero 0x20000228 0x4 sam_ba_monitor.o [1] - .bss zero 0x2000022c 0x4 sam_ba_monitor.o [1] - .bss zero 0x20000230 0x4 sam_ba_monitor.o [1] - .bss zero 0x20000234 0x4 sam_ba_monitor.o [1] - .bss zero 0x20000238 0x4 sam_ba_monitor.o [1] - .bss zero 0x2000023c 0x4 sam_ba_monitor.o [1] - .bss zero 0x20000240 0x4 sam_ba_monitor.o [1] - .bss zero 0x20000244 0x2 cdc_enumerate.o [1] - .bss zero 0x20000246 0x2 cdc_enumerate.o [1] - .bss zero 0x20000248 0x2 cdc_enumerate.o [1] - .bss zero 0x2000024a 0x2 cdc_enumerate.o [1] - .bss zero 0x2000024c 0x2 usart_sam_ba.o [1] - .bss zero 0x2000024e 0x1 cdc_enumerate.o [1] - .bss zero 0x2000024f 0x1 cdc_enumerate.o [1] - .bss zero 0x20000250 0x1 cdc_enumerate.o [1] - .bss zero 0x20000251 0x1 cdc_enumerate.o [1] - .bss zero 0x20000252 0x1 main.o [1] - .bss zero 0x20000253 0x1 sam_ba_monitor.o [1] - .bss zero 0x20000254 0x1 sam_ba_monitor.o [1] - .bss zero 0x20000255 0x1 sam_ba_monitor.o [1] - .bss zero 0x20000256 0x1 sam_ba_monitor.o [1] - .bss zero 0x20000257 0x1 uart_driver.o [1] - .bss zero 0x20000258 0x1 usart_sam_ba.o [1] - .bss zero 0x20000259 0x1 usart_sam_ba.o [1] - .bss zero 0x2000025a 0x1 usart_sam_ba.o [1] - .bss zero 0x2000025b 0x1 usart_sam_ba.o [1] - .bss zero 0x2000025c 0x1 usart_sam_ba.o [1] - .bss zero 0x2000025d 0x1 usart_sam_ba.o [1] - .bss zero 0x2000025e 0x1 usart_sam_ba.o [1] - - 0x2000025f 0x20f - -"P2", part 3 of 3: 0x200 - CSTACK 0x20000260 0x200 <Block> - CSTACK uninit 0x20000260 0x200 <Block tail> - - 0x20000460 0x200 - - -******************************************************************************* -*** INIT TABLE -*** - - Address Size - ------- ---- -Zero (__iar_zero_init3) - 1 destination range, total size 0x20f: - 0x20000050 0x20f - -Copy (__iar_copy_init3) - 1 source range, total size 0x50 (103% of destination): - 0x00001c78 0x50 - 1 destination range, total size 0x4d: - 0x20000000 0x4d - - - -******************************************************************************* -*** MODULE SUMMARY -*** - - Module ro code ro data rw data - ------ ------- ------- ------- -E:\Arduino 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Debug\Obj: [1] - cdc_enumerate.o 2 692 100 492 - interrupt_sam_nvic.o 1 1 - main.o 700 16 1 - sam_ba_monitor.o 1 312 84 100 - startup_samd21.o 36 176 - uart_driver.o 248 24 1 - usart_sam_ba.o 1 508 4 9 - ----------------------------------------------- - Total: 6 496 405 604 - -command line: [2] - ----------------------------------------------- - Total: - -dl6M_tln.a: [3] - exit.o 8 - memcpy.o 12 - memset.o 20 - ----------------------------------------------- - Total: 40 - -rt6M_tl.a: [4] - ABImemcpy.o 92 - ABImemset.o 84 - XXexit.o 12 - cexit.o 10 - cmain.o 26 - copy_init3.o 48 - cstartup_M.o 12 - data_init.o 40 - strlen.o 16 - zero_init3.o 42 - ----------------------------------------------- - Total: 382 - - Gaps 6 - Linker created 39 512 ---------------------------------------------------- - Grand Total: 6 924 444 1 116 - - -******************************************************************************* -*** ENTRY LIST -*** - -Entry Address Size Type Object ------ ------- ---- ---- ------ -.intvec$$Base 0x00000000 -- Gb - Linker created - -.intvec$$Limit 0x000000b0 -- Gb - Linker created - -?main 0x00001b81 Code Gb cmain.o [4] -AC_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -ADC_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -AT91F_CDC_Enumerate 0x000005d1 0x47c Code Lc cdc_enumerate.o [1] -AT91F_CDC_Open 0x00000221 0x24 Code Gb cdc_enumerate.o [1] -AT91F_InitUSB 0x000000b1 0x170 Code Gb cdc_enumerate.o [1] -AT91F_USB_SendData 0x0000054d 0xa Code Lc cdc_enumerate.o [1] -AT91F_USB_SendStall 0x000005b5 0x1c Code Gb cdc_enumerate.o [1] -AT91F_USB_SendZlp 0x00000557 0x3a Code Gb cdc_enumerate.o [1] -CSTACK$$Base 0x20000260 -- Gb - Linker created - -CSTACK$$Limit 0x20000460 -- Gb - Linker created - -DAC_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -DMAC_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -Dummy_Handler 0x00001b51 0x4 Code Gb startup_samd21.o [1] -EIC_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -EVSYS_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -HardFault_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -I2S_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -NMI_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -NVMCTRL_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -PM_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -PTC_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -PendSV_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -RTC_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -Region$$Table$$Base 0x00001bbc -- Gb - Linker created - -Region$$Table$$Limit 0x00001be0 -- Gb - Linker created - -Reset_Handler 0x00001b6d 0x8 Code Gb startup_samd21.o [1] -RomBOOT_Version 0x00001c70 0x4 Data Gb sam_ba_monitor.o [1] -SERCOM0_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -SERCOM1_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -SERCOM2_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -SERCOM3_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -SERCOM4_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -SERCOM5_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -SVC_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -SYSCTRL_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -SysTick_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -TC3_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -TC4_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -TC5_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -TC6_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -TC7_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -TCC0_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -TCC1_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -TCC2_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -USB_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -USB_IsConfigured 0x00000245 0xa0 Code Lc cdc_enumerate.o [1] -USB_Read 0x000002ed 0x8a Code Lc cdc_enumerate.o [1] -USB_Read_blocking 0x0000038d 0x76 Code Lc cdc_enumerate.o [1] -USB_Write 0x00000435 0x10a Code Lc cdc_enumerate.o [1] -WDT_Handler 0x00001b51 0x4 Code Wk startup_samd21.o [1] -__aeabi_memcpy 0x00000ba9 Code Gb ABImemcpy.o [4] -__aeabi_memcpy4 0x00000bd1 Code Gb ABImemcpy.o [4] -__aeabi_memcpy8 0x00000bd1 Code Gb ABImemcpy.o [4] -__aeabi_memset 0x00000b55 Code Gb ABImemset.o [4] -__cmain 0x00001b81 Code Gb cmain.o [4] -__exit 0x00001bb1 Code Gb XXexit.o [4] -__iar_Memset4_word 0x00000b75 Code Gb ABImemset.o [4] -__iar_Memset_word 0x00000b61 Code Gb ABImemset.o [4] -__iar_copy_init3 0x00001acd 0x30 Code Gb copy_init3.o [4] -__iar_data_init3 0x00001b29 0x28 Code Gb data_init.o [4] -__iar_program_start 0x00001b75 Code Gb cstartup_M.o [4] -__iar_zero_init3 0x00001afd 0x2a Code Gb zero_init3.o [4] -__low_level_init 0x00001b55 0xe Code Gb startup_samd21.o [1] -__vector_table 0x00000000 0xb0 Data Gb startup_samd21.o [1] -_call_main 0x00001b8d Code Gb cmain.o [4] -_exit 0x00001ba5 Code Gb cexit.o [4] -_main 0x00001b97 Code Gb cmain.o [4] -add_crc 0x00000e7f 0x2c Code Gb usart_sam_ba.o [1] -b_sam_ba_interface_usart - 0x20000254 0x1 Data Gb sam_ba_monitor.o [1] -b_sharp_received 0x20000258 0x1 Data Gb usart_sam_ba.o [1] -b_terminal_mode 0x20000253 0x1 Data Gb sam_ba_monitor.o [1] -call_applet 0x00001395 0x20 Code Gb sam_ba_monitor.o [1] -cdc_getc 0x00000a8d 0x12 Code Gb cdc_enumerate.o [1] -cdc_is_rx_ready 0x00000a9f 0x22 Code Gb cdc_enumerate.o [1] -cdc_putc 0x00000a77 0x12 Code Gb cdc_enumerate.o [1] -cdc_read_buf 0x00000add 0x20 Code Gb cdc_enumerate.o [1] -cdc_read_buf_xmd 0x00000afd 0x20 Code Gb cdc_enumerate.o [1] -cdc_write_buf 0x00000ac5 0x14 Code Gb cdc_enumerate.o [1] -cfgDescriptor 0x20000000 0x44 Data Gb cdc_enumerate.o [1] -check_start_application - 0x00001811 0x4e Code Lc main.o [1] -command 0x20000255 0x1 Data Gb sam_ba_monitor.o [1] -current_number 0x2000022c 0x4 Data Gb sam_ba_monitor.o [1] -data 0x200001d0 0x40 Data Gb sam_ba_monitor.o [1] -devDescriptor 0x00001c30 0x14 Data Gb cdc_enumerate.o [1] -error_timeout 0x2000025d 0x1 Data Gb usart_sam_ba.o [1] -exit 0x00001b9b 0x8 Code Gb exit.o [3] -g_interrupt_enabled 0x2000004c 0x1 Data Gb interrupt_sam_nvic.o [1] -getPacket 0x00000f91 0x70 Code Gb usart_sam_ba.o [1] -getbytes 0x00000eb1 0x62 Code Lc usart_sam_ba.o [1] -i 0x20000230 0x4 Data Gb sam_ba_monitor.o [1] -idx_rx_read 0x20000259 0x1 Data Gb usart_sam_ba.o [1] -idx_rx_write 0x2000025a 0x1 Data Gb usart_sam_ba.o [1] -idx_tx_read 0x2000025b 0x1 Data Gb usart_sam_ba.o [1] -idx_tx_write 0x2000025c 0x1 Data Gb usart_sam_ba.o [1] -j 0x20000256 0x1 Data Gb sam_ba_monitor.o [1] -length 0x20000234 0x4 Data Gb sam_ba_monitor.o [1] -line_coding 0x20000044 0x8 Data Lc cdc_enumerate.o [1] -main 0x000019eb 0x60 Code Gb main.o [1] -main_b_cdc_enable 0x20000252 0x1 Data Lc main.o [1] -memcpy 0x00000b49 0xc Code Gb memcpy.o [3] -memset 0x00000b35 0x14 Code Gb memset.o [3] -mode_of_transfer 0x2000025e 0x1 Data Gb usart_sam_ba.o [1] -pCdc 0x20000210 0x14 Data Lc cdc_enumerate.o [1] -ptr 0x2000023c 0x4 Data Gb sam_ba_monitor.o [1] -ptr_data 0x20000238 0x4 Data Gb sam_ba_monitor.o [1] -ptr_monitor_if 0x20000224 0x4 Data Gb sam_ba_monitor.o [1] -putPacket 0x00000f13 0x7a Code Lc usart_sam_ba.o [1] -read_job 0x2000024e 0x1 Data Lc cdc_enumerate.o [1] -sam_ba_monitor_init 0x000012e1 0x22 Code Gb sam_ba_monitor.o [1] -sam_ba_monitor_run 0x000013d1 0x3f0 Code Gb sam_ba_monitor.o [1] -sam_ba_putdata_term 0x00001303 0x92 Code Gb sam_ba_monitor.o [1] -size_of_data 0x2000024c 0x2 Data Gb usart_sam_ba.o [1] -sp 0x20000228 0x4 Data Gb sam_ba_monitor.o [1] -strlen 0x00001801 0x10 Code Gb strlen.o [4] -system_init 0x0000185f 0x18c Code Gb main.o [1] -u32tmp 0x20000240 0x4 Data Gb sam_ba_monitor.o [1] -uart_basic_init 0x00001217 0x6c Code Gb uart_driver.o [1] -uart_drv_error_flag 0x20000257 0x1 Data Gb uart_driver.o [1] -uart_get_sercom_index 0x000011e9 0x2e Code Gb uart_driver.o [1] -uart_if 0x00001be0 0x1c Data Gb sam_ba_monitor.o [1] -uart_read_byte 0x00001297 0x3e Code Gb uart_driver.o [1] -uart_write_byte 0x00001283 0x14 Code Gb uart_driver.o [1] -udd_ep_in_cache_buffer 0x20000150 0x80 Data Gb cdc_enumerate.o [1] -udd_ep_out_cache_buffer - 0x200000d0 0x80 Data Gb cdc_enumerate.o [1] -usart_getc 0x00000e19 0x14 Code Gb usart_sam_ba.o [1] -usart_getdata 0x00000e71 0xe Code Gb usart_sam_ba.o [1] -usart_getdata_xmd 0x00001119 0xbe Code Gb usart_sam_ba.o [1] -usart_is_rx_ready 0x00000e47 0xe Code Gb usart_sam_ba.o [1] -usart_open 0x00000c05 0x204 Code Gb usart_sam_ba.o [1] -usart_putc 0x00000e09 0x10 Code Gb usart_sam_ba.o [1] -usart_putdata 0x00000e55 0x1c Code Gb usart_sam_ba.o [1] -usart_putdata_xmd 0x00001031 0xd8 Code Gb usart_sam_ba.o [1] -usart_sharp_received 0x00000e2d 0x1a Code Gb usart_sam_ba.o [1] -usb_endpoint_table 0x20000050 0x80 Data Gb cdc_enumerate.o [1] -usb_init 0x00000a5d 0x1a Code Gb cdc_enumerate.o [1] -usbcdc_if 0x00001bfc 0x1c Data Gb sam_ba_monitor.o [1] - - -[1] = E:\Arduino 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Debug\Obj -[2] = command line -[3] = dl6M_tln.a -[4] = rt6M_tl.a - - 6 924 bytes of readonly code memory - 444 bytes of readonly data memory - 1 116 bytes of readwrite data memory - -Errors: none -Warnings: none diff --git a/bootloaders/zero/Makefile b/bootloaders/zero/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..d8fb2f3496f1afaed60b92ba7ba706c456879849 --- /dev/null +++ b/bootloaders/zero/Makefile @@ -0,0 +1,29 @@ +IDE_PATH="../../../../.." +ARM_GCC_PATH=$(IDE_PATH)/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin +CC=$(ARM_GCC_PATH)/arm-none-eabi-gcc +CFLAGS=-mthumb -mcpu=cortex-m0plus -Wall -c -g -Os -w -std=gnu99 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 +LDFLAGS=-mthumb -mcpu=cortex-m0plus -Wall -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols +BLD_EXTA_FLAGS=-D__SAMD21G18A__ +BUILD_PATH=build +INCLUDES=-I$(IDE_PATH)/hardware/tools/CMSIS/CMSIS/Include/ -I$(IDE_PATH)/hardware/tools/CMSIS/Device/ATMEL/ -I./drivers/ -I./utils/ -I./utils/preprocessor/ -I./utils/interrupt +SOURCES=main.c sam_ba_monitor.c startup_samd21.c usart_sam_ba.c drivers/cdc_enumerate.c drivers/uart_driver.c utils/interrupt/interrupt_sam_nvic.c +OBJECTS=$(addprefix $(BUILD_PATH)/, $(SOURCES:.c=.o)) + +NAME=samd21_sam_ba +EXECUTABLE=$(NAME).bin + +SLASH=/ +BSLASH=$(EMPTY)\$(EMPTY) + +all: $(SOURCES) $(EXECUTABLE) + +$(EXECUTABLE): $(OBJECTS) + $(CC) -L$(BUILD_PATH) $(LDFLAGS) -Os -Wl,--gc-sections -save-temps -Tsamd21j18a_flash.ld -Wl,-Map,$(BUILD_PATH)/$(NAME).map --specs=nano.specs --specs=nosys.specs -o $(BUILD_PATH)/$(NAME).elf $(OBJECTS) -Wl,--start-group -lm -Wl,--end-group + $(ARM_GCC_PATH)/arm-none-eabi-objcopy -O binary $(BUILD_PATH)/$(NAME).elf $@ + +$(BUILD_PATH)/%.o: %.c + -@mkdir -p $(@D) + $(CC) $(CFLAGS) $(BLD_EXTA_FLAGS) $(INCLUDES) $< -o $@ + +clean: + del $(EXECUTABLE) $(subst /,\,$(OBJECTS)) $(subst /,\,$(BUILD_PATH)/$(NAME).*) diff --git a/bootloaders/zero/Release/Exe/samd21_sam_ba.bin b/bootloaders/zero/Release/Exe/samd21_sam_ba.bin deleted file mode 100644 index 85f64d32907a6aabe148de2e4322e350a624b3ce..0000000000000000000000000000000000000000 Binary files a/bootloaders/zero/Release/Exe/samd21_sam_ba.bin and /dev/null differ diff --git a/bootloaders/zero/Release/Exe/samd21_sam_ba.out b/bootloaders/zero/Release/Exe/samd21_sam_ba.out deleted file mode 100644 index 9a77e3c9ac2d1b0fddc45281bc5c2bc8f9858c98..0000000000000000000000000000000000000000 Binary files a/bootloaders/zero/Release/Exe/samd21_sam_ba.out and /dev/null differ diff --git a/bootloaders/zero/Release/List/samd21_sam_ba.map b/bootloaders/zero/Release/List/samd21_sam_ba.map deleted file mode 100644 index 777c2b8cdc98e450882a910e4e7e7e2c05ceb5fc..0000000000000000000000000000000000000000 --- a/bootloaders/zero/Release/List/samd21_sam_ba.map +++ /dev/null @@ -1,326 +0,0 @@ -############################################################################### -# -# IAR ELF Linker V7.10.3.6832/W32 for ARM 07/Aug/2014 15:50:08 -# Copyright 2007-2014 IAR Systems AB. -# -# Output file = -# E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Release\Exe\samd21_sam_ba.out -# Map file = -# E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Release\List\samd21_sam_ba.map -# Command line = -# "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Release\Obj\cdc_enumerate.o" -# "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Release\Obj\interrupt_sam_nvic.o" -# "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Release\Obj\main.o" -# "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Release\Obj\sam_ba_monitor.o" -# "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Release\Obj\startup_samd21.o" -# "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Release\Obj\uart_driver.o" -# "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Release\Obj\usart_sam_ba.o" -# -o "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Release\Exe\samd21_sam_ba.out" -# --redirect _Printf=_PrintfFull --redirect _Scanf=_ScanfFull --map -# "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Release\List\samd21_sam_ba.map" -# --config "E:\Arduino -# 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\samd21_sam_ba.icf" -# --entry __iar_program_start --inline --vfe -# -############################################################################### - -******************************************************************************* -*** RUNTIME MODEL ATTRIBUTES -*** - -CppFlavor = * -__SystemLibrary = DLib - - -******************************************************************************* -*** PLACEMENT SUMMARY -*** - -"A1": place at 0x00000000 { ro section .intvec }; -"P1": place in [from 0x00000000 to 0x00001fff] { ro }; -"P2": place in [from 0x20000000 to 0x20007fff] { rw, block CSTACK, block HEAP }; - - Section Kind Address Size Object - ------- ---- ------- ---- ------ -"A1": 0xb0 - .intvec 0x00000000 0xb0 <Block> - .intvec const 0x00000000 0xb0 startup_samd21.o [1] - - 0x000000b0 0xb0 - -"P1": 0x1430 - .text ro code 0x000000b0 0x754 cdc_enumerate.o [1] - .text ro code 0x00000804 0x34 ABImemset.o [4] - .text ro code 0x00000838 0x5c ABImemcpy.o [4] - .text ro code 0x00000894 0x43c usart_sam_ba.o [1] - .text ro code 0x00000cd0 0xec uart_driver.o [1] - .text ro code 0x00000dbc 0x3b8 sam_ba_monitor.o [1] - .text ro code 0x00001174 0x10 strlen.o [4] - .text ro code 0x00001184 0x1ec main.o [1] - .text ro code 0x00001370 0x30 copy_init3.o [4] - .text ro code 0x000013a0 0x2a zero_init3.o [4] - .text ro code 0x000013cc 0x28 data_init.o [4] - .iar.init_table const 0x000013f4 0x24 - Linker created - - .text ro code 0x00001418 0x20 startup_samd21.o [1] - .text ro code 0x00001438 0xc cstartup_M.o [4] - .text ro code 0x00001444 0x1a cmain.o [4] - .text ro code 0x0000145e 0x8 exit.o [3] - .text ro code 0x00001468 0xa cexit.o [4] - .text ro code 0x00001474 0xc XXexit.o [4] - .rodata const 0x00001480 0x0 zero_init3.o [4] - .rodata const 0x00001480 0x0 copy_init3.o [4] - Initializer bytes ro data 0x00001480 0x60 <for P2 s0> - - 0x000014e0 0x1430 - -"P2", part 1 of 3: 0x60 - P2 s0 0x20000000 0x60 <Init block> - .data inited 0x20000000 0x58 cdc_enumerate.o [1] - .data inited 0x20000058 0x8 interrupt_sam_nvic.o [1] - - 0x20000060 0x60 - -"P2", part 2 of 3: 0x208 - .bss zero 0x20000060 0x114 cdc_enumerate.o [1] - .bss zero 0x20000174 0x80 cdc_enumerate.o [1] - .bss zero 0x200001f4 0x64 sam_ba_monitor.o [1] - .bss zero 0x20000258 0xa usart_sam_ba.o [1] - .bss zero 0x20000262 0x1 cdc_enumerate.o [1] - .bss zero 0x20000263 0x1 main.o [1] - .bss zero 0x20000264 0x1 uart_driver.o [1] - - 0x20000265 0x205 - -"P2", part 3 of 3: 0x200 - CSTACK 0x20000268 0x200 <Block> - CSTACK uninit 0x20000268 0x200 <Block tail> - - 0x20000468 0x200 - - -******************************************************************************* -*** INIT TABLE -*** - - Address Size - ------- ---- -Zero (__iar_zero_init3) - 1 destination range, total size 0x205: - 0x20000060 0x205 - -Copy (__iar_copy_init3) - 1 source range, total size 0x60: - 0x00001480 0x60 - 1 destination range, total size 0x60: - 0x20000000 0x60 - - - -******************************************************************************* -*** MODULE SUMMARY -*** - - Module ro code ro data rw data - ------ ------- ------- ------- -E:\Arduino 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Release\Obj: [1] - cdc_enumerate.o 1 876 88 493 - interrupt_sam_nvic.o 8 8 - main.o 492 1 - sam_ba_monitor.o 952 100 - startup_samd21.o 32 176 - uart_driver.o 236 1 - usart_sam_ba.o 1 084 10 - ----------------------------------------------- - Total: 4 672 272 613 - -command line: [2] - ----------------------------------------------- - Total: - -dl6M_tln.a: [3] - exit.o 8 - ----------------------------------------------- - Total: 8 - -rt6M_tl.a: [4] - ABImemcpy.o 92 - ABImemset.o 52 - XXexit.o 12 - cexit.o 10 - cmain.o 26 - copy_init3.o 48 - cstartup_M.o 12 - data_init.o 40 - strlen.o 16 - zero_init3.o 42 - ----------------------------------------------- - Total: 350 - - Gaps 6 - Linker created 36 512 ---------------------------------------------------- - Grand Total: 5 036 308 1 125 - - -******************************************************************************* -*** ENTRY LIST -*** - -Entry Address Size Type Object ------ ------- ---- ---- ------ -.intvec$$Base 0x00000000 -- Gb - Linker created - -.intvec$$Limit 0x000000b0 -- Gb - Linker created - -?main 0x00001445 Code Gb cmain.o [4] -AC_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -ADC_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -AT91F_CDC_Enumerate 0x0000039d 0x2e2 Code Lc cdc_enumerate.o [1] -AT91F_CDC_Open 0x000001a1 0x20 Code Gb cdc_enumerate.o [1] -AT91F_InitUSB 0x000000b1 0xea Code Gb cdc_enumerate.o [1] -AT91F_USB_SendZlp 0x00000327 0x28 Code Gb cdc_enumerate.o [1] -CSTACK$$Base 0x20000268 -- Gb - Linker created - -CSTACK$$Limit 0x20000468 -- Gb - Linker created - -DAC_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -DMAC_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -Dummy_Handler 0x00001419 0x2 Code Gb startup_samd21.o [1] -EIC_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -EVSYS_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -HardFault_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -I2S_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -NMI_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -NVMCTRL_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -PM_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -PTC_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -PendSV_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -RTC_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -Region$$Table$$Base 0x000013f4 -- Gb - Linker created - -Region$$Table$$Limit 0x00001418 -- Gb - Linker created - -Reset_Handler 0x00001431 0x8 Code Gb startup_samd21.o [1] -RomBOOT_Version 0x00001170 0x4 Data Gb sam_ba_monitor.o [1] -SERCOM0_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -SERCOM1_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -SERCOM2_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -SERCOM3_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -SERCOM4_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -SERCOM5_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -SVC_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -SYSCTRL_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -SysTick_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -TC3_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -TC4_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -TC5_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -TC6_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -TC7_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -TCC0_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -TCC1_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -TCC2_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -USB_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -USB_IsConfigured 0x000001c1 0x78 Code Lc cdc_enumerate.o [1] -USB_Read 0x00000239 0x70 Code Lc cdc_enumerate.o [1] -USB_Write 0x000002a9 0x7e Code Lc cdc_enumerate.o [1] -WDT_Handler 0x00001419 0x2 Code Wk startup_samd21.o [1] -__aeabi_memclr4 0x00000835 Code Gb ABImemset.o [4] -__aeabi_memclr8 0x00000835 Code Gb ABImemset.o [4] -__aeabi_memcpy 0x00000839 Code Gb ABImemcpy.o [4] -__aeabi_memcpy4 0x00000861 Code Gb ABImemcpy.o [4] -__aeabi_memcpy8 0x00000861 Code Gb ABImemcpy.o [4] -__cmain 0x00001445 Code Gb cmain.o [4] -__exit 0x00001475 Code Gb XXexit.o [4] -__iar_Memset4_word 0x00000805 Code Gb ABImemset.o [4] -__iar_copy_init3 0x00001371 0x30 Code Gb copy_init3.o [4] -__iar_data_init3 0x000013cd 0x28 Code Gb data_init.o [4] -__iar_program_start 0x00001439 Code Gb cstartup_M.o [4] -__iar_zero_init3 0x000013a1 0x2a Code Gb zero_init3.o [4] -__low_level_init 0x0000141b 0xe Code Gb startup_samd21.o [1] -__vector_table 0x00000000 0xb0 Data Gb startup_samd21.o [1] -_call_main 0x00001451 Code Gb cmain.o [4] -_exit 0x00001469 Code Gb cexit.o [4] -_main 0x0000145b Code Gb cmain.o [4] -add_crc 0x000009ad 0x24 Code Gb usart_sam_ba.o [1] -b_sam_ba_interface_usart - 0x200001f5 0x1 Data Gb sam_ba_monitor.o [1] -b_sharp_received 0x20000258 0x1 Data Gb usart_sam_ba.o [1] -b_terminal_mode 0x200001f4 0x1 Data Gb sam_ba_monitor.o [1] -cdc_getc 0x000006c9 0x68 Code Gb cdc_enumerate.o [1] -cdc_is_rx_ready 0x00000731 0x1c Code Gb cdc_enumerate.o [1] -cdc_putc 0x000006ad 0x12 Code Gb cdc_enumerate.o [1] -cdc_read_buf 0x00000765 0x1e Code Gb cdc_enumerate.o [1] -cdc_read_buf_xmd 0x00000783 0x66 Code Gb cdc_enumerate.o [1] -cdc_write_buf 0x00000751 0x14 Code Gb cdc_enumerate.o [1] -cfgDescriptor 0x2000000c 0x44 Data Gb cdc_enumerate.o [1] -command 0x200001f6 0x1 Data Gb sam_ba_monitor.o [1] -cpu_irq_critical_section_counter - 0x2000005c 0x4 Data Lc interrupt_sam_nvic.o [1] -cpu_irq_prev_interrupt_state - 0x20000058 0x1 Data Lc interrupt_sam_nvic.o [1] -current_number 0x20000200 0x4 Data Gb sam_ba_monitor.o [1] -data 0x20000218 0x40 Data Gb sam_ba_monitor.o [1] -devDescriptor 0x00000680 0x14 Data Gb cdc_enumerate.o [1] -error_timeout 0x2000025d 0x1 Data Gb usart_sam_ba.o [1] -exit 0x0000145f 0x8 Code Gb exit.o [3] -g_interrupt_enabled 0x20000059 0x1 Data Gb interrupt_sam_nvic.o [1] -getPacket 0x00000a37 0x7c Code Gb usart_sam_ba.o [1] -getbytes 0x000009d1 0x66 Code Lc usart_sam_ba.o [1] -i 0x20000204 0x4 Data Gb sam_ba_monitor.o [1] -idx_rx_read 0x20000259 0x1 Data Gb usart_sam_ba.o [1] -idx_rx_write 0x2000025a 0x1 Data Gb usart_sam_ba.o [1] -idx_tx_read 0x2000025b 0x1 Data Gb usart_sam_ba.o [1] -idx_tx_write 0x2000025c 0x1 Data Gb usart_sam_ba.o [1] -j 0x200001f7 0x1 Data Gb sam_ba_monitor.o [1] -length 0x20000208 0x4 Data Gb sam_ba_monitor.o [1] -line_coding 0x20000050 0x8 Data Lc cdc_enumerate.o [1] -main 0x0000128d 0x94 Code Gb main.o [1] -main_b_cdc_enable 0x20000263 0x1 Data Lc main.o [1] -mode_of_transfer 0x2000025e 0x1 Data Gb usart_sam_ba.o [1] -pCdc 0x200000e0 0x14 Data Lc cdc_enumerate.o [1] -ptr 0x20000210 0x4 Data Gb sam_ba_monitor.o [1] -ptr_data 0x2000020c 0x4 Data Gb sam_ba_monitor.o [1] -ptr_monitor_if 0x200001f8 0x4 Data Gb sam_ba_monitor.o [1] -read_job 0x20000262 0x1 Data Lc cdc_enumerate.o [1] -sam_ba_monitor_init 0x00000dbd 0x20 Code Gb sam_ba_monitor.o [1] -sam_ba_monitor_run 0x00000e8d 0x2b4 Code Gb sam_ba_monitor.o [1] -sam_ba_putdata_term 0x00000e15 0x74 Code Gb sam_ba_monitor.o [1] -size_of_data 0x20000260 0x2 Data Gb usart_sam_ba.o [1] -sp 0x200001fc 0x4 Data Gb sam_ba_monitor.o [1] -strlen 0x00001175 0x10 Code Gb strlen.o [4] -system_init 0x00001185 0x108 Code Gb main.o [1] -u32tmp 0x20000214 0x4 Data Gb sam_ba_monitor.o [1] -uart_basic_init 0x00000d07 0x5e Code Gb uart_driver.o [1] -uart_drv_error_flag 0x20000264 0x1 Data Gb uart_driver.o [1] -uart_get_sercom_index 0x00000cd1 0x36 Code Gb uart_driver.o [1] -uart_if 0x00000ddc 0x1c Data Gb sam_ba_monitor.o [1] -uart_read_byte 0x00000d71 0x2a Code Gb uart_driver.o [1] -uart_write_byte 0x00000d65 0xc Code Gb uart_driver.o [1] -udd_ep_in_cache_buffer 0x200000f4 0x80 Data Gb cdc_enumerate.o [1] -udd_ep_out_cache_buffer - 0x20000174 0x80 Data Gb cdc_enumerate.o [1] -usart_getc 0x0000093b 0x10 Code Gb usart_sam_ba.o [1] -usart_getdata 0x00000997 0x16 Code Gb usart_sam_ba.o [1] -usart_getdata_xmd 0x00000c2d 0x98 Code Gb usart_sam_ba.o [1] -usart_is_rx_ready 0x0000096b 0xa Code Gb usart_sam_ba.o [1] -usart_open 0x00000895 0x94 Code Gb usart_sam_ba.o [1] -usart_putc 0x0000092d 0xe Code Gb usart_sam_ba.o [1] -usart_putdata 0x00000975 0x22 Code Gb usart_sam_ba.o [1] -usart_putdata_xmd 0x00000ad5 0x14c Code Gb usart_sam_ba.o [1] -usart_sharp_received 0x0000094b 0x20 Code Gb usart_sam_ba.o [1] -usb_endpoint_table 0x20000060 0x80 Data Gb cdc_enumerate.o [1] -usb_init 0x00000695 0x18 Code Gb cdc_enumerate.o [1] -usbcdc_if 0x00000df8 0x1c Data Gb sam_ba_monitor.o [1] - - -[1] = E:\Arduino 2014\ArduinoZero\hardware\arduino\samd\bootloaders\zero\Release\Obj -[2] = command line -[3] = dl6M_tln.a -[4] = rt6M_tl.a - - 5 036 bytes of readonly code memory - 308 bytes of readonly data memory - 1 125 bytes of readwrite data memory - -Errors: none -Warnings: none diff --git a/bootloaders/zero/drivers/cdc_enumerate.c b/bootloaders/zero/drivers/cdc_enumerate.c index 300ce5b6cbf940c48d2681460c79a82608eff0ee..3bb4fd6e587c7d4a2333e1afe65fe3b10f6c4708 100644 --- a/bootloaders/zero/drivers/cdc_enumerate.c +++ b/bootloaders/zero/drivers/cdc_enumerate.c @@ -276,7 +276,7 @@ void AT91F_InitUSB(void) /* Set the descriptor address */ USB->HOST.DESCADD.reg = (uint32_t)(&usb_endpoint_table[0]); /* Set speed configuration to Full speed */ - USB->DEVICE.CTRLB.bit.SPDCONF = USB_DEVICE_CTRLB_SPDCONF_0_Val; + USB->DEVICE.CTRLB.bit.SPDCONF = USB_DEVICE_CTRLB_SPDCONF_FS_Val; /* Attach to the USB host */ USB->DEVICE.CTRLB.reg &= ~USB_DEVICE_CTRLB_DETACH; @@ -367,13 +367,14 @@ static uint32_t USB_Read(P_USB_CDC pCdc, char *pData, uint32_t length) } /* Check for Transfer Complete 0 flag */ - if ( pUsb->DEVICE.DeviceEndpoint[USB_EP_OUT].EPINTFLAG.reg & USB_DEVICE_EPINTFLAG_TRCPT0 ) { + if ( pUsb->DEVICE.DeviceEndpoint[USB_EP_OUT].EPINTFLAG.bit.TRCPT & (1<<0) ) { /* Set packet size */ packetSize = MIN(usb_endpoint_table[USB_EP_OUT].DeviceDescBank[0].PCKSIZE.bit.BYTE_COUNT, length); /* Copy read data to user buffer */ memcpy(pData, udd_ep_out_cache_buffer[USB_EP_OUT-1], packetSize); /* Clear the Transfer Complete 0 flag */ - pUsb->DEVICE.DeviceEndpoint[USB_EP_OUT].EPINTFLAG.bit.TRCPT0 = true; + //pUsb->DEVICE.DeviceEndpoint[USB_EP_OUT].EPINTFLAG.bit.TRCPT0 = true; + pUsb->DEVICE.DeviceEndpoint[USB_EP_OUT].EPINTFLAG.bit.TRCPT |= (1 << 0); /* Clear the user flag */ read_job = false; } @@ -401,9 +402,10 @@ static uint32_t USB_Read_blocking(P_USB_CDC pCdc, char *pData, uint32_t length) /* Clear the bank 0 ready flag */ pUsb->DEVICE.DeviceEndpoint[USB_EP_OUT].EPSTATUSCLR.bit.BK0RDY = true; /* Wait for transfer to complete */ - while (!( pUsb->DEVICE.DeviceEndpoint[USB_EP_OUT].EPINTFLAG.reg & USB_DEVICE_EPINTFLAG_TRCPT0 )); + while (!( pUsb->DEVICE.DeviceEndpoint[USB_EP_OUT].EPINTFLAG.bit.TRCPT & (1<<0) )); /* Clear Transfer complete 0 flag */ - pUsb->DEVICE.DeviceEndpoint[USB_EP_OUT].EPINTFLAG.bit.TRCPT0 = true; + //pUsb->DEVICE.DeviceEndpoint[USB_EP_OUT].EPINTFLAG.bit.TRCPT0 = true; + pUsb->DEVICE.DeviceEndpoint[USB_EP_OUT].EPINTFLAG.bit.TRCPT |= (1 << 0); return length; @@ -439,12 +441,13 @@ static uint32_t USB_Write(P_USB_CDC pCdc, const char *pData, uint32_t length, ui /* Set the multi packet size as zero for multi-packet transfers where length > ep size */ usb_endpoint_table[ep_num].DeviceDescBank[1].PCKSIZE.bit.MULTI_PACKET_SIZE = 0; /* Clear the transfer complete flag */ - pUsb->DEVICE.DeviceEndpoint[ep_num].EPINTFLAG.bit.TRCPT1 = true; + //pUsb->DEVICE.DeviceEndpoint[ep_num].EPINTFLAG.bit.TRCPT1 = true; + pUsb->DEVICE.DeviceEndpoint[ep_num].EPINTFLAG.bit.TRCPT |= (1 << 1); /* Set the bank as ready */ pUsb->DEVICE.DeviceEndpoint[ep_num].EPSTATUSSET.bit.BK1RDY = true; /* Wait for transfer to complete */ - while (!( pUsb->DEVICE.DeviceEndpoint[ep_num].EPINTFLAG.reg & USB_DEVICE_EPINTFLAG_TRCPT1 )); + while (!( pUsb->DEVICE.DeviceEndpoint[ep_num].EPINTFLAG.bit.TRCPT & (1<<1) )); return length; } @@ -468,11 +471,12 @@ void AT91F_USB_SendZlp(Usb *pUsb) /* Set the byte count as zero */ usb_endpoint_table[0].DeviceDescBank[1].PCKSIZE.bit.BYTE_COUNT = 0; /* Clear the transfer complete flag */ - pUsb->DEVICE.DeviceEndpoint[0].EPINTFLAG.bit.TRCPT1 = true; + //pUsb->DEVICE.DeviceEndpoint[0].EPINTFLAG.bit.TRCPT1 = true; + pUsb->DEVICE.DeviceEndpoint[0].EPINTFLAG.bit.TRCPT |= (1 << 1); /* Set the bank as ready */ pUsb->DEVICE.DeviceEndpoint[0].EPSTATUSSET.bit.BK1RDY = true; /* Wait for transfer to complete */ - while (!( pUsb->DEVICE.DeviceEndpoint[0].EPINTFLAG.reg & USB_DEVICE_EPINTFLAG_TRCPT1 )); + while (!( pUsb->DEVICE.DeviceEndpoint[0].EPINTFLAG.bit.TRCPT & (1<<1) )); } //*---------------------------------------------------------------------------- @@ -484,10 +488,12 @@ void AT91F_USB_SendStall(Usb *pUsb, bool direction_in) /* Check the direction */ if (direction_in) { /* Set STALL request on IN direction */ - pUsb->DEVICE.DeviceEndpoint[0].EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_STALLRQ1; + //pUsb->DEVICE.DeviceEndpoint[0].EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_STALLRQ1; + pUsb->DEVICE.DeviceEndpoint[0].EPSTATUSSET.bit.STALLRQ = (1<<1); } else { /* Set STALL request on OUT direction */ - pUsb->DEVICE.DeviceEndpoint[0].EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_STALLRQ0; + //pUsb->DEVICE.DeviceEndpoint[0].EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_STALLRQ0; + pUsb->DEVICE.DeviceEndpoint[0].EPSTATUSSET.bit.STALLRQ = (1<<0); } } @@ -579,9 +585,11 @@ void AT91F_CDC_Enumerate(P_USB_CDC pCdc) wIndex &= 0x0F; if (wIndex <= 3) { if (dir) { - wStatus = (pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUS.reg & USB_DEVICE_EPSTATUSSET_STALLRQ1) ? 1 : 0; + //wStatus = (pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUS.reg & USB_DEVICE_EPSTATUSSET_STALLRQ1) ? 1 : 0; + wStatus = (pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUS.bit.STALLRQ & (1<<1)) ? 1 : 0; } else { - wStatus = (pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUS.reg & USB_DEVICE_EPSTATUSSET_STALLRQ0) ? 1 : 0; + //wStatus = (pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUS.reg & USB_DEVICE_EPSTATUSSET_STALLRQ0) ? 1 : 0; + wStatus = (pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUS.bit.STALLRQ & (1<<0)) ? 1 : 0; } /* Return current status of endpoint */ AT91F_USB_SendData(pCdc, (char *) &wStatus, sizeof(wStatus)); @@ -604,9 +612,11 @@ void AT91F_CDC_Enumerate(P_USB_CDC pCdc) if ((wValue == 0) && wIndex && (wIndex <= 3)) { /* Set STALL request for the endpoint */ if (dir) { - pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_STALLRQ1; + //pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_STALLRQ1; + pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUSSET.bit.STALLRQ = (1<<1); } else { - pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_STALLRQ0; + //pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_STALLRQ0; + pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUSSET.bit.STALLRQ = (1<<0); } /* Send ZLP */ AT91F_USB_SendZlp(pUsb); @@ -628,21 +638,23 @@ void AT91F_CDC_Enumerate(P_USB_CDC pCdc) wIndex &= 0x0F; if ((wValue == 0) && wIndex && (wIndex <= 3)) { if (dir) { - if (pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUS.reg & USB_DEVICE_EPSTATUSSET_STALLRQ1) { + if (pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUS.bit.STALLRQ & (1<<1)) { // Remove stall request - pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_STALLRQ1; - if (pUsb->DEVICE.DeviceEndpoint[wIndex].EPINTFLAG.reg & USB_DEVICE_EPINTFLAG_STALL1) { - pUsb->DEVICE.DeviceEndpoint[wIndex].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_STALL1; + //pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_STALLRQ1; + pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUSCLR.bit.STALLRQ = (1<<1); + if (pUsb->DEVICE.DeviceEndpoint[wIndex].EPINTFLAG.bit.STALL & (1<<1)) { + pUsb->DEVICE.DeviceEndpoint[wIndex].EPINTFLAG.bit.STALL = (1<<1); // The Stall has occurred, then reset data toggle pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSSET_DTGLIN; } } } else { - if (pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUS.reg & USB_DEVICE_EPSTATUSSET_STALLRQ0) { + if (pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUS.bit.STALLRQ & (1<<0)) { // Remove stall request - pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_STALLRQ0; - if (pUsb->DEVICE.DeviceEndpoint[wIndex].EPINTFLAG.reg & USB_DEVICE_EPINTFLAG_STALL0) { - pUsb->DEVICE.DeviceEndpoint[wIndex].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_STALL0; + //pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_STALLRQ0; + pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUSCLR.bit.STALLRQ = (1<<0); + if (pUsb->DEVICE.DeviceEndpoint[wIndex].EPINTFLAG.bit.STALL & (1<<0)) { + pUsb->DEVICE.DeviceEndpoint[wIndex].EPINTFLAG.bit.STALL = (1<<0); // The Stall has occurred, then reset data toggle pUsb->DEVICE.DeviceEndpoint[wIndex].EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSSET_DTGLOUT; } @@ -711,7 +723,7 @@ bool cdc_is_rx_ready(void) return 0; /* Return transfer complete 0 flag status */ - return (pCdc.pUsb->DEVICE.DeviceEndpoint[USB_EP_OUT].EPINTFLAG.reg & USB_DEVICE_EPINTFLAG_TRCPT0); + return (pCdc.pUsb->DEVICE.DeviceEndpoint[USB_EP_OUT].EPINTFLAG.bit.TRCPT & (1<<0)); } uint32_t cdc_write_buf(void const* data, uint32_t length) diff --git a/bootloaders/zero/drivers/cdc_enumerate.h b/bootloaders/zero/drivers/cdc_enumerate.h index 259a46a6e61807ef1538c9493d2ae07f1cc9e54b..41002626f7a56fabc45c3f6665d34708b6f88e1e 100644 --- a/bootloaders/zero/drivers/cdc_enumerate.h +++ b/bootloaders/zero/drivers/cdc_enumerate.h @@ -30,7 +30,7 @@ #ifndef CDC_ENUMERATE_H #define CDC_ENUMERATE_H -#include "iosamd21.h" +#include "sam.h" #include "stdbool.h" #define USB_EP_OUT 2 diff --git a/bootloaders/zero/drivers/uart_driver.h b/bootloaders/zero/drivers/uart_driver.h index 8f4b440c428b2bda58a8416d634659eafba32ac3..84bfe1b1ac90ad8425d2a1bfacdb429fe1be90af 100644 --- a/bootloaders/zero/drivers/uart_driver.h +++ b/bootloaders/zero/drivers/uart_driver.h @@ -30,7 +30,7 @@ #ifndef UART_DRIVER_H #define UART_DRIVER_H #include <stdio.h> -#include "iosamd21.h" +#include "sam.h" #include <stdbool.h> #define PINMUX_UNUSED 0xFFFFFFFF diff --git a/bootloaders/zero/main.c b/bootloaders/zero/main.c index 83115157810413d0e77706b891db59da4b03d62b..a1c76860f55ee78704a82ef80854727a8553475b 100644 --- a/bootloaders/zero/main.c +++ b/bootloaders/zero/main.c @@ -73,7 +73,7 @@ */ #include <stdio.h> -#include <iosamd21.h> +#include <sam.h> #include "compiler.h" #include "sam_ba_monitor.h" #include "usart_sam_ba.h" @@ -93,6 +93,10 @@ static volatile bool main_b_cdc_enable = false; */ static void check_start_application(void) { + volatile PortGroup *led_port = (volatile PortGroup *)&PORT->Group[1]; + led_port->DIRSET.reg = (1<<30); + led_port->OUTCLR.reg = (1<<30); + uint32_t app_start_address; /* Load the Reset Handler address of the application */ @@ -124,6 +128,8 @@ static void check_start_application(void) return; } + led_port->OUTSET.reg = (1<<30); + /* Rebase the Stack Pointer */ __set_MSP(*(uint32_t *) APP_START_ADDRESS); diff --git a/bootloaders/zero/main.h b/bootloaders/zero/main.h index d41a77083a6575749729e8f0bd073f1a85be3f8a..d1d6941afbf380ab4da6ad9d711380b7ea380358 100644 --- a/bootloaders/zero/main.h +++ b/bootloaders/zero/main.h @@ -34,14 +34,18 @@ #define CPU_FREQUENCY 8000000 #define APP_START_ADDRESS 0x00002000 -#define BOOT_LOAD_PIN PIN_PA15 +#define BOOT_LOAD_PIN PIN_PA21 //Pin 7 +//#define BOOT_LOAD_PIN PIN_PA15 //Pin 5 #define BOOT_PIN_MASK (1U << (BOOT_LOAD_PIN & 0x1f)) #define FLASH_WAIT_STATES 1 -#define BOOT_USART_MODULE SERCOM5 +#define BOOT_USART_MODULE SERCOM0 +//#define BOOT_USART_MODULE SERCOM5 #define BOOT_USART_MUX_SETTINGS UART_RX_PAD3_TX_PAD2 -#define BOOT_USART_PAD3 PINMUX_PB23D_SERCOM5_PAD3 -#define BOOT_USART_PAD2 PINMUX_PB22D_SERCOM5_PAD2 +//#define BOOT_USART_PAD3 PINMUX_PB23D_SERCOM5_PAD3 +//#define BOOT_USART_PAD2 PINMUX_PB22D_SERCOM5_PAD2 +#define BOOT_USART_PAD3 PINMUX_PA11C_SERCOM0_PAD3 +#define BOOT_USART_PAD2 PINMUX_PA10C_SERCOM0_PAD2 #define BOOT_USART_PAD1 PINMUX_UNUSED #define BOOT_USART_PAD0 PINMUX_UNUSED diff --git a/bootloaders/zero/sam_ba_monitor.c b/bootloaders/zero/sam_ba_monitor.c index d7e4b4654321d93536542faa919819d67e3b3877..1df6d0437017094c0b635edf36406d9b36f9a24f 100644 --- a/bootloaders/zero/sam_ba_monitor.c +++ b/bootloaders/zero/sam_ba_monitor.c @@ -27,7 +27,7 @@ * ---------------------------------------------------------------------------- */ -#include "iosamd21.h" +#include "sam.h" #include <string.h> #include "sam_ba_monitor.h" #include "usart_sam_ba.h" diff --git a/bootloaders/zero/samd21_sam_ba.bin b/bootloaders/zero/samd21_sam_ba.bin new file mode 100644 index 0000000000000000000000000000000000000000..042c36320aa8edf90875b9cbc5ed4d23beebcac2 Binary files /dev/null and b/bootloaders/zero/samd21_sam_ba.bin differ diff --git a/bootloaders/zero/samd21_sam_ba.ewp b/bootloaders/zero/samd21_sam_ba.ewp deleted file mode 100644 index 219d1e6489674f526fb6f408cd03442fff39f6a5..0000000000000000000000000000000000000000 --- a/bootloaders/zero/samd21_sam_ba.ewp +++ /dev/null @@ -1,1976 +0,0 @@ -<?xml version="1.0" encoding="iso-8859-1"?> - -<project> - <fileVersion>2</fileVersion> - <configuration> - <name>Debug</name> - <toolchain> - <name>ARM</name> - </toolchain> - <debug>1</debug> - <settings> - <name>General</name> - <archiveVersion>3</archiveVersion> - <data> - <version>22</version> - <wantNonLocal>1</wantNonLocal> - <debug>1</debug> - <option> - <name>ExePath</name> - <state>Debug\Exe</state> - </option> - <option> - <name>ObjPath</name> - <state>Debug\Obj</state> - </option> - <option> - <name>ListPath</name> - <state>Debug\List</state> - </option> - <option> - <name>Variant</name> - <version>20</version> - <state>35</state> - </option> - <option> - <name>GEndianMode</name> - <state>0</state> - </option> - <option> - <name>Input variant</name> - <version>3</version> - <state>1</state> - </option> - <option> - <name>Input description</name> - <state>Full formatting.</state> - </option> - <option> - <name>Output variant</name> - <version>2</version> - <state>1</state> - </option> - <option> - <name>Output description</name> - <state>Full formatting.</state> - </option> - <option> - <name>GOutputBinary</name> - <state>0</state> - </option> - <option> - <name>FPU</name> - <version>2</version> - <state>0</state> - </option> - <option> - <name>OGCoreOrChip</name> - <state>1</state> - </option> - <option> - <name>GRuntimeLibSelect</name> - <version>0</version> - <state>1</state> - </option> - <option> - <name>GRuntimeLibSelectSlave</name> - <version>0</version> - <state>1</state> - </option> - <option> - <name>RTDescription</name> - <state>Use the normal configuration of the C/C++ runtime library. No locale interface, C locale, no file descriptor support, no multibytes in printf and scanf, and no hex floats in strtod.</state> - </option> - <option> - <name>OGProductVersion</name> - <state>5.10.0.159</state> - </option> - <option> - <name>OGLastSavedByProductVersion</name> - <state>7.10.3.6927</state> - </option> - <option> - <name>GeneralEnableMisra</name> - <state>0</state> - </option> - <option> - <name>GeneralMisraVerbose</name> - <state>0</state> - </option> - <option> - <name>OGChipSelectEditMenu</name> - <state>ATSAMD21G18A Atmel ATSAMD21G18A</state> - </option> - <option> - <name>GenLowLevelInterface</name> - <state>0</state> - </option> - <option> - <name>GEndianModeBE</name> - <state>1</state> - </option> - <option> - <name>OGBufferedTerminalOutput</name> - <state>0</state> - </option> - <option> - <name>GenStdoutInterface</name> - <state>0</state> - </option> - <option> - <name>GeneralMisraRules98</name> - <version>0</version> - <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state> - </option> - <option> - <name>GeneralMisraVer</name> - <state>0</state> - </option> - <option> - <name>GeneralMisraRules04</name> - <version>0</version> - <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state> - </option> - <option> - <name>RTConfigPath2</name> - <state>$TOOLKIT_DIR$\INC\c\DLib_Config_Normal.h</state> - </option> - <option> - <name>GFPUCoreSlave</name> - <version>20</version> - <state>35</state> - </option> - <option> - <name>GBECoreSlave</name> - <version>20</version> - <state>35</state> - </option> - <option> - <name>OGUseCmsis</name> - <state>0</state> - </option> - <option> - <name>OGUseCmsisDspLib</name> - <state>0</state> - </option> - <option> - <name>GRuntimeLibThreads</name> - <state>0</state> - </option> - </data> - </settings> - <settings> - <name>ICCARM</name> - <archiveVersion>2</archiveVersion> - <data> - <version>31</version> - <wantNonLocal>1</wantNonLocal> - <debug>1</debug> - <option> - <name>CCDefines</name> - <state>__ATSAMD21G18A__</state> - <state>SAM_BA_INTERFACE=SAM_BA_BOTH_INTERFACES</state> - </option> - <option> - <name>CCPreprocFile</name> - <state>0</state> - </option> - <option> - <name>CCPreprocComments</name> - <state>0</state> - </option> - <option> - <name>CCPreprocLine</name> - <state>0</state> - </option> - <option> - <name>CCListCFile</name> - <state>0</state> - </option> - <option> - <name>CCListCMnemonics</name> - <state>0</state> - </option> - <option> - <name>CCListCMessages</name> - <state>0</state> - </option> - <option> - <name>CCListAssFile</name> - <state>0</state> - </option> - <option> - <name>CCListAssSource</name> - <state>0</state> - </option> - <option> - <name>CCEnableRemarks</name> - <state>0</state> - </option> - <option> - <name>CCDiagSuppress</name> - <state></state> - </option> - <option> - <name>CCDiagRemark</name> - <state></state> - </option> - <option> - <name>CCDiagWarning</name> - <state></state> - </option> - <option> - <name>CCDiagError</name> - <state></state> - </option> - <option> - <name>CCObjPrefix</name> - <state>1</state> - </option> - <option> - <name>CCAllowList</name> - <version>1</version> - <state>00000000</state> - </option> - <option> - <name>CCDebugInfo</name> - <state>1</state> - </option> - <option> - <name>IEndianMode</name> - <state>1</state> - </option> - <option> - <name>IProcessor</name> - <state>1</state> - </option> - <option> - <name>IExtraOptionsCheck</name> - <state>0</state> - </option> - <option> - <name>IExtraOptions</name> - <state></state> - </option> - <option> - <name>CCLangConformance</name> - <state>0</state> - </option> - <option> - <name>CCSignedPlainChar</name> - <state>1</state> - </option> - <option> - <name>CCRequirePrototypes</name> - <state>0</state> - </option> - <option> - <name>CCMultibyteSupport</name> - <state>0</state> - </option> - <option> - <name>CCDiagWarnAreErr</name> - <state>0</state> - </option> - <option> - <name>CCCompilerRuntimeInfo</name> - <state>0</state> - </option> - <option> - <name>IFpuProcessor</name> - <state>1</state> - </option> - <option> - <name>OutputFile</name> - <state>$FILE_BNAME$.o</state> - </option> - <option> - <name>CCLibConfigHeader</name> - <state>1</state> - </option> - <option> - <name>PreInclude</name> - <state></state> - </option> - <option> - <name>CompilerMisraOverride</name> - <state>0</state> - </option> - <option> - <name>CCIncludePath2</name> - <state>$TOOLKIT_DIR$\inc\Atmel</state> - <state>$TOOLKIT_DIR$\inc\Atmel\samd21</state> - <state>$TOOLKIT_DIR$\CMSIS\Include</state> - <state>$PROJ_DIR$\</state> - <state>$PROJ_DIR$\drivers</state> - <state>$PROJ_DIR$\utils</state> - <state>$PROJ_DIR$\utils\interrupt</state> - <state>$PROJ_DIR$\utils\preprocessor</state> - </option> - <option> - <name>CCStdIncCheck</name> - <state>0</state> - </option> - <option> - <name>CCCodeSection</name> - <state>.text</state> - </option> - <option> - <name>IInterwork2</name> - <state>0</state> - </option> - <option> - <name>IProcessorMode2</name> - <state>1</state> - </option> - <option> - <name>CCOptLevel</name> - <state>1</state> - </option> - <option> - <name>CCOptStrategy</name> - <version>0</version> - <state>0</state> - </option> - <option> - <name>CCOptLevelSlave</name> - <state>1</state> - </option> - <option> - <name>CompilerMisraRules98</name> - <version>0</version> - <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state> - </option> - <option> - <name>CompilerMisraRules04</name> - <version>0</version> - <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state> - </option> - <option> - <name>CCPosIndRopi</name> - <state>0</state> - </option> - <option> - <name>CCPosIndRwpi</name> - <state>0</state> - </option> - <option> - <name>CCPosIndNoDynInit</name> - <state>0</state> - </option> - <option> - <name>IccLang</name> - <state>0</state> - </option> - <option> - <name>IccCDialect</name> - <state>1</state> - </option> - <option> - <name>IccAllowVLA</name> - <state>0</state> - </option> - <option> - <name>IccCppDialect</name> - <state>1</state> - </option> - <option> - <name>IccExceptions</name> - <state>1</state> - </option> - <option> - <name>IccRTTI</name> - <state>1</state> - </option> - <option> - <name>IccStaticDestr</name> - <state>1</state> - </option> - <option> - <name>IccCppInlineSemantics</name> - <state>0</state> - </option> - <option> - <name>IccCmsis</name> - <state>1</state> - </option> - <option> - <name>IccFloatSemantics</name> - <state>0</state> - </option> - <option> - <name>CCOptimizationNoSizeConstraints</name> - <state>0</state> - </option> - <option> - <name>CCNoLiteralPool</name> - <state>0</state> - </option> - <option> - <name>CCOptStrategySlave</name> - <version>0</version> - <state>0</state> - </option> - <option> - <name>CCGuardCalls</name> - <state>1</state> - </option> - </data> - </settings> - <settings> - <name>AARM</name> - <archiveVersion>2</archiveVersion> - <data> - <version>9</version> - <wantNonLocal>1</wantNonLocal> - <debug>1</debug> - <option> - <name>AObjPrefix</name> - <state>1</state> - </option> - <option> - <name>AEndian</name> - <state>1</state> - </option> - <option> - <name>ACaseSensitivity</name> - <state>1</state> - </option> - <option> - <name>MacroChars</name> - <version>0</version> - <state>0</state> - </option> - <option> - <name>AWarnEnable</name> - <state>0</state> - </option> - <option> - <name>AWarnWhat</name> - <state>0</state> - </option> - <option> - <name>AWarnOne</name> - <state></state> - </option> - <option> - <name>AWarnRange1</name> - <state></state> - </option> - <option> - <name>AWarnRange2</name> - <state></state> - </option> - <option> - <name>ADebug</name> - <state>1</state> - </option> - <option> - <name>AltRegisterNames</name> - <state>0</state> - </option> - <option> - <name>ADefines</name> - <state>__ATSAMD21J18A__</state> - <state>SAM_BA_INTERFACE=SAM_BA_UART_ONLY</state> - </option> - <option> - <name>AList</name> - <state>0</state> - </option> - <option> - <name>AListHeader</name> - <state>1</state> - </option> - <option> - <name>AListing</name> - <state>1</state> - </option> - <option> - <name>Includes</name> - <state>0</state> - </option> - <option> - <name>MacDefs</name> - <state>0</state> - </option> - <option> - <name>MacExps</name> - <state>1</state> - </option> - <option> - <name>MacExec</name> - <state>0</state> - </option> - <option> - <name>OnlyAssed</name> - <state>0</state> - </option> - <option> - <name>MultiLine</name> - <state>0</state> - </option> - <option> - <name>PageLengthCheck</name> - <state>0</state> - </option> - <option> - <name>PageLength</name> - <state>80</state> - </option> - <option> - <name>TabSpacing</name> - <state>8</state> - </option> - <option> - <name>AXRef</name> - <state>0</state> - </option> - <option> - <name>AXRefDefines</name> - <state>0</state> - </option> - <option> - <name>AXRefInternal</name> - <state>0</state> - </option> - <option> - <name>AXRefDual</name> - <state>0</state> - </option> - <option> - <name>AProcessor</name> - <state>1</state> - </option> - <option> - <name>AFpuProcessor</name> - <state>1</state> - </option> - <option> - <name>AOutputFile</name> - <state>$FILE_BNAME$.o</state> - </option> - <option> - <name>AMultibyteSupport</name> - <state>0</state> - </option> - <option> - <name>ALimitErrorsCheck</name> - <state>0</state> - </option> - <option> - <name>ALimitErrorsEdit</name> - <state>100</state> - </option> - <option> - <name>AIgnoreStdInclude</name> - <state>0</state> - </option> - <option> - <name>AUserIncludes</name> - <state>$TOOLKIT_DIR$\inc\Atmel\</state> - <state>$TOOLKIT_DIR$\inc\Atmel\samd21</state> - <state>$TOOLKIT_DIR$\CMSIS\Include</state> - <state>$PROJ_DIR$\</state> - <state>$PROJ_DIR$\drivers</state> - <state>$TOOLKIT_DIR$\inc\Atmel</state> - <state>$TOOLKIT_DIR$\inc\Atmel\samd21</state> - </option> - <option> - <name>AExtraOptionsCheckV2</name> - <state>0</state> - </option> - <option> - <name>AExtraOptionsV2</name> - <state></state> - </option> - <option> - <name>AsmNoLiteralPool</name> - <state>0</state> - </option> - </data> - </settings> - <settings> - <name>OBJCOPY</name> - <archiveVersion>0</archiveVersion> - <data> - <version>1</version> - <wantNonLocal>1</wantNonLocal> - <debug>1</debug> - <option> - <name>OOCOutputFormat</name> - <version>2</version> - <state>2</state> - </option> - <option> - <name>OCOutputOverride</name> - <state>0</state> - </option> - <option> - <name>OOCOutputFile</name> - <state>samd21_sam_ba.bin</state> - </option> - <option> - <name>OOCCommandLineProducer</name> - <state>1</state> - </option> - <option> - <name>OOCObjCopyEnable</name> - <state>1</state> - </option> - </data> - </settings> - <settings> - <name>CUSTOM</name> - <archiveVersion>3</archiveVersion> - <data> - <extensions></extensions> - <cmdline></cmdline> - </data> - </settings> - <settings> - <name>BICOMP</name> - <archiveVersion>0</archiveVersion> - <data/> - </settings> - <settings> - <name>BUILDACTION</name> - <archiveVersion>1</archiveVersion> - <data> - <prebuild></prebuild> - <postbuild></postbuild> - </data> - </settings> - <settings> - <name>ILINK</name> - <archiveVersion>0</archiveVersion> - <data> - <version>16</version> - <wantNonLocal>1</wantNonLocal> - <debug>1</debug> - <option> - <name>IlinkOutputFile</name> - <state>samd21_sam_ba.out</state> - </option> - <option> - <name>IlinkLibIOConfig</name> - <state>1</state> - </option> - <option> - <name>XLinkMisraHandler</name> - <state>0</state> - </option> - <option> - <name>IlinkInputFileSlave</name> - <state>0</state> - </option> - <option> - <name>IlinkDebugInfoEnable</name> - <state>1</state> - </option> - <option> - <name>IlinkKeepSymbols</name> - <state></state> - </option> - <option> - <name>IlinkRawBinaryFile</name> - <state></state> - </option> - <option> - <name>IlinkRawBinarySymbol</name> - <state></state> - </option> - <option> - <name>IlinkRawBinarySegment</name> - <state></state> - </option> - <option> - <name>IlinkRawBinaryAlign</name> - <state></state> - </option> - <option> - <name>IlinkDefines</name> - <state></state> - </option> - <option> - <name>IlinkConfigDefines</name> - <state></state> - </option> - <option> - <name>IlinkMapFile</name> - <state>1</state> - </option> - <option> - <name>IlinkLogFile</name> - <state>0</state> - </option> - <option> - <name>IlinkLogInitialization</name> - <state>0</state> - </option> - <option> - <name>IlinkLogModule</name> - <state>0</state> - </option> - <option> - <name>IlinkLogSection</name> - <state>0</state> - </option> - <option> - <name>IlinkLogVeneer</name> - <state>0</state> - </option> - <option> - <name>IlinkIcfOverride</name> - <state>1</state> - </option> - <option> - <name>IlinkIcfFile</name> - <state>$PROJ_DIR$\samd21_sam_ba.icf</state> - </option> - <option> - <name>IlinkIcfFileSlave</name> - <state></state> - </option> - <option> - <name>IlinkEnableRemarks</name> - <state>0</state> - </option> - <option> - <name>IlinkSuppressDiags</name> - <state></state> - </option> - <option> - <name>IlinkTreatAsRem</name> - <state></state> - </option> - <option> - <name>IlinkTreatAsWarn</name> - <state></state> - </option> - <option> - <name>IlinkTreatAsErr</name> - <state></state> - </option> - <option> - <name>IlinkWarningsAreErrors</name> - <state>0</state> - </option> - <option> - <name>IlinkUseExtraOptions</name> - <state>0</state> - </option> - <option> - <name>IlinkExtraOptions</name> - <state></state> - </option> - <option> - <name>IlinkLowLevelInterfaceSlave</name> - <state>1</state> - </option> - <option> - <name>IlinkAutoLibEnable</name> - <state>1</state> - </option> - <option> - <name>IlinkAdditionalLibs</name> - <state></state> - </option> - <option> - <name>IlinkOverrideProgramEntryLabel</name> - <state>0</state> - </option> - <option> - <name>IlinkProgramEntryLabelSelect</name> - <state>0</state> - </option> - <option> - <name>IlinkProgramEntryLabel</name> - <state>__iar_program_start</state> - </option> - <option> - <name>DoFill</name> - <state>0</state> - </option> - <option> - <name>FillerByte</name> - <state>0xFF</state> - </option> - <option> - <name>FillerStart</name> - <state>0x0</state> - </option> - <option> - <name>FillerEnd</name> - <state>0x1fff</state> - </option> - <option> - <name>CrcSize</name> - <version>0</version> - <state>1</state> - </option> - <option> - <name>CrcAlign</name> - <state>1</state> - </option> - <option> - <name>CrcPoly</name> - <state>0x11021</state> - </option> - <option> - <name>CrcCompl</name> - <version>0</version> - <state>0</state> - </option> - <option> - <name>CrcBitOrder</name> - <version>0</version> - <state>0</state> - </option> - <option> - <name>CrcInitialValue</name> - <state>0x0</state> - </option> - <option> - <name>DoCrc</name> - <state>0</state> - </option> - <option> - <name>IlinkBE8Slave</name> - <state>1</state> - </option> - <option> - <name>IlinkBufferedTerminalOutput</name> - <state>1</state> - </option> - <option> - <name>IlinkStdoutInterfaceSlave</name> - <state>1</state> - </option> - <option> - <name>CrcFullSize</name> - <state>0</state> - </option> - <option> - <name>IlinkIElfToolPostProcess</name> - <state>0</state> - </option> - <option> - <name>IlinkLogAutoLibSelect</name> - <state>0</state> - </option> - <option> - <name>IlinkLogRedirSymbols</name> - <state>0</state> - </option> - <option> - <name>IlinkLogUnusedFragments</name> - <state>0</state> - </option> - <option> - <name>IlinkCrcReverseByteOrder</name> - <state>0</state> - </option> - <option> - <name>IlinkCrcUseAsInput</name> - <state>1</state> - </option> - <option> - <name>IlinkOptInline</name> - <state>0</state> - </option> - <option> - <name>IlinkOptExceptionsAllow</name> - <state>1</state> - </option> - <option> - <name>IlinkOptExceptionsForce</name> - <state>0</state> - </option> - <option> - <name>IlinkCmsis</name> - <state>1</state> - </option> - <option> - <name>IlinkOptMergeDuplSections</name> - <state>0</state> - </option> - <option> - <name>IlinkOptUseVfe</name> - <state>1</state> - </option> - <option> - <name>IlinkOptForceVfe</name> - <state>0</state> - </option> - <option> - <name>IlinkStackAnalysisEnable</name> - <state>0</state> - </option> - <option> - <name>IlinkStackControlFile</name> - <state></state> - </option> - <option> - <name>IlinkStackCallGraphFile</name> - <state></state> - </option> - <option> - <name>CrcAlgorithm</name> - <version>0</version> - <state>1</state> - </option> - <option> - <name>CrcUnitSize</name> - <version>0</version> - <state>0</state> - </option> - <option> - <name>IlinkThreadsSlave</name> - <state>1</state> - </option> - </data> - </settings> - <settings> - <name>IARCHIVE</name> - <archiveVersion>0</archiveVersion> - <data> - <version>0</version> - <wantNonLocal>1</wantNonLocal> - <debug>1</debug> - <option> - <name>IarchiveInputs</name> - <state></state> - </option> - <option> - <name>IarchiveOverride</name> - <state>0</state> - </option> - <option> - <name>IarchiveOutput</name> - <state>###Unitialized###</state> - </option> - </data> - </settings> - <settings> - <name>BILINK</name> - <archiveVersion>0</archiveVersion> - <data/> - </settings> - </configuration> - <configuration> - <name>Release</name> - <toolchain> - <name>ARM</name> - </toolchain> - <debug>0</debug> - <settings> - <name>General</name> - <archiveVersion>3</archiveVersion> - <data> - <version>22</version> - <wantNonLocal>1</wantNonLocal> - <debug>0</debug> - <option> - <name>ExePath</name> - <state>Release\Exe</state> - </option> - <option> - <name>ObjPath</name> - <state>Release\Obj</state> - </option> - <option> - <name>ListPath</name> - <state>Release\List</state> - </option> - <option> - <name>Variant</name> - <version>20</version> - <state>35</state> - </option> - <option> - <name>GEndianMode</name> - <state>0</state> - </option> - <option> - <name>Input variant</name> - <version>3</version> - <state>1</state> - </option> - <option> - <name>Input description</name> - <state>Full formatting.</state> - </option> - <option> - <name>Output variant</name> - <version>2</version> - <state>1</state> - </option> - <option> - <name>Output description</name> - <state>Full formatting.</state> - </option> - <option> - <name>GOutputBinary</name> - <state>0</state> - </option> - <option> - <name>FPU</name> - <version>2</version> - <state>0</state> - </option> - <option> - <name>OGCoreOrChip</name> - <state>1</state> - </option> - <option> - <name>GRuntimeLibSelect</name> - <version>0</version> - <state>1</state> - </option> - <option> - <name>GRuntimeLibSelectSlave</name> - <version>0</version> - <state>1</state> - </option> - <option> - <name>RTDescription</name> - <state>Use the normal configuration of the C/C++ runtime library. No locale interface, C locale, no file descriptor support, no multibytes in printf and scanf, and no hex floats in strtod.</state> - </option> - <option> - <name>OGProductVersion</name> - <state>5.10.0.159</state> - </option> - <option> - <name>OGLastSavedByProductVersion</name> - <state>7.10.3.6927</state> - </option> - <option> - <name>GeneralEnableMisra</name> - <state>0</state> - </option> - <option> - <name>GeneralMisraVerbose</name> - <state>0</state> - </option> - <option> - <name>OGChipSelectEditMenu</name> - <state>ATSAMD21G18A Atmel ATSAMD21G18A</state> - </option> - <option> - <name>GenLowLevelInterface</name> - <state>0</state> - </option> - <option> - <name>GEndianModeBE</name> - <state>1</state> - </option> - <option> - <name>OGBufferedTerminalOutput</name> - <state>0</state> - </option> - <option> - <name>GenStdoutInterface</name> - <state>0</state> - </option> - <option> - <name>GeneralMisraRules98</name> - <version>0</version> - <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state> - </option> - <option> - <name>GeneralMisraVer</name> - <state>0</state> - </option> - <option> - <name>GeneralMisraRules04</name> - <version>0</version> - <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state> - </option> - <option> - <name>RTConfigPath2</name> - <state>$TOOLKIT_DIR$\INC\c\DLib_Config_Normal.h</state> - </option> - <option> - <name>GFPUCoreSlave</name> - <version>20</version> - <state>35</state> - </option> - <option> - <name>GBECoreSlave</name> - <version>20</version> - <state>35</state> - </option> - <option> - <name>OGUseCmsis</name> - <state>0</state> - </option> - <option> - <name>OGUseCmsisDspLib</name> - <state>0</state> - </option> - <option> - <name>GRuntimeLibThreads</name> - <state>0</state> - </option> - </data> - </settings> - <settings> - <name>ICCARM</name> - <archiveVersion>2</archiveVersion> - <data> - <version>31</version> - <wantNonLocal>1</wantNonLocal> - <debug>0</debug> - <option> - <name>CCDefines</name> - <state>NDEBUG</state> - <state>__ATSAMD21G18A__</state> - <state>SAM_BA_INTERFACE=SAM_BA_BOTH_INTERFACES</state> - </option> - <option> - <name>CCPreprocFile</name> - <state>0</state> - </option> - <option> - <name>CCPreprocComments</name> - <state>0</state> - </option> - <option> - <name>CCPreprocLine</name> - <state>0</state> - </option> - <option> - <name>CCListCFile</name> - <state>0</state> - </option> - <option> - <name>CCListCMnemonics</name> - <state>0</state> - </option> - <option> - <name>CCListCMessages</name> - <state>0</state> - </option> - <option> - <name>CCListAssFile</name> - <state>0</state> - </option> - <option> - <name>CCListAssSource</name> - <state>0</state> - </option> - <option> - <name>CCEnableRemarks</name> - <state>0</state> - </option> - <option> - <name>CCDiagSuppress</name> - <state></state> - </option> - <option> - <name>CCDiagRemark</name> - <state></state> - </option> - <option> - <name>CCDiagWarning</name> - <state></state> - </option> - <option> - <name>CCDiagError</name> - <state></state> - </option> - <option> - <name>CCObjPrefix</name> - <state>1</state> - </option> - <option> - <name>CCAllowList</name> - <version>1</version> - <state>11111110</state> - </option> - <option> - <name>CCDebugInfo</name> - <state>0</state> - </option> - <option> - <name>IEndianMode</name> - <state>1</state> - </option> - <option> - <name>IProcessor</name> - <state>1</state> - </option> - <option> - <name>IExtraOptionsCheck</name> - <state>0</state> - </option> - <option> - <name>IExtraOptions</name> - <state></state> - </option> - <option> - <name>CCLangConformance</name> - <state>0</state> - </option> - <option> - <name>CCSignedPlainChar</name> - <state>1</state> - </option> - <option> - <name>CCRequirePrototypes</name> - <state>0</state> - </option> - <option> - <name>CCMultibyteSupport</name> - <state>0</state> - </option> - <option> - <name>CCDiagWarnAreErr</name> - <state>0</state> - </option> - <option> - <name>CCCompilerRuntimeInfo</name> - <state>0</state> - </option> - <option> - <name>IFpuProcessor</name> - <state>1</state> - </option> - <option> - <name>OutputFile</name> - <state>$FILE_BNAME$.o</state> - </option> - <option> - <name>CCLibConfigHeader</name> - <state>1</state> - </option> - <option> - <name>PreInclude</name> - <state></state> - </option> - <option> - <name>CompilerMisraOverride</name> - <state>0</state> - </option> - <option> - <name>CCIncludePath2</name> - <state>$TOOLKIT_DIR$\inc\Atmel</state> - <state>$TOOLKIT_DIR$\inc\Atmel\samd21</state> - <state>$TOOLKIT_DIR$\CMSIS\Include</state> - <state>$PROJ_DIR$\</state> - <state>$PROJ_DIR$\drivers</state> - <state>$PROJ_DIR$\utils</state> - <state>$PROJ_DIR$\utils\interrupt</state> - <state>$PROJ_DIR$\utils\preprocessor</state> - </option> - <option> - <name>CCStdIncCheck</name> - <state>0</state> - </option> - <option> - <name>CCCodeSection</name> - <state>.text</state> - </option> - <option> - <name>IInterwork2</name> - <state>0</state> - </option> - <option> - <name>IProcessorMode2</name> - <state>1</state> - </option> - <option> - <name>CCOptLevel</name> - <state>3</state> - </option> - <option> - <name>CCOptStrategy</name> - <version>0</version> - <state>0</state> - </option> - <option> - <name>CCOptLevelSlave</name> - <state>3</state> - </option> - <option> - <name>CompilerMisraRules98</name> - <version>0</version> - <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state> - </option> - <option> - <name>CompilerMisraRules04</name> - <version>0</version> - <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state> - </option> - <option> - <name>CCPosIndRopi</name> - <state>0</state> - </option> - <option> - <name>CCPosIndRwpi</name> - <state>0</state> - </option> - <option> - <name>CCPosIndNoDynInit</name> - <state>0</state> - </option> - <option> - <name>IccLang</name> - <state>0</state> - </option> - <option> - <name>IccCDialect</name> - <state>1</state> - </option> - <option> - <name>IccAllowVLA</name> - <state>0</state> - </option> - <option> - <name>IccCppDialect</name> - <state>1</state> - </option> - <option> - <name>IccExceptions</name> - <state>1</state> - </option> - <option> - <name>IccRTTI</name> - <state>1</state> - </option> - <option> - <name>IccStaticDestr</name> - <state>1</state> - </option> - <option> - <name>IccCppInlineSemantics</name> - <state>0</state> - </option> - <option> - <name>IccCmsis</name> - <state>1</state> - </option> - <option> - <name>IccFloatSemantics</name> - <state>0</state> - </option> - <option> - <name>CCOptimizationNoSizeConstraints</name> - <state>0</state> - </option> - <option> - <name>CCNoLiteralPool</name> - <state>0</state> - </option> - <option> - <name>CCOptStrategySlave</name> - <version>0</version> - <state>0</state> - </option> - <option> - <name>CCGuardCalls</name> - <state>1</state> - </option> - </data> - </settings> - <settings> - <name>AARM</name> - <archiveVersion>2</archiveVersion> - <data> - <version>9</version> - <wantNonLocal>1</wantNonLocal> - <debug>0</debug> - <option> - <name>AObjPrefix</name> - <state>1</state> - </option> - <option> - <name>AEndian</name> - <state>1</state> - </option> - <option> - <name>ACaseSensitivity</name> - <state>1</state> - </option> - <option> - <name>MacroChars</name> - <version>0</version> - <state>0</state> - </option> - <option> - <name>AWarnEnable</name> - <state>0</state> - </option> - <option> - <name>AWarnWhat</name> - <state>0</state> - </option> - <option> - <name>AWarnOne</name> - <state></state> - </option> - <option> - <name>AWarnRange1</name> - <state></state> - </option> - <option> - <name>AWarnRange2</name> - <state></state> - </option> - <option> - <name>ADebug</name> - <state>0</state> - </option> - <option> - <name>AltRegisterNames</name> - <state>0</state> - </option> - <option> - <name>ADefines</name> - <state></state> - </option> - <option> - <name>AList</name> - <state>0</state> - </option> - <option> - <name>AListHeader</name> - <state>1</state> - </option> - <option> - <name>AListing</name> - <state>1</state> - </option> - <option> - <name>Includes</name> - <state>0</state> - </option> - <option> - <name>MacDefs</name> - <state>0</state> - </option> - <option> - <name>MacExps</name> - <state>1</state> - </option> - <option> - <name>MacExec</name> - <state>0</state> - </option> - <option> - <name>OnlyAssed</name> - <state>0</state> - </option> - <option> - <name>MultiLine</name> - <state>0</state> - </option> - <option> - <name>PageLengthCheck</name> - <state>0</state> - </option> - <option> - <name>PageLength</name> - <state>80</state> - </option> - <option> - <name>TabSpacing</name> - <state>8</state> - </option> - <option> - <name>AXRef</name> - <state>0</state> - </option> - <option> - <name>AXRefDefines</name> - <state>0</state> - </option> - <option> - <name>AXRefInternal</name> - <state>0</state> - </option> - <option> - <name>AXRefDual</name> - <state>0</state> - </option> - <option> - <name>AProcessor</name> - <state>1</state> - </option> - <option> - <name>AFpuProcessor</name> - <state>1</state> - </option> - <option> - <name>AOutputFile</name> - <state>$FILE_BNAME$.o</state> - </option> - <option> - <name>AMultibyteSupport</name> - <state>0</state> - </option> - <option> - <name>ALimitErrorsCheck</name> - <state>0</state> - </option> - <option> - <name>ALimitErrorsEdit</name> - <state>100</state> - </option> - <option> - <name>AIgnoreStdInclude</name> - <state>0</state> - </option> - <option> - <name>AUserIncludes</name> - <state></state> - </option> - <option> - <name>AExtraOptionsCheckV2</name> - <state>0</state> - </option> - <option> - <name>AExtraOptionsV2</name> - <state></state> - </option> - <option> - <name>AsmNoLiteralPool</name> - <state>0</state> - </option> - </data> - </settings> - <settings> - <name>OBJCOPY</name> - <archiveVersion>0</archiveVersion> - <data> - <version>1</version> - <wantNonLocal>1</wantNonLocal> - <debug>0</debug> - <option> - <name>OOCOutputFormat</name> - <version>2</version> - <state>2</state> - </option> - <option> - <name>OCOutputOverride</name> - <state>0</state> - </option> - <option> - <name>OOCOutputFile</name> - <state>samd21_sam_ba.bin</state> - </option> - <option> - <name>OOCCommandLineProducer</name> - <state>1</state> - </option> - <option> - <name>OOCObjCopyEnable</name> - <state>1</state> - </option> - </data> - </settings> - <settings> - <name>CUSTOM</name> - <archiveVersion>3</archiveVersion> - <data> - <extensions></extensions> - <cmdline></cmdline> - </data> - </settings> - <settings> - <name>BICOMP</name> - <archiveVersion>0</archiveVersion> - <data/> - </settings> - <settings> - <name>BUILDACTION</name> - <archiveVersion>1</archiveVersion> - <data> - <prebuild></prebuild> - <postbuild></postbuild> - </data> - </settings> - <settings> - <name>ILINK</name> - <archiveVersion>0</archiveVersion> - <data> - <version>16</version> - <wantNonLocal>1</wantNonLocal> - <debug>0</debug> - <option> - <name>IlinkOutputFile</name> - <state>samd21_sam_ba.out</state> - </option> - <option> - <name>IlinkLibIOConfig</name> - <state>1</state> - </option> - <option> - <name>XLinkMisraHandler</name> - <state>0</state> - </option> - <option> - <name>IlinkInputFileSlave</name> - <state>0</state> - </option> - <option> - <name>IlinkDebugInfoEnable</name> - <state>1</state> - </option> - <option> - <name>IlinkKeepSymbols</name> - <state></state> - </option> - <option> - <name>IlinkRawBinaryFile</name> - <state></state> - </option> - <option> - <name>IlinkRawBinarySymbol</name> - <state></state> - </option> - <option> - <name>IlinkRawBinarySegment</name> - <state></state> - </option> - <option> - <name>IlinkRawBinaryAlign</name> - <state></state> - </option> - <option> - <name>IlinkDefines</name> - <state></state> - </option> - <option> - <name>IlinkConfigDefines</name> - <state></state> - </option> - <option> - <name>IlinkMapFile</name> - <state>1</state> - </option> - <option> - <name>IlinkLogFile</name> - <state>0</state> - </option> - <option> - <name>IlinkLogInitialization</name> - <state>0</state> - </option> - <option> - <name>IlinkLogModule</name> - <state>0</state> - </option> - <option> - <name>IlinkLogSection</name> - <state>0</state> - </option> - <option> - <name>IlinkLogVeneer</name> - <state>0</state> - </option> - <option> - <name>IlinkIcfOverride</name> - <state>1</state> - </option> - <option> - <name>IlinkIcfFile</name> - <state>$PROJ_DIR$\samd21_sam_ba.icf</state> - </option> - <option> - <name>IlinkIcfFileSlave</name> - <state></state> - </option> - <option> - <name>IlinkEnableRemarks</name> - <state>0</state> - </option> - <option> - <name>IlinkSuppressDiags</name> - <state></state> - </option> - <option> - <name>IlinkTreatAsRem</name> - <state></state> - </option> - <option> - <name>IlinkTreatAsWarn</name> - <state></state> - </option> - <option> - <name>IlinkTreatAsErr</name> - <state></state> - </option> - <option> - <name>IlinkWarningsAreErrors</name> - <state>0</state> - </option> - <option> - <name>IlinkUseExtraOptions</name> - <state>0</state> - </option> - <option> - <name>IlinkExtraOptions</name> - <state></state> - </option> - <option> - <name>IlinkLowLevelInterfaceSlave</name> - <state>1</state> - </option> - <option> - <name>IlinkAutoLibEnable</name> - <state>1</state> - </option> - <option> - <name>IlinkAdditionalLibs</name> - <state></state> - </option> - <option> - <name>IlinkOverrideProgramEntryLabel</name> - <state>0</state> - </option> - <option> - <name>IlinkProgramEntryLabelSelect</name> - <state>0</state> - </option> - <option> - <name>IlinkProgramEntryLabel</name> - <state>__iar_program_start</state> - </option> - <option> - <name>DoFill</name> - <state>0</state> - </option> - <option> - <name>FillerByte</name> - <state>0xFF</state> - </option> - <option> - <name>FillerStart</name> - <state>0x0</state> - </option> - <option> - <name>FillerEnd</name> - <state>0x0</state> - </option> - <option> - <name>CrcSize</name> - <version>0</version> - <state>1</state> - </option> - <option> - <name>CrcAlign</name> - <state>1</state> - </option> - <option> - <name>CrcPoly</name> - <state>0x11021</state> - </option> - <option> - <name>CrcCompl</name> - <version>0</version> - <state>0</state> - </option> - <option> - <name>CrcBitOrder</name> - <version>0</version> - <state>0</state> - </option> - <option> - <name>CrcInitialValue</name> - <state>0x0</state> - </option> - <option> - <name>DoCrc</name> - <state>0</state> - </option> - <option> - <name>IlinkBE8Slave</name> - <state>1</state> - </option> - <option> - <name>IlinkBufferedTerminalOutput</name> - <state>1</state> - </option> - <option> - <name>IlinkStdoutInterfaceSlave</name> - <state>1</state> - </option> - <option> - <name>CrcFullSize</name> - <state>0</state> - </option> - <option> - <name>IlinkIElfToolPostProcess</name> - <state>0</state> - </option> - <option> - <name>IlinkLogAutoLibSelect</name> - <state>0</state> - </option> - <option> - <name>IlinkLogRedirSymbols</name> - <state>0</state> - </option> - <option> - <name>IlinkLogUnusedFragments</name> - <state>0</state> - </option> - <option> - <name>IlinkCrcReverseByteOrder</name> - <state>0</state> - </option> - <option> - <name>IlinkCrcUseAsInput</name> - <state>1</state> - </option> - <option> - <name>IlinkOptInline</name> - <state>1</state> - </option> - <option> - <name>IlinkOptExceptionsAllow</name> - <state>1</state> - </option> - <option> - <name>IlinkOptExceptionsForce</name> - <state>0</state> - </option> - <option> - <name>IlinkCmsis</name> - <state>1</state> - </option> - <option> - <name>IlinkOptMergeDuplSections</name> - <state>0</state> - </option> - <option> - <name>IlinkOptUseVfe</name> - <state>1</state> - </option> - <option> - <name>IlinkOptForceVfe</name> - <state>0</state> - </option> - <option> - <name>IlinkStackAnalysisEnable</name> - <state>0</state> - </option> - <option> - <name>IlinkStackControlFile</name> - <state></state> - </option> - <option> - <name>IlinkStackCallGraphFile</name> - <state></state> - </option> - <option> - <name>CrcAlgorithm</name> - <version>0</version> - <state>1</state> - </option> - <option> - <name>CrcUnitSize</name> - <version>0</version> - <state>0</state> - </option> - <option> - <name>IlinkThreadsSlave</name> - <state>1</state> - </option> - </data> - </settings> - <settings> - <name>IARCHIVE</name> - <archiveVersion>0</archiveVersion> - <data> - <version>0</version> - <wantNonLocal>1</wantNonLocal> - <debug>0</debug> - <option> - <name>IarchiveInputs</name> - <state></state> - </option> - <option> - <name>IarchiveOverride</name> - <state>0</state> - </option> - <option> - <name>IarchiveOutput</name> - <state>###Unitialized###</state> - </option> - </data> - </settings> - <settings> - <name>BILINK</name> - <archiveVersion>0</archiveVersion> - <data/> - </settings> - </configuration> - <group> - <name>drivers</name> - <file> - <name>$PROJ_DIR$\drivers\cdc_enumerate.c</name> - </file> - <file> - <name>$PROJ_DIR$\drivers\uart_driver.c</name> - </file> - </group> - <group> - <name>linker script</name> - <file> - <name>$PROJ_DIR$\samd21_sam_ba.icf</name> - </file> - </group> - <group> - <name>utils</name> - <group> - <name>interrupt</name> - <file> - <name>$PROJ_DIR$\utils\interrupt\interrupt_sam_nvic.c</name> - </file> - </group> - <group> - <name>preprocessor</name> - <file> - <name>$PROJ_DIR$\utils\preprocessor\mrecursion.h</name> - </file> - <file> - <name>$PROJ_DIR$\utils\preprocessor\mrepeat.h</name> - </file> - <file> - <name>$PROJ_DIR$\utils\preprocessor\preprocessor.h</name> - </file> - <file> - <name>$PROJ_DIR$\utils\preprocessor\stringz.h</name> - </file> - <file> - <name>$PROJ_DIR$\utils\preprocessor\tpaste.h</name> - </file> - </group> - <file> - <name>$PROJ_DIR$\utils\compiler.h</name> - </file> - <file> - <name>$PROJ_DIR$\utils\interrupt.h</name> - </file> - <file> - <name>$PROJ_DIR$\utils\status_codes.h</name> - </file> - </group> - <file> - <name>$PROJ_DIR$\main.c</name> - </file> - <file> - <name>$PROJ_DIR$\sam_ba_monitor.c</name> - </file> - <file> - <name>$PROJ_DIR$\startup_samd21.c</name> - </file> - <file> - <name>$PROJ_DIR$\usart_sam_ba.c</name> - </file> -</project> - - diff --git a/bootloaders/zero/samd21_sam_ba.eww b/bootloaders/zero/samd21_sam_ba.eww deleted file mode 100644 index e638798aaac31b3a1b23de4dc74cba9841ffe422..0000000000000000000000000000000000000000 --- a/bootloaders/zero/samd21_sam_ba.eww +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="iso-8859-1"?> - -<workspace> - <project> - <path>$WS_DIR$\samd21_sam_ba.ewp</path> - </project> - <batchBuild> - <batchDefinition> - <name>all</name> - <member> - <project>samd21_sam_ba</project> - <configuration>Debug</configuration> - </member> - <member> - <project>samd21_sam_ba</project> - <configuration>Release</configuration> - </member> - </batchDefinition> - </batchBuild> -</workspace> - - diff --git a/bootloaders/zero/samd21_sam_ba.icf b/bootloaders/zero/samd21_sam_ba.icf deleted file mode 100644 index 8489055d893784f3e0b1d4e5c8e656f080529392..0000000000000000000000000000000000000000 --- a/bootloaders/zero/samd21_sam_ba.icf +++ /dev/null @@ -1,76 +0,0 @@ -/** - * \file - * - * \brief Linker script for running in internal FLASH on the SAMD21J18A - * - * Copyright (c) 2014 Atmel Corporation. All rights reserved. - * - * \asf_license_start - * - * \page License - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name of Atmel may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * 4. This software may only be redistributed and used in connection with an - * Atmel microcontroller product. - * - * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * \asf_license_stop - * - */ - -/*###ICF### Section handled by ICF editor, don't touch! ****/ -/*-Editor annotation file-*/ -/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ -/*-Specials-*/ -define symbol __ICFEDIT_intvec_start__ = 0x00000000; -/*-Memory Regions-*/ -define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; -define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF; -define symbol __ICFEDIT_region_ROM_start__ = 0x00000000; -define symbol __ICFEDIT_region_ROM_end__ = 0x00001fff; -//define symbol __ICFEDIT_region_ROM_end__ = 0x0003FFFF; -/*-Sizes-*/ -if (!isdefinedsymbol(__ICFEDIT_size_cstack__)) { -define symbol __ICFEDIT_size_cstack__ = 0x200; -} -if (!isdefinedsymbol(__ICFEDIT_size_heap__)) { -define symbol __ICFEDIT_size_heap__ = 0x0; -} -/**** End of ICF editor section. ###ICF###*/ - -define memory mem with size = 4G; -define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; -define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; - -define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; -define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; - -initialize by copy { readwrite }; -do not initialize { section .noinit }; - -place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; -place in ROM_region { readonly }; -place in RAM_region { readwrite, block CSTACK, block HEAP }; \ No newline at end of file diff --git a/bootloaders/zero/samd21j18a_flash.ld b/bootloaders/zero/samd21j18a_flash.ld new file mode 100644 index 0000000000000000000000000000000000000000..8fa81d10d9100f4ad3185f71fc9c05244e2124e2 --- /dev/null +++ b/bootloaders/zero/samd21j18a_flash.ld @@ -0,0 +1,157 @@ +/** + * \file + * + * \brief Linker script for running in internal FLASH on the SAMD21J18A + * + * Copyright (c) 2013-2014 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +SEARCH_DIR(.) + +/* Memory Spaces Definitions */ +MEMORY +{ + rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000 + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 +} + +/* The stack size used by the application. NOTE: you need to adjust according to your application. */ +STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000; + +/* Section Definitions */ +SECTIONS +{ + .text : + { + . = ALIGN(4); + _sfixed = .; + KEEP(*(.vectors .vectors.*)) + *(.text .text.* .gnu.linkonce.t.*) + *(.glue_7t) *(.glue_7) + *(.rodata .rodata* .gnu.linkonce.r.*) + *(.ARM.extab* .gnu.linkonce.armextab.*) + + /* Support C constructors, and C destructors in both user code + and the C library. This also provides support for C++ code. */ + . = ALIGN(4); + KEEP(*(.init)) + . = ALIGN(4); + __preinit_array_start = .; + KEEP (*(.preinit_array)) + __preinit_array_end = .; + + . = ALIGN(4); + __init_array_start = .; + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + __init_array_end = .; + + . = ALIGN(4); + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*crtend.o(.ctors)) + + . = ALIGN(4); + KEEP(*(.fini)) + + . = ALIGN(4); + __fini_array_start = .; + KEEP (*(.fini_array)) + KEEP (*(SORT(.fini_array.*))) + __fini_array_end = .; + + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*crtend.o(.dtors)) + + . = ALIGN(4); + _efixed = .; /* End of text section */ + } > rom + + /* .ARM.exidx is sorted, so has to go in its own output section. */ + PROVIDE_HIDDEN (__exidx_start = .); + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > rom + PROVIDE_HIDDEN (__exidx_end = .); + + . = ALIGN(4); + _etext = .; + + .relocate : AT (_etext) + { + . = ALIGN(4); + _srelocate = .; + *(.ramfunc .ramfunc.*); + *(.data .data.*); + . = ALIGN(4); + _erelocate = .; + } > ram + + /* .bss section which is used for uninitialized data */ + .bss (NOLOAD) : + { + . = ALIGN(4); + _sbss = . ; + _szero = .; + *(.bss .bss.*) + *(COMMON) + . = ALIGN(4); + _ebss = . ; + _ezero = .; + } > ram + + /* stack section */ + .stack (NOLOAD): + { + . = ALIGN(8); + _sstack = .; + . = . + STACK_SIZE; + . = ALIGN(8); + _estack = .; + } > ram + + . = ALIGN(4); + _end = . ; +} diff --git a/bootloaders/zero/startup_samd21.c b/bootloaders/zero/startup_samd21.c index ea934da9c6e9a5a84d4aa6e37f86497b80f4a5ed..0f45ae3f907a495bf367a230fb42379660a54d4e 100644 --- a/bootloaders/zero/startup_samd21.c +++ b/bootloaders/zero/startup_samd21.c @@ -1,136 +1,112 @@ -/* ---------------------------------------------------------------------------- - * SAM Software Package License - * ---------------------------------------------------------------------------- - * Copyright (c) 2011-2012, Atmel Corporation +/** + * \file + * + * \brief gcc starttup file for SAMD21 + * + * Copyright (c) 2013-2014 Atmel Corporation. All rights reserved. * - * All rights reserved. + * \asf_license_start + * + * \page License * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following condition is met: + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * */ -#include "iosamd21.h" +#include "sam.h" -void __iar_program_start(void); -int __low_level_init(void); - -void Dummy_Handler(void); -void Reset_Handler(void); +/* Initialize segments */ +extern uint32_t _sfixed; +extern uint32_t _efixed; +extern uint32_t _etext; +extern uint32_t _srelocate; +extern uint32_t _erelocate; +extern uint32_t _szero; +extern uint32_t _ezero; +extern uint32_t _sstack; +extern uint32_t _estack; -/** - * \brief Default interrupt handler for unused IRQs. - */ -void Dummy_Handler(void) -{ - while (1) { - } -} +/** \cond DOXYGEN_SHOULD_SKIP_THIS */ +int main(void); +/** \endcond */ -/* Cortex-M0+ core handlers */ -void NMI_Handler ( void ); -void HardFault_Handler ( void ); -void SVC_Handler ( void ); -void PendSV_Handler ( void ); -void SysTick_Handler ( void ); +void __libc_init_array(void); -/* Peripherals handlers */ -void PM_Handler ( void ); -void SYSCTRL_Handler ( void ); -void WDT_Handler ( void ); -void RTC_Handler ( void ); -void EIC_Handler ( void ); -void NVMCTRL_Handler ( void ); -void DMAC_Handler ( void ); -void USB_Handler ( void ); -void EVSYS_Handler ( void ); -void SERCOM0_Handler ( void ); -void SERCOM1_Handler ( void ); -void SERCOM2_Handler ( void ); -void SERCOM3_Handler ( void ); -void SERCOM4_Handler ( void ); -void SERCOM5_Handler ( void ); -void TCC0_Handler ( void ); -void TCC1_Handler ( void ); -void TCC2_Handler ( void ); -void TC3_Handler ( void ); -void TC4_Handler ( void ); -void TC5_Handler ( void ); -void TC6_Handler ( void ); -void TC7_Handler ( void ); -void ADC_Handler ( void ); -void AC_Handler ( void ); -void DAC_Handler ( void ); -void PTC_Handler ( void ); -void I2S_Handler ( void ); +/* Default empty handler */ +void Dummy_Handler(void); /* Cortex-M0+ core handlers */ -#pragma weak NMI_Handler = Dummy_Handler -#pragma weak HardFault_Handler = Dummy_Handler -#pragma weak SVC_Handler = Dummy_Handler -#pragma weak PendSV_Handler = Dummy_Handler -#pragma weak SysTick_Handler = Dummy_Handler +void NMI_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void HardFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SVC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void PendSV_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SysTick_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* Peripherals handlers */ -#pragma weak PM_Handler = Dummy_Handler -#pragma weak SYSCTRL_Handler = Dummy_Handler -#pragma weak WDT_Handler = Dummy_Handler -#pragma weak RTC_Handler = Dummy_Handler -#pragma weak EIC_Handler = Dummy_Handler -#pragma weak NVMCTRL_Handler = Dummy_Handler -#pragma weak DMAC_Handler = Dummy_Handler -#pragma weak USB_Handler = Dummy_Handler -#pragma weak EVSYS_Handler = Dummy_Handler -#pragma weak SERCOM0_Handler = Dummy_Handler -#pragma weak SERCOM1_Handler = Dummy_Handler -#pragma weak SERCOM2_Handler = Dummy_Handler -#pragma weak SERCOM3_Handler = Dummy_Handler -#pragma weak SERCOM4_Handler = Dummy_Handler -#pragma weak SERCOM5_Handler = Dummy_Handler -#pragma weak TCC0_Handler = Dummy_Handler -#pragma weak TCC1_Handler = Dummy_Handler -#pragma weak TCC2_Handler = Dummy_Handler -#pragma weak TC3_Handler = Dummy_Handler -#pragma weak TC4_Handler = Dummy_Handler -#pragma weak TC5_Handler = Dummy_Handler -#pragma weak TC6_Handler = Dummy_Handler -#pragma weak TC7_Handler = Dummy_Handler -#pragma weak ADC_Handler = Dummy_Handler -#pragma weak AC_Handler = Dummy_Handler -#pragma weak DAC_Handler = Dummy_Handler -#pragma weak PTC_Handler = Dummy_Handler -#pragma weak I2S_Handler = Dummy_Handler +void PM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SYSCTRL_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void WDT_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void RTC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void NVMCTRL_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void DMAC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void USB_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EVSYS_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC6_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC7_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void ADC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void AC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void DAC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void PTC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void I2S_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* Exception Table */ -#pragma language=extended -#pragma segment="CSTACK" - -/* The name "__vector_table" has special meaning for C-SPY: */ -/* it is where the SP start value is found, and the NVIC vector */ -/* table register (VTOR) is initialized to this address if != 0 */ - -#pragma section = ".intvec" -#pragma location = ".intvec" -//! [startup_vector_table] -const DeviceVectors __vector_table[] = { - __sfe("CSTACK"), +__attribute__ ((section(".vectors"))) +const DeviceVectors exception_table = { + + /* Configure Initial Stack Pointer, using linker-generated symbols */ + (void*) (&_estack), + (void*) Reset_Handler, (void*) NMI_Handler, (void*) HardFault_Handler, @@ -177,26 +153,49 @@ const DeviceVectors __vector_table[] = { (void*) PTC_Handler, /* 26 Peripheral Touch Controller */ (void*) I2S_Handler /* 27 Inter-IC Sound Interface */ }; -//! [startup_vector_table] -/**------------------------------------------------------------------------------ - * This is the code that gets called on processor reset. To initialize the - * device. - *------------------------------------------------------------------------------*/ -int __low_level_init(void) +/** + * \brief This is the code that gets called on processor reset. + * To initialize the device, and call the main() routine. + */ +void Reset_Handler(void) { - uint32_t *pSrc = __section_begin(".intvec"); + uint32_t *pSrc, *pDest; + + /* Initialize the relocate segment */ + pSrc = &_etext; + pDest = &_srelocate; + + if (pSrc != pDest) { + for (; pDest < &_erelocate;) { + *pDest++ = *pSrc++; + } + } + + /* Clear the zero segment */ + for (pDest = &_szero; pDest < &_ezero;) { + *pDest++ = 0; + } + /* Set the vector table base address */ + pSrc = (uint32_t *) & _sfixed; SCB->VTOR = ((uint32_t) pSrc & SCB_VTOR_TBLOFF_Msk); - return 1; /* if return 0, the data sections will not be initialized */ + /* Initialize the C library */ + __libc_init_array(); + + /* Branch to main function */ + main(); + + /* Infinite loop */ + while (1); } -/**------------------------------------------------------------------------------ - * This is the code that gets called on processor reset. To initialize the - * device. - *------------------------------------------------------------------------------*/ -void Reset_Handler(void) +/** + * \brief Default interrupt handler for unused IRQs. + */ +void Dummy_Handler(void) { - __iar_program_start(); + while (1) { + } } diff --git a/bootloaders/zero/usart_sam_ba.c b/bootloaders/zero/usart_sam_ba.c index 631590e59cf463531e8bf5f0b26aa08ee45df343..f17f319554a93d80831bc4d29340d97ac14089d0 100644 --- a/bootloaders/zero/usart_sam_ba.c +++ b/bootloaders/zero/usart_sam_ba.c @@ -32,7 +32,7 @@ #include "main.h" #include "uart_driver.h" #include "compiler.h" -#include "iosamd21.h" +#include "sam.h" /* Local reference to current Usart instance in use with this driver */ //struct usart_module usart_sam_ba; diff --git a/bootloaders/zero/utils/compiler.h b/bootloaders/zero/utils/compiler.h index 3630aabf58f9147935fcd67a429628d6fa9ec3b4..e31d7dba4ba7bae55e614114eedfbcc294cc36aa 100644 --- a/bootloaders/zero/utils/compiler.h +++ b/bootloaders/zero/utils/compiler.h @@ -47,7 +47,7 @@ //#include <parts.h> #include <status_codes.h> #include <preprocessor.h> -#include <iosamd21.h> +#include <sam.h> #ifndef __ASSEMBLY__