mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
add bl602 bsp
This commit is contained in:
parent
08b37e5999
commit
c2be858509
35
bsp/bl602/Makefile
Normal file
35
bsp/bl602/Makefile
Normal file
@ -0,0 +1,35 @@
|
||||
#
|
||||
# This is a project Makefile. It is assumed the directory this Makefile resides in is a
|
||||
# project subdirectory.
|
||||
#
|
||||
|
||||
PROJECT_NAME := pikascript_bl602
|
||||
PROJECT_PATH := $(abspath .)
|
||||
PROJECT_BOARD := evb
|
||||
export PROJECT_PATH PROJECT_BOARD
|
||||
#CONFIG_TOOLPREFIX :=
|
||||
|
||||
-include ./proj_config.mk
|
||||
|
||||
ifeq ($(origin BL60X_SDK_PATH), undefined)
|
||||
BL60X_SDK_PATH_GUESS ?= $(shell pwd)
|
||||
BL60X_SDK_PATH ?= $(BL60X_SDK_PATH_GUESS)/..
|
||||
endif
|
||||
|
||||
COMPONENTS_BLSYS := bltime blfdt blmtd bloop loopadc looprt loopset
|
||||
COMPONENTS_VFS := romfs
|
||||
|
||||
INCLUDE_COMPONENTS += freertos_riscv_ram bl602 bl602_std newlibc hosal mbedtls_lts lwip vfs yloop utils cli blog blog_testc coredump
|
||||
INCLUDE_COMPONENTS += $(COMPONENTS_NETWORK)
|
||||
INCLUDE_COMPONENTS += $(COMPONENTS_BLSYS)
|
||||
INCLUDE_COMPONENTS += $(COMPONENTS_VFS)
|
||||
|
||||
EXTRA_COMPONENT_DIRS += $(PROJECT_PATH)/boot
|
||||
EXTRA_COMPONENT_DIRS += $(PROJECT_PATH)/pikascript
|
||||
|
||||
INCLUDE_COMPONENTS += boot
|
||||
INCLUDE_COMPONENTS += pikascript
|
||||
|
||||
CPPFLAGS += -Wno-format
|
||||
|
||||
include $(BL60X_SDK_PATH)/make_scripts_riscv/project.mk
|
21
bsp/bl602/README.md
Normal file
21
bsp/bl602/README.md
Normal file
@ -0,0 +1,21 @@
|
||||
# How to Compile
|
||||
|
||||
1. Install Wine
|
||||
|
||||
```
|
||||
sudo apt install wine
|
||||
```
|
||||
|
||||
2. Install SDK:
|
||||
> https://blog.csdn.net/Boantong_/article/details/125604649?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522166617877716800182741996%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=166617877716800182741996&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-3-125604649-null-null.nonecase&utm_term=wb2&spm=1018.2226.3001.4450
|
||||
|
||||
3.
|
||||
|
||||
``` bash
|
||||
mv pikascript_bl602 Ai-Thinker-Wb2/
|
||||
cd Ai-Thinker-Wb2/pikascript_bl602
|
||||
sh make.sh
|
||||
```
|
||||
|
||||
# How to Flash
|
||||
> https://blog.csdn.net/Boantong_/article/details/125781602?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522166617877716800182741996%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=166617877716800182741996&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-1-125781602-null-null.nonecase&utm_term=wb2&spm=1018.2226.3001.4450
|
26
bsp/bl602/boot/bouffalo.mk
Normal file
26
bsp/bl602/boot/bouffalo.mk
Normal file
@ -0,0 +1,26 @@
|
||||
#
|
||||
# "main" pseudo-component makefile.
|
||||
#
|
||||
# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.)
|
||||
|
||||
include $(BL60X_SDK_PATH)/components/network/ble/ble_common.mk
|
||||
|
||||
ifeq ($(CONFIG_ENABLE_PSM_RAM),1)
|
||||
CPPFLAGS += -DCONF_USER_ENABLE_PSRAM
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ENABLE_CAMERA),1)
|
||||
CPPFLAGS += -DCONF_USER_ENABLE_CAMERA
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ENABLE_BLSYNC),1)
|
||||
CPPFLAGS += -DCONF_USER_ENABLE_BLSYNC
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ENABLE_VFS_SPI),1)
|
||||
CPPFLAGS += -DCONF_USER_ENABLE_VFS_SPI
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ENABLE_VFS_ROMFS),1)
|
||||
CPPFLAGS += -DCONF_USER_ENABLE_VFS_ROMFS
|
||||
endif
|
9
bsp/bl602/boot/include/main_board.h
Normal file
9
bsp/bl602/boot/include/main_board.h
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef __MAIN_BOARD_H__
|
||||
#define __MAIN_BOARD_H__
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
uint32_t bl60x_board_get_factory_addr(void);
|
||||
int bl60x_board_cfg(uint8_t board_code);
|
||||
|
||||
#endif /*__MAIN_BOARD_H__*/
|
58
bsp/bl602/boot/main.c
Normal file
58
bsp/bl602/boot/main.c
Normal file
@ -0,0 +1,58 @@
|
||||
#include <FreeRTOS.h>
|
||||
#include <aos/yloop.h>
|
||||
#include <bl_gpio.h>
|
||||
#include <cli.h>
|
||||
#include <stdio.h>
|
||||
#include <task.h>
|
||||
#include <vfs.h>
|
||||
#include "hosal_uart.h"
|
||||
#include "pikaScript.h"
|
||||
|
||||
volatile PikaObj* root = NULL;
|
||||
static volatile char rxbuff[1024 * 10];
|
||||
static volatile int rxsize = 0;
|
||||
static volatile int rxbusy = 0;
|
||||
|
||||
char __platform_getchar() {
|
||||
char inbuf[2] = {0};
|
||||
int ret = -1;
|
||||
extern hosal_uart_dev_t uart_stdio;
|
||||
while (ret != 1) {
|
||||
ret = hosal_uart_receive(&uart_stdio, inbuf, 1);
|
||||
vTaskDelay(1);
|
||||
}
|
||||
return inbuf[0];
|
||||
}
|
||||
|
||||
/* file API */
|
||||
FILE* __platform_fopen(const char* filename, const char* modes) {
|
||||
return fopen(filename, modes);
|
||||
}
|
||||
|
||||
int __platform_fclose(FILE* stream) {
|
||||
return fclose(stream);
|
||||
}
|
||||
|
||||
size_t __platform_fwrite(const void* ptr, size_t size, size_t n, FILE* stream) {
|
||||
return fwrite(ptr, size, n, stream);
|
||||
}
|
||||
|
||||
size_t __platform_fread(void* ptr, size_t size, size_t n, FILE* stream) {
|
||||
return fread(ptr, size, n, stream);
|
||||
}
|
||||
|
||||
int __platform_fseek(FILE* stream, long offset, int whence) {
|
||||
return fseek(stream, offset, whence);
|
||||
}
|
||||
|
||||
long __platform_ftell(FILE* stream) {
|
||||
return ftell(stream);
|
||||
}
|
||||
|
||||
void main(void) {
|
||||
bl_gpio_enable_input(4, 0, 0);
|
||||
bl_gpio_output_set(4, false);
|
||||
printf("[ Info] In PikaSciprt Demo...\r\n");
|
||||
root = pikaScriptInit();
|
||||
pikaScriptShell(root);
|
||||
}
|
4
bsp/bl602/boot/pika_config.h
Normal file
4
bsp/bl602/boot/pika_config.h
Normal file
@ -0,0 +1,4 @@
|
||||
#define __platform_printf printf
|
||||
#define PIKA_OPTIMIZE PIKA_OPTIMIZE_SPEED
|
||||
#define PIKA_SHELL_SAVE_FILE_ENABLE 1
|
||||
#define PIKA_SHELL_SAVE_FILE_NAME "/lfs/boot.py"
|
5
bsp/bl602/make.sh
Normal file
5
bsp/bl602/make.sh
Normal file
@ -0,0 +1,5 @@
|
||||
rm /mnt/d/pikascript_bl602.bin
|
||||
cd pikascript && wine rust-msc-latest-win10.exe
|
||||
cd -
|
||||
make -j
|
||||
cp build_out/pikascript_bl602.bin /mnt/d
|
14
bsp/bl602/pikascript/bouffalo.mk
Normal file
14
bsp/bl602/pikascript/bouffalo.mk
Normal file
@ -0,0 +1,14 @@
|
||||
COMPONENT_ADD_INCLUDEDIRS += pikascript-core \
|
||||
pikascript-api
|
||||
|
||||
COMPONENT_SRCS :=
|
||||
|
||||
CFLAGS += -DPIKASCRIPT -DPIKA_CONFIG_ENABLE -DCONFIG_SYS_VFS_ENABLE=1 \
|
||||
-DLFS_YES_TRACE
|
||||
|
||||
COMPONENT_OBJS := $(patsubst %.c,%.o, $(COMPONENT_SRCS))
|
||||
|
||||
COMPONENT_SRCDIRS := pikascript-core \
|
||||
pikascript-api \
|
||||
pikascript-lib/pika_lvgl \
|
||||
pikascript-lib/PikaStdLib
|
3
bsp/bl602/pikascript/main.py
Normal file
3
bsp/bl602/pikascript/main.py
Normal file
@ -0,0 +1,3 @@
|
||||
import PikaStdLib
|
||||
print('hello pikascript')
|
||||
mem = PikaStdLib.MemChecker()
|
BIN
bsp/bl602/pikascript/pikaPackage.exe
Normal file
BIN
bsp/bl602/pikascript/pikaPackage.exe
Normal file
Binary file not shown.
2
bsp/bl602/pikascript/requestment.txt
Normal file
2
bsp/bl602/pikascript/requestment.txt
Normal file
@ -0,0 +1,2 @@
|
||||
pikascript-core==v1.11.7
|
||||
PikaStdLib==v1.11.7
|
50
bsp/bl602/proj_config.mk
Normal file
50
bsp/bl602/proj_config.mk
Normal file
@ -0,0 +1,50 @@
|
||||
#
|
||||
#compiler flag config domain
|
||||
#
|
||||
#CONFIG_TOOLPREFIX :=
|
||||
#CONFIG_OPTIMIZATION_LEVEL_RELEASE := 1
|
||||
#CONFIG_M4_SOFTFP := 1
|
||||
|
||||
#
|
||||
#board config domain
|
||||
#
|
||||
CONFIG_BOARD_FLASH_SIZE := 2
|
||||
|
||||
#firmware config domain
|
||||
#
|
||||
|
||||
#set CONFIG_ENABLE_ACP to 1 to enable ACP, set to 0 or comment this line to disable
|
||||
#CONFIG_ENABLE_ACP:=1
|
||||
CONFIG_BL_IOT_FW_AP:=1
|
||||
CONFIG_BL_IOT_FW_AMPDU:=0
|
||||
CONFIG_BL_IOT_FW_AMSDU:=0
|
||||
CONFIG_BL_IOT_FW_P2P:=0
|
||||
CONFIG_ENABLE_PSM_RAM:=1
|
||||
#CONFIG_ENABLE_CAMERA:=1
|
||||
#CONFIG_ENABLE_BLSYNC:=1
|
||||
#CONFIG_ENABLE_VFS_SPI:=1
|
||||
CONFIG_ENABLE_VFS_ROMFS:=1
|
||||
CONFIG_EASYFLASH_ENABLE:=0
|
||||
|
||||
CONFIG_SYS_APP_TASK_STACK_SIZE:=4096
|
||||
CONFIG_SYS_APP_TASK_PRIORITY:=15
|
||||
CONFIG_BL602_USE_ROM_DRIVER:=1
|
||||
CONFIG_FREERTOS_TICKLESS_MODE:=0
|
||||
CONFIG_SYS_VFS_ENABLE:=1
|
||||
CONFIG_SYS_VFS_UART_ENABLE:=1
|
||||
CONFIG_SYS_AOS_CLI_ENABLE:=0
|
||||
CONFIG_SYS_AOS_LOOP_ENABLE:=1
|
||||
CONFIG_SYS_BLOG_ENABLE:=1
|
||||
CONFIG_SYS_DMA_ENABLE:=0
|
||||
CONFIG_SYS_USER_VFS_ROMFS_ENABLE:=0
|
||||
|
||||
CONFIG_BT_CENTRAL:=1
|
||||
CONFIG_BT_OBSERVER:=1
|
||||
CONFIG_BT_PERIPHERAL:=1
|
||||
CONFIG_BT_STACK_CLI:=1
|
||||
CONFIG_BT_WIFIPROV_SERVER:=1
|
||||
CONFIG_WIFI:=0
|
||||
|
||||
CONF_ENABLE_COREDUMP:=1
|
||||
|
||||
LOG_ENABLED_COMPONENTS:=blog_testc hosal loopset looprt bloop
|
Loading…
x
Reference in New Issue
Block a user