Skip to content

Commit

Permalink
k230 sdk release v1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwentao committed Oct 26, 2023
1 parent 562aeb7 commit ff6900f
Show file tree
Hide file tree
Showing 1,590 changed files with 487,141 additions and 1,070 deletions.
45 changes: 43 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@ default:
image: ai.b-bug.org:5000/k230_sdk:latest
interruptible: true

# download dir publish with tag
download_dir_publish:
rules:
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v\d+\.\d+.*$/
extends:
- .setup_env
- .sync_download_dir

# sdk zip and image publish with tag
release_file_publish:
rules:
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v\d+\.\d+.*$/
extends:
- .setup_env
- .sync_release_file

# MR merged
merge_sync:
rules:
Expand Down Expand Up @@ -93,8 +109,7 @@ build-image:
- git config --global --add safe.directory $CI_PROJECT_DIR

.sync_github_gitee:
timeout: 90m
image: ai.b-bug.org:5000/k230_sdk:latest
timeout: 30m
tags:
- k230_sdk
script:
Expand All @@ -121,6 +136,32 @@ build-image:
- echo "---push to github---"
- git push --atomic --tags -u -f github main || git push --atomic --tags -u -f github main || git push --atomic --tags -u -f github main

.sync_download_dir:
timeout: 60m
tags:
- k230_sdk
script:
- cd $CI_PROJECT_DIR
- ls -alht
- wget -qc https://ai.b-bug.org/k510/downloads/github/sync_file.sh -O ./sync_file.sh
- chmod +x ./sync_file.sh
- time ./sync_file.sh || time ./sync_file.sh
- echo "all file synced"

.sync_release_file:
timeout: 60m
tags:
- k230_sdk
script:
- cd $CI_PROJECT_DIR
- ls -alht
- wget -qc https://ai.b-bug.org/k510/downloads/github/sync_release.sh -O ./sync_release.sh
- chmod +x ./sync_release.sh
- echo $CI_COMMIT_TAG || exit 1
- echo $CONF || exit 1
- time ./sync_release.sh $CI_COMMIT_TAG $CONF || time ./sync_release.sh $CI_COMMIT_TAG $CONF
- echo "all release file synced"

.generate_version: &generate_version
- echo "----------get version from file----------"
- pwd
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ prepare_sourcecode:prepare_toolchain
#ai
@echo "download nncase sdk"
@rm -rf src/big/utils/; rm -rf src/big/ai;
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/kmodel/kmodel_v2.3.0.tgz -O - | tar -xzC src/big/
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/nncase/nncase_k230_v2.3.0.tgz -O - | tar -xzC src/big/
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/kmodel/kmodel_v2.4.0.tgz -O - | tar -xzC src/big/
@wget -q --show-progress $(DOWNLOAD_URL)/downloads/nncase/nncase_k230_v2.4.0.tgz -O - | tar -xzC src/big/

#big utils
@echo "download big utils"
Expand Down
2 changes: 1 addition & 1 deletion configs/k230_evb_doorlock_ov9286_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ CONFIG_MEM_SPECKLE_BASE=0x7c40000
CONFIG_MEM_SPECKLE_SIZE=0x00000
CONFIG_MEM_MMZ_BASE=0x4ee0000
CONFIG_MEM_MMZ_SIZE=0x30e0000
CONFIG_MEM_RTAPP_BASE=0x4e00000
CONFIG_MEM_RTAPP_BASE=0x4ee0000
CONFIG_MEM_RTAPP_SIZE=0x1400000
CONFIG_MEM_BOUNDARY_RESERVED_SIZE=0x00001000

Expand Down
2 changes: 1 addition & 1 deletion configs/k230d_doorlock_ov9286_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ CONFIG_MEM_SPECKLE_BASE=0x7c40000
CONFIG_MEM_SPECKLE_SIZE=0x00000
CONFIG_MEM_MMZ_BASE=0x4ee0000
CONFIG_MEM_MMZ_SIZE=0x30e0000
CONFIG_MEM_RTAPP_BASE=0x4e00000
CONFIG_MEM_RTAPP_BASE=0x4ee0000
CONFIG_MEM_RTAPP_SIZE=0x1400000
CONFIG_MEM_BOUNDARY_RESERVED_SIZE=0x00001000

Expand Down
10 changes: 5 additions & 5 deletions repo.mak
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
RT-SMART_VERSION = "0e9316ca84c3df5b556d1aaaf213bc929bdd103d"
MPP_VERSION = "e224f078e9ec8f5185c2be6b190e55505354bf10"
RT-SMART_VERSION = "0a2c55975d1181e66abf4ee10f8cf29f0966071d"
MPP_VERSION = "0955ee6e157771ff8870bf49fd0c598126abe9f2"
UNITTEST_VERSION = "a07caf5e19a6a215605271cfeedce18111790e9d"
OPENSBI_VERSION = "9aa2f6d34e685bbbb0afaab4e308b93a9cd06ec7"
BUILDROOT-EXT_VERSION = "b271acab71c5cb5efb00047a223ed21edec40660"
LINUX_VERSION = "70d9f999f4081bd783c089b6e26c97792676be65"
BUILDROOT-EXT_VERSION = "8eafd41f1dde4ff48b914d5978cecf7af627fba6"
LINUX_VERSION = "04b6371ff02d49cba18adc81dfcdbbec0cbfed56"
UBOOT_VERSION = "317894980fd498b863820b1343096fe188faae53"
CDK_VERSION = "9ddc100e5be1df8af31e21e29ee1980bc0487a4a"
CDK_VERSION = "fea98217f3a781508de19bb2ecfea390526414ba"

RT-SMART_SRC_PATH = src/big/rt-smart
MPP_SRC_PATH = src/big/mpp
Expand Down
7 changes: 7 additions & 0 deletions src/big/mpp/include/comm/k_audio_comm.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ typedef enum
KD_AUDIO_SOUND_MODE_STEREO = 2, /* stereo */
} k_audio_snd_mode;

typedef enum
{
KD_I2S_IN_MONO_RIGHT_CHANNEL = 0, //mic input
KD_I2S_IN_MONO_LEFT_CHANNEL = 1, //hp input
} k_i2s_in_mono_channel;

