Skip to content

Commit

Permalink
K210:Model Data must be in IOMEM
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangbingj committed Oct 26, 2019
1 parent 9a11c0a commit f417cb0
Show file tree
Hide file tree
Showing 17 changed files with 1,089 additions and 636 deletions.
Empty file modified examples/20classes_yolo/k210/kpu_20classes_example/img2c.py
100644 → 100755
Empty file.
314 changes: 0 additions & 314 deletions examples/20classes_yolo/k210/kpu_20classes_example/incbin.h

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "0.1.0",
"files": [
{
"address": 0,
"bin": "kpu_20classes_example.bin",
"sha256Prefix": true
},
{
"address": 0x00A00000,
"bin": "yolo.kmodel",
"sha256Prefix": false
}
]
}
Binary file not shown.
Binary file not shown.
File renamed without changes.
15 changes: 11 additions & 4 deletions examples/20classes_yolo/k210/kpu_20classes_example/main.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@
#include "utils.h"
#include "kpu.h"
#include "region_layer.h"
#define INCBIN_STYLE INCBIN_STYLE_SNAKE
#define INCBIN_PREFIX
#include "incbin.h"
#include "w25qxx.h"
#include "iomem.h"

#define PLL0_OUTPUT_FREQ 800000000UL
#define PLL1_OUTPUT_FREQ 400000000UL

#define CLASS_NUMBER 20

extern const unsigned char gImage_image[] __attribute__((aligned(128)));
INCBIN(model, "yolo.kmodel");

#define KMODEL_SIZE (1351976)
uint8_t *model_data;

kpu_model_context_t task;
static region_layer_t detect_rl;
Expand Down Expand Up @@ -198,6 +199,12 @@ int main(void)
io_set_power();
plic_init();

printf("flash init\n");
w25qxx_init(3, 0);
w25qxx_enable_quad_mode();
model_data = (uint8_t *)iomem_malloc(KMODEL_SIZE);
w25qxx_read_data(0xA00000, model_data, KMODEL_SIZE, W25QXX_QUAD_FAST);

lable_init();

/* LCD init */
Expand Down
Loading

0 comments on commit f417cb0

Please sign in to comment.