Skip to content

Commit

Permalink
licheePi4A for ROS MasterX3 walks in circle
Browse files Browse the repository at this point in the history
  • Loading branch information
elliott10 committed Oct 31, 2023
1 parent c8eb173 commit 7fe6f32
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 6 deletions.
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@ tar zxf x86_64-linux-musl-cross.tgz
# exec below command in bash OR add below info in ~/.bashrc
export PATH=`pwd`/x86_64-linux-musl-cross/bin:`pwd`/aarch64-linux-musl-cross/bin:`pwd`/riscv64-linux-musl-cross/bin:$PATH
```
### 荔枝派硬件平台运行
```
make A=apps/fs/shell ARCH=riscv64 SMP=4 PLATFORM=riscv64-lpi4a LOG=debug FS=y APP_FEATURES="axstd/driver-ramdisk,axstd/irq" lpi4a
```

### Example apps

```bash
Expand All @@ -107,6 +104,28 @@ make A=apps/net/httpserver ARCH=aarch64 LOG=info SMP=4 run NET=y

Note that the `NET=y` argument is required to enable the network device in QEMU. These arguments (`BLK`, `GRAPHIC`, etc.) only take effect at runtime not build time.

### 荔枝派Lichee Pi 4A硬件平台支持

* 编译荔枝派 for RosMasterX3 系统镜像

```
make A=apps/ros2/rosmasterx3 ARCH=riscv64 SMP=4 PLATFORM=riscv64-lpi4a LOG=debug FS=y APP_FEATURES="axstd/driver-ramdisk" lpi4a
```

生成镜像文件:`arceos-lpi4a.uImage`

* 镜像烧写

将编译好的ArceOS系统镜像`arceos-lpi4a.uImage`,以及OpenSBI镜像`fw_dynamic.bin` 放置于荔枝派的boot分区目录,例如可以通过自带的Linux网络传输的方式。

* 上机运行

启动荔枝派,在u-boot命令行界面,执行ArceOS内核引导命令:

```
ext4load mmc 0:2 $kernel_addr arceos-lpi4a.uImage; bootm $kernel_addr - $dtb_addr;'
```

### Your custom apps

#### Rust
Expand Down
37 changes: 36 additions & 1 deletion apps/ros2/rosmasterx3/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,41 @@ fn main() {
}
delay(1);

// 画圆
loop {
println!("forward");
{
//前进
uart.putchar(0xff);
uart.putchar(0xfc);
uart.putchar(0x07);
uart.putchar(0x11);
uart.putchar(0x01);
uart.putchar(0x01);
uart.putchar(0x32);
uart.putchar(0x00);
uart.putchar(0x4c);
}
delay(4);
{
//偏航角PID设置
uart.putchar(0xff);
uart.putchar(0xfc);
uart.putchar(0x0a);
uart.putchar(0x14);
uart.putchar(0x20);
uart.putchar(0x00);
uart.putchar(0x20);
uart.putchar(0x00);
uart.putchar(0x20);
uart.putchar(0x00);
uart.putchar(0x00);
uart.putchar(0x7e);
}
delay(1);
}

/*
loop {
println!("forward");
{
Expand Down Expand Up @@ -160,6 +195,6 @@ fn main() {
uart.putchar(0x83);
}
delay(1);
}
}*/

}
2 changes: 1 addition & 1 deletion crates/page_table_entry/src/arch/riscv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl From<MappingFlags> for PTEFlags {
if f.is_empty() {
return Self::empty();
}
//let mut ret = Self::V | Self::K;
// let mut ret = Self::V | Self::K;
let mut ret = Self::V;
if f.contains(MappingFlags::READ) {
ret |= Self::R;
Expand Down
Binary file added tools/lpi4a/fw_dynamic.bin
Binary file not shown.

0 comments on commit 7fe6f32

Please sign in to comment.