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

[bsp][esp32-c3] Realization of scons compilation of ESP32-C3 | 实现ESP32-C3的scons编译 #7821

Merged
merged 10 commits into from
Jul 25, 2023

Conversation

WCX1024979076
Copy link
Contributor

…-C3 | 初步实现ESP32-C3的scons编译

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

[

为什么提交这份PR (why to submit this PR)

更改bsp/ESP32C3代码引入scons编译支持,目前可以直接使用scons来编译bsp/ESP32-C3

你的解决方案是什么 (what is your solution)

修改bsp/ESP32C3SConstructSConscript代码,使得可以直接使用scons命令来编译bsp而无需使用idf.py来进行编译

在什么测试环境下测试通过 (what is the test environment)

在一个新的系统环境中完成了工具链下载和配置,并成功用scons编译出rtthread.bin并烧录运行。
]

当前拉取/合并请求的状态 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

@WCX1024979076 WCX1024979076 changed the title [bsp][esp32-c3] Preliminary realization of scons compilation of ESP32-C3 | 初步实现ESP32-C3的scons编译 [bsp][esp32-c3] Realization of scons compilation of ESP32-C3 | 实现ESP32-C3的scons编译 Jul 16, 2023
@WCX1024979076
Copy link
Contributor Author

上面自动化测试不通过是由于网络问题导致build bouffalo_lab/bl70xbouffalo_lab/bl60x检查不通过,我查看了一下日志是从gitee.com上下载失败。

@supperthomas
Copy link
Member

可以尝试添加esp32c3的toolchain,放到action.yml中。这个看下难不难。

@WCX1024979076
Copy link
Contributor Author

好的,我去试一下

@supperthomas supperthomas added the BSP: ESP32 BSP related with ESP label Jul 17, 2023
@supperthomas
Copy link
Member

好的,我去试一下

麻烦吗?要不我们先把这个合进去?

@WCX1024979076
Copy link
Contributor Author

这个昨天写了一下试了一下,发现packages的PR还没通过,scons检查没通过,要不这个代码先合并了吧,下一次我写驱动的时候顺带实现了那个action.xml

@supperthomas supperthomas added the +1 Agree +1 label Jul 18, 2023
@mysterywolf mysterywolf added the in progress PR/issue in progress. label Jul 18, 2023
- Any convenient method to install ESP-IDF can be used, such as [VSCode plugin](https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/tutorial/install.md). Make sure to install the master version of ESP-IDF.
- Enter the local ESP-IDF directory and run the following commands
```
git checkout 5c1044d84d625219eafa18c24758d9f0e4006b2c
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这一步需要吗?https://github.com/RT-Thread-packages/esp-idf 你是直接用的这个仓库吗?

@supperthomas
Copy link
Member

这个昨天写了一下试了一下,发现packages的PR还没通过,scons检查没通过,要不这个代码先合并了吧,下一次我写驱动的时候顺带实现了那个action.xml

packages 已经合进去了,试下加下action.yml.需要我帮你写一些吗?

@WCX1024979076
Copy link
Contributor Author

还依赖于一个package,是FreeRTOS-Wrapper,目前已和负责人联系并且商议合并,地址在 RT-Thread-packages/FreeRTOS-Wrapper#36

@WCX1024979076
Copy link
Contributor Author

还有一个下载的压缩包是tat.xz,解压命令有误,这样写就可以了:

wget -q https://github.com/espressif/crosstool-NG/releases/download/esp-2022r1-RC1/riscv32-esp-elf-gcc11_2_0-esp-2022r1-RC1-linux-amd64.tar.xz
 sudo tar xf riscv32-esp-elf-gcc11_2_0-esp-2022r1-RC1-linux-amd64.tar.xz -C /opt
/opt/riscv32-esp-elf/bin/riscv32-esp-elf-gcc --version
echo "RTT_EXEC_PATH=/opt/riscv32-esp-elf/bin" >> $GITHUB_ENV
pip install esptool

@supperthomas
Copy link
Member

还有一个下载的压缩包是tat.xz,解压命令有误,这样写就可以了:

wget -q https://github.com/espressif/crosstool-NG/releases/download/esp-2022r1-RC1/riscv32-esp-elf-gcc11_2_0-esp-2022r1-RC1-linux-amd64.tar.xz
 sudo tar xf riscv32-esp-elf-gcc11_2_0-esp-2022r1-RC1-linux-amd64.tar.xz -C /opt
/opt/riscv32-esp-elf/bin/riscv32-esp-elf-gcc --version
echo "RTT_EXEC_PATH=/opt/riscv32-esp-elf/bin" >> $GITHUB_ENV
pip install esptool

你自己把代码拉下来改下吧,或者直接仓库里面改,应该不难了吧?CI?

@WCX1024979076
Copy link
Contributor Author

好的,不难,我参考一下写一下

@supperthomas
Copy link
Member

好的,不难,我参考一下写一下

记得要把我改的拉下来。

@WCX1024979076
Copy link
Contributor Author

好的

@supperthomas supperthomas removed the +1 Agree +1 label Jul 24, 2023
@WCX1024979076
Copy link
Contributor Author

GitHub action 报错,scons编译过程中提示esptool没找到,我看了一下编译日志scons是使用的独立的缓存的python环境,LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.17/x64/lib,我在尝试解决但是没有查到合适的方法。 @supperthomas

@WCX1024979076
Copy link
Contributor Author

我有个想法,/opt/hostedtoolcache/Python/3.8.17/x64/bin/pip install esptool这样来写命令安装esptool,不知道可行不可行了

@supperthomas
Copy link
Member

我有个想法,/opt/hostedtoolcache/Python/3.8.17/x64/bin/pip install esptool这样来写命令安装esptool,不知道可行不可行了

试试呗。

@supperthomas
Copy link
Member

https://club.rt-thread.org/ask/article/d25fb0a88165f166.html

试试用下这个黑科技。

@WCX1024979076
Copy link
Contributor Author

Github codespace 我正在用,感觉还可以,用了一段时间了

@WCX1024979076
Copy link
Contributor Author

还是报相同的错误,我再想想办法

@supperthomas
Copy link
Member

Github codespace 我正在用,感觉还可以,用了一段时间了

在codespace里面先试试命令,会报错吗?

@WCX1024979076
Copy link
Contributor Author

在codespace中运行pip install esptool并且导入esptool没问题

@supperthomas
Copy link
Member

pip3 install esptool 试试

@WCX1024979076
Copy link
Contributor Author

还是报错,我新开一个codespace重新配置一下试试

@mysterywolf mysterywolf removed the in progress PR/issue in progress. label Jul 25, 2023
@WCX1024979076
Copy link
Contributor Author

问题解决了,通过apt-get安装的scons使用的python环境是系统默认自带的python环境,通过/usr/bin/pip install esptool就可以了。另一个测试/ kernel/atomic 没过我就不知道具体原因了。 @supperthomas

@supperthomas supperthomas merged commit 0a6aaf1 into RT-Thread:master Jul 25, 2023
@supperthomas
Copy link
Member

supperthomas commented Jul 26, 2023

可否帮忙在论坛里面发一篇现在如何使用ESP32_C3的文章?

@WCX1024979076
Copy link
Contributor Author

可以的,我去整理一下材料写一下

supperthomas added a commit to supperthomas/rt-thread that referenced this pull request Aug 21, 2023
* [bsp][rt-spark] Update README.md

* [ci][action] add the repo check for self-use

* [bsp][stm32] add B-U585I-IOT02A BSP (RT-Thread#7778)

B-U585I-IOT02A芯片为STM32U585AIIxQ,与stm32u575-st-nucleo板卡接近,因此参考stm32u575-st-nucleo对B-U585I-IOT02A板卡的BSP进行了实现

* [bsp][Infineon] Add I2C4 config for psoc6-evaluationkit

* [SAL/SOCKET]修复在 RT_DEBUG 开启后,调用 closesocket 接口触发断言的 BUG

* 【dd2.0】Support the Core API for dd2.0 (RT-Thread#7791)

* [libcpu]fix RT_ASSERT undefine (RT-Thread#7816)

* [components][i2c] 优化 controt 接口格式,增加可用命令 (RT-Thread#7806)

原来 rt_i2c_control 只能执行 RT_I2C_DEV_CTRL_CLK 单一命令,通过此修改可以支持更多可用命令

* [libcpu][cortex-a]modified start_gcc.S (RT-Thread#7810)

* AArch64: fixup fpu storage's size in stack and append Q16 ~ Q31 (RT-Thread#7815)

Signed-off-by: GuEe-GUI <[email protected]>

* [time]时钟框架重构 (RT-Thread#7794)

* [libcpu][arc]修复arc架构线程切换bug (RT-Thread#7825)

* [add] add msp432e401y-LaunchPad BSP v0.1

* [bsp][Infineon]fix i2c init error (RT-Thread#7817)

添加iic4的配置,将初始化错误断言部分修改为打印方式

* [github] Add the code_owner review quest

* [component/lwp] support more feature of signal from IEEE Std 1003.1-2017 (RT-Thread#7828)

Signed-off-by: Shell <[email protected]>

* [bsp][stm32][airm2m]<pin>更新pin num命令 (RT-Thread#7390)

* [components][net][sal][socket] Fix duplicate free on allocated buffer

- Avoid duplicate free as the d->vnode will be freed in the fd_release API call

Signed-off-by: Fan YANG <[email protected]>

* ✨ feat(ktime): add RT_USING_KTIME to kconfig build

* [github] coder reviewer change

* overflow is invalid in oneshot mode

* [libc][time] cleanup code

* [smart] fix possible memory leak (RT-Thread#7832)

Signed-off-by: Shell <[email protected]>

* [debug] 整理debug宏并增加RT_DEBUGING_CONTEXT (RT-Thread#7805)

* clean up rtthread.h (RT-Thread#7843)

* [ci] add paths-ignore for format and static check (RT-Thread#7845)

* [ci] update code owner (RT-Thread#7846)

* modify some function prototypes of the dfs_file_ops structure and the function declarations based on it (RT-Thread#7849)

* [tools][mdk] fix .uvoptx/uvopt project name

e.g. scons --target=mdk5/4 --project-path='test'
will generate the test.uvoptx/uvopt file correctly

* [tools] --project-name= can use name with space

* [doc][env] update env document

* [smart] 修复用户态 mq_receive 不能阻塞 (RT-Thread#7836)

* [bsp][esp32-c3] Realization of scons compilation of ESP32-C3 | 实现ESP32-C3的scons编译 (RT-Thread#7821)

Co-authored-by: Supper Thomas <[email protected]>

* [libcpu/arm] fix race condition with ldrex,strex (RT-Thread#7842)

Signed-off-by: Shell <[email protected]>

* 更新瑞萨相关 bsp (RT-Thread#7858)

* AArch64: fixup HW atomic_t ops type from dword to qword (RT-Thread#7861)

Signed-off-by: GuEe-GUI <[email protected]>

* [smart] fix the setup of fake lwp in sys_execve (RT-Thread#7855)

* AArch64: support public linker scripts (RT-Thread#7831)

Signed-off-by: GuEe-GUI <[email protected]>

* [bsp][wch] fix UART IRQ declarion 

将UART4后的中断函数声明改为UART

* [docs][qemu] update quick_start_qemu_windows

* [codeowners] add /documentation owners

* [doc][qemu] update qemu for windows doc

* [debug] fix the error when disable RT_USING_DEBUG

* 【dd2.0】move the core header files to include/drivers/core

* 🐞 fix(ktime): fix wrong boottime

因为tick从中断到设置中间的时延特别大,因此暂不采用tick做基准时间,直接取gtime的cnt做基准时间

* 🐞 fix(rtc/soft_rtc): fix wrong time

use boottime as soft_rtc time source

* 🐞 fix(ktime/hrtimer): fix ctrl c

* 📃 docs(ktime/readme): add readme

* [dfs v2]fix fcntl(F_SETFL) bug,and modify the error code when opening… (RT-Thread#7878)

* [syscall][socket]fix socket addr bug (RT-Thread#7876)

* Add the system call eventfd (RT-Thread#7835)

* [debug] use LOG_D instead RT_DEBUG_LOG

related: RT-Thread#7799

* [drivers/core] revise the macros of header files

the macros is too common to use so that to avoid conflicts

* [drivers/ipc] fix the recursive including if legacy enabled

* [ci][kconfig][qemu] guard the legacy option

* [.github] add CONTRIBUTING.md

https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/setting-guidelines-for-repository-contributors

* [docs] add env vscode document

* [bsp][pico]add: drv_spi and drv_i2c

* [components/ctime] fix the free of rt_work (RT-Thread#7882)

Signed-off-by: Shell <[email protected]>

* [libcpu/Kconfig] add ARCH_ARM_CORTEX_M23 define (RT-Thread#7895)

* [components][fal] remove some assert.

* [components][utilities][var_export] update the var export auto init to board_init.

* [sdio]开启emmc内部cache加快传输 (RT-Thread#7896)

* Add the system call epoll (RT-Thread#7893)

* [RTduino][stm32-f401nucleo] 支持对接引脚的功能切换 (RT-Thread#7901)

* Prepare some api for DM (RT-Thread#7894)

Signed-off-by: GuEe-GUI <[email protected]>

* [bsp] phytium e2000 update (RT-Thread#7900)

Co-authored-by: zhugengyu <[email protected]>

* update dfs (RT-Thread#7887)

* [bsp][renesas]update ra6m3&4 readme

* [lwp] 修复错误码误用 (RT-Thread#7906)

* [DFS_V1] 修复close失败后不释放fd导致内存被永久占用且无法释放 (RT-Thread#7907)

* [components][drivers][sdio] Fix minor issue in sdio driver (RT-Thread#7904)

Signed-off-by: Fan YANG <[email protected]>

* [smart] Fix bugs on lwp kill (RT-Thread#7892)

Signed-off-by: Shell <[email protected]>

* Add fops for dfs_v2 and rt_set_errno (RT-Thread#7910)

* [kernel][mutex] 去除mutex中的递归

* [bsp][stm32][drv_spi.c] remove meaningless settings

* [bsp][Phytium] qspi debug (RT-Thread#7914)

* [ci] add the manual trigger;add the fail bsp check (RT-Thread#7919)

* [rtduino][stm32-f401] support timer9 as tone timer

* [rtduino][stm32-l476] add LED_BUILTIN

* [bsp][stm32h750_artpi] use gnu99

* fix some variables not used warnings when build. (RT-Thread#7925)

* update components & lwp. (RT-Thread#7888)

* avoid warning message of sequence-point

board/ports/touch/gt911/src/gt911.c: warning: operation on '*(config + 8)' may be undefined [-Wsequence-point]
                config[8] = config[8] ^= (1 << 3);
                ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~

* [libc][time] silence the incorrect type warning

* rt_hw_cpu_reset: remove all other rt_weak

* rt_hw_cpu_shutdown: implement default weak function

and remvoe duplicated default functions in each cpu/bsp level

* [libcpu][risc-v][common] Avoid using t0 before being saved

- Fixed the issue that t0 was modified unexpectedly before being saved

Signed-off-by: Fan YANG <[email protected]>

* [stm32][pandora] fix LCD init ahead PWM

* [SAL] fix the IPv4&v6 compiling issue. (RT-Thread#7938)

* [bsp/ifx] add cyw43012 wifi module

* [libcpu][risc-v][common] Fix application crash on risc-v soc if FPU is
enabled

- Defined ARCH_RISCV_FPU once the __riscv_flen macro was detected

Signed-off-by: Fan YANG <[email protected]>

* fix dfs_file_open error code (RT-Thread#7942)

* fix mkdir error code. (RT-Thread#7944)

* fix lwp_free tty switch to foreground error (RT-Thread#7945)

* [libc][timezone] implement lightweith timezone configuration

* [device][rtc] support output UTC minutes level

* [libc][time] pre-support fully version timezone and daylight saving time

* [bsp][stm32][rt-spark] 更新 cubemx ports

* [bsp][hpmicro] Update libraries, add new BSPs

- Updated hpm_sdk in libraries
- Updated rt-thread driver adapter
- Updated bsp for hpm6750evkmini
- Updated bsp for hpm6750evk
- Added bsp for hpm6750evk2
- Added bsp for hpm6300evk
- Added bsp for hpm6200evk

Signed-off-by: Fan YANG <[email protected]>

* fix msh exec permission denied (RT-Thread#7943)

* 🎈 perf(ktime): perf hrtimer, del wrong function (RT-Thread#7880)

* [components/mm] add unmap page API (RT-Thread#7834)

Signed-off-by: Shell <[email protected]>

* [libc][posix/io/stdio] rename libc.c as posix/stdio.c

* [libc][newlib] __sdidinit is obselete

related:
RT-Thread#7923
mirror/newlib-cygwin@44b60f0

Co-authored-by: Meco Man <[email protected]>

* [components][drivers][can]Init can tx completion flag before tx

* [DFS_V1]修复 dfs_file_stat 一个 FATFS 根目录会失败的问题 (RT-Thread#7940)

* fix list_page (RT-Thread#7968)

* [bsp][gd32]添加 立创开发板 GD32F470 的 SDRAM驱动,从STM32的drv_sdram.c修改而来

* [tools][gcc] remove legacy functions
- GenerateGCCConfig
- GenCconfigFile

* [tools] add GetGCCLikePLATFORM
GCC like means the toolchains which are compatible with GCC

* [ci] Add more config for future use

---------

Signed-off-by: GuEe-GUI <[email protected]>
Signed-off-by: Shell <[email protected]>
Signed-off-by: Fan YANG <[email protected]>
Co-authored-by: Zheng-Bicheng <[email protected]>
Co-authored-by: Siwei Xu <[email protected]>
Co-authored-by: yanghaiyong <[email protected]>
Co-authored-by: ErikChanHub <[email protected]>
Co-authored-by: sp-cai <[email protected]>
Co-authored-by: lepus <[email protected]>
Co-authored-by: GUI <[email protected]>
Co-authored-by: xqyjlj <[email protected]>
Co-authored-by: yby <[email protected]>
Co-authored-by: yby <[email protected]>
Co-authored-by: Rbb666 <[email protected]>
Co-authored-by: Shell <[email protected]>
Co-authored-by: wangqinglin <[email protected]>
Co-authored-by: Fan YANG <[email protected]>
Co-authored-by: Mr.M <[email protected]>
Co-authored-by: Meco Man <[email protected]>
Co-authored-by: xiao-mang <[email protected]>
Co-authored-by: zhkag <[email protected]>
Co-authored-by: WCX <[email protected]>
Co-authored-by: guo <[email protected]>
Co-authored-by: bxhsiman <[email protected]>
Co-authored-by: erikchan <[email protected]>
Co-authored-by: Tennn11 <[email protected]>
Co-authored-by: zmq810150896 <[email protected]>
Co-authored-by: Shicheng Chu <[email protected]>
Co-authored-by: 朱天龙 (Armink) <[email protected]>
Co-authored-by: heyuanjie87 <[email protected]>
Co-authored-by: liYangYang <[email protected]>
Co-authored-by: zhangyan <[email protected]>
Co-authored-by: zhugengyu <[email protected]>
Co-authored-by: geniusgogo <[email protected]>
Co-authored-by: Rbb666 <[email protected]>
Co-authored-by: Junjie Wang <[email protected]>
Co-authored-by: Fan Yang <[email protected]>
Co-authored-by: vacabun <[email protected]>
Co-authored-by: DingDing <[email protected]>
Co-authored-by: KunYi Chen <[email protected]>
Co-authored-by: cx <[email protected]>
Co-authored-by: Bernard Xiong <[email protected]>
Co-authored-by: FragrantRye <[email protected]>
Co-authored-by: cmbjxxiao <[email protected]>
Co-authored-by: yuanzihao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BSP: ESP32 BSP related with ESP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants