diff --git a/README_ZH.md b/README_ZH.md index f283802..d205f0b 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -67,7 +67,7 @@ mkdir openharmony cd openharmony -repo init -u https://gitee.com/openharmony-sig/manifest.git -m devboard_asrmicro.xml --no-repo-verify +repo init -u https://gitee.com/openharmony/manifest.git -m default.xml --no-repo-verify repo sync -c @@ -197,19 +197,19 @@ hb build -f --gn-args build_xts=true 5. 点击“确认”关闭小窗口,bootloader烧录一次即可,再次烧录可勾选“only image”只烧录app文件。 6. 将 ASR582X 设置为 Uart boot 模式。 -[朗国开发板设置为"Uart boot"模式 操作参考](https://gitee.com/openharmony-sig/device_board_lango#3-%E8%BF%9B%E5%85%A5%E7%83%A7%E5%BD%95%E6%A8%A1%E5%BC%8F-uart-boot-%E6%A8%A1%E5%BC%8F) +[朗国开发板设置为"Uart boot"模式 操作参考](https://gitee.com/openharmony/device_board_lango#3-%E8%BF%9B%E5%85%A5%E7%83%A7%E5%BD%95%E6%A8%A1%E5%BC%8F-uart-boot-%E6%A8%A1%E5%BC%8F) 7. Demo 板接通电源后,按下复位键,待出现“1F2E3D00”后点击“烧录”。 **图 2** Dogo烧录 ![](tools/figure/dogo2.png "Dogo烧录") 8. 烧录完成后, 将 ASR582X 设置为 Flash boot 模式,按下复位键,DOGO 串口接收窗口中即可以看到程序正常运行。 -[朗国开发板设置"Flash boot"模式 操作参考](https://gitee.com/openharmony-sig/device_board_lango#5-%E9%80%80%E5%87%BA%E7%83%A7%E5%BD%95%E6%A8%A1%E5%BC%8F-%E8%BF%9B%E5%85%A5flash-boot-%E6%A8%A1%E5%BC%8F) +[朗国开发板设置"Flash boot"模式 操作参考](https://gitee.com/openharmony/device_board_lango#5-%E9%80%80%E5%87%BA%E7%83%A7%E5%BD%95%E6%A8%A1%E5%BC%8F-%E8%BF%9B%E5%85%A5flash-boot-%E6%A8%A1%E5%BC%8F) ## 相关仓库 -* [device/soc/asrmicro](https://gitee.com/openharmony-sig/device_soc_asrmicro) -* [device/board/lango](https://gitee.com/openharmony-sig/device_board_lango) +* [device/soc/asrmicro](https://gitee.com/openharmony/device_soc_asrmicro) +* [device/board/lango](https://gitee.com/openharmony/device_board_lango) ## 常见错误与处理 ### 1. Ubuntu 20.04.3 LTS 下编译报错 diff --git a/asr582x/liteos_m/sdk/drivers/platform/system/sysCalls.c b/asr582x/liteos_m/sdk/drivers/platform/system/sysCalls.c index 3aa1796..c5ddb18 100755 --- a/asr582x/liteos_m/sdk/drivers/platform/system/sysCalls.c +++ b/asr582x/liteos_m/sdk/drivers/platform/system/sysCalls.c @@ -16,19 +16,23 @@ #include #include #include -//#include #include "duet_cm4.h" #include "printf_uart.h" -///////////////////////////////////// -char *itoa(char *p, unsigned x) { - p += 3*sizeof(int); - *--p = 0; - do { - *--p = '0' + x % 10; - x /= 10; - } while (x); - return p; +#define DEC_BASE 10 +#define ITOA_BASE 3 + +char *itoa(char *p, unsigned x) +{ + unsigned tmp_x = x; + char *tmp_p = p; + tmp_p += ITOA_BASE * sizeof(int); + *--tmp_p = 0; + do { + *--tmp_p = '0' + tmp_x % DEC_BASE; + tmp_x /= DEC_BASE; + } while (tmp_x); + return tmp_p; } const char *__locale_ctype_ptr (void) @@ -36,117 +40,7 @@ const char *__locale_ctype_ptr (void) return "1.0.0-LiteOS_M"; } -#if 0 -_ssize_t _write_r(struct _reent *ptr, int fd, const void *buf, size_t nbytes) +int access(const char *filename, int amode) { - const char *tmp = buf; - int i = 0; - - if (buf == NULL) - { - return 0; - } - - if ((fd == 1) || (fd == 2)) - { - for (i = 0; i < nbytes; i++) - { - uart_put_char(*tmp); - tmp++; - } - return nbytes; - } - else - { - return -1; - } -} - /////////////////////////////////// - #if 1 - int _isatty (int fd) - { - return 1; - } - - ///////////////////////////////// - int _lseek(int i, int k, int j) - { - return -1; - } - #endif - //////////////////////////////// - int _read (int fd, char *pBuffer, int size) - { - return size; - } - //////////////////////////////////// - int _fstat (int fd, struct stat *pStat) - { - pStat->st_mode = S_IFCHR; - return 0; - } - //////////////////////////////////// - #if 1 - int _close(int i) - { - return -1; - } -#endif -#if 0 -caddr_t _sbrk(int increment) -{ - extern char end __asm__("end"); - register char *pStack __asm__("sp"); - - static char *s_pHeapEnd; - - if (!s_pHeapEnd) - s_pHeapEnd = &end; - - if (s_pHeapEnd + increment > pStack) - return (caddr_t)-1; - - char *pOldHeapEnd = s_pHeapEnd; - s_pHeapEnd += increment; - return (caddr_t)pOldHeapEnd; - } - #endif -int _kill(int pid, int sig) -{ - //errno = EINVAL; - return -1; -} -int _getpid(void) -{ - return -1; -} -int _open_r(struct _reent *ptr, const char *file, int flags, int mode) -{ - return -1; -} - -__attribute__((weak)) void _exit (int status) -{ - _kill(status, -1); - while (1) {} /* Make sure we hang here */ -} - -#if 0 -//void _sbrk_r(void) -//{ -//} - -//void _close_r(void) -//{ -//} - -//void _lseek_r(void) -//{ -//} - -//void _read_r(void) -//{ -//} -#endif -#endif - /************end *************************/ \ No newline at end of file + return 0; +} \ No newline at end of file diff --git a/asr582x/liteos_m/sdk/rtos/lega_rtos_port.h b/asr582x/liteos_m/sdk/rtos/lega_rtos_port.h index daad805..2ffca4b 100755 --- a/asr582x/liteos_m/sdk/rtos/lega_rtos_port.h +++ b/asr582x/liteos_m/sdk/rtos/lega_rtos_port.h @@ -18,20 +18,5 @@ #include "los_arch_context.h" -// typedef unsigned int UINTPTR; -#define lega_rtos_declare_critical() UINTPTR uvIntSave -/** @brief Enter a critical session, all interrupts are disabled - * - * @return none - */ -#define lega_rtos_enter_critical() do{uvIntSave = LOS_IntLock();}while(0) -//void lega_rtos_enter_critical( void ); - -/** @brief Exit a critical session, all interrupts are enabled - * - * @return none - */ -#define lega_rtos_exit_critical() do{LOS_IntRestore(uvIntSave);}while(0) -//void lega_rtos_exit_critical( void ); #endif //__LEGA_RTOS_PORT_H__ \ No newline at end of file