mirror of
https://github.com/Fishwaldo/bl_mcu_sdk.git
synced 2025-03-15 19:31:43 +00:00
enable lp core of bl808 and change example name to triplecore
This commit is contained in:
parent
ff125a583c
commit
ab70ccc953
22 changed files with 102 additions and 10 deletions
|
@ -33,9 +33,9 @@ MEMORY
|
|||
|
||||
SECTIONS
|
||||
{
|
||||
.fw_header0 :
|
||||
.fw_header :
|
||||
{
|
||||
KEEP(*(.fw_header0))
|
||||
KEEP(*(.fw_header))
|
||||
} > fw_header_memory0
|
||||
|
||||
.text :
|
||||
|
|
|
@ -203,8 +203,9 @@ static void console_init()
|
|||
bflb_gpio_init(gpio, GPIO_PIN_16, 21 | GPIO_ALTERNATE | GPIO_PULLUP | GPIO_SMT_EN | GPIO_DRV_1);
|
||||
bflb_gpio_init(gpio, GPIO_PIN_17, 21 | GPIO_ALTERNATE | GPIO_PULLUP | GPIO_SMT_EN | GPIO_DRV_1);
|
||||
#elif defined(CPU_LP)
|
||||
bflb_gpio_uart_init(gpio, GPIO_PIN_16, GPIO_UART_FUNC_UART1_TX);
|
||||
bflb_gpio_uart_init(gpio, GPIO_PIN_17, GPIO_UART_FUNC_UART1_RX);
|
||||
/* map GPIO_PIN_18 and GPIO_PIN_19 as UART for LP core */
|
||||
bflb_gpio_uart_init(gpio, GPIO_PIN_18, GPIO_UART_FUNC_UART1_TX);
|
||||
bflb_gpio_uart_init(gpio, GPIO_PIN_19, GPIO_UART_FUNC_UART1_RX);
|
||||
#endif
|
||||
struct bflb_uart_config_s cfg;
|
||||
cfg.baudrate = 2000000;
|
||||
|
@ -277,6 +278,12 @@ void board_init(void)
|
|||
/* D0 image offset on flash is CONFIG_D0_FLASH_ADDR+0x1000(header) */
|
||||
bflb_sf_ctrl_set_flash_image_offset(CONFIG_D0_FLASH_ADDR + 0x1000, 1, SF_CTRL_FLASH_BANK0);
|
||||
|
||||
Tzc_Sec_Set_CPU_Group(GLB_CORE_ID_LP, 2);
|
||||
/* LP boot from 0x58020000 */
|
||||
GLB_Set_CPU_Reset_Address(GLB_CORE_ID_LP, 0x58020000);
|
||||
/* LP image offset on flash is CONFIG_LP_FLASH_ADDR+0x1000(header) */
|
||||
bflb_sf_ctrl_set_flash_image_offset(CONFIG_LP_FLASH_ADDR + 0x1000, 2, SF_CTRL_FLASH_BANK1);
|
||||
|
||||
bflb_irq_restore(flag);
|
||||
|
||||
GLB_Release_CPU(GLB_CORE_ID_D0);
|
||||
|
|
|
@ -128,7 +128,7 @@ string(TOUPPER ${CPU_ID} CPU_ID_NAME)
|
|||
sdk_add_compile_definitions(-DCPU_${CPU_ID_NAME})
|
||||
endif()
|
||||
|
||||
if(NOT ("${CPU_ID}" STREQUAL "d0"))
|
||||
if((NOT ("${CPU_ID}" STREQUAL "d0")) AND (NOT ("${CPU_ID}" STREQUAL "lp")))
|
||||
sdk_add_static_library(src/pka/libpka.a)
|
||||
endif()
|
||||
# add_subdirectory(src/pka)
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
build_dirs += helloworld_m0
|
||||
build_dirs += helloworld_d0
|
||||
build_dirs += helloworld_lp
|
||||
|
||||
all: $(build_dirs)
|
||||
|
||||
$(build_dirs):
|
||||
make -C $@
|
||||
|
||||
.PHONY: $(build_dirs)
|
||||
.PHONY: $(build_dirs)
|
|
@ -1,4 +1,4 @@
|
|||
# bl808_dualcore
|
||||
# bl808_triplecore
|
||||
|
||||
|
||||
## Support CHIP
|
||||
|
@ -19,4 +19,4 @@ make CHIP=bl808 BOARD=bl808dk CPU_ID=d0
|
|||
|
||||
```
|
||||
make flash CHIP=chip_name COMX=xxx # xxx is your com name
|
||||
```
|
||||
```
|
14
examples/bl808_triplecore/helloworld_lp/Makefile
Normal file
14
examples/bl808_triplecore/helloworld_lp/Makefile
Normal file
|
@ -0,0 +1,14 @@
|
|||
SDK_DEMO_PATH ?= .
|
||||
BL_SDK_BASE ?= $(SDK_DEMO_PATH)/../../..
|
||||
|
||||
export BL_SDK_BASE
|
||||
|
||||
CHIP ?= bl808
|
||||
BOARD ?= bl808dk
|
||||
CPU_ID ?= lp
|
||||
CROSS_COMPILE ?= riscv64-unknown-elf-
|
||||
|
||||
# add custom cmake definition
|
||||
#cmake_definition+=-Dxxx=sss
|
||||
|
||||
include $(BL_SDK_BASE)/project.build
|
28
examples/bl808_triplecore/helloworld_lp/README.md
Normal file
28
examples/bl808_triplecore/helloworld_lp/README.md
Normal file
|
@ -0,0 +1,28 @@
|
|||
# bl808_triplecore
|
||||
|
||||
|
||||
## Support CHIP
|
||||
|
||||
| CHIP | Remark |
|
||||
|:----------------:|:------:|
|
||||
|BL808 | Only for LP CPU |
|
||||
|
||||
## Compile
|
||||
|
||||
- BL808
|
||||
|
||||
```
|
||||
make CHIP=bl808 BOARD=bl808dk CPU_ID=lp
|
||||
```
|
||||
|
||||
## Flash
|
||||
|
||||
```
|
||||
make flash CHIP=chip_name COMX=xxx # xxx is your com name
|
||||
```
|
||||
|
||||
## UART of LP
|
||||
|
||||
It's defined in 'console_init' of bl808dk/board.c.
|
||||
- GPIO 18 : TX
|
||||
- GPIO 19 : RX
|
12
examples/bl808_triplecore/helloworld_lp/flash_prog_cfg.ini
Normal file
12
examples/bl808_triplecore/helloworld_lp/flash_prog_cfg.ini
Normal file
|
@ -0,0 +1,12 @@
|
|||
[cfg]
|
||||
# 0: no erase, 1:programmed section erase, 2: chip erase
|
||||
erase = 1
|
||||
# skip mode set first para is skip addr, second para is skip len, multi-segment region with ; separated
|
||||
skip_mode = 0x0, 0x0
|
||||
# 0: not use isp mode, #1: isp mode
|
||||
boot2_isp_mode = 0
|
||||
|
||||
[FW]
|
||||
filedir = ./build/build_out/helloworld*_$(CHIPNAME).bin
|
||||
# since LP is boot by M0,this address should consistent with m0's board_init in board.c
|
||||
address = 0x20000
|
19
examples/bl808_triplecore/helloworld_lp/main.c
Normal file
19
examples/bl808_triplecore/helloworld_lp/main.c
Normal file
|
@ -0,0 +1,19 @@
|
|||
#include "bflb_mtimer.h"
|
||||
#include "board.h"
|
||||
|
||||
#define DBG_TAG "MAIN"
|
||||
#include "log.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
board_init();
|
||||
while (1) {
|
||||
LOG_F("hello world lp\r\n");
|
||||
LOG_E("hello world lp\r\n");
|
||||
LOG_W("hello world lp\r\n");
|
||||
LOG_I("hello world lp\r\n");
|
||||
LOG_D("hello world lp\r\n");
|
||||
LOG_T("hello world lp\r\n");
|
||||
bflb_mtimer_delay_ms(1000);
|
||||
}
|
||||
}
|
2
examples/bl808_triplecore/helloworld_lp/proj.conf
Normal file
2
examples/bl808_triplecore/helloworld_lp/proj.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
set(CONFIG_BFLOG 0)
|
||||
set(CONFIG_PSRAM 1)
|
9
examples/bl808_triplecore/helloworld_m0/CMakeLists.txt
Normal file
9
examples/bl808_triplecore/helloworld_m0/CMakeLists.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
include(proj.conf)
|
||||
|
||||
find_package(bouffalo_sdk REQUIRED HINTS $ENV{BL_SDK_BASE})
|
||||
|
||||
sdk_set_main_file(main.c)
|
||||
|
||||
project(helloworld)
|
|
@ -1,4 +1,4 @@
|
|||
# bl808_dualcore
|
||||
# bl808_triplecore
|
||||
|
||||
|
||||
## Support CHIP
|
||||
|
@ -19,4 +19,4 @@ make CHIP=bl808 BOARD=bl808dk CPU_ID=m0
|
|||
|
||||
```
|
||||
make flash CHIP=chip_name COMX=xxx # xxx is your com name
|
||||
```
|
||||
```
|
Loading…
Add table
Reference in a new issue