summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author1ridic <[email protected]>2023-10-10 19:53:50 +0800
committerguo <[email protected]>2023-10-11 13:41:12 +0800
commit299700cf78d12e3c04d68b527c881667eb4b90ad (patch)
tree4ef96ea7c10847549ec6fff31de4dd652cd88fac
parent220222a3875aea6c623c8f0eb89a91cad9fdb1b7 (diff)
[bsp][pico] Remove cmake dependency
-rw-r--r--bsp/raspberry-pico/README.md18
-rw-r--r--bsp/raspberry-pico/SConstruct9
-rw-r--r--bsp/raspberry-pico/tools/SConscript14
-rwxr-xr-xbsp/raspberry-pico/tools/generate_files.py38
4 files changed, 12 insertions, 67 deletions
diff --git a/bsp/raspberry-pico/README.md b/bsp/raspberry-pico/README.md
index 5b8c9b49fe..3e958715ef 100644
--- a/bsp/raspberry-pico/README.md
+++ b/bsp/raspberry-pico/README.md
@@ -27,7 +27,7 @@
## Supported compiler
-Support GCC 6 and above compilers. CMake and Scons is needed.
+Support GCC 6 and above compilers.
## Program firmware
@@ -37,19 +37,7 @@ Support GCC 6 and above compilers. CMake and Scons is needed.
pkgs --update
```
-### Step 2: generate necessary files
-
-```bash
-python ./tools/generate_files.py
-```
-
-Use PICO_TOOLCHAIN_PATH to specify the compilation toolchain location, for example:
-
-```bash
-env PICO_TOOLCHAIN_PATH=/opt/rt-gcc-arm-none-eabi/bin ./tools/generate_files.py
-``
-
-### Step 3: build
+### Step 2: build
```bash
scons -c
@@ -58,7 +46,7 @@ scons
**gcc version >= 6.x.x**
-### Step 4: flash
+### Step 3: flash
scons generates a UF2 file:
diff --git a/bsp/raspberry-pico/SConstruct b/bsp/raspberry-pico/SConstruct
index 6e0d0b32f3..bb72242f84 100644
--- a/bsp/raspberry-pico/SConstruct
+++ b/bsp/raspberry-pico/SConstruct
@@ -27,6 +27,15 @@ Export('rtconfig')
# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT)
+ocwd = os.getcwd()
+os.chdir('packages/raspberrypi-pico-sdk-latest')
+print("Enter " + os.getcwd())
+if GetOption('clean'):
+ os.system("scons -c")
+else:
+ os.system("scons")
+os.chdir(ocwd)
+
objs.extend(SConscript(os.path.join(os.getcwd(), 'board', 'ports', 'SConscript')))
# make a building
diff --git a/bsp/raspberry-pico/tools/SConscript b/bsp/raspberry-pico/tools/SConscript
deleted file mode 100644
index 154232ca49..0000000000
--- a/bsp/raspberry-pico/tools/SConscript
+++ /dev/null
@@ -1,14 +0,0 @@
-import rtconfig
-Import('RTT_ROOT')
-from building import *
-
-# get current directory
-cwd = GetCurrentDir()
-
-path = [
- cwd + '/generated/pico_base'
- ]
-
-group = DefineGroup('generated', ['generated/bs2_default_padded_checksummed.S'], depend = [''], CPPPATH = path)
-
-Return('group')
diff --git a/bsp/raspberry-pico/tools/generate_files.py b/bsp/raspberry-pico/tools/generate_files.py
deleted file mode 100755
index 47d6120cf9..0000000000
--- a/bsp/raspberry-pico/tools/generate_files.py
+++ /dev/null
@@ -1,38 +0,0 @@
-#! /usr/bin/env python3
-import os
-import sys
-import shutil
-
-# get the path of current file
-cmd = os.path.split(os.path.realpath(__file__))[0]
-
-if not os.path.exists(os.path.join(cmd, '../packages/raspberrypi-pico-sdk-latest')):
- print('Error: raspberrypi-pico-sdk not found, please run "pkgs --update" first')
- exit(1)
-
-if os.path.exists(os.path.join(cmd, 'build')):
- shutil.rmtree(os.path.join(cmd, 'build'))
-
-
-os.mkdir(os.path.join(cmd, 'build'))
-os.chdir(os.path.join(cmd, 'build'))
-
-# run cmake
-os.system('cmake ' + os.path.join(cmd, '../packages/raspberrypi-pico-sdk-latest'))
-os.system('make ELF2UF2Build bs2_default_padded_checksummed_asm')
-
-# copy header files
-shutil.copytree(os.path.join(cmd, 'build', 'generated'), os.path.join(cmd, 'generated'), dirs_exist_ok = True)
-
-# copy the generated files to the destination
-if "linux" in sys.platform:
- shutil.copyfile(os.path.join(cmd, 'build', 'elf2uf2', 'elf2uf2'), os.path.join(cmd, 'elf2uf2'))
-if "win32" in sys.platform:
- shutil.copyfile(os.path.join(cmd, 'build', 'elf2uf2', 'elf2uf2.exe'), os.path.join(cmd, 'elf2uf2.exe'))
-
-# copy bs2_default_padded_checksummed_asm
-shutil.copyfile(os.path.join(cmd, 'build', 'src', 'rp2_common', 'boot_stage2', 'bs2_default_padded_checksummed.S'), \
- os.path.join(cmd, 'generated', 'bs2_default_padded_checksummed.S'))
-
-# clean up
-shutil.rmtree(os.path.join(cmd, 'build'))