typedef enum
{
KD_AUDIO_INPUT_TYPE_I2S = 0,//i2s in
Expand Down Expand Up @@ -97,6 +103,7 @@ typedef struct
k_u32 sample_rate; /* sample rate */
k_audio_bit_width bit_width; /* bit_width */
k_audio_snd_mode snd_mode; /* momo or stereo */
k_i2s_in_mono_channel mono_channel;/* use mic input or headphone input */
k_i2s_work_mode i2s_mode; /*i2s work mode*/
k_u32 frame_num; /* frame num in buf[2,K_MAX_AUDIO_FRAME_NUM] */
k_u32 point_num_per_frame;
Expand Down
4 changes: 4 additions & 0 deletions src/big/mpp/include/comm/k_connector_comm.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ extern "C" {

typedef enum {
HX8377_V2_MIPI_4LAN_1080X1920_30FPS,
LT9611_MIPI_4LAN_1920X1080_60FPS,
LT9611_MIPI_4LAN_1920X1080_30FPS,
LT9611_MIPI_4LAN_1280X720_60FPS,
LT9611_MIPI_4LAN_1280X720_50FPS,
LT9611_MIPI_4LAN_640X480_60FPS,
} k_connector_type;

typedef struct
Expand Down
15 changes: 15 additions & 0 deletions src/big/mpp/include/comm/k_vo_comm.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,21 @@ typedef struct
} k_vo_display_resolution;


typedef struct
{
k_u32 hsync_start;
k_u32 hsync_stop;
k_u32 hsync1_start;
k_u32 hsync1_stop;
k_u32 hsync2_start;
k_u32 hsync2_stop;
k_u32 vsync1_start;
k_u32 vsync1_stop;
k_u32 vsync2_start;
k_u32 vsync2_stop;
} k_vo_sync_attr;


typedef struct
{
k_u32 n;
Expand Down
6 changes: 6 additions & 0 deletions src/big/mpp/kernel/connector/src/connector_comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ k_u32 connector_set_vo_param(k_vo_pub_attr *attr)
}


k_u32 connector_set_vo_attr(k_vo_pub_attr *pub_attr, k_vo_sync_attr *sync_attr)
{
return kd_vo_set_dev_attr(pub_attr, sync_attr);
}


void connector_set_vo_enable(void)
{
kd_vo_enable();
Expand Down
2 changes: 2 additions & 0 deletions src/big/mpp/kernel/connector/src/connector_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ extern k_u32 dwc_dsi_enable(k_u32 enable);
extern k_u32 dwc_dst_set_test_mode(void);
extern k_u32 vo_init(void);
extern k_s32 kd_vo_set_dev_param(k_vo_pub_attr *attr);
extern k_s32 kd_vo_set_dev_attr(k_vo_pub_attr *pub_attr, k_vo_sync_attr *sync_attr);
extern void kd_vo_enable(void);
extern void kd_vo_set_vtth_intr(k_bool status, k_u32 vpos);

Expand All @@ -93,6 +94,7 @@ k_u32 connector_set_dsi_enable(k_u32 enable);
k_u32 connector_set_dsi_test_mode(void);
k_u32 connector_set_vo_init(void);
k_u32 connector_set_vo_param(k_vo_pub_attr *attr);
k_u32 connector_set_vo_attr(k_vo_pub_attr *pub_attr, k_vo_sync_attr *sync_attr);
void connector_set_vo_enable(void);
void connector_set_vtth_intr(k_bool status, k_u32 vpos);
void connector_delay_us(uint64_t us);
Expand Down
39 changes: 29 additions & 10 deletions src/big/mpp/kernel/connector/src/lt9611.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,20 +547,39 @@ static k_s32 k230_dsi_resolution_init(k_connector_info *info)
return 0;
}

static k_s32 k230_vo_resolution_init(k_vo_display_resolution *resolution, k_u32 bg_color, k_u32 intr_line)
static k_s32 k230_vo_resolution_init(k_connector_type type, k_vo_display_resolution *resolution, k_u32 bg_color, k_u32 intr_line)
{
k_vo_display_resolution vo_resolution;
k_vo_pub_attr attr;

memset(&attr, 0, sizeof(k_vo_pub_attr));
attr.bg_color = bg_color;
attr.intf_sync = K_VO_OUT_1080P30;
attr.intf_type = K_VO_INTF_MIPI;
attr.sync_info = resolution;
k_vo_pub_attr pub_attr;
k_vo_sync_attr sync_attr;

memset(&pub_attr, 0, sizeof(k_vo_pub_attr));
pub_attr.bg_color = bg_color;
pub_attr.intf_sync = K_VO_OUT_1080P30;
pub_attr.intf_type = K_VO_INTF_MIPI;
pub_attr.sync_info = resolution;

memset(&sync_attr, 0, sizeof(k_vo_sync_attr));
if (type == LT9611_MIPI_4LAN_1920X1080_60FPS || type == LT9611_MIPI_4LAN_1920X1080_30FPS) {
sync_attr.hsync_start = 2;
sync_attr.hsync_stop = 2;

sync_attr.hsync1_start = 1;
sync_attr.hsync1_stop = 2;
sync_attr.hsync2_start = 1;
sync_attr.hsync2_stop = 2;

sync_attr.vsync1_start = 1;
sync_attr.vsync1_stop = 1;
sync_attr.vsync2_start = 1;
sync_attr.vsync2_stop = 1;
} else {
rt_kprintf("Unsupported connector type \n");
}

connector_set_vo_init();
connector_set_vtth_intr(1, intr_line);
connector_set_vo_param(&attr);
connector_set_vo_attr(&pub_attr, &sync_attr);
connector_set_vo_enable();

return 0;
Expand Down Expand Up @@ -588,7 +607,7 @@ k_s32 lt9611_init(void *ctx, k_connector_info *info)
rt_thread_mdelay(50);
ret |= lt9611_enable_hdmi_out(lt9611_dev);

ret |= k230_vo_resolution_init(&info->resolution, info->bg_color, info->intr_line);
ret |= k230_vo_resolution_init(info->type, &info->resolution, info->bg_color, info->intr_line);
ret |= k230_set_phy_freq(&info->phy_attr);
ret |= k230_dsi_resolution_init(info);

Expand Down
Binary file modified src/big/mpp/kernel/lib/libaudio.a
Binary file not shown.
Binary file modified src/big/mpp/kernel/lib/libcmpi.a
Binary file not shown.
Binary file modified src/big/mpp/kernel/lib/libdma.a
Binary file not shown.
Binary file modified src/big/mpp/kernel/lib/libdpu.a
Binary file not shown.
Binary file modified src/big/mpp/kernel/lib/liblog.a
Binary file not shown.
Binary file modified src/big/mpp/kernel/lib/libmediafreq.a
Binary file not shown.
Binary file modified src/big/mpp/kernel/lib/libmmz.a
Binary file not shown.
Binary file modified src/big/mpp/kernel/lib/libpm.a
Binary file not shown.
Binary file modified src/big/mpp/kernel/lib/libsys.a
Binary file not shown.
Binary file modified src/big/mpp/kernel/lib/libvb.a
Binary file not shown.
Binary file modified src/big/mpp/kernel/lib/libvdss.a
Binary file not shown.
Binary file modified src/big/mpp/kernel/lib/libvicap.a
Binary file not shown.
Binary file modified src/big/mpp/kernel/lib/libvo.a
Binary file not shown.
Binary file modified src/big/mpp/kernel/lib/libvpu.a
Binary file not shown.
Binary file modified src/big/mpp/kernel/lib/libvvi.a
Binary file not shown.
Binary file modified src/big/mpp/kernel/lib/libvvo.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/lib3a.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libadec.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libaenc.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libai.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libao.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libauto_ctrol.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libbinder.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libbuffer_management.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libcam_caldb.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libcam_device.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libcam_engine.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libcameric_drv.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libcameric_reg_drv.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libcmd_buffer.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libcommon.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libdma.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libdpu.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libebase.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libfpga.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libhal.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libisi.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libisp_drv.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/liboslayer.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libpm.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libsom_ctrl.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libstart_engine.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libswitch.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libsys.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libt_common_c.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libt_database_c.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libt_json_c.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libt_mxml_c.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libvb.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libvdec.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libvdss.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libvenc.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libvicap.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libvideo_in.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libvirtual_hal.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libvo.a
Binary file not shown.
Binary file modified src/big/mpp/userapps/lib/libvvi.a
Binary file not shown.
28 changes: 16 additions & 12 deletions src/big/mpp/userapps/sample/fastboot_app/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ int main(int argc, char *argv[])
int num = 0;
int ret;
PRINT_TIME_NOW();

if (argc != 2)
{
std::cerr << "Usage: " << argv[0] << " <kmodel>" << std::endl;
Expand All @@ -676,7 +677,8 @@ int main(int argc, char *argv[])
size_t size = CHANNEL * ISP_CHN1_HEIGHT * ISP_CHN1_WIDTH;;

MobileRetinaface model(argv[1], CHANNEL, ISP_CHN1_HEIGHT, ISP_CHN1_WIDTH);
std::vector<int> boxes;
DetectResult box_result;
std::vector<face_coordinate> boxes;

TEST_BOOT_TIME_INIT();

Expand Down Expand Up @@ -711,9 +713,9 @@ int main(int argc, char *argv[])

model.run(reinterpret_cast<uintptr_t>(vbvaddr), reinterpret_cast<uintptr_t>(dump_info.v_frame.phys_addr[0]));
kd_mpi_sys_munmap(vbvaddr, size);
// model.run();
// get face boxes
boxes = model.get_result();
box_result = model.get_result();
boxes = box_result.boxes;
#ifdef TEST_BOOT_TIME
TEST_BOOT_TIME_TRIGER();
if(boxes.size() > 0)
Expand All @@ -726,27 +728,29 @@ int main(int argc, char *argv[])
printf("boxes %llu \n",(perf_get_smodecycles()));
}
#endif
if(boxes.size() / 4 < face_count)
if(boxes.size() < face_count)
{
for (size_t i = boxes.size() / 4; i < face_count; i++)
for (size_t i = boxes.size(); i < face_count; i++)
{
vo_frame.draw_en = 0;
vo_frame.frame_num = i + 1;
kd_mpi_vo_draw_frame(&vo_frame);
}
}
for (size_t i = 0, j = 0; i < boxes.size(); i += 4)

for (size_t i = 0, j = 0; i < boxes.size(); i += 1)
{
// std::cout << "[" << boxes[i] << ", " << boxes[i + 1] << ", " << boxes[i + 2] <<", " << boxes[i + 3] << "]" << std::endl;
vo_frame.draw_en = 1;
vo_frame.line_x_start = ((uint32_t)boxes[0 + i]) * ISP_CHN0_WIDTH / ISP_CHN1_WIDTH;
vo_frame.line_y_start = ((uint32_t)boxes[1 + i]) * ISP_CHN0_HEIGHT / ISP_CHN1_HEIGHT;
vo_frame.line_x_end = ((uint32_t)boxes[2 + i]) * ISP_CHN0_WIDTH / ISP_CHN1_WIDTH;
vo_frame.line_y_end = ((uint32_t)boxes[3 + i]) * ISP_CHN0_HEIGHT / ISP_CHN1_HEIGHT;
vo_frame.line_x_start = ((uint32_t)boxes[i].x1) * ISP_CHN0_WIDTH / ISP_CHN1_WIDTH;
vo_frame.line_y_start = ((uint32_t)boxes[i].y1) * ISP_CHN0_HEIGHT / ISP_CHN1_HEIGHT;
vo_frame.line_x_end = ((uint32_t)boxes[i].x2) * ISP_CHN0_WIDTH / ISP_CHN1_WIDTH;
vo_frame.line_y_end = ((uint32_t)boxes[i].y2) * ISP_CHN0_HEIGHT / ISP_CHN1_HEIGHT;
vo_frame.frame_num = ++j;
kd_mpi_vo_draw_frame(&vo_frame);
}
face_count = boxes.size() / 4;

face_count = boxes.size();
ret = kd_mpi_vicap_dump_release(vicap_dev, VICAP_CHN_ID_1, &dump_info);
if (ret) {
printf("sample_vicap...kd_mpi_vicap_dump_release failed.\n");
Expand All @@ -755,7 +759,7 @@ int main(int argc, char *argv[])

app_exit:
pthread_join(exit_thread_handle, NULL);
for(size_t i = 0;i < boxes.size()/4;i++)
for(size_t i = 0;i < boxes.size();i++)
{
vo_frame.draw_en = 0;
vo_frame.frame_num = i + 1;
Expand Down
Loading

0 comments on commit ff6900f

Please sign in to comment.