Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "tools/kconfig/Kconfiglib"]
path = tools/kconfig/Kconfiglib
url = https://github.com/ulfalizer/Kconfiglib.git
[submodule "components/kendryte_sdk/kendryte-standalone-sdk"]
path = components/kendryte_sdk/kendryte-standalone-sdk
url = https://github.com/sipeed/kendryte-standalone-sdk
[submodule "tools/flash/kflash_py"]
path = tools/flash/kflash_py
url = https://github.com/sipeed/kflash.py.git
Expand All @@ -20,3 +17,6 @@
[submodule "tools/spiffs/mkspiffs"]
path = tools/spiffs/mkspiffs
url = https://github.com/igrr/mkspiffs.git
[submodule "components/kendryte_sdk/kendryte-standalone-sdk"]
path = components/kendryte_sdk/kendryte-standalone-sdk
url = https://github.com/elect-gombe/kendryte-standalone-sdk.git
2 changes: 1 addition & 1 deletion components/kendryte_sdk/src/sipeed_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void maix_i2c_init_as_slave(i2c_device_number_t i2c_num, uint32_t slave_address,
is_master_mode[i2c_num] = false;
}

#define time_ms() (unsigned long)(read_csr(mcycle)/(sysctl_clock_get_freq(SYSCTL_CLOCK_CPU)/1000))
#define time_ms() (unsigned long)(get_cycle()/(sysctl_clock_get_freq(SYSCTL_CLOCK_CPU)/1000))

/**
*
Expand Down
2 changes: 2 additions & 0 deletions components/micropython/port/include/mphalport.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ extern ringbuf_t stdin_ringbuf;
extern TaskHandle_t mp_main_task_handle;
#endif

#define mp_hal_stdio_poll(poll_flags) (0)

//uint32_t mp_hal_ticks_us(void);
//uint32_t mp_hal_ticks_ms(void);
//uint32_t mp_hal_ticks_cpu(void);
Expand Down
14 changes: 7 additions & 7 deletions components/micropython/port/src/maixpy_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ void load_config_from_spiffs(config_data_t* config)
SPIFFS_close(&spiffs_user_mount_handle.fs, fd);
}

#if MICROPY_ENABLE_COMPILER
#if MICROPY_ENABLE_COMPILER
void pyexec_str(vstr_t* str) {
nlr_buf_t nlr;
if (nlr_push(&nlr) == 0) {
Expand Down Expand Up @@ -526,18 +526,17 @@ int maixpy_main()
sysctl_clock_enable(SYSCTL_CLOCK_AI);
sysctl_set_power_mode(SYSCTL_POWER_BANK6, SYSCTL_POWER_V18);
sysctl_set_power_mode(SYSCTL_POWER_BANK7, SYSCTL_POWER_V18);
sysctl_enable_irq();
sysctl_enable_irq();
rtc_init();
rtc_timer_set(2019,1, 1,0, 0, 0);
flash_init(&manuf_id, &device_id);
printk("[MAIXPY]Flash:0x%02x:0x%02x\r\n", manuf_id, device_id);
/* Init SPI IO map and function settings */
sysctl_set_spi0_dvp_data(1);
/* Init SPI IO map and function settings */
sysctl_set_spi0_dvp_data(1);
/* open core 1 */
printk("open second core...\r\n");
register_core1(core1_function, 0);
register_core1(core1_function, 0);

#if MICROPY_PY_THREAD
#if MICROPY_PY_THREAD
xTaskCreateAtProcessor(0, // processor
mp_task, // function entry
"mp_task", //task name
Expand All @@ -552,6 +551,7 @@ int maixpy_main()
#endif
return 0;
}

void do_str(const char *src, mp_parse_input_kind_t input_kind) {
nlr_buf_t nlr;
if (nlr_push(&nlr) == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "sysctl.h"
#include "printf.h"

#define time_us() (unsigned long)(read_csr(mcycle)/(sysctl_clock_get_freq(SYSCTL_CLOCK_CPU)/1000000))
#define time_us() (unsigned long)(get_cycle()/(sysctl_clock_get_freq(SYSCTL_CLOCK_CPU)/1000000))

typedef void (*set_pin_func_t)(uint8_t gpio, gpio_pin_value_t value);
typedef gpio_pin_value_t (*get_pin_func_t)(uint8_t gpio);
Expand Down
6 changes: 3 additions & 3 deletions components/micropython/port/src/mphalport.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@ void mp_hal_debug_tx_strn_cooked(void *env, const char *str, size_t len) {

mp_uint_t inline mp_hal_ticks_cpu(void)
{
return (unsigned long)(read_csr(mcycle));
return (unsigned long)(get_cycle());
}

mp_uint_t inline mp_hal_ticks_us(void)
{
return (unsigned long)(read_csr(mcycle)/(sysctl_clock_get_freq(SYSCTL_CLOCK_CPU)/1000000));
return (unsigned long)(get_cycle()/(sysctl_clock_get_freq(SYSCTL_CLOCK_CPU)/1000000));
}

mp_uint_t inline mp_hal_ticks_ms(void)
{
return (unsigned long)(read_csr(mcycle)/(sysctl_clock_get_freq(SYSCTL_CLOCK_CPU)/1000));
return (unsigned long)(get_cycle()/(sysctl_clock_get_freq(SYSCTL_CLOCK_CPU)/1000));
}

void mp_hal_delay_ms(mp_uint_t ms)
Expand Down
2 changes: 1 addition & 1 deletion components/micropython/port/src/video/video_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int video_hal_display(image_t* img, video_display_roi_t img_roi)

uint64_t inline video_hal_ticks_us(void)
{
return (uint64_t)(read_csr(mcycle)/(sysctl_clock_get_freq(SYSCTL_CLOCK_CPU)/1000000));
return (uint64_t)(get_cycle()/(sysctl_clock_get_freq(SYSCTL_CLOCK_CPU)/1000000));
}


Expand Down
5 changes: 5 additions & 0 deletions projects/mmu_code/compile/compile_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ set(CMAKE_C_FLAGS -mcmodel=medany
-Wno-error=restrict
-Wno-error=sequence-point
-Wno-int-to-pointer-cast
-Wl,--no-relax
-g3
)
################################

Expand Down Expand Up @@ -75,6 +77,8 @@ set(CMAKE_CXX_FLAGS -mcmodel=medany
-Wno-error=restrict
-Wno-error=sequence-point
-Wno-int-to-pointer-cast
-Wl,--no-relax
-g3
)
################################

Expand All @@ -83,6 +87,7 @@ set(LINK_FLAGS ${LINK_FLAGS}
-Wl,-static
-nostartfiles
-Wl,--gc-sections
-Wl,--no-relax
-Wl,-EL
-T ${PROJECT_SOURCE_DIR}/compile/kendryte.ld
-Wl,--start-group
Expand Down
1 change: 1 addition & 0 deletions projects/mmu_code/compile/priority.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ kendryte_sdk
drivers
spiffs
boards
micropython
main


2 changes: 1 addition & 1 deletion projects/mmu_code/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ list(APPEND ADD_SRCS "src/main.c"
###############################################

###### Add required/dependent components ######
list(APPEND ADD_REQUIREMENTS kendryte_sdk drivers boards)
list(APPEND ADD_REQUIREMENTS kendryte_sdk drivers boards micropython)
###############################################

############ Add static libs ##################
Expand Down
Loading