Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Microchip SAM series MCU support for RT-Thread #5771

Merged
merged 15 commits into from
Apr 14, 2022

Conversation

klmchp
Copy link
Contributor

@klmchp klmchp commented Apr 4, 2022

Add Microchip SAM series MCU support for RT-Thread, including SAM Cortex-M0+, M4F and M7.

拉取/合并请求描述:(PR description)

[
Add Microchip SAM series MCU support for RT-Thread.
Pull request has verified on Microchip SAMC21-Xplained demo board, SAME54-Xplained demo board and SAME70-XULT demo board, see microchip\readme.MD for more details. The verification including using env tools to compile code, using menuconfig on env tools to generate RT configuration header file and code debug test with Microchip IDE.
]

以下的内容不应该在提交PR时的message修改,修改下述message,PR会被直接关闭。请在提交PR后,浏览器查看PR并对以下检查项逐项check,没问题后逐条在页面上打钩。
The following content must not be changed in the submitted PR message. Otherwise, the PR will be closed immediately. After submitted PR, please use a web browser to visit PR, and check items one by one, and ticked them if no problem.

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • [*] 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • [*] 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • [*] 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • [*] 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • [*] 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • [*] 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • [*] 本拉取/合并请求代码是高质量的 Code in this PR is of high quality
  • [*] 本拉取/合并使用formatting等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification

Add Microchip SAM series MCU support for RT-Thread, including SAM Cortex-M0+, M4F and M7.
@klmchp
Copy link
Contributor Author

klmchp commented Apr 4, 2022

There are many File format errors, such as:
[file_check.py 131 ERROR] bsp/microchip/same54/bsp/hri/hri_gclk_e54.h line[679]: please use space replace tab at the start of this line.
Comment:
These code is generated by Microchip online development tool, not from developer's code.

@mysterywolf
Copy link
Member

如果是半导体厂商提供的库,不需要格式化代码 可以参照此处来让ci排除格式检查,增加这个文件机器人就不会检查格式问题了 https://github.com/RT-Thread/rt-thread/blob/master/bsp/acm32/acm32f0x0-nucleo/.ignore_format.yml

如果是给rtt适配的驱动,是需要整理格式的,请使用这个脚本来进行扫描:https://github.com/mysterywolf/formatting

感谢提交pr

@mysterywolf
Copy link
Member

也请将新增加的bsp 加入到机器人自检队列中:
https://github.com/RT-Thread/rt-thread/blob/master/.github/workflows/action.yml

@mysterywolf
Copy link
Member

mysterywolf commented Apr 4, 2022

image
请确认对于Keil IAR GCC的接口文件是否还需要提供,RT-Thread这侧已经对接了编译器接口,按理来说是不需要再对接一遍了,否则可能会冲突,因为定义了两个相同的函数名,详见:
https://www.rt-thread.org/document/site/#/rt-thread-version/rt-thread-standard/programming-manual/libc/compiler?id=%e7%bc%96%e8%af%91%e5%99%a8%e9%85%8d%e5%b9%b3%e5%b1%82

https://github.com/RT-Thread/rt-thread/tree/master/components/libc/compilers

你只需要实现我们这侧的console设备也就是将串口设备实现好,并将console设备指定到该串口设备,就可以直接使用printf putc, read(FILENO_STDIN) write(FILENO_STDOUT)这类基本的输入输出了。如果对接了文件系统,就可以直接用read write来读写文件了。

Add bsp directory to ignored check list, add microchip /samc21/same54/same70 to workflows list
@CLAassistant
Copy link

CLAassistant commented Apr 5, 2022

CLA assistant check
All committers have signed the CLA.

klmchp and others added 2 commits April 6, 2022 09:20
1. remove STDIO code from Microchip official BSP. 2. bug fix of SAME70 hpl/hpl_usart.c, samc21&same54 hpl/hpl_sercom.c baudrate update interface.  3. Add RT-Thread standard STDIO implementation on Microchip SAM MCU.
@klmchp
Copy link
Contributor Author

klmchp commented Apr 6, 2022

也请将新增加的bsp 加入到机器人自检队列中: https://github.com/RT-Thread/rt-thread/blob/master/.github/workflows/action.yml

已经添加

也请将新增加的bsp 加入到机器人自检队列中: https://github.com/RT-Thread/rt-thread/blob/master/.github/workflows/action.yml

已经添加,开发者的代码已经通过工具扫描

请确认对于Keil IAR GCC的接口文件是否还需要提供

已经移除Microchip官方STDIO实现的代码,添加RT-Thread console设备在Microchip SAM MCU上的实现。

@klmchp
Copy link
Contributor Author

klmchp commented Apr 6, 2022

image
在个人电脑端用最新env_released_1.2.0,对samc21/same54/same70工程进行编译都没有问题。看提交的代码后台链接时报错,没有看到更具体的报错说明,哪里可以看到后台代码编译环境的搭建说明?谢谢

@mysterywolf
Copy link
Member

@Guozhanxin 郭老师 帮忙看一下 是不是CI没有安装gcc10的工具链?

@klmchp
Copy link
Contributor Author

klmchp commented Apr 8, 2022

@mysterywolf 请问有什么建议解决后台编译出错的问题?我这边用env tools工具测试都是没问题的。

@BernardXiong
Copy link
Member

感谢提交代码,您的几份bsp rtconfig.py文件都还存在些问题:

例如 bsp/microchip/samc21/rtconfig.py

LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread.map,-cref, -T bsp/samc21/gcc/gcc/samc21j18a_flash.ld'

-cref,-T bsp...中间不应该存在空格,应该是:

LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread.map,-cref,-T bsp/samc21/gcc/gcc/samc21j18a_flash.ld'

@klmchp
Copy link
Contributor Author

klmchp commented Apr 9, 2022

@BernardXiong 感谢指正,我修正rtconfig.py脚本后再提交

klmchp and others added 2 commits April 9, 2022 10:18
Add CAN driver and example for SAMC21/SAME5x/SAME70 and fix rtconfig.py issue(unused space might result link error)
@BernardXiong
Copy link
Member

关于README.md文档中,中文相关的是缺少的,但是存在中文的链接。

@klmchp
Copy link
Contributor Author

klmchp commented Apr 10, 2022

关于README.md文档中,中文相关的是缺少的,但是存在中文的链接。

已经添加

@mysterywolf
Copy link
Member

@Guozhanxin 郭老师麻烦再批准一下ci流程

@mysterywolf
Copy link
Member

你好 请选择合适的架构适配上即可,不要将无用的文件也传过来
1649735430

@mysterywolf
Copy link
Member

另外请不要上传makefile文件
1649735444(1)

@klmchp
Copy link
Contributor Author

klmchp commented Apr 12, 2022

你好 请选择合适的架构适配上即可,不要将无用的文件也传过来 1649735430

Makefile文件、Keil/IAR工程导入文件都是官方BSP生成的时候一起产生的。
对于官方文件这一块我就没有去做改动,只是增加SConscript文件来解决编译依赖关系。

@mysterywolf
Copy link
Member

这些文件对于本bsp来说是无意义的,如果每个bsp都上传一些无意义的文件的话,rtt的仓库就会变成垃圾堆了😂

@mysterywolf
Copy link
Member

mysterywolf commented Apr 12, 2022

这样 你先把Makefile都干掉吧 CMSIS的部分可以先留着,后续我们统一处理一下,不止这一个bsp有这个问题。但是Makefile文件要都删掉,否则可能和我们自己生成的Makefile工程产生冲突。

klmchp and others added 2 commits April 13, 2022 09:09
Remove Makefile to avoid conflict with rt and add directory description.
@mysterywolf
Copy link
Member

@Guozhanxin 郭老师这个PR我没有问题了,请批准CI流程,并review一下。

@mysterywolf mysterywolf added the +1 Agree +1 label Apr 13, 2022
bsp/microchip/README.md Outdated Show resolved Hide resolved
@Guozhanxin Guozhanxin added the +2 Agree +2 label Apr 14, 2022
@Guozhanxin Guozhanxin merged commit 8af8dec into RT-Thread:master Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BSP +1 Agree +1 +2 Agree +2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants