rt-thread/bsp/microchip
ryancw ac8fba0129 [drivers][serial_v2]允许阻塞接收超过rx缓冲区大小的数据、增加超时时间、flush、获取缓冲区数据长度命令、数据溢出逻辑修复、稳定性细节优化、添加更多serial_v2测试用例
[components][serial_v2] 优化txflush逻辑、对tx的activated做中断保护

[components][at] at_client适配新版serial_v2

[components][at] at_server适配新版serial_v2

[components][serial_v2] 测试用例增加循环调用,format测试用例

[components][serial_v2] poll模式判断逻辑错误

[components][serial_v2] 测试用例去掉一些非必要延时

[components][serial_v2] 测试例程使用menuconfig进行配置,更新readme

[components][at_client] at_client_getchar返回值错误、at_client解析线程优先级错误设置

[components][at] 错误码应该返回负值

[components][serial_v2] TCFLSH和FIONREAD完善、control函数增加错误返回值

[components][serial_v2] RT_SERIAL_CTRL_GET_RX_DATA_LEN更改为RT_SERIAL_CTRL_GET_UNREAD_BYTES_COUNT

[utest][serial_v2] TC_UART_SEND_TIMES替换为RT_SERIAL_TC_SEND_ITERATIONS

[components][serial_v2] FIONREAD参数应该是无符号类型

[utest][serial_v2] 完善测试用例

[components][serial_v2] 避免使用三目运算符

[components][serial_v2] 使用clang-format格式化代码

[components][serial_v2] 添加get超时时间命令

[components][serial_v2] 完善posix接口

[components][serial_v2] 阻塞接口添加阻塞时间为0时的处理逻辑、优化RX阻塞接收逻辑

[components][serial_v2] 设置超时时间命令的参数改为指针形式

[components][serial_v2] nbuf发送添加超时时间为0时的逻辑

[components][serial_v2] 完善添加测试用例

[utest][serial_v2] 修复依赖关系

[components][serial_v2] 非阻塞模式下tx_flush错误修复

[components][serial_v2] activated使用原子API

[components][serial_v2] 优化DMA逻辑、没使能DMA时屏蔽DMA逻辑节约资源

[components][serial_v2] 提供写满时丢弃新数据和覆盖旧数据策略,写满丢弃策略效率更高

[components][serial_v2] 部分平台适配写满时两种策略功能

[components][serial_v2] DMA模式暂不支持丢弃新数据策略

[utest][serial_v2] 优化测试代码

[components][serial_v2] DMA模式下使用乒乓缓冲、DMA模式支持丢弃新数据策略

[utest][serial_v2] 适配DMA乒乓缓冲

[bsp][serial_v2] 部分bsp适配DMA下乒乓缓冲

[components][serial_v2] 使用spinlock替换中断,对部分结构体变量使用原子操作

[utest][serial_v2] 更新测试用例

[components][at] 适配new serialv2不再判断RTT版本号

[components][at] 删除多余的中文注释

[utest][serial_v2] 添加交叉echo示例,qemu环境下专用

[bsp][qemu] 适配串口v2并开启fifo

[components][at] 修复合并导致的错误

[bsp][n32] 适配serial_v2,没有经过测试

[components][serial_v2] 格式化代码

[utest][serial_v2] 删除无意义的打印
2025-05-16 09:42:11 +08:00
..
common [drivers][serial_v2]允许阻塞接收超过rx缓冲区大小的数据、增加超时时间、flush、获取缓冲区数据长度命令、数据溢出逻辑修复、稳定性细节优化、添加更多serial_v2测试用例 2025-05-16 09:42:11 +08:00
doc Microchip SAM MCU新增ethernet支持和驱动更新 (#5821) 2022-04-19 14:32:02 +08:00
samc21 bsp中option env语句替换为新语句,并同步更新了source "$xxx"语句 2024-06-20 14:40:42 +08:00
samd51-adafruit-metro-m4 bsp中option env语句替换为新语句,并同步更新了source "$xxx"语句 2024-06-20 14:40:42 +08:00
samd51-seeed-wio-terminal bsp中option env语句替换为新语句,并同步更新了source "$xxx"语句 2024-06-20 14:40:42 +08:00
same54 [ci][bsp]fix same54&same70&ls1cdev build errors. (#9282) 2024-08-08 14:08:59 +08:00
same70 [ci][bsp]fix same54&same70&ls1cdev build errors. (#9282) 2024-08-08 14:08:59 +08:00
saml10 bsp中option env语句替换为新语句,并同步更新了source "$xxx"语句 2024-06-20 14:40:42 +08:00
README.md [bsp][mchp] update README.md 2023-10-09 09:28:12 +08:00

README.md

Microchip BSP

1. Microchip BSP Introduction

Supported Microchip SAM (ARM Cortex-Mx Core) MCU is as following

ARM Cortex-M23 Series

  • saml10 | 3.3V Cortex-M23 with ultra low power
  • saml11 | 3.3V Cortex-M23 with ultra low power and trust-zone

ARM Cortex-M0+ Series

  • samc21 | 5V Cortex-M0+ with 2 CAN-FD support
  • saml21 | 3.3V low power Cortex-M0+
  • samd21 | 3.3V industrial level Cortex-M0+

ARM Cortex-M4 Series

  • same54 | 3.3V 120MHz Cortex-M4F core with CAN-FD/USB/Ethernet support

ARM Cortex-M7 Series

  • same70 | 3.3V 300MHz Cortex-M7 core with CAN-FD/High speed USB/Ethernet support

Directory description

* applications: 
	* user main function entrance,
	* driver example - like i2c, can, adc ...
	* application example
* board: 
	* user board initialization
	* user driver adpater code, like console device, ethernet device
* bsp:
	* MCU BSP files - startup file, peripheral drivers, configuation headers and linker script
	* generated from start.atmel.com - DO NOT modify it

2. RT-Thread porting guide of Microchip SAM MCU

2.1 Configure project BSP on Atmel Start

Visit https://start.atmel.com/# and click CREATE NEW PROJECT.

Input MCU part number and then select device, click CREATE NEW PROJECT.

Add STDIO and other driver/middleware to project.

Configure STDIO driver.

Configure CAN module clock.

Configure CAN module driver.

Add LED pin description.

Rename project.

Save project configuration.

Export project source code.

2.2 Add project to RT-Thread source code

Link: https://github.com/RT-Thread/rt-thread and download RT souce code.

Unzip downloaded RT-Thread and SAME70 CAN Example

Enter rt-thread-xxx/bsp/microchip directory and copy same70 folder and rename it to same70q20.

Enter same70q20 directory and remove all files except SConscript file.

Copy all files from SAME70 CAN Example to rt-thread-xxx/bsp/microchip/same70q20/bsp.

Modify rt-thread-xxx\bsp\microchip\same70q20\rtconfig.py.

Modify rt-thread-xxx\bsp\microchip\same70q20\bsp\SConscript.

Modify rt-thread-xxx\bsp\microchip\same70q20\bsp\same70b\gcc\gcc\same70q20b_flash.ld.

Modify rt-thread-xxx\bsp\microchip\same70q20\bsp\same70b\gcc\gcc\startup_same70q20b.c.

Alright, now you can use RT-Thread env tools to compile the project.

2.3 Compile project with RT-Thread env tools

About RT-Thread env tools, click Here.

Download RT-Thread env tools https://www.rt-thread.org/download.html#download-rt-thread-env-tool

Unzip downloaded file and run env.exe.

Enter your project directory and run scons command to compile it.

Compile error you may have and proposed solution.

Fix compiling error

Compiling success

In the following chapter I will show you how to debug RT-Thread with Studio 7.

3. RT-Thread debugging with Microchip IDE

Link: https://www.microchip.com/en-us/tools-resources/develop/microchip-studio, download & install Microchip Studio 7.

Open installed Microchip Studio 7 and open object file for debugging.

Choose object file, fill project name and select where to save this project.

Select the right part number and complete object set up.

Object file import complete and you can see related files are linked to project.

Right click the project and choose the debug tools in project propertities setting.

Choose debugger/programmer and debugger interface - SWD or JTGA.

Press debugging button and enjoy your debugging journey.

Debugging start and you can add breakpoint.

Debugging paused at breakpoint and you can monitor local variables at Watch window.

Debugging message output.

4. Reconfigure MCU BSP

Visit https://start.atmel.com/# and upload project configuration.

Now you can reconfigure your project.

5. Microchip SAM MCU BSP configuration and user guide

Please refer to ASF4 API Reference Manual for more details

5.1 SAMC2x/E5x/E70 CAN Driver

CAN driver configuration.

CAN driver user guide - see ASF4 API Reference Manual P121 for more details.

To be continued.

6. Contact Info