From b1b66dd1954c100b2fbcf1525cc9becfd6d08dcf Mon Sep 17 00:00:00 2001 From: 阿基米东 Date: Fri, 22 Sep 2023 18:06:18 +0800 Subject: [bsp][mchp][samd51] re-config uart0, remove dma, and fix some error --- bsp/microchip/samd51-seeed-wio-terminal/.config | 4 +- bsp/microchip/samd51-seeed-wio-terminal/README.md | 17 ++- .../samd51-seeed-wio-terminal/README_zh.md | 27 ++-- .../samd51-seeed-wio-terminal/board/board.c | 7 +- .../samd51-seeed-wio-terminal/board/board.h | 2 +- .../samd51-seeed-wio-terminal/bsp/AtmelStart.gpdsc | 8 -- .../samd51-seeed-wio-terminal/bsp/SConscript | 7 - .../samd51-seeed-wio-terminal/bsp/armcc/Makefile | 25 ++-- .../samd51-seeed-wio-terminal/bsp/atmel_start.c | 1 - .../samd51-seeed-wio-terminal/bsp/atmel_start.h | 1 - .../bsp/atmel_start_config.atstart | 9 -- .../bsp/dma_m2m/dma_memory.c | 143 --------------------- .../bsp/dma_m2m/dma_memory.h | 132 ------------------- .../bsp/dma_m2m/dma_memory_config.h | 16 --- .../samd51-seeed-wio-terminal/bsp/dma_m2m_main.c | 55 -------- .../samd51-seeed-wio-terminal/bsp/dma_m2m_main.h | 33 ----- .../bsp/documentation/dma_m2m.rst | 15 --- .../samd51-seeed-wio-terminal/bsp/gcc/Makefile | 21 +-- .../bsp/hal/src/hal_sleep.c | 2 + .../bsp/hal/utils/src/utils_syscalls.c | 2 + .../bsp/iar-project-connection.ipcf | 12 -- .../bsp/samd51a/gcc/gcc/samd51p19a_flash.ld | 26 ++++ .../bsp/samd51a/gcc/gcc/startup_samd51.c | 6 +- bsp/microchip/samd51-seeed-wio-terminal/rtconfig.h | 2 +- 24 files changed, 82 insertions(+), 491 deletions(-) delete mode 100644 bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m/dma_memory.c delete mode 100644 bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m/dma_memory.h delete mode 100644 bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m/dma_memory_config.h delete mode 100644 bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m_main.c delete mode 100644 bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m_main.h delete mode 100644 bsp/microchip/samd51-seeed-wio-terminal/bsp/documentation/dma_m2m.rst (limited to 'bsp') diff --git a/bsp/microchip/samd51-seeed-wio-terminal/.config b/bsp/microchip/samd51-seeed-wio-terminal/.config index 1cdcc1f9c3..29c8febdf8 100644 --- a/bsp/microchip/samd51-seeed-wio-terminal/.config +++ b/bsp/microchip/samd51-seeed-wio-terminal/.config @@ -1054,8 +1054,8 @@ CONFIG_RT_USING_KTIME=y # # Hardware Drivers Config # -CONFIG_SOC_SAMD51J19=y -# CONFIG_SOC_SAMD51P19 is not set +# CONFIG_SOC_SAMD51J19 is not set +CONFIG_SOC_SAMD51P19=y # CONFIG_SOC_SAME54P20 is not set # CONFIG_SOC_SAME54N20 is not set # CONFIG_SOC_SAME53J20 is not set diff --git a/bsp/microchip/samd51-seeed-wio-terminal/README.md b/bsp/microchip/samd51-seeed-wio-terminal/README.md index d6b19a05e5..6a59cb8d73 100644 --- a/bsp/microchip/samd51-seeed-wio-terminal/README.md +++ b/bsp/microchip/samd51-seeed-wio-terminal/README.md @@ -1,13 +1,15 @@ -# SAMD51J19A Adafruit Metro M4 BSP Introduction +# Seeed Wio-Terminal BSP Introduction -[中文](README_zh.md) +[中文](README_zh.md) -- MCU: ATSAMD51J19A @120MHz, 512KB FLASH, 192KB RAM +![](https://static.getiot.tech/WioT-Hardware-Overview.png) + +- MCU: ATSAMD51P19A @120MHz, 512KB FLASH, 192KB RAM - D51: Cortex-M4F + Adavanced Feature Set - Pin: G=48 pins, J=64 pins, N=100 pins, P=128 pins - Flash: 18=256KB, 19=512KB, 20=1024KB (size=2^n) - SRAM : 128KB(Flash 256KB), 192KB(Flash 512KB), 256KB(Flash 1MB) -- Datasheet: +- Datasheet: #### KEY FEATURES @@ -18,8 +20,9 @@ #### Memories - 1 MB/512 KB/256 KB in-system self-programmable Flash with: -- Error Correction Code (ECC) -- Dual bank with Read-While-Write (RWW) support + - Error Correction Code (ECC) + - Dual bank with Read-While-Write (RWW) support + - EEPROM hardware emulation - 128 KB, 192 KB, 256 KB SRAM main memory - 64 KB, 96 KB, 128 KB of Error Correction Code (ECC) RAM option @@ -114,7 +117,7 @@ #### Board info -- [Adafruit Metro M4 feat. Microchip ATSAMD51](https://www.adafruit.com/product/3382) +- [Wio Terminal: ATSAMD51 Core with Realtek RTL8720DN BLE 5.0 & Wi-Fi Dev Board](https://www.seeedstudio.com/Wio-Terminal-p-4509.html) #### Contact Info diff --git a/bsp/microchip/samd51-seeed-wio-terminal/README_zh.md b/bsp/microchip/samd51-seeed-wio-terminal/README_zh.md index 5535157470..287b1de3cc 100644 --- a/bsp/microchip/samd51-seeed-wio-terminal/README_zh.md +++ b/bsp/microchip/samd51-seeed-wio-terminal/README_zh.md @@ -1,25 +1,28 @@ -# SAMD51J19A Adafruit Metro M4 BSP 介绍 +# Seeed Wio-Terminal BSP 介绍 [English](README.md) -- MCU: ATSAMD51J19A @120MHz, 512KB FLASH, 192KB RAM -- D51: Cortex-M4F + Adavanced Feature Set -- 管脚: G系列-48 pins, J系列-64 pins, N系列-100 pins, P系列-128 pins -- Flash: 尾缀18=256KB, 19=512KB, 20=1024KB (size=2^n) -- SRAM : 128KB(Flash 256KB), 192KB(Flash 512KB), 256KB(Flash 1MB) -- 手册: +![](https://static.getiot.tech/WioT-Hardware-Overview.png) + +- MCU:ATSAMD51P19A @120MHz,512KB FLASH,192KB RAM +- D51:Cortex-M4F + Adavanced Feature Set +- 管脚:G 系列-48 pins,J 系列-64 pins,N 系列-100 pins,P 系列-128 pins +- Flash:尾缀 18=256KB, 19=512KB, 20=1024KB(size=2^n) +- SRAM:128KB(Flash 256KB),192KB(Flash 512KB),256KB(Flash 1MB) +- 手册: #### 关键特性 #### 内核 -- 32-bit Arm® Cortex®-M4 内核 + 单精度FPU + 4 KB 复用的指令和数据Cache,最大工作主频120 MHz, 带MPU, 403 CoreMark®@120 MHz, 支持 DSP指令集 +- 32-bit Arm® Cortex®-M4 内核 + 单精度 FPU + 4 KB 复用的指令和数据 Cache,最大工作主频 120 MHz,带MPU,403 CoreMark®@120 MHz,支持 DSP 指令集 #### 内存 - 1 MB/512 KB/256 KB in-system self-programmable Flash with: -- Error Correction Code (ECC) -- Dual bank with Read-While-Write (RWW) support + - Error Correction Code (ECC) + - Dual bank with Read-While-Write (RWW) support + - EEPROM hardware emulation - 128 KB, 192 KB, 256 KB SRAM main memory - 64 KB, 96 KB, 128 KB of Error Correction Code (ECC) RAM option @@ -97,7 +100,7 @@ #### I/O管脚 - - 最多提供99个用户可编程I/O管脚 + - 最多提供 99 个用户可编程 I/O 管脚 #### 汽车应用 @@ -114,7 +117,7 @@ #### 开发板信息 -- [Adafruit Metro M4 feat. Microchip ATSAMD51](https://www.adafruit.com/product/3382) +- [Wio Terminal: ATSAMD51 Core with Realtek RTL8720DN BLE 5.0 & Wi-Fi Dev Board](https://www.seeedstudio.com/Wio-Terminal-p-4509.html) #### 联系方式 diff --git a/bsp/microchip/samd51-seeed-wio-terminal/board/board.c b/bsp/microchip/samd51-seeed-wio-terminal/board/board.c index 3d6f2ad3a7..46c2cc1724 100644 --- a/bsp/microchip/samd51-seeed-wio-terminal/board/board.c +++ b/bsp/microchip/samd51-seeed-wio-terminal/board/board.c @@ -21,18 +21,19 @@ extern int rt_hw_uart_init(void); #endif static struct io_descriptor* g_stdio; -static uint8_t board_info[48] = "Seeed Wio-Terminal, Microchip SAMD51\n"; +static uint8_t board_info[24] = "Seeed Wio-Terminal\r\n"; // Microchip SAMD51 void rt_hw_console_output(const char *str) { io_write(g_stdio, (uint8_t *)str, strlen(str)); + while (TARGET_IO.stat != 0); } RTM_EXPORT(rt_hw_console_output); static inline void hw_board_init_usart(void) { - usart_sync_get_io_descriptor(&TARGET_IO, &g_stdio); - usart_sync_enable(&TARGET_IO); + usart_async_get_io_descriptor(&TARGET_IO, &g_stdio); + usart_async_enable(&TARGET_IO); io_write(g_stdio, board_info, strlen(board_info)); } diff --git a/bsp/microchip/samd51-seeed-wio-terminal/board/board.h b/bsp/microchip/samd51-seeed-wio-terminal/board/board.h index a81ca418dc..999a86085b 100644 --- a/bsp/microchip/samd51-seeed-wio-terminal/board/board.h +++ b/bsp/microchip/samd51-seeed-wio-terminal/board/board.h @@ -75,7 +75,7 @@ extern int __bss_end; #ifdef RT_USING_SERIAL #include "hpl_sercom_config.h" -#define DEFAULT_USART_BAUD_RATE CONF_SERCOM_3_USART_BAUD_RATE +#define DEFAULT_USART_BAUD_RATE CONF_SERCOM_2_USART_BAUD_RATE #endif void rt_hw_board_init(void); diff --git a/bsp/microchip/samd51-seeed-wio-terminal/bsp/AtmelStart.gpdsc b/bsp/microchip/samd51-seeed-wio-terminal/bsp/AtmelStart.gpdsc index b0630f726f..6f1c251d8d 100644 --- a/bsp/microchip/samd51-seeed-wio-terminal/bsp/AtmelStart.gpdsc +++ b/bsp/microchip/samd51-seeed-wio-terminal/bsp/AtmelStart.gpdsc @@ -132,9 +132,6 @@ - - - @@ -186,8 +183,6 @@ - - @@ -202,7 +197,6 @@ - @@ -223,8 +217,6 @@ - - diff --git a/bsp/microchip/samd51-seeed-wio-terminal/bsp/SConscript b/bsp/microchip/samd51-seeed-wio-terminal/bsp/SConscript index b15f26cb30..ef6cc0c5da 100644 --- a/bsp/microchip/samd51-seeed-wio-terminal/bsp/SConscript +++ b/bsp/microchip/samd51-seeed-wio-terminal/bsp/SConscript @@ -16,12 +16,10 @@ src = Glob('hal/src/*.c') src += Glob('hal/utils/src/*.c') # src += Glob('hpl/adc/*.c') # src += Glob('hpl/aes/*.c') -# src += Glob('hpl/can/*.c') src += Glob('hpl/cmcc/*.c') src += Glob('hpl/core/*.c') src += Glob('hpl/dmac/*.c') src += Glob('hpl/gclk/*.c') -# src += Glob('hpl/gmac/*.c') src += Glob('hpl/mclk/*.c') src += Glob('hpl/osc32kctrl/*.c') src += Glob('hpl/oscctrl/*.c') @@ -30,15 +28,12 @@ src += Glob('hpl/port/*.c') src += Glob('hpl/ramecc/*.c') src += Glob('hpl/sercom/*.c') src += Glob('hpl/usb/*.c') -src += Glob('stdio_redirect/*.c') -# src += Glob('ethernet_phy/*.c') src += Glob('hpl/usb/*.c') src += Glob('usb/*.c') src += Glob('usb/device/*.c') src += Glob('usb/class/cdc/device/*.c') src += [cwd + '/atmel_start.c'] src += [cwd + '/driver_init.c'] -src += [cwd + '/stdio_start.c'] src += [cwd + '/usb_start.c'] #add for startup script @@ -59,7 +54,6 @@ path = [ cwd + '/hal/include', cwd + '/hal/utils/include', # cwd + '/hpl/adc', - # cwd + '/hpl/can', cwd + '/hpl/core', cwd + '/hpl/gclk', cwd + '/hpl/pm', @@ -71,7 +65,6 @@ path = [ cwd + '/usb/class/cdc/device', cwd + '/usb/device', cwd + '/samd51a/include', - cwd + '/stdio_redirect', cwd + '/../board', cwd + '/../../common/applications' ] diff --git a/bsp/microchip/samd51-seeed-wio-terminal/bsp/armcc/Makefile b/bsp/microchip/samd51-seeed-wio-terminal/bsp/armcc/Makefile index 9cefdc0975..c981b579ac 100644 --- a/bsp/microchip/samd51-seeed-wio-terminal/bsp/armcc/Makefile +++ b/bsp/microchip/samd51-seeed-wio-terminal/bsp/armcc/Makefile @@ -33,7 +33,6 @@ samd51a/armcc/Device/SAMD51/Source \ hpl/ramecc \ hpl/dmac \ usb/class/cdc/device \ -dma_m2m \ hal/src \ hpl/mclk \ usb \ @@ -52,12 +51,11 @@ hpl/cmcc OBJS += \ hal/src/hal_io.o \ hpl/core/hpl_core_m4.o \ -dma_m2m/dma_memory.o \ +usb/class/cdc/device/cdcdf_acm.o \ samd51a/armcc/Device/SAMD51/Source/ARM/startup_samd51.o \ usb_start.o \ hpl/usb/hpl_usb.o \ samd51a/armcc/Device/SAMD51/Source/system_samd51.o \ -usb/class/cdc/device/cdcdf_acm.o \ hal/src/hal_delay.o \ hpl/pm/hpl_pm.o \ hpl/core/hpl_init.o \ @@ -71,14 +69,13 @@ hpl/ramecc/hpl_ramecc.o \ usb/usb_protocol.o \ hal/src/hal_init.o \ hal/src/hal_usb_device.o \ -dma_m2m_main.o \ +main.o \ hpl/osc32kctrl/hpl_osc32kctrl.o \ examples/driver_examples.o \ driver_init.o \ hal/src/hal_usart_async.o \ hpl/sercom/hpl_sercom.o \ hal/utils/src/utils_ringbuffer.o \ -main.o \ hal/src/hal_gpio.o \ hal/utils/src/utils_event.o \ hal/src/hal_sleep.o \ @@ -91,12 +88,11 @@ hal/src/hal_atomic.o OBJS_AS_ARGS += \ "hal/src/hal_io.o" \ "hpl/core/hpl_core_m4.o" \ -"dma_m2m/dma_memory.o" \ +"usb/class/cdc/device/cdcdf_acm.o" \ "samd51a/armcc/Device/SAMD51/Source/ARM/startup_samd51.o" \ "usb_start.o" \ "hpl/usb/hpl_usb.o" \ "samd51a/armcc/Device/SAMD51/Source/system_samd51.o" \ -"usb/class/cdc/device/cdcdf_acm.o" \ "hal/src/hal_delay.o" \ "hpl/pm/hpl_pm.o" \ "hpl/core/hpl_init.o" \ @@ -110,14 +106,13 @@ OBJS_AS_ARGS += \ "usb/usb_protocol.o" \ "hal/src/hal_init.o" \ "hal/src/hal_usb_device.o" \ -"dma_m2m_main.o" \ +"main.o" \ "hpl/osc32kctrl/hpl_osc32kctrl.o" \ "examples/driver_examples.o" \ "driver_init.o" \ "hal/src/hal_usart_async.o" \ "hpl/sercom/hpl_sercom.o" \ "hal/utils/src/utils_ringbuffer.o" \ -"main.o" \ "hal/src/hal_gpio.o" \ "hal/utils/src/utils_event.o" \ "hal/src/hal_sleep.o" \ @@ -131,15 +126,13 @@ OBJS_AS_ARGS += \ DEPS := $(OBJS:%.o=%.d) DEPS_AS_ARGS += \ -"usb/class/cdc/device/cdcdf_acm.d" \ "hal/utils/src/utils_event.d" \ "hal/src/hal_io.d" \ "hpl/ramecc/hpl_ramecc.d" \ "hpl/core/hpl_core_m4.d" \ -"dma_m2m/dma_memory.d" \ +"usb/class/cdc/device/cdcdf_acm.d" \ "samd51a/armcc/Device/SAMD51/Source/system_samd51.d" \ "hpl/usb/hpl_usb.d" \ -"main.d" \ "samd51a/armcc/Device/SAMD51/Source/ARM/startup_samd51.d" \ "hal/utils/src/utils_list.d" \ "hpl/cmcc/hpl_cmcc.d" \ @@ -157,7 +150,7 @@ DEPS_AS_ARGS += \ "driver_init.d" \ "hal/src/hal_usart_async.d" \ "hpl/osc32kctrl/hpl_osc32kctrl.d" \ -"dma_m2m_main.d" \ +"main.d" \ "examples/driver_examples.d" \ "hal/src/hal_cache.d" \ "hal/src/hal_sleep.d" \ @@ -203,7 +196,7 @@ $(OBJS_AS_ARGS) @echo Building file: $< @echo ARMCC Compiler $(QUOTE)armcc$(QUOTE) --c99 -c -DDEBUG -O1 -g --apcs=interwork --split_sections --cpu Cortex-M4 -D__SAMD51P19A__ \ --I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../dma_m2m" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../CMSIS/Core/Include" -I"../samd51a/include" \ +-I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../CMSIS/Core/Include" -I"../samd51a/include" \ --depend "$@" -o "$@" "$<" @echo Finished building: $< @@ -212,7 +205,7 @@ $(OBJS_AS_ARGS) @echo Building file: $< @echo ARMCC Assembler $(QUOTE)armasm$(QUOTE) -g --apcs=interwork --cpu Cortex-M4 --pd "D__SAMD51P19A__ SETA 1" \ --I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../dma_m2m" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../CMSIS/Core/Include" -I"../samd51a/include" \ +-I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../CMSIS/Core/Include" -I"../samd51a/include" \ --depend "$(@:%.o=%.d)" -o "$@" "$<" @echo Finished building: $< @@ -221,7 +214,7 @@ $(OBJS_AS_ARGS) @echo Building file: $< @echo ARMCC Preprocessing Assembler $(QUOTE)armcc$(QUOTE) --c99 -c -DDEBUG -O1 -g --apcs=interwork --split_sections --cpu Cortex-M4 -D__SAMD51P19A__ \ --I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../dma_m2m" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../CMSIS/Core/Include" -I"../samd51a/include" \ +-I"../" -I"../config" -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/cmcc" -I"../hpl/core" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/mclk" -I"../hpl/osc32kctrl" -I"../hpl/oscctrl" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/ramecc" -I"../hpl/sercom" -I"../hpl/usb" -I"../hri" -I"../" -I"../config" -I"../usb" -I"../usb/class/cdc" -I"../usb/class/cdc/device" -I"../usb/device" -I"../" -I"../CMSIS/Core/Include" -I"../samd51a/include" \ --depend "$@" -o "$@" "$<" @echo Finished building: $< diff --git a/bsp/microchip/samd51-seeed-wio-terminal/bsp/atmel_start.c b/bsp/microchip/samd51-seeed-wio-terminal/bsp/atmel_start.c index f039343339..9a5f36c73d 100644 --- a/bsp/microchip/samd51-seeed-wio-terminal/bsp/atmel_start.c +++ b/bsp/microchip/samd51-seeed-wio-terminal/bsp/atmel_start.c @@ -6,6 +6,5 @@ void atmel_start_init(void) { system_init(); - dma_memory_init(); usb_init(); } diff --git a/bsp/microchip/samd51-seeed-wio-terminal/bsp/atmel_start.h b/bsp/microchip/samd51-seeed-wio-terminal/bsp/atmel_start.h index 99b3903e03..953f947c36 100644 --- a/bsp/microchip/samd51-seeed-wio-terminal/bsp/atmel_start.h +++ b/bsp/microchip/samd51-seeed-wio-terminal/bsp/atmel_start.h @@ -6,7 +6,6 @@ extern "C" { #endif #include "driver_init.h" -#include "dma_m2m_main.h" #include "usb_start.h" /** diff --git a/bsp/microchip/samd51-seeed-wio-terminal/bsp/atmel_start_config.atstart b/bsp/microchip/samd51-seeed-wio-terminal/bsp/atmel_start_config.atstart index d4070c3778..9acfafe871 100644 --- a/bsp/microchip/samd51-seeed-wio-terminal/bsp/atmel_start_config.atstart +++ b/bsp/microchip/samd51-seeed-wio-terminal/bsp/atmel_start_config.atstart @@ -19,15 +19,6 @@ board: details: null application: null middlewares: - M2M_DMA_0: - user_label: M2M_DMA_0 - configuration: - conf_channel: 0 - definition: Atmel:MEMORY_DMA:0.0.1::M2M_DMA - functionality: M2M_DMA - api: DMA:M2M:Core - dependencies: - DMAC: DMAC USB_CHAPTER_9: user_label: USB_CHAPTER_9 configuration: {} diff --git a/bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m/dma_memory.c b/bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m/dma_memory.c deleted file mode 100644 index f3951147d9..0000000000 --- a/bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m/dma_memory.c +++ /dev/null @@ -1,143 +0,0 @@ -/** - * \file - * - * \brief Memory with DMA functionality implementation. - * - * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries. - * - * \asf_license_start - * - * \page License - * - * Subject to your compliance with these terms, you may use Microchip - * software and any derivatives exclusively with Microchip products. - * It is your responsibility to comply with third party license terms applicable - * to your use of third party software (including open source software) that - * may accompany Microchip software. - * - * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, - * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, - * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, - * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE - * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL - * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE - * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE - * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT - * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY - * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, - * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. - * - * \asf_license_stop - * - */ - -#include "dma_memory.h" -#include "dma_memory_config.h" -#include -#include -#include - -/** - * \brief Driver version - */ -#define DRIVER_VERSION 0x00000001u - -/** - * \brief memory with dma descriptor instance - */ -static struct dma_memory_descriptor descr; - -/** - * \internal Process transfer done interrupts - * - * \param[in] resource The pointer to memory resource - */ -static void dma_transfer_done(struct _dma_resource *resource) -{ - (void)resource; - if (descr.memory_cb.complete) { - descr.memory_cb.complete(); - } -} - -/** - * \internal Process transfer error interrupts - * - * \param[in] resource The pointer to memory resource - */ -static void dma_memory_error(struct _dma_resource *resource) -{ - (void)resource; - if (descr.memory_cb.error) { - descr.memory_cb.error(); - } -} - -/** - * \brief Initialize DMA - */ -int32_t dma_memory_init(void) -{ - _dma_get_channel_resource(&descr.resource, CONF_DMA_MEMORY_CHANNEL); - descr.resource->dma_cb.transfer_done = dma_transfer_done; - descr.resource->dma_cb.error = dma_memory_error; - - return ERR_NONE; -} - -/** - * \brief Register DMA callback - */ -int32_t dma_memory_register_callback(const enum dma_memory_callback_type type, dma_memory_cb_t cb) -{ - switch (type) { - case DMA_MEMORY_COMPLETE_CB: - descr.memory_cb.complete = cb; - break; - - case DMA_MEMORY_ERROR_CB: - descr.memory_cb.error = cb; - break; - - default: - return ERR_INVALID_ARG; - } - - _dma_set_irq_state(CONF_DMA_MEMORY_CHANNEL, (enum _dma_callback_type)type, (cb != NULL)); - - return ERR_NONE; -} - -/** - * \brief Memory copy with dma - */ -int32_t dma_memcpy(void *dst, void *src, uint32_t size) -{ - _dma_srcinc_enable(CONF_DMA_MEMORY_CHANNEL, true); - _dma_dstinc_enable(CONF_DMA_MEMORY_CHANNEL, true); - _dma_set_destination_address(CONF_DMA_MEMORY_CHANNEL, dst); - _dma_set_source_address(CONF_DMA_MEMORY_CHANNEL, src); - _dma_set_data_amount(CONF_DMA_MEMORY_CHANNEL, size); - _dma_enable_transaction(CONF_DMA_MEMORY_CHANNEL, true); - - return ERR_NONE; -} - -/** - * \brief Memory set with dma - */ -int32_t dma_memset(void *dst, int32_t ch, uint32_t size) -{ - static int32_t tmp_ch; - - tmp_ch = ch; - - _dma_set_source_address(CONF_DMA_MEMORY_CHANNEL, &tmp_ch); - _dma_srcinc_enable(CONF_DMA_MEMORY_CHANNEL, false); - _dma_dstinc_enable(CONF_DMA_MEMORY_CHANNEL, true); - _dma_set_destination_address(CONF_DMA_MEMORY_CHANNEL, dst); - _dma_set_data_amount(CONF_DMA_MEMORY_CHANNEL, size); - _dma_enable_transaction(CONF_DMA_MEMORY_CHANNEL, true); - - return ERR_NONE; -} diff --git a/bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m/dma_memory.h b/bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m/dma_memory.h deleted file mode 100644 index 3bd6dc9662..0000000000 --- a/bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m/dma_memory.h +++ /dev/null @@ -1,132 +0,0 @@ -/** - * \file - * - * \brief Memory with DMA functionality declaration. - * - * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries. - * - * \asf_license_start - * - * \page License - * - * Subject to your compliance with these terms, you may use Microchip - * software and any derivatives exclusively with Microchip products. - * It is your responsibility to comply with third party license terms applicable - * to your use of third party software (including open source software) that - * may accompany Microchip software. - * - * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, - * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, - * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, - * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE - * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL - * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE - * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE - * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT - * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY - * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, - * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. - * - * \asf_license_stop - * - */ - -#ifndef DMA_MEMORY_H_INCLUDED -#define DMA_MEMORY_H_INCLUDED - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \addtogroup dma_memory - * - * \section dma_rev Revision History - * - v0.0.0.1 Initial Commit - * - *@{ - */ - -/** - * \brief Memory with DMA descriptor - * - * The Memory with DMA descriptor forward declaration. - */ -struct dma_memory_descriptor; - -/** - * \brief memory with dma callback type - */ -typedef void (*dma_memory_cb_t)(void); - -/** - * \brief Memory with DMA callback types - */ -enum dma_memory_callback_type { DMA_MEMORY_COMPLETE_CB, DMA_MEMORY_ERROR_CB }; - -/** - * \brief Memory with DMA callbacks - */ -struct dma_memory_callbacks { - dma_memory_cb_t complete; - dma_memory_cb_t error; -}; - -/** - * \brief Memory with DMA descriptor - */ -struct dma_memory_descriptor { - struct _dma_resource * resource; - struct dma_memory_callbacks memory_cb; -}; - -/** - * \brief Initialize Memory with DMA - * - * \return Initialization status. - */ -int32_t dma_memory_init(void); - -/** - * \brief Register Memory with DMA callback - * - * \param[in] type Callback type - * \param[in] cb A callback function, passing NULL de-registers callback - * - * \return The status of callback assignment. - * \retval ERR_INVALID_ARG Passed parameters were invalid - * \retval ERR_NONE A callback is registered successfully - */ -int32_t dma_memory_register_callback(const enum dma_memory_callback_type type, dma_memory_cb_t cb); - -/** - * \brief dma memory copy - * - * \param[in] dst The pointer to destination address for transfer - * \param[in] src The pointer to source address for transfer - * \param[in] size The transfer size - * - * \return the status of operation` - */ -int32_t dma_memcpy(void *dst, void *src, uint32_t size); - -/** - * \brief dma memory set - * - * \param[in] dst The pointer to address to fill - * \param[in] ch The value to be filled - * \param[in] size Number of bytes to set to the value - * - * \return the status of operation - */ -int32_t dma_memset(void *dst, int32_t ch, uint32_t size); - -/**@}*/ - -#ifdef __cplusplus -} -#endif - -#endif /* DMA_MEMORY_H_INCLUDED */ diff --git a/bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m/dma_memory_config.h b/bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m/dma_memory_config.h deleted file mode 100644 index a5dba3c03b..0000000000 --- a/bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m/dma_memory_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* Auto-generated config file dma_memory_config.h */ -#ifndef DMA_MEMORY_CONFIG_H -#define DMA_MEMORY_CONFIG_H - -// <<< Use Configuration Wizard in Context Menu >>> - -// Channel <0-15> -// This defines DMA channel to be used -// conf_channel -#ifndef CONF_DMA_MEMORY_CHANNEL -#define CONF_DMA_MEMORY_CHANNEL 0 -#endif - -// <<< end of configuration section >>> - -#endif // DMA_MEMORY_CONFIG_H diff --git a/bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m_main.c b/bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m_main.c deleted file mode 100644 index 331f5784b2..0000000000 --- a/bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m_main.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Code generated from Atmel Start. - * - * This file will be overwritten when reconfiguring your Atmel Start project. - * Please copy examples or other code you want to keep to a separate file or main.c - * to avoid loosing it when reconfiguring. - */ - -#include "atmel_start.h" - -static volatile uint8_t dma_complete_flag; -static void M2M_DMA_0_complete_cb(void) -{ - dma_complete_flag = 1; -} - -void M2M_DMA_0_example(void) -{ - uint8_t src_array[100]; - uint8_t dst_array[100]; - uint32_t i; - - dma_memory_register_callback(DMA_MEMORY_COMPLETE_CB, M2M_DMA_0_complete_cb); - for (i = 0; i < 100; i++) { - src_array[i] = i; - dst_array[i] = 0; - } - - /* dma_memset example, set all array data to 0x01 */ - dma_complete_flag = 0; - dma_memset(dst_array, 0x01, 100); - while (dma_complete_flag == 0) { - } - - /* Check if memory set success */ - for (i = 0; i < 100; i++) { - if (dst_array[i] != 0x01) { - while (1) { - }; - } - } - - /* dma_memcpy example */ - dma_complete_flag = 0; - dma_memcpy(dst_array, src_array, 100); - while (dma_complete_flag == 0) { - } - /* Check if dma_memcpy success */ - for (i = 0; i < 100; i++) { - if (dst_array[i] != src_array[i]) { - while (1) { - }; - } - } -} diff --git a/bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m_main.h b/bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m_main.h deleted file mode 100644 index d5c447af19..0000000000 --- a/bsp/microchip/samd51-seeed-wio-terminal/bsp/dma_m2m_main.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Code generated from Atmel Start. - * - * This file will be overwritten when reconfiguring your Atmel Start project. - * Please copy examples or other code you want to keep to a separate file or main.c - * to avoid loosing it when reconfiguring. - */ -#ifndef DMA_M2M_MAIN_H -#define DMA_M2M_MAIN_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include - -/** - * \berif Example function for how to use \ref dma_memset and \ref dma_memcpy - * function. - * - * The system driver DMAC must be setup before using DMA M2M example function. - * For ATSAMD51P19A, below configuratino must be set: - * Enable 'DMAC', 'Channel' and associated 'Priority Level'. - * Enable 'Source Address Increment' and 'Destination Address Increment' for - * associate 'Channel'. - */ -void M2M_DMA_0_example(void); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* DMA_M2M_MAIN_H */ diff --git a/bsp/microchip/samd51-seeed-wio-terminal/bsp/documentation/dma_m2m.rst b/bsp/microchip/samd51-seeed-wio-terminal/bsp/documentation/dma_m2m.rst deleted file mode 100644 index 22bffcf563..0000000000 --- a/bsp/microchip/samd51-seeed-wio-terminal/bsp/documentation/dma_m2m.rst +++ /dev/null @@ -1,15 +0,0 @@ -Memory DMA -========== - -Memory DMA is middleware which provides DMA-based versions of memcpy and memset -functions. - -Architecture and provided functionality ---------------------------------------- - -Memory DMA uses system DMA driver which varies depending on MCU. User must configure -system DMA driver before using Memory DMA middleware. - -DMA-based versions of memcpy and memset functions work asynchronously. Application -can be notifications about completion of copy or set operation via callbacks. -A callback can be registered via dma_memory_register_callback function. \ No newline at end of file diff --git a/bsp/microchip/samd51-seeed-wio-terminal/bsp/gcc/Makefile b/bsp/microchip/samd51-seeed-wio-terminal/bsp/gcc/Makefile index e4d61fb37e..a60ee19060 100644 --- a/bsp/microchip/samd51-seeed-wio-terminal/bsp/gcc/Makefile +++ b/bsp/microchip/samd51-seeed-wio-terminal/bsp/gcc/Makefile @@ -36,7 +36,6 @@ hpl/ramecc \ hpl/dmac \ samd51a/gcc \ usb/class/cdc/device \ -dma_m2m \ hal/src \ samd51a/gcc/gcc \ hpl/mclk \ @@ -56,11 +55,10 @@ OBJS += \ hal/src/hal_io.o \ samd51a/gcc/system_samd51.o \ hpl/core/hpl_core_m4.o \ -dma_m2m/dma_memory.o \ +usb/class/cdc/device/cdcdf_acm.o \ hal/utils/src/utils_syscalls.o \ usb_start.o \ hpl/usb/hpl_usb.o \ -usb/class/cdc/device/cdcdf_acm.o \ hal/src/hal_delay.o \ hpl/pm/hpl_pm.o \ hpl/core/hpl_init.o \ @@ -74,14 +72,13 @@ hpl/ramecc/hpl_ramecc.o \ usb/usb_protocol.o \ hal/src/hal_init.o \ hal/src/hal_usb_device.o \ -dma_m2m_main.o \ +main.o \ hpl/osc32kctrl/hpl_osc32kctrl.o \ examples/driver_examples.o \ driver_init.o \ hal/src/hal_usart_async.o \ hpl/sercom/hpl_sercom.o \ hal/utils/src/utils_ringbuffer.o \ -main.o \ hal/src/hal_gpio.o \ hal/utils/src/utils_event.o \ hal/src/hal_sleep.o \ @@ -96,11 +93,10 @@ OBJS_AS_ARGS += \ "hal/src/hal_io.o" \ "samd51a/gcc/system_samd51.o" \ "hpl/core/hpl_core_m4.o" \ -"dma_m2m/dma_memory.o" \ +"usb/class/cdc/device/cdcdf_acm.o" \ "hal/utils/src/utils_syscalls.o" \ "usb_start.o" \ "hpl/usb/hpl_usb.o" \ -"usb/class/cdc/device/cdcdf_acm.o" \ "hal/src/hal_delay.o" \ "hpl/pm/hpl_pm.o" \ "hpl/core/hpl_init.o" \ @@ -114,14 +110,13 @@ OBJS_AS_ARGS += \ "usb/usb_protocol.o" \ "hal/src/hal_init.o" \ "hal/src/hal_usb_device.o" \ -"dma_m2m_main.o" \ +"main.o" \ "hpl/osc32kctrl/hpl_osc32kctrl.o" \ "examples/driver_examples.o" \ "driver_init.o" \ "hal/src/hal_usart_async.o" \ "hpl/sercom/hpl_sercom.o" \ "hal/utils/src/utils_ringbuffer.o" \ -"main.o" \ "hal/src/hal_gpio.o" \ "hal/utils/src/utils_event.o" \ "hal/src/hal_sleep.o" \ @@ -153,8 +148,6 @@ DIR_INCLUDES += \ -I"../hpl/usb" \ -I"../hri" \ -I"../" \ --I"../dma_m2m" \ --I"../" \ -I"../config" \ -I"../usb" \ -I"../usb/class/cdc" \ @@ -168,16 +161,14 @@ DIR_INCLUDES += \ DEPS := $(OBJS:%.o=%.d) DEPS_AS_ARGS += \ -"usb/class/cdc/device/cdcdf_acm.d" \ "hal/utils/src/utils_event.d" \ "hal/src/hal_io.d" \ "hpl/ramecc/hpl_ramecc.d" \ "hpl/core/hpl_core_m4.d" \ "hal/utils/src/utils_syscalls.d" \ -"dma_m2m/dma_memory.d" \ +"usb/class/cdc/device/cdcdf_acm.d" \ "samd51a/gcc/system_samd51.d" \ "hpl/usb/hpl_usb.d" \ -"main.d" \ "hal/utils/src/utils_list.d" \ "hpl/cmcc/hpl_cmcc.d" \ "hpl/dmac/hpl_dmac.d" \ @@ -194,7 +185,7 @@ DEPS_AS_ARGS += \ "driver_init.d" \ "hal/src/hal_usart_async.d" \ "hpl/osc32kctrl/hpl_osc32kctrl.d" \ -"dma_m2m_main.d" \ +"main.d" \ "examples/driver_examples.d" \ "hal/src/hal_cache.d" \ "hal/src/hal_sleep.d" \ diff --git a/bsp/microchip/samd51-seeed-wio-terminal/bsp/hal/src/hal_sleep.c b/bsp/microchip/samd51-seeed-wio-terminal/bsp/hal/src/hal_sleep.c index 89472f156a..fed5bec156 100644 --- a/bsp/microchip/samd51-seeed-wio-terminal/bsp/hal/src/hal_sleep.c +++ b/bsp/microchip/samd51-seeed-wio-terminal/bsp/hal/src/hal_sleep.c @@ -39,6 +39,7 @@ */ #define DRIVER_VERSION 0x00000001u +#if 0 /** * \brief Set the sleep mode of the device and put the MCU to sleep * @@ -61,6 +62,7 @@ int sleep(const uint8_t mode) return ERR_NONE; } +#endif /** * \brief Retrieve the current driver version diff --git a/bsp/microchip/samd51-seeed-wio-terminal/bsp/hal/utils/src/utils_syscalls.c b/bsp/microchip/samd51-seeed-wio-terminal/bsp/hal/utils/src/utils_syscalls.c index 79e2f1fe48..657cc5ae13 100644 --- a/bsp/microchip/samd51-seeed-wio-terminal/bsp/hal/utils/src/utils_syscalls.c +++ b/bsp/microchip/samd51-seeed-wio-terminal/bsp/hal/utils/src/utils_syscalls.c @@ -119,6 +119,7 @@ extern int _lseek(int file, int ptr, int dir) return 0; } +#if 0 /** * \brief Replacement of C library of _exit */ @@ -129,6 +130,7 @@ extern void _exit(int status) for (;;) ; } +#endif /** * \brief Replacement of C library of _kill diff --git a/bsp/microchip/samd51-seeed-wio-terminal/bsp/iar-project-connection.ipcf b/bsp/microchip/samd51-seeed-wio-terminal/bsp/iar-project-connection.ipcf index a0bc29d03f..718c6d03c4 100644 --- a/bsp/microchip/samd51-seeed-wio-terminal/bsp/iar-project-connection.ipcf +++ b/bsp/microchip/samd51-seeed-wio-terminal/bsp/iar-project-connection.ipcf @@ -24,8 +24,6 @@ $PROJ_DIR$\hpl\usb $PROJ_DIR$\hri $PROJ_DIR$\ - $PROJ_DIR$\dma_m2m - $PROJ_DIR$\ $PROJ_DIR$\config $PROJ_DIR$\usb $PROJ_DIR$\usb\class\cdc @@ -56,8 +54,6 @@ $PROJ_DIR$\hpl\usb $PROJ_DIR$\hri $PROJ_DIR$\ - $PROJ_DIR$\dma_m2m - $PROJ_DIR$\ $PROJ_DIR$\config $PROJ_DIR$\usb $PROJ_DIR$\usb\class\cdc @@ -87,8 +83,6 @@ atmel_start.c atmel_start.h atmel_start_pins.h - dma_m2m_main.c - dma_m2m_main.h driver_init.c driver_init.h main.c @@ -134,12 +128,6 @@ config/usbd_config.h - - dma_m2m/dma_memory.c - dma_m2m/dma_memory.h - dma_m2m/dma_memory_config.h - - examples/driver_examples.c examples/driver_examples.h diff --git a/bsp/microchip/samd51-seeed-wio-terminal/bsp/samd51a/gcc/gcc/samd51p19a_flash.ld b/bsp/microchip/samd51-seeed-wio-terminal/bsp/samd51a/gcc/gcc/samd51p19a_flash.ld index 34abb31e13..606284a4b1 100644 --- a/bsp/microchip/samd51-seeed-wio-terminal/bsp/samd51a/gcc/gcc/samd51p19a_flash.ld +++ b/bsp/microchip/samd51-seeed-wio-terminal/bsp/samd51a/gcc/gcc/samd51p19a_flash.ld @@ -57,6 +57,30 @@ SECTIONS *(.rodata .rodata* .gnu.linkonce.r.*) *(.ARM.extab* .gnu.linkonce.armextab.*) + /* section information for finsh shell */ + . = ALIGN(4); + __fsymtab_start = .; + KEEP(*(FSymTab)) + __fsymtab_end = .; + . = ALIGN(4); + __vsymtab_start = .; + KEEP(*(VSymTab)) + __vsymtab_end = .; + . = ALIGN(4); + + /* section information for initial. */ + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + . = ALIGN(4); + + /* section information for utest */ + . = ALIGN(4); + __rt_utest_tc_tab_start = .; + KEEP(*(UtestTcTab)) + __rt_utest_tc_tab_end = .; + /* Support C constructors, and C destructors in both user code and the C library. This also provides support for C++ code. */ . = ALIGN(4); @@ -160,4 +184,6 @@ SECTIONS . = ALIGN(4); _end = . ; + __bss_end = _end; + _ram_end_ = ORIGIN(ram) + LENGTH(ram) - 1 ; } diff --git a/bsp/microchip/samd51-seeed-wio-terminal/bsp/samd51a/gcc/gcc/startup_samd51.c b/bsp/microchip/samd51-seeed-wio-terminal/bsp/samd51a/gcc/gcc/startup_samd51.c index f05ffd7bc2..814dee1ad1 100644 --- a/bsp/microchip/samd51-seeed-wio-terminal/bsp/samd51a/gcc/gcc/startup_samd51.c +++ b/bsp/microchip/samd51-seeed-wio-terminal/bsp/samd51a/gcc/gcc/startup_samd51.c @@ -623,6 +623,8 @@ __attribute__((section(".vectors"))) const DeviceVectors exception_table #endif }; +int rtthread_startup(void); + /** * \brief This is the code that gets called on processor reset. * To initialize the device, and call the main() routine. @@ -660,8 +662,8 @@ void Reset_Handler(void) /* Initialize the C library */ __libc_init_array(); - /* Branch to main function */ - main(); + /* Branch to rtthread_startup function */ + rtthread_startup(); /* Infinite loop */ while (1) diff --git a/bsp/microchip/samd51-seeed-wio-terminal/rtconfig.h b/bsp/microchip/samd51-seeed-wio-terminal/rtconfig.h index 2ae10486a2..092ca5f357 100644 --- a/bsp/microchip/samd51-seeed-wio-terminal/rtconfig.h +++ b/bsp/microchip/samd51-seeed-wio-terminal/rtconfig.h @@ -267,7 +267,7 @@ /* Hardware Drivers Config */ -#define SOC_SAMD51J19 +#define SOC_SAMD51P19 /* Onboard Peripheral Drivers */ -- cgit v1.3.1