diff --git a/device/board/csg/htzd3201_board/liteos_m/config.gni b/device/board/csg/htzd3201_board/liteos_m/config.gni index 99734d7b..f1258fa6 100755 --- a/device/board/csg/htzd3201_board/liteos_m/config.gni +++ b/device/board/csg/htzd3201_board/liteos_m/config.gni @@ -9,7 +9,7 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and -# limitations under the License. +# limitations under the License. # Kernel type, e.g. "linux", "liteos_a", "liteos_m". kernel_type = "liteos_m" @@ -21,7 +21,7 @@ kernel_version = "3.0.0" board_cpu = "" # Board arch, e.g. "armv7-a", "rv32imac". -board_arch = "rv32i" +board_arch = "rv32imc_zicsr" # Toolchain name used for system compiling. # E.g. gcc-arm-none-eabi, arm-linux-harmonyeabi-gcc, ohos-clang, riscv32-unknown-elf. @@ -57,7 +57,11 @@ board_cflags = [ "-fno-short-enums", "-D__LITEOS__M", "-nostartfiles", - "-mstrict-align" + "-mstrict-align", + "-Wno-error=incompatible-pointer-types", + "-Wno-error=implicit-function-declaration", + "-Wno-error=maybe-uninitialized", + "-Wno-error=int-in-bool-context" ] board_cxx_flags = board_cflags diff --git a/device/soc/htzd/htzd32xx/kunlun/Mainline/ap/src/main.c b/device/soc/htzd/htzd32xx/kunlun/Mainline/ap/src/main.c index 06f81ddb..d92c2e82 100755 --- a/device/soc/htzd/htzd32xx/kunlun/Mainline/ap/src/main.c +++ b/device/soc/htzd/htzd32xx/kunlun/Mainline/ap/src/main.c @@ -28,6 +28,7 @@ #include "iot_gpio.h" #include "iot_errno_api.h" #include "iot_mtd.h" +#include "iot_gpio_api.h" #include "read_flash.h" @@ -49,7 +50,7 @@ void LwipTestTimeoutCallback(void const *argument) iot_printf("TT\n"); } -uint32_t g_lwipTestTimerId = NULL; +uint32_t g_lwipTestTimerId = 0; void LwipTestStartTimer() { uint32_t status; diff --git a/device/soc/htzd/htzd32xx/kunlun/Mainline/ap/src/read_flash.c b/device/soc/htzd/htzd32xx/kunlun/Mainline/ap/src/read_flash.c index a0d861e8..8e4d80d8 100755 --- a/device/soc/htzd/htzd32xx/kunlun/Mainline/ap/src/read_flash.c +++ b/device/soc/htzd/htzd32xx/kunlun/Mainline/ap/src/read_flash.c @@ -1,4 +1,5 @@ #include +#include "stdint.h" #include "read_flash.h" diff --git a/device/soc/htzd/htzd32xx/kunlun/Mainline/common/os_shim/liteos/src/os_malloc.c b/device/soc/htzd/htzd32xx/kunlun/Mainline/common/os_shim/liteos/src/os_malloc.c index 79f5051d..9074ad2f 100755 --- a/device/soc/htzd/htzd32xx/kunlun/Mainline/common/os_shim/liteos/src/os_malloc.c +++ b/device/soc/htzd/htzd32xx/kunlun/Mainline/common/os_shim/liteos/src/os_malloc.c @@ -145,7 +145,7 @@ void os_heap_alloc_caps_init(unsigned int reserved_sz) g_reserved_part = os_mem_malloc(IOT_CLI_MID, reserved_sz); } - return ret; + return; } uint32_t os_heap_alloc_get_reserved_part_info(uint32_t *addr) diff --git a/device/soc/htzd/htzd32xx/kunlun/Mainline/common/os_shim/liteos/src/os_task.c b/device/soc/htzd/htzd32xx/kunlun/Mainline/common/os_shim/liteos/src/os_task.c index 64295785..d33feea7 100755 --- a/device/soc/htzd/htzd32xx/kunlun/Mainline/common/os_shim/liteos/src/os_task.c +++ b/device/soc/htzd/htzd32xx/kunlun/Mainline/common/os_shim/liteos/src/os_task.c @@ -172,7 +172,7 @@ void os_set_task_prio_ext(os_task_h handle, uint8_t prio) if (!ISVALID_LOS_PRIORITY(priority)) { /* unsupported priority */ - return NULL; + return; } LOS_TaskPriSet((uint32_t)handle, priority); @@ -189,7 +189,7 @@ void os_set_task_prio(os_task_h handle, uint8_t prio) if (!ISVALID_LOS_PRIORITY(priority)) { /* unsupported priority */ - return NULL; + return; } LOS_TaskPriSet((uint32_t)handle, priority); diff --git a/device/soc/htzd/htzd32xx/kunlun/Mainline/common/os_shim/liteos/src/os_timer.c b/device/soc/htzd/htzd32xx/kunlun/Mainline/common/os_shim/liteos/src/os_timer.c index 32e7a1ba..cbc6fe74 100755 --- a/device/soc/htzd/htzd32xx/kunlun/Mainline/common/os_shim/liteos/src/os_timer.c +++ b/device/soc/htzd/htzd32xx/kunlun/Mainline/common/os_shim/liteos/src/os_timer.c @@ -140,7 +140,7 @@ void os_delete_timer(timer_id_t id) { SWTMR_CTRL_S *swtmr = (SWTMR_CTRL_S *)id; - os_mem_free(swtmr->uwArg); + os_mem_free((void *)swtmr->uwArg); LOS_SwtmrDelete(swtmr->usTimerID); } diff --git a/device/soc/htzd/htzd32xx/kunlun/Mainline/driver/src/hw3/wdg.c b/device/soc/htzd/htzd32xx/kunlun/Mainline/driver/src/hw3/wdg.c index d10220ea..752e3a18 100755 --- a/device/soc/htzd/htzd32xx/kunlun/Mainline/driver/src/hw3/wdg.c +++ b/device/soc/htzd/htzd32xx/kunlun/Mainline/driver/src/hw3/wdg.c @@ -211,10 +211,10 @@ uint32_t IRAM_ATTR wdg_timeout_handler(uint32_t vector, iot_addrword_t data) uintptr_t mbadaddr = 0, mepc = 0, mcause = 0; mbadaddr = 0xdeadfeed; __asm volatile ( "csrc mstatus, 8" ); - __asm volatile ( "csrw mbadaddr, %0" :: "r"(mbadaddr) ); + __asm volatile ( "csrw mtval, %0" :: "r"(mbadaddr) ); __asm volatile ( "csrr %0, mepc" : "=r"(mepc) ); __asm volatile ( "csrr %0, mcause" : "=r"(mcause) ); - iot_sprintf(buf, "mcause: 0x%08x, mepc: 0x%08x, mbadaddr: 0x%08x\n", + iot_sprintf(buf, "mcause: 0x%08x, mepc: 0x%08x, mtval: 0x%08x\n", mcause, mepc, mbadaddr); print_cache_error_msg(buf); iot_interrupt_mask(wdg->handle); diff --git a/device/soc/htzd/htzd32xx/kunlun/Mainline/startup/riscv3/src/exception.c b/device/soc/htzd/htzd32xx/kunlun/Mainline/startup/riscv3/src/exception.c index 7e313390..50786e2a 100755 --- a/device/soc/htzd/htzd32xx/kunlun/Mainline/startup/riscv3/src/exception.c +++ b/device/soc/htzd/htzd32xx/kunlun/Mainline/startup/riscv3/src/exception.c @@ -469,7 +469,7 @@ void IRAM_ATTR exception_handler(uintptr_t mcause, uintptr_t epc, saved_register //disble global interrupt; __asm volatile ( "csrc mstatus,8" ); - __asm volatile ( "csrr %0, mbadaddr" : "=r"(mbadaddr)); + __asm volatile ( "csrr %0, mtval" : "=r"(mbadaddr)); asm volatile ( "csrr %0, mcause" : "=r"(curr_mcause)); asm volatile ( "csrr %0, mip" : "=r"(curr_mip